InterRep contracts
InterRep Solidity smart contracts.
If you want an overwiew of InterRep, read our announcement post: https://jaygraber.medium.com/introducing-interrep-255d3f56682. For more details, please see our documentation website.
⚠️ Notice: interrep.link and ropsten.interrep.link still refer to the old MVP version of interRep. They will soon be updated. You can find an updated version at kovan.interrep.link (staging env).
Deployed contracts
| Kovan | Ropsten | Arbitrum One | |
|---|---|---|---|
| ReputationBadge (Twitter) | 0x0Cb0....1EB6 | 0x2F4d...BC11 | 0x2F4d...BC11 |
| ReputationBadge (Github) | 0x091D...1d14 | ||
| ReputationBadge (Reddit) | 0xAB18...6c37 | ||
| InterRepGroups | 0xB9A5...a1E4 | 0xa2A7...6419 |
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.