- Notifications
You must be signed in to change notification settings - Fork1
futurex-dev/FutureX-POAPs
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
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.
Install deps with
npm install
Enable your local blockchain with command
npx hardhat node
first, and let this session stay opened.Run command
npx hardhat deploy-poap --network localhost
to deploy the Poaps. It shall output the proxy contract address [ADDRESS].Interact with the contract using
npx hardhat console --network localhost
>constPoap=awaitethers.getContractFactory("Poap")>constpoap=awaitPoap.attach("[ADDRESS]")>awaitpoap.name()...
Stay the above console opened, you can update the contract functions under
contracts/*
and usenpx hardhat upgrade-poap --network localhost [ADDRESS]
to upgrade. You can then continue testing the functions withpoap
object in step.3
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.
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
Thanks to the great open-sourced POAPscontract frompoap.xyz !