Socket
Socket
Sign inDemoInstall

@hypercerts-org/contracts

Package Overview
Dependencies
277
Maintainers
3
Versions
33
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @hypercerts-org/contracts

EVM compatible protocol for managing impact claims


Version published
Weekly downloads
9
decreased by-59.09%
Maintainers
3
Created
Weekly downloads
 

Readme

Source

hypercerts-protocol Foundry

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_KEY and OPENZEPPELIN_SECRET_KEY: OpenZeppelin Defender is used for proposing upgrades to the multi-sig.
  • ETHERSCAN_API_KEY: Etherscan
  • OPTIMISTIC_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 build
Tests

Solidity tests are executed using Foundry Run the tests:

forge test
Gas Usage

Get a gas report:

forge test --gas-report
Analyze storage gaps
forge inspect HypercertMinter storageLayout --pretty
Clean

Delete the build artifacts and cache directories:

forge clean

Hardhat operations

Build
yarn build:hardhat
Deploy

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 goerli
Transfer 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_ADDRESS

This 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_ADDRESS
Propose 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_ADDRESS

This 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 prettier
Lint

Lint the contracts:

yarn lint

Contracts

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.

Keywords

FAQs

Last updated on 01 Mar 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc