diff --git a/.openzeppelin/dev-99.json b/.openzeppelin/dev-99.json index dd8d455..2f37ba1 100644 --- a/.openzeppelin/dev-99.json +++ b/.openzeppelin/dev-99.json @@ -1,11 +1,11 @@ { "contracts": { "PoaMania": { - "address": "0x0C31e682d401c465fdD05e40cE7149F8497B18E5", - "constructorCode": "6080604052613ecc806100136000396000f3fe", - "bodyBytecodeHash": "80cdd475d169d643c0b2d9367b7b0d4262a7b46ebd77b1eac6ee0bab1066d491", - "localBytecodeHash": "08a508b3b25eaea0b5d55f4b73e801a8c44d4a80bbfe988824199d03d0763200", - "deployedBytecodeHash": "5475bde87356dfad16ac56fb800f6c5a3b43fc832b6ee0742e9176b6e252e396", + "address": "0x2300e0cd5d065d285236D7f55f6E2a19EB090C50", + "constructorCode": "6080604052613cf5806100136000396000f3fe", + "bodyBytecodeHash": "92e90facd14021b0ac4c8467982ed67bce63540e287954d3d3443d61a5754dd3", + "localBytecodeHash": "02d7082da1ef7c7f7a2a0c0fcb1253883c5ff9e001bc87d462ddfc2916d3a4d5", + "deployedBytecodeHash": "4dfd472c5601819fbd5ebe1189dbc93fa53535cef276e0dd47ace6c1690a8188", "types": { "t_bool": { "id": "t_bool", @@ -38,7 +38,7 @@ "label": "sortitionSumTrees", "astId": 1204, "type": "t_struct", - "src": "465:59:5" + "src": "531:59:5" } ] }, @@ -122,6 +122,37 @@ "label": "mapping(key => SortitionSumTreeFactory.SortitionSumTree)", "kind": "mapping" }, + "t_struct": { + "id": "t_struct", + "kind": "struct", + "label": "Random.State", + "members": [ + { + "label": "posdaoRandomContract", + "astId": 2667, + "type": "t_address", + "src": "133:34:8" + }, + { + "label": "seed", + "astId": 2669, + "type": "t_uint256", + "src": "205:12:8" + }, + { + "label": "seedLastBlock", + "astId": 2671, + "type": "t_uint256", + "src": "293:21:8" + }, + { + "label": "randomUpdateInterval", + "astId": 2673, + "type": "t_uint256", + "src": "363:28:8" + } + ] + }, "t_array:2": { "id": "t_array:2", "valueType": "t_uint256", @@ -171,149 +202,125 @@ "type": "t_array:50", "src": "2471:29:3" }, - { - "contract": "Random", - "path": "contracts/Random.sol", - "label": "posdaoRandomContract", - "astId": 2591, - "type": "t_address", - "src": "79:41:8" - }, - { - "contract": "Random", - "path": "contracts/Random.sol", - "label": "_seed", - "astId": 2593, - "type": "t_uint256", - "src": "127:21:8" - }, - { - "contract": "Random", - "path": "contracts/Random.sol", - "label": "_seedLastBlock", - "astId": 2595, - "type": "t_uint256", - "src": "154:30:8" - }, - { - "contract": "Random", - "path": "contracts/Random.sol", - "label": "randomUpdateInterval", - "astId": 2597, - "type": "t_uint256", - "src": "190:28:8" - }, { "contract": "PoaMania", "path": "contracts/PoaMania.sol", "label": "drawManager", - "astId": 1510, + "astId": 1511, "type": "t_struct", - "src": "863:38:7" + "src": "2167:38:7" + }, + { + "contract": "PoaMania", + "path": "contracts/PoaMania.sol", + "label": "random", + "astId": 1513, + "type": "t_struct", + "src": "2257:28:7" }, { "contract": "PoaMania", "path": "contracts/PoaMania.sol", "label": "roundId", - "astId": 1512, + "astId": 1515, "type": "t_uint256", - "src": "908:22:7" + "src": "2324:22:7" }, { "contract": "PoaMania", "path": "contracts/PoaMania.sol", "label": "startedAt", - "astId": 1514, + "astId": 1517, "type": "t_uint256", - "src": "936:24:7" + "src": "2409:24:7" }, { "contract": "PoaMania", "path": "contracts/PoaMania.sol", "label": "blockTime", - "astId": 1516, + "astId": 1519, "type": "t_uint256", - "src": "966:24:7" + "src": "2483:24:7" }, { "contract": "PoaMania", "path": "contracts/PoaMania.sol", "label": "roundDuration", - "astId": 1518, + "astId": 1521, "type": "t_uint256", - "src": "1025:28:7" + "src": "2560:28:7" }, { "contract": "PoaMania", "path": "contracts/PoaMania.sol", "label": "minDeposit", - "astId": 1520, + "astId": 1523, "type": "t_uint256", - "src": "1059:25:7" + "src": "2632:25:7" }, { "contract": "PoaMania", "path": "contracts/PoaMania.sol", "label": "maxDeposit", - "astId": 1522, + "astId": 1525, "type": "t_uint256", - "src": "1090:25:7" + "src": "2701:25:7" }, { "contract": "PoaMania", "path": "contracts/PoaMania.sol", "label": "fee", - "astId": 1524, + "astId": 1527, "type": "t_uint256", - "src": "1122:18:7" + "src": "2779:18:7" }, { "contract": "PoaMania", "path": "contracts/PoaMania.sol", "label": "feeReceiver", - "astId": 1526, + "astId": 1529, "type": "t_address", - "src": "1146:26:7" + "src": "2843:26:7" }, { "contract": "PoaMania", "path": "contracts/PoaMania.sol", "label": "executorShare", - "astId": 1528, + "astId": 1531, "type": "t_uint256", - "src": "1178:28:7" + "src": "2931:28:7" }, { "contract": "PoaMania", "path": "contracts/PoaMania.sol", "label": "jackpotShare", - "astId": 1530, + "astId": 1533, "type": "t_uint256", - "src": "1213:27:7" + "src": "3036:27:7" }, { "contract": "PoaMania", "path": "contracts/PoaMania.sol", "label": "jackpotChance", - "astId": 1532, + "astId": 1535, "type": "t_uint256", - "src": "1246:28:7" + "src": "3112:28:7" }, { "contract": "PoaMania", "path": "contracts/PoaMania.sol", "label": "jackpot", - "astId": 1534, + "astId": 1537, "type": "t_uint256", - "src": "1280:22:7" + "src": "3179:22:7" }, { "contract": "PoaMania", "path": "contracts/PoaMania.sol", "label": "prizeSizes", - "astId": 1538, + "astId": 1541, "type": "t_array:2", - "src": "1427:21:7" + "src": "3331:21:7" } ], "warnings": { @@ -326,28 +333,35 @@ } }, "solidityLibs": { + "Random": { + "address": "0xFD2f68F276AAA39724eDC354C78bD8743f10A3f7", + "constructorCode": "610816610026600b82828239805160001a60731461001957fe5b30600052607381538281f3fe", + "bodyBytecodeHash": "a0dd27279156e587dac1bd1f55f087f0517ef95e57bb09f3d3c4d25d25566252", + "localBytecodeHash": "60307f2d3bd7a4e7647d871275eacd800c5fd7d75ea400ba30ec8fff0f2bff92", + "deployedBytecodeHash": "60307f2d3bd7a4e7647d871275eacd800c5fd7d75ea400ba30ec8fff0f2bff92" + }, "SortitionSumTreeFactory": { - "address": "0x345ab49aD007D0E8b4A1d9860D657c3D73b66717", + "address": "0x1dda5EC8B8DE6C84aC758B83ec535CF2874062d2", "constructorCode": "610cdd610026600b82828239805160001a60731461001957fe5b30600052607381538281f3fe", "bodyBytecodeHash": "332d70e537680cddd7eeb01991fedaafb8d0542fc2c829fe424f4ab127e20365", "localBytecodeHash": "96d23934f52c4ae63f3c1eeefd69f5aa8ac04ac3eefe91aee500c6809de79a53", "deployedBytecodeHash": "96d23934f52c4ae63f3c1eeefd69f5aa8ac04ac3eefe91aee500c6809de79a53" }, "DrawManager": { - "address": "0xa604ae3cE64d99774061B861b39212d020F78Ee8", + "address": "0xde6179253917dd5D67248FB40D210c628cD03F88", "constructorCode": "610df7610026600b82828239805160001a60731461001957fe5b30600052607381538281f3fe", - "bodyBytecodeHash": "cc1bf1e28893094ca40a3781c64a5ca0fc375cfc8c3769d6aa6bc506b262ca0f", + "bodyBytecodeHash": "845745468a82ace6c2c0832aa57ef34bbdc22bd3489d4d441f4f8d062e94c44b", "localBytecodeHash": "3a3374e0d85a88bcdc7353a2008c9a3bd4d0df40e842bcacd46521c3c879d6f8", - "deployedBytecodeHash": "3e910e511987b2fafa92bd4586b67c396312bdfa6fb312d510e5335da513d383" + "deployedBytecodeHash": "e09529e85eec0de8c5ad3ff4e56488cf4c6e3bee5bd8bbc9fa9afa5a3e1f782d" } }, "proxies": { "poa-mania/PoaMania": [ { - "address": "0xf7ECea96dA4951e88E699cfb67d909Ec74Ba917E", + "address": "0xD9505dc188d0f6dC583143e5A97D8e8cF7c107e0", "version": "1.0.0", - "implementation": "0x0C31e682d401c465fdD05e40cE7149F8497B18E5", - "admin": "0x92F35e10a24174f4451f3A021c9F1C562b62365A", + "implementation": "0x2300e0cd5d065d285236D7f55f6E2a19EB090C50", + "admin": "0xFF2aA23344f6455644B0bc37D4d9382e811F7797", "kind": "Upgradeable" } ] @@ -355,13 +369,13 @@ "manifestVersion": "2.2", "dependencies": { "@openzeppelin/contracts-ethereum-package": { - "package": "0x1944EAbF1Fc64A81Ce4e25D054A150A06e5c5716", + "package": "0x661976ac47C32be3917577eEe5e4989e16032F9A", "version": "2.4.0", "customDeploy": true } }, "version": "1.0.0", "proxyAdmin": { - "address": "0x92F35e10a24174f4451f3A021c9F1C562b62365A" + "address": "0xFF2aA23344f6455644B0bc37D4d9382e811F7797" } } diff --git a/README.md b/README.md index 4d69762..70ac60b 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [**www.poamania.com**](https://www.poamania.com/) -**POA Mania** is a no-loss lottery where POA hodlers can win an extra slice of POA emission reward. Prizes are distributed to the winners every round. +**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](https://www.poa.network/for-users/poa-mania) to understand the game rules. 2. Read about [POA randomness](https://www.poa.network/for-developers/on-chain-random-numbers) @@ -14,8 +14,8 @@ to see how cool it is. ### POA Core | Contract | Address | | -------------- | ------- | -| Proxy | [0xf7ECea96dA4951e88E699cfb67d909Ec74Ba917E](https://blockscout.com/poa/core/address/0xf7ECea96dA4951e88E699cfb67d909Ec74Ba917E) | -| Implementation | [0x0C31e682d401c465fdD05e40cE7149F8497B18E5](https://blockscout.com/poa/core/address/0x0C31e682d401c465fdD05e40cE7149F8497B18E5) | +| Proxy | [0xD9505dc188d0f6dC583143e5A97D8e8cF7c107e0](https://blockscout.com/poa/core/address/0xD9505dc188d0f6dC583143e5A97D8e8cF7c107e0) | +| Implementation | [0x2300e0cd5d065d285236D7f55f6E2a19EB090C50](https://blockscout.com/poa/core/address/0x2300e0cd5d065d285236D7f55f6E2a19EB090C50) | ### Sokol Testnet | Contract | Address | @@ -23,6 +23,9 @@ to see how cool it is. | Proxy | [0x9fa644CCF16cE358AFf9A86Cc2046a6C601b8F71](https://blockscout.com/poa/sokol/address/0x9fa644CCF16cE358AFf9A86Cc2046a6C601b8F71) | | Implementation | [0x6f04Cf809fe42aa1a05d5B65B42540EF52aDBf5B](https://blockscout.com/poa/sokol/address/0x6f04Cf809fe42aa1a05d5B65B42540EF52aDBf5B) | +## Security audit +Poa Mania **was audited** by Quantstamp. You can find the audit report [here](https://www.poa.network/for-users/poa-mania/poa-mania-security-audit). + ## How to run ### Setup Clone the repo and then install dependencies: @@ -69,8 +72,8 @@ The owner can only change the game parameters. 9. `setMinDeposit(uint256 _minDeposit)` 10. `setMaxDeposit(uint256 _maxDeposit)` -### Proxy Admin -The Proxy Admin can upgrade the logic of the contracts. This role will be abolished after an audit and some testing time. +### ~~Proxy Admin~~ (abolished, see [`renounceOwnership` transaction](https://blockscout.com/poa/core/tx/0x7c862374580a015fd55a467fc14e839ffe86f90594aacaf78e9d743bf09fd50e/internal_transactions)) +~~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.`*