Interep contracts
Interep Solidity smart contracts.
Please, visit our web app or our documentation website for more details.
Deployed contracts
| Kovan | Arbitrum One | |
|---|---|---|
| Groups | 0x8c29...6c77 |
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 the contracts:
yarn deploy
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 --network kovan // Kovan testnet
yarn deploy --network localhost // Local network
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 the Groups.sol contract:
yarn deploy:groups --network localhost
You can omit --network localhost if your DEFAULT_NETWORK env variable is equal to localhost.