PoolTogether RNG Service Smart Contracts
!Tests



The PoolTogether Prize Savings Protocol Ethereum smart contracts.
See the documentation
The RNGWitnet contract is a custom-built solution to request a random number from the Witnet oracle. It is hosted in a separate repository as it is built using the Python-based Brownie development suite.
Install Dependencies
``sh`
$ yarn
Copy over .envrc.example to .envrc
`sh`
$ cp .envrc.example .envrc
Make sure to update the enviroment variables with suitable values.
Now enable the env vars using direnv
`sh`
$ direnv allow
You can interact with the contract using the buidler console:
`sh`
$ npx hardhat console --network [network]
Then you can interact with deployed contracts:
`javascript`
> const signer = (await ethers.getSigners())[0]
> const d = await deployments.all()
> const chainlink = await ethers.getContractAt('RNGChainlink', d.RNGChainlink.address, signer)
> const link = await ethers.getContractAt('IERC20', (await chainlink.getLink()), signer)
You can deploy using the deploy script:
`sh`
$ yarn deploy [network]
Where [network] can be mainnet, rinkeby, ropsten, or kovan.
Now you should verify the contracts on Etherscan:
`sh`
$ yarn etherscan-verify [network]
The network option is the same as above.
Verify Codebase (hint + test)
`sh`
$ yarn verify
Run Static Code Analysis
`sh`
$ yarn hint
Run Tests
`sh`
$ yarn test
Run Coverage
`sh`
$ yarn coverage
Run Gas Report
`sh`
$ yarn gas
Start Local TestRPC & Deploy
`sh``
$ yarn start
Deploy to an Ethereum Network