2021-11-10 17:02:02 +01:00
2021-06-04 16:17:21 +02:00
2021-11-08 18:42:30 +01:00
2021-11-08 18:35:33 +01:00
2021-08-26 16:59:56 +02:00
2021-10-04 19:33:10 +02:00
2021-06-04 16:17:21 +02:00
2021-06-04 16:17:21 +02:00
2021-06-04 16:17:21 +02:00
2021-08-26 16:59:56 +02:00
2021-06-04 16:17:21 +02:00
2021-11-08 18:00:29 +01:00
2021-11-10 16:26:00 +01:00

InterRep contracts

InterRep Solidity smart contracts.

Linter eslint Code style prettier Repository top language


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) 0xF685...1E07 0x2F4d...BC11 0x2F4d...BC11
ReputationBadge (Github) 0xD6B4...2E18
ReputationBadge (Reddit) 0x55d2...B4Cf
Groups 0xD2C9...735B

Install

Clone this repository and install the dependencies:

$ git clone https://github.com/InterRep/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

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

Start a local network

Run a Hardhat Network in a stand-alone fashion:

yarn start

Use --network localhost with the following commands if you want to interact with it.

Deploy

Deploy the contracts:

yarn deploy:reputation-badge --name "InterRep Twitter Badge" --symbol iTWITT
yarn deploy:groups

If you have to deploy the contracts locally you can also run yarn deploy:mocks --network localhost. It runs both the previous commands with mocked data.

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:groups --network kovan // Kovan testnet
yarn deploy:groups --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.

Groups

Create the InterRep default groups:

$ yarn create:groups --address <contractAddress> --depth <treesDepth>
Description
No description provided
Readme MIT 7.4 MiB
Languages
TypeScript 64%
Solidity 36%