Skip to content

🧾 InterRep Solidity smart contracts.

License

Notifications You must be signed in to change notification settings

0xlws/contracts

 
 

Repository files navigation

Interep contracts

Interep Solidity smart contracts.

Github license GitHub Workflow test Coveralls Linter eslint Code style prettier Repository top language


Please, visit our web app or our documentation website for more details.

Deployed contracts

Kovan Arbitrum One
Interep 0x5B8e...a6dc

Install

Clone this repository and install the dependencies:

git clone https://github.com/interep-project/contracts.git
cd contracts
yarn # or `npm i`

Usage

Copy the .env.example file and rename it .env.

Compile

Compile the smart contracts with Hardhat:

yarn compile

Lint

Lint the Solidity or the TypeScript code:

yarn lint:sol
yarn lint:ts
# or yarn lint to lint both.

And check if the code is well formatted:

yarn prettier

Test

Run the Mocha tests:

yarn test

Coverage

Generate the code coverage report:

yarn test:coverage

Report Gas

See the gas usage per unit test and average gas per method call:

yarn test:report-gas

Deploy

Deploy a Semaphore verifier contract with depth = 20:

yarn deploy:verifier # The resulting address will have to be used in the next step.

Deploy the Interep contract with one Semaphore verifier:

yarn deploy --verifiers '[[20, "0x5FbDB2315678afecb367f032d93F642f64180aa3"]]'

If you want to deploy contracts in a specific network you can set up the DEFAULT_NETWORK variable in your .env file with the name of one of our supported networks (hardhat, localhost, ropsten, kovan, arbitrum). Or you can specify it as option:

yarn deploy --verifiers '[[20, "0x06bcD633988c1CE7Bd134DbE2C12119b6f3E4bD1"]]' --network kovan
yarn deploy --verifiers '[[20, "0x5FbDB2315678afecb367f032d93F642f64180aa3"]]' --network localhost

If you want to deploy the contracts on Ropsten, Kovan or Arbitrum remember to provide a valid private key and an Infura API in your .env file.

Preparing a local network

Run a Hardhat Network in a stand-alone fashion:

yarn start

Deploy a Semaphore verifier and the Interep contract:

yarn deploy:verifier --network localhost
yarn deploy --verifiers '[[20, "0x5FbDB2315678afecb367f032d93F642f64180aa3"]]' --network localhost

You can omit --network localhost if your DEFAULT_NETWORK env variable is equal to localhost.

About

🧾 InterRep Solidity smart contracts.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 60.6%
  • Solidity 38.6%
  • Shell 0.8%