Skip to content

tomafc330/pooltogether-contracts

 
 

Repository files navigation

PoolTogether Contracts

PoolTogether is a prize-linked savings account built on Ethereum. This project contains the Ethereum smart contracts that power the protocol.

If you want to run PoolTogether locally in an isolated test environment check out the PoolTogether Mock project

Ethereum Networks

Network Contract Address
mainnet Pool (abi) 0xb7896fce748396EcFC240F5a0d3Cc92ca42D7d84

Setup

Clone the repo and then install deps:

$ yarn

Copy over .envrc and allow direnv:

$ cp .envrc.example .envrc
$ direnv allow

Deploying Locally

If you changed the mnemonic, you should update the ADMIN_ADDRESS variable in .envrc with another address (I use the second address listed when ganache-cli starts).

Start ganache-cli:

$ yarn start

Now start a new zos session:

$ yarn session

Push out the local contracts:

$ yarn push

Migrate the contracts and bootstrap the data:

$ yarn migrate

Deploying to Rinkeby

yarn session-rinkeby
yarn push
yarn migrate-rinkeby

Notes

Current interest rate can be pulled from the CErc20 using:

CErc20.markets() and you should get back a tuple that contains, amoung other things, a supplyRatePerBlock. This is the current per-block interest rate (scaled up by 1e18).

CErc20 on Rinkeby: 0x61bbd7bd5ee2a202d7e62519750170a52a8dfd45

About

PoolTogether Prize-Linked Savings Game Contracts

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 99.6%
  • Shell 0.4%