@hypercerts-org/contracts v2.0.0-alpha.0
hypercerts-protocol 
Setup
Create a copy of .env.example and rename the copy to .env. If your organization already has keys, ask your admin
where they are.
MNEMONIC: the seed phrase used for deploying the contract and upgrades- Make sure there is sufficient balance in the account for these operations
- If you need a new address, you can run
yarn hardhat generate-address
INFURA_API_KEY: Infura is used as the gateway.OPENZEPPELIN_API_KEYandOPENZEPPELIN_SECRET_KEY: OpenZeppelin Defender is used for proposing upgrades to the multi-sig.ETHERSCAN_API_KEY: EtherscanOPTIMISTIC_ETHERSCAN_API_KEY: Optimism Explorer
Usage
Here's a list of the most frequently needed commands.
Note that the project is configured to use both Hardhat and Foundry. We typically use Foundry for fast compiles and testing. We typically use Hardhat to compile for deployment and to run operational tasks.
Foundry operations
Build
Build the contracts:
forge buildTests
Solidity tests are executed using Foundry Run the tests:
forge testGas Usage
Get a gas report:
forge test --gas-reportAnalyze storage gaps
forge inspect HypercertMinter storageLayout --prettyClean
Delete the build artifacts and cache directories:
forge cleanHardhat operations
Build
yarn build:hardhatDeploy
Deployment of the contract to EVM compatible net is managed by OpenZeppelin, primarily because of proxy management and safety checks.
yarn build:deploy
yarn hardhat deploy --network goerliTransfer ownership
To transfer ownership of the proxy contract for upgrades, run the following:
yarn hardhat transfer-owner-minter --network goerli --proxy PROXY_CONTRACT_ADDRESS --owner NEW_OWNER_ADDRESSThis is typically done to transfer control to a multi-sig (i.e. Gnosis Safe).
Validate upgrade
Validate contract upgradeability against deployment.
For example goerli deployment:
yarn hardhat validate-upgrade --network goerli --proxy PROXY_CONTRACT_ADDRESSPropose Upgrade
Propose an upgrade via OpenZeppelin Defender. For more information, see this guide
yarn build:hardhat
yarn hardhat propose-upgrade-minter --network goerli --proxy PROXY_CONTRACT_ADDRESS --multisig OWNER_MULTISIG_ADDRESSThis will output an OpenZeppelin URL that multi-sig members can use to approve/reject the upgrade.
Other operations
Format
Format the contracts with Prettier:
yarn prettierLint
Lint the contracts:
yarn lintContracts
IHypercertToken
This interface is the requirements set for hypercert-compliant tokens. This enables developer to use their own preferred token implementation or standard.
HypercertMinter
Example implementation for a hypercert token that is an ERC1155 NFT under the hood with an Allowlist extension.
1 year ago
1 year ago
10 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago