Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Poaps for FutureX

License

NotificationsYou must be signed in to change notification settings

futurex-dev/FutureX-POAPs

Repository files navigation

Core functions

API not stable yet.

CreatReadUpdateDelete:

  • C: Add Event -creatEvent

  • C: Add Event Organizer -addEventMinter

  • C: Add admin -addAdmin

  • C: Mint tokenfor an event -mintToken

  • C: Batch Mint -mintEventToManyUsers

  • R: view all poaps for one user - (balanceOf, theneventOfOwnerByIndex)

  • R: view all usersfor one event - (balanceOfEvent, thenuserOfEventByIndex)

  • R: view user role -isEventMinter,isEventCreator,isAdmin

  • R: view event infos -eventHasUser,eventMetaURI

  • U: Pause or un-pause contract -pause,unpause

  • U: Authorize or un-authorize contract -authorize,unauthorize

  • D: Burn Tokens -burn

  • : ERC721 interfaces - (base, URI, enumerable)

Checkouttest/Poap.js for more details.

Deploy to local

  1. Install deps withnpm install

  2. Enable your local blockchain with commandnpx hardhat node first, and let this session stay opened.

  3. Run commandnpx hardhat deploy-poap --network localhost to deploy the Poaps. It shall output the proxy contract address [ADDRESS].

  4. Interact with the contract usingnpx hardhat console --network localhost

    >constPoap=awaitethers.getContractFactory("Poap")>constpoap=awaitPoap.attach("[ADDRESS]")>awaitpoap.name()...
  5. Stay the above console opened, you can update the contract functions undercontracts/* and usenpx hardhat upgrade-poap --network localhost [ADDRESS] to upgrade. You can then continue testing the functions withpoap object in step.3

Deploy to BlockChains

Future-Poap supports Goerli testnet and Gnosis sidechain for now, check out more details inhardhat.config.js. To enable deployment, create a.env file under root dir:

For Gnosis, you should set up your private key and api token from gnosisscan:

Gnosis_PRIVATE_KEY = "XXX"Gnosis_API = "XXX"

For Goerli testnet, you should set up your private key and a provider's url(e.g. Alchemy):

Goerli_API_URL = "https://eth-goerli.g.alchemy.com/v2/XXX"Goerli_PRIVATE_KEY = "XXX"

Then you can deploy and interact the contract following the commands in "Deploy to local" section, but only replace all thelocalhost term to your network(gnosis for Gnosis,goerli for Goerli testnet).

To add more chains, please refer to their documents about hardhat development.

Commands

npx hardhat compile# compile contracts to artifactsnpx hardhattest# test the contracts using test/*.jsREPORT_GAS=true npx hardhattest# estimate the contracts gas fee. Extremly SLOWnpx hardhat run scripts/deploy.js --network XXX

Acknowledgement

Thanks to the great open-sourced POAPscontract frompoap.xyz !

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp