Create an .env file from .env.example
cp .env.example .env- Create an account at NFT Storage
- Get your API KEY
- Add it to
.envasNFT_STORAGE_API_KEY
- Create a user in Alchemy
- Create an Optimism / Polygon app
- Get your RPC HTTP URL and add it to
.envasOPTIMISM_RPC_URL/POLYGON_RPC_URL
It should look like https://opt-mainnet.g.alchemy.com/v2/your-api-key or https://polygon-mainnet.g.alchemy.com/v2/your-api-key.
Notice that this url might change, so make sure to look into alchemy and get the right HTTP url for your RPC
You will need to have an Otterspace Raft, and fill in the .env variables
OPTIMISM_RAFT_ID, POLYGON_TEST_RAFT_ID or POLYGON_PROD_RAFT_ID
You will need a signer address to send the transactions, that should also be the raft owner.
Fill in the following .env variables
For Optimism and Polygon test raft
TESTING_ADDRESS
TESTING_PK
For Polygon prod raft
PRD_ADDRESS
PRD_PK
Use the following command to upload a badge spec to IPFS and mint it
npx hardhat --network [networkConfig] createBadge --name "Badge Name" --description "Badge Description" --image "Badge.png"- The
networkConfigparam can beoptimism,polytestorpolygon - The
imageparam needs to be the name of an image stored in/images - You need to run this command from the root dir of the project
- badges uploaded to IPFS are added to the
uploadedBadges.jsonfile
If you already uploaded the spec, or the minting failed, you can try minting again
npx hardhat --network optimism mintBadge --badgecid bafyreicojasgf7mqvclql3saq7hg7qtys6o227pyedpvmcjcow5obpuxqi npx hardhat --network optimism airdrop --badgecid someBadgeCid --recipients someAddress,anotherAddressRevokes a user badge. Use this to end a tenure (the default reason for revoking).
Available reasons are:
Reason 0: Abuse
Reason 1: Left community
Reason 2: Tenure ended
Reason 3: Other.
Default is 2
npx hardhat --network optimism revoke --badgeid someId [--reason reasonNumber]Only the badge owner (the user) can burn the badge.
If you are using this you should probably update TESTING_PK or PRD_PK to the desired user's.
npx hardhat --network optimism burn --badgeid someId