Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@hypercerts-org/contracts

Package Overview
Dependencies
Maintainers
3
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hypercerts-org/contracts

EVM compatible protocol for managing impact claims

  • 2.0.0-alpha.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created
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

Package last updated on 07 Jun 2024

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc