Go to file
Max Alekseenko abbbb50456 add comment for Rewarded event 2020-05-12 19:53:45 +03:00
.openzeppelin deploy new version 2020-05-04 20:46:46 +03:00
contracts add comment for Rewarded event 2020-05-12 19:53:45 +03:00
scripts make use of truffle for tests and add solidity-coverage 2020-04-28 14:49:20 +03:00
test update validation of round duration 2020-04-30 18:38:07 +03:00
.editorconfig add more tests 2020-03-27 14:18:19 +03:00
.gitattributes Highlight Solidity code in GitHub 2020-05-08 11:05:11 +03:00
.gitignore make use of truffle for tests and add solidity-coverage 2020-04-28 14:49:20 +03:00
.solcover.js make use of truffle for tests and add solidity-coverage 2020-04-28 14:49:20 +03:00
README.md Add a link to renounceOwnership transaction 2020-05-11 12:09:16 +03:00
networks.js add core network 2020-03-31 13:11:11 +03:00
package-lock.json make use of truffle for tests and add solidity-coverage 2020-04-28 14:49:20 +03:00
package.json make use of truffle for tests and add solidity-coverage 2020-04-28 14:49:20 +03:00
truffle.js make use of truffle for tests and add solidity-coverage 2020-04-28 14:49:20 +03:00

README.md

Smart contracts for POA Mania

built-with openzeppelin

www.poamania.com

POA Mania is a no-loss and non-custodial lottery where POA hodlers can win an extra slice of POA emission reward. Prizes are distributed to the winners every round.

  1. Read POA Mania Docs to understand the game rules.
  2. Read about POA randomness to see how cool it is.

Deployed contracts

POA Core

Contract Address
Proxy 0xD9505dc188d0f6dC583143e5A97D8e8cF7c107e0
Implementation 0x2300e0cd5d065d285236D7f55f6E2a19EB090C50

Sokol Testnet

Contract Address
Proxy 0x9fa644CCF16cE358AFf9A86Cc2046a6C601b8F71
Implementation 0x6f04Cf809fe42aa1a05d5B65B42540EF52aDBf5B

Security audit

Poa Mania was audited by Quantstamp. You can find the audit report here.

How to run

Setup

Clone the repo and then install dependencies:

$ npm i
$ npm i -g npx

Testing

To run the entire test suite:

$ npm test

Deployment

To run deployment in interactive mode:

$ npx oz deploy

More about oz commands here.

How it works

After deployment and initialization the 1st round is started. Anyone can deposit() and withdraw() POA tokens during each round. When the round time is over anyone can call nextRound(): the winners of the current round will be selected and rewarded, and the next round will be started. More details you can find in POA Mania Docs.

Roles and methods available to each role

Anyone

  1. deposit()
  2. withdraw()
  3. withdraw(uint256 _amount)
  4. nextRound()

Owner

The owner can only change the game parameters.

  1. setRoundDuration(uint256 _roundDuration)
  2. setFee(uint256 _fee)
  3. setFeeReceiver(address _feeReceiver)
  4. setJackpotShare(uint256 _jackpotShare)
  5. setJackpotChance(uint256 _jackpotChance)
  6. setExecutorShare(uint256 _executorShare)
  7. setPrizeSizes(uint256[2] calldata _prizeSizes)
  8. setBlockTime(uint256 _blockTime)
  9. setMinDeposit(uint256 _minDeposit)
  10. setMaxDeposit(uint256 _maxDeposit)

Proxy Admin (abolished, see renounceOwnership transaction)

The Proxy Admin can upgrade the logic of the contracts. This role will be abolished after an audit and some testing time.

Note: All methods are described in code.

Dependencies

The project uses the modified library SortitionSumTreeFactory with added total() and numberOfNodes() functions. You can find the modified implementation here: @poanetwork/kleros. These changes were not audited but they add minimal risk.