# @hypercerts-org/contracts

> EVM compatible protocol for managing impact claims

Latest version **2.0.0-alpha.0** (published 2024-06-07) · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @hypercerts-org/contracts
pnpm add @hypercerts-org/contracts
yarn add @hypercerts-org/contracts
bun add @hypercerts-org/contracts
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.0.0-alpha.0 |
| Published | 2024-06-07 |
| First published | 2023-06-21 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 407.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 100 |
| Author | Hypercerts Foundation |
| Maintainers | jipperism, bitbeckers, ryscheng |
| Keywords | blockchain, ethereum, forge, foundry, hypercerts, smart-contracts, solidity, template |

## Links

- npm: https://www.npmjs.com/package/@hypercerts-org/contracts
- Repository: https://github.com/hypercerts-org/hypercerts
- Homepage: https://hypercerts.org
- Issues: https://github.com/hypercerts-org/hypercerts/issues/new
- npm.io page: https://npm.io/package/@hypercerts-org/contracts

## Dependencies (1)

- [hardhat](https://npm.io/package/hardhat.md) ^2.18.3

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 2.0.0-alpha.0 (latest) — 2024-06-07
- 2.0.0-alpha.12 (next) — 2025-01-20
- 2.0.0-alpha.11 — 2024-11-22
- 2.0.0-alpha.10 — 2024-10-16
- 2.0.0-alpha.9 — 2024-09-29
- 2.0.0-alpha.8 — 2024-09-09
- 2.0.0-alpha.7 — 2024-08-20
- 2.0.0-alpha.6 — 2024-08-20
- 2.0.0-alpha.5 — 2024-08-19
- 2.0.0-alpha.4 — 2024-08-19
- 2.0.0-alpha.3 — 2024-08-18
- 2.0.0-alpha.2 — 2024-08-05
- 2.0.0-alpha.1 — 2024-07-17
- 1.1.2 — 2024-03-01
- 1.1.1 — 2024-03-01
- … 31 more at https://npm.io/package/@hypercerts-org/contracts/versions

## README

# hypercerts-protocol [![Foundry][foundry-badge]][foundry]

[foundry]: https://getfoundry.sh/
[foundry-badge]: https://img.shields.io/badge/Built%20with-Foundry-FFDB1C.svg

## 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](https://www.infura.io/) is used as the gateway.
- `OPENZEPPELIN_API_KEY` and `OPENZEPPELIN_SECRET_KEY`: [OpenZeppelin Defender](https://defender.openzeppelin.com/) is
  used for proposing upgrades to the multi-sig.
- `ETHERSCAN_API_KEY`: [Etherscan](https://etherscan.io/)
- `OPTIMISTIC_ETHERSCAN_API_KEY`: [Optimism Explorer](https://optimistic.etherscan.io/myapikey)

## 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:

```sh
forge build
```

#### Tests

Solidity tests are executed using Foundry Run the tests:

```sh
forge test
```

#### Gas Usage

Get a gas report:

```sh
forge test --gas-report
```

#### Analyze storage gaps

```sh
forge inspect HypercertMinter storageLayout --pretty
```

#### Clean

Delete the build artifacts and cache directories:

```sh
forge clean
```

### Hardhat operations

#### Build

```sh
yarn build:hardhat
```

#### Deploy

Deployment of the contract to EVM compatible net is managed by
[OpenZeppelin](https://docs.openzeppelin.com/upgrades-plugins/1.x/api-hardhat-upgrades), primarily because of proxy
management and safety checks.

```sh
yarn build:deploy
yarn hardhat deploy --network goerli
```

#### Transfer ownership

To transfer ownership of the proxy contract for upgrades, run the following:

```sh
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:

```sh
yarn hardhat validate-upgrade --network goerli --proxy PROXY_CONTRACT_ADDRESS
```

#### Propose Upgrade

Propose an upgrade via OpenZeppelin Defender. For more information, see this
[guide](https://docs.openzeppelin.com/defender/guide-upgrades)

```sh
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:

```sh
yarn prettier
```

#### Lint

Lint the contracts:

```sh
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.

---
_Source: https://npm.io/package/@hypercerts-org/contracts · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
