InterRep contracts
InterRep Solidity smart contracts.
Read the announcement post: https://jaygraber.medium.com/introducing-interrep-255d3f56682
Official website: https://interrep.link/
For more details on how to use and a technical overview, please see the wiki.
Deployed contracts
| Kovan | Ropsten | Arbitrum One | |
|---|---|---|---|
| ReputationBadge | 0x99FC...dC07 | 0x2F4d...BC11 | 0x2F4d...BC11 |
| InterRepGroups | 0x6a6f...BE1c | 0xa2A7...6419 |
⚠️ If you had a badge minted on Ropsten and want to unlink your account, please visit https://ropsten.interrep.link/
Table of Contents
Install
Clone this repository and install the dependencies:
$ git clone https://github.com/InterRep/contracts.git interrep-contracts
$ cd interrep-contracts
$ yarn # or `npm i`
Usage
Compile
Compile the smart contracts with Hardhat:
$ yarn compile
This should generate the TypeChain typings. If you want to generate them manually run:
$ yarn typechain
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 coverage
Report Gas
See the gas usage per unit test and average gas per method call:
$ REPORT_GAS=true yarn test
Clean
Delete the smart contract artifacts, the coverage reports and the Hardhat cache:
$ yarn clean
Deploy
Deploy the contracts to Hardhat Network:
$ yarn deploy:reputation-badge --name "InterRep Twitter Badge" --symbol iTWITT
$ yarn deploy:interrep-groups
or run yarn deploy:mocks if you want a short command to simulate the previous command for testing purposes.
Set your .env file and deploy the contracts to a specific network, such as the Ropsten testnet:
$ NODE_ENV=production yarn deploy:reputation-badge --name "InterRep Twitter Badge" --symbol iTWITT --network ropsten
$ NODE_ENV=production yarn deploy:interrep-groups --network ropsten
You can find a copy of the .env file in the .env.example file.
Syntax Highlighting
If you use VSCode, you can enjoy syntax highlighting for your Solidity code via the vscode-solidity extension. The recommended approach to set the compiler version is to add the following fields to your VSCode user settings:
{
"solidity.compileUsingRemoteVersion": "v0.8.4+commit.c7e474f2",
"solidity.defaultCompiler": "remote"
}
Where of course v0.8.4+commit.c7e474f2 can be replaced with any other version.