diff --git a/.env.example b/.env.example index 10eb025f..627a02ab 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,6 @@ INFURA_TOKEN="909b972ab2ff3afb8b0f8f6a9667test" BOR_CHAIN_URL="http://localhost:9545" ENV="local" -MNEMONIC_DEV="poly radar mass judge dismiss just intact mind resemble fringe diary casino" \ No newline at end of file +MNEMONIC_DEV="poly radar mass judge dismiss just intact mind resemble fringe diary casino" +ALCHEMY_KEY="" +ETHERSCAN_API_KEY="" \ No newline at end of file diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 52031de5..00000000 --- a/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.sol linguist-language=Solidity diff --git a/.gitignore b/.gitignore index 5fcc829e..6b7548d4 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,6 @@ node_modules artifacts out contractAddresses.json -.vscode # ignore generated files diff --git a/.gitmodules b/.gitmodules index 638b2891..820a87c8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ -[submodule "lib/solady"] - path = lib/solady - url = https://github.com/vectorized/solady [submodule "lib/deployment-log-generator"] path = lib/deployment-log-generator url = https://github.com/0xPolygon/deployment-log-generator diff --git a/.nvmrc b/.nvmrc deleted file mode 100644 index 1cc433a1..00000000 --- a/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -20.6.0 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e44295d8..b6567da6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,6 @@ repos: - id: mixed-line-ending args: ["--fix=lf"] description: Forces to replace line ending by the UNIX 'lf' character. - exclude: "^docs/autogen" - repo: local hooks: - id: format @@ -15,16 +14,8 @@ repos: entry: forge fmt exclude: "^lib/" pass_filenames: true - - id: doc - name: Generate documentation - description: Generate docs with `forge doc` - language: system - # generates docs and unstages files if only the commit hash changed within the file, this way only when the documentation is updated, the documentation needs to be regenerated and only the changed files are pushed - entry: "scripts/util/doc_gen.sh" - pass_filenames: false - repo: https://github.com/pre-commit/mirrors-prettier rev: "v3.0.3" hooks: - id: prettier name: Format non solidity files with prettier - exclude: "^docs/autogen" diff --git a/.prettierrc b/.prettierrc index 155c7a32..94368d23 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,16 +1,5 @@ { "overrides": [ - { - "files": "*.sol", - "options": { - "printWidth": 120, - "tabWidth": 4, - "useTabs": false, - "singleQuote": false, - "bracketSpacing": false, - "explicitTypes": "always" - } - }, { "files": "*.js", "options": { diff --git a/.solhint.json b/.solhint.json new file mode 100644 index 00000000..ae32aa33 --- /dev/null +++ b/.solhint.json @@ -0,0 +1,8 @@ +{ + "extends": "solhint:recommended", + "rules": { + "compiler-version": "off", + "max-states-count": "off", + "reason-string": "off" + } +} diff --git a/.soliumignore b/.soliumignore deleted file mode 100644 index 3c3629e6..00000000 --- a/.soliumignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/.soliumrc.json b/.soliumrc.json deleted file mode 100644 index 264b4a60..00000000 --- a/.soliumrc.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "extends": "solium:all", - "plugins": ["security"], - "rules": { - "imports-on-top": 1, - "variable-declarations": 1, - "array-declarations": 1, - "operator-whitespace": 1, - "lbrace": 0, - "mixedcase": 0, - "camelcase": 1, - "uppercase": 1, - "no-empty-blocks": 1, - "no-unused-vars": 1, - "quotes": 1, - "error-reason": 0, - "indentation": ["error", 4], - "arg-overflow": ["error", 8], - "whitespace": 1, - "deprecated-suicide": 1, - "pragma-on-top": 1, - "no-experimental": 0, - "security/enforce-explicit-visibility": ["error"], - "security/no-block-members": ["warning"], - "security/no-low-level-calls": 0, - "security/no-inline-assembly": 0 - } -} diff --git a/README.md b/README.md index 182ed875..8cd6dff0 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,7 @@ npm run bor:clean Run Hardhat test ``` -npm test:hardhat +npm run test:hardhat ``` ### Coverage diff --git a/broadcast/UpgradeDepositManager_Sepolia.s.sol/11155111/run-1721057237.json b/broadcast/UpgradeDepositManager_Sepolia.s.sol/11155111/run-1721057237.json deleted file mode 100644 index b0c4eb8b..00000000 --- a/broadcast/UpgradeDepositManager_Sepolia.s.sol/11155111/run-1721057237.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "transactions": [ - { - "hash": "0x7791e1d6b77d0b8483bc9294d1562089b2257f9e478014154dc9dc6e70ca7afc", - "transactionType": "CREATE", - "contractName": null, - "contractAddress": "0x332d42a3c83fbc46f27137278018a589c637ce3b", - "function": null, - "arguments": null, - "transaction": { - "from": "0x0724d72eb61e508d81ca701881f2248f092953bf", - "gas": "0x23dd76", - "value": "0x0", - "input": "0x608060405268056bc75e2d6310000060085534801561001d57600080fd5b50600080546001600160a01b031916331780825560405182916001600160a01b03169082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3600280546001600160a01b0319166001600160a01b039290921691909117905550611ed9806100976000396000f3fe6080604052600436106101815760003560e01c80638f32d59b116100d1578063cb10f94c1161008a578063e7af7ba111610064578063e7af7ba11461063c578063f220371114610663578063f2fde38b14610696578063f83d08ba146106c957610181565b8063cb10f94c146105d9578063cf309012146105ee578063d29a4bf61461060357610181565b80638f32d59b1461050a57806397feb92614610533578063987ab9db1461056c57806398ea5fca14610181578063a69df4b514610581578063b02c43d01461059657610181565b80635aa6e6751161013e5780637b103999116101185780637b103999146103c55780637b1f7117146103da5780638b9e4f93146104b25780638da5cb5b146104f557610181565b80635aa6e675146103715780636567082814610386578063715018a6146103b057610181565b8063072b15351461018b578063150b7a02146101ce57806342be8379146102be57806342fc47fb146102d357806349f4cc17146103045780634b56c07114610347575b6101896106de565b005b34801561019757600080fd5b50610189600480360360608110156101ae57600080fd5b506001600160a01b038135811691602081013590911690604001356107c0565b3480156101da57600080fd5b506102a1600480360360808110156101f157600080fd5b6001600160a01b0382358116926020810135909116916040820135919081019060808101606082013564010000000081111561022c57600080fd5b82018360208201111561023e57600080fd5b8035906020019184600183028401116401000000008311171561026057600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610892945050505050565b604080516001600160e01b03199092168252519081900360200190f35b3480156102ca57600080fd5b506101896108a2565b3480156102df57600080fd5b506102e86109b3565b604080516001600160a01b039092168252519081900360200190f35b34801561031057600080fd5b506101896004803603606081101561032757600080fd5b506001600160a01b038135811691602081013590911690604001356109c2565b34801561035357600080fd5b506101896004803603602081101561036a57600080fd5b5035610f42565b34801561037d57600080fd5b506102e8610f88565b34801561039257600080fd5b50610189600480360360208110156103a957600080fd5b5035610f97565b3480156103bc57600080fd5b50610189610fab565b3480156103d157600080fd5b506102e8611006565b3480156103e657600080fd5b50610189600480360360608110156103fd57600080fd5b81019060208101813564010000000081111561041857600080fd5b82018360208201111561042a57600080fd5b8035906020019184602083028401116401000000008311171561044c57600080fd5b91939092909160208101903564010000000081111561046a57600080fd5b82018360208201111561047c57600080fd5b8035906020019184602083028401116401000000008311171561049e57600080fd5b9193509150356001600160a01b0316611015565b3480156104be57600080fd5b50610189600480360360608110156104d557600080fd5b506001600160a01b0381358116916020810135909116906040013561127f565b34801561050157600080fd5b506102e86112f1565b34801561051657600080fd5b5061051f611300565b604080519115158252519081900360200190f35b34801561053f57600080fd5b506101896004803603604081101561055657600080fd5b506001600160a01b038135169060200135611311565b34801561057857600080fd5b506102e861131c565b34801561058d57600080fd5b5061018961132b565b3480156105a257600080fd5b506105c0600480360360208110156105b957600080fd5b503561133d565b6040805192835260208301919091528051918290030190f35b3480156105e557600080fd5b506102e8611356565b3480156105fa57600080fd5b5061051f611365565b34801561060f57600080fd5b506101896004803603604081101561062657600080fd5b506001600160a01b038135169060200135611375565b34801561064857600080fd5b50610651611380565b60408051918252519081900360200190f35b34801561066f57600080fd5b506101896004803603602081101561068657600080fd5b50356001600160a01b0316611386565b3480156106a257600080fd5b50610189600480360360208110156106b957600080fd5b50356001600160a01b03166113b9565b3480156106d557600080fd5b506101896113d3565b60035460408051638b9c948960e01b815290516000926001600160a01b031691638b9c9489916004808301926020929190829003018186803b15801561072357600080fd5b505afa158015610737573d6000803e3d6000fd5b505050506040513d602081101561074d57600080fd5b505160408051630d0e30db60e41b8152905191925082916001600160a01b0383169163d0e30db091349160048082019260009290919082900301818588803b15801561079857600080fd5b505af11580156107ac573d6000803e3d6000fd5b50505050506107bc3383346113e3565b5050565b600354604080516301f07db560e01b81526001600160a01b038681166004830152915191909216916301f07db5916024808301926020929190829003018186803b15801561080d57600080fd5b505afa158015610821573d6000803e3d6000fd5b505050506040513d602081101561083757600080fd5b5051610877576040805162461bcd60e51b815260206004820152600a6024820152696e6f742065726337323160b01b604482015290519081900360640190fd5b610882338483611541565b61088d8284836113e3565b505050565b630a85bd0160e11b949350505050565b60035460408051630c91702f60e31b8152815160009384936001600160a01b039091169263648b81789260048083019392829003018186803b1580156108e757600080fd5b505afa1580156108fb573d6000803e3d6000fd5b505050506040513d604081101561091157600080fd5b50805160209091015160055491935091506001600160a01b03808316911614158061094a57506007546001600160a01b03838116911614155b6109855760405162461bcd60e51b815260040180806020018281038252603e815260200180611e41603e913960400191505060405180910390fd5b600780546001600160a01b039384166001600160a01b03199182161790915560058054929093169116179055565b6007546001600160a01b031681565b600354604080516337b1d58560e01b815233600482015290516001600160a01b03909216916337b1d58591602480820192602092909190829003018186803b158015610a0d57600080fd5b505afa158015610a21573d6000803e3d6000fd5b505050506040513d6020811015610a3757600080fd5b50516003811115610a4457fe5b60ff16610a90576040805162461bcd60e51b81526020600482015260156024820152744e6f7420612076616c69642070726564696361746560581b604482015290519081900360640190fd5b60035460408051638b9c948960e01b815290516000926001600160a01b031691638b9c9489916004808301926020929190829003018186803b158015610ad557600080fd5b505afa158015610ae9573d6000803e3d6000fd5b505050506040513d6020811015610aff57600080fd5b5051600354604080516336a8279560e21b81526001600160a01b038881166004830152915193945091169163daa09e5491602480820192602092909190829003018186803b158015610b5057600080fd5b505afa158015610b64573d6000803e3d6000fd5b505050506040513d6020811015610b7a57600080fd5b505115610bf657604080516323b872dd60e01b81523060048201526001600160a01b038581166024830152604482018590529151918616916323b872dd9160648082019260009290919082900301818387803b158015610bd957600080fd5b505af1158015610bed573d6000803e3d6000fd5b50505050610f3c565b806001600160a01b0316846001600160a01b03161415610c7e5760408051627b8a6760e11b8152600481018490526001600160a01b0385811660248301529151869283169162f714ce91604480830192600092919082900301818387803b158015610c6057600080fd5b505af1158015610c74573d6000803e3d6000fd5b5050505050610f3c565b60035460408051646d6174696360d81b8152815190819003600501812063cac39a0560e01b8252600482015290516001600160a01b039092169163cac39a0591602480820192602092909190829003018186803b158015610cde57600080fd5b505afa158015610cf2573d6000803e3d6000fd5b505050506040513d6020811015610d0857600080fd5b50516001600160a01b0385811691161415610e6d576003805460408051621c1bdb60ea1b8152815190819003909301832063cac39a0560e01b84526004840152516001600160a01b039091169163cac39a05916024808301926020929190829003018186803b158015610d7a57600080fd5b505afa158015610d8e573d6000803e3d6000fd5b505050506040513d6020811015610da457600080fd5b50516040805163a9059cbb60e01b81526001600160a01b038681166004830152602482018690529151919092169163a9059cbb9160448083019260209291908290030181600087803b158015610df957600080fd5b505af1158015610e0d573d6000803e3d6000fd5b505050506040513d6020811015610e2357600080fd5b5051610e68576040805162461bcd60e51b815260206004820152600f60248201526e1514905394d1915497d19052531151608a1b604482015290519081900360640190fd5b610f3c565b836001600160a01b031663a9059cbb84846040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610ecd57600080fd5b505af1158015610ee1573d6000803e3d6000fd5b505050506040513d6020811015610ef757600080fd5b5051610f3c576040805162461bcd60e51b815260206004820152600f60248201526e1514905394d1915497d19052531151608a1b604482015290519081900360640190fd5b50505050565b610f4a6115b6565b80610f5457600080fd5b6008546040518291907f010c0265813c273963aa5e8683cf5c45a3b744ba6369c22af0958ec5fcf16b2090600090a3600855565b6002546001600160a01b031681565b610f9f6115b6565b610fa8816115ff565b50565b610fb3611300565b610fbc57600080fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6003546001600160a01b031681565b61101d6118b0565b838214611061576040805162461bcd60e51b815260206004820152600d60248201526c125b9d985b1a5908125b9c1d5d609a1b604482015290519081900360640190fd5b6004805460408051635391f48360e01b8152928301879052516000926001600160a01b0390921691635391f48391602480830192602092919082900301818787803b1580156110af57600080fd5b505af11580156110c3573d6000803e3d6000fd5b505050506040513d60208110156110d957600080fd5b50516003549091506001600160a01b031660005b8681101561127557816001600160a01b03166301f07db589898481811061111057fe5b905060200201356001600160a01b03166040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b15801561116657600080fd5b505afa15801561117a573d6000803e3d6000fd5b505050506040513d602081101561119057600080fd5b5051156111d4576111cf338989848181106111a757fe5b905060200201356001600160a01b03168888858181106111c357fe5b90506020020135611541565b611221565b61122133308888858181106111e557fe5b905060200201358b8b868181106111f857fe5b905060200201356001600160a01b03166001600160a01b03166118f8909392919063ffffffff16565b61125a8489898481811061123157fe5b905060200201356001600160a01b031688888581811061124d57fe5b9050602002013586611952565b61126b83600163ffffffff611c6d16565b92506001016110ed565b5050505050505050565b6008548111156112d6576040805162461bcd60e51b815260206004820152601d60248201527f657863656564206d6178696d756d206465706f73697420616d6f756e74000000604482015290519081900360640190fd5b6108826001600160a01b03841633308463ffffffff6118f816565b6000546001600160a01b031690565b6000546001600160a01b0316331490565b6107bc82338361127f565b6004546001600160a01b031681565b6113336115b6565b61133b611c86565b565b6006602052600090815260409020805460019091015482565b6005546001600160a01b031681565b600154600160a01b900460ff1681565b6107bc8233836107c0565b60085481565b61138e611300565b61139757600080fd5b600480546001600160a01b0319166001600160a01b0392909216919091179055565b6113c1611300565b6113ca57600080fd5b610fa881611c95565b6113db6115b6565b61133b611d03565b6113eb6118b0565b60035460408051636416c18360e01b81526001600160a01b038086166004830152915185939290921691636416c18391602480820192602092909190829003018186803b15801561143b57600080fd5b505afa15801561144f573d6000803e3d6000fd5b505050506040513d602081101561146557600080fd5b50516114ae576040805162461bcd60e51b81526020600482015260136024820152721513d2d15397d393d517d4d5541413d4951151606a1b604482015290519081900360640190fd5b610f3c848484600460009054906101000a90046001600160a01b03166001600160a01b0316635391f48360016040518263ffffffff1660e01b815260040180828152602001915050602060405180830381600087803b15801561151057600080fd5b505af1158015611524573d6000803e3d6000fd5b505050506040513d602081101561153a57600080fd5b5051611952565b60408051632142170760e11b81526001600160a01b038581166004830152306024830152604482018490529151918416916342842e0e9160648082019260009290919082900301818387803b15801561159957600080fd5b505af11580156115ad573d6000803e3d6000fd5b50505050505050565b6002546001600160a01b0316331461133b5760405162461bcd60e51b8152600401808060200182810382526026815260200180611e7f6026913960400191505060405180910390fd5b60035460408051646d6174696360d81b8152815190819003600501812063cac39a0560e01b8252600482015290516000926001600160a01b03169163cac39a05916024808301926020929190829003018186803b15801561165f57600080fd5b505afa158015611673573d6000803e3d6000fd5b505050506040513d602081101561168957600080fd5b5051600354604080516f3837b63cb3b7b726b4b3b930ba34b7b760811b8152815190819003601001812063cac39a0560e01b8252600482015290519293506000926001600160a01b039092169163cac39a0591602480820192602092909190829003018186803b1580156116fc57600080fd5b505afa158015611710573d6000803e3d6000fd5b505050506040513d602081101561172657600080fd5b5051604080516370a0823160e01b8152306004820152905191925084916001600160a01b038516916370a08231916024808301926020929190829003018186803b15801561177357600080fd5b505afa158015611787573d6000803e3d6000fd5b505050506040513d602081101561179d57600080fd5b505110156117dc5760405162461bcd60e51b815260040180806020018281038252602c815260200180611e15602c913960400191505060405180910390fd5b816001600160a01b031663095ea7b382856040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561183c57600080fd5b505af1158015611850573d6000803e3d6000fd5b505050506040513d602081101561186657600080fd5b5050604080516308a960c160e31b81526004810185905290516001600160a01b0383169163454b060891602480830192600092919082900301818387803b15801561159957600080fd5b600154600160a01b900460ff161561133b576040805162461bcd60e51b81526020600482015260066024820152651b1bd8dad95960d21b604482015290519081900360640190fd5b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052610f3c908590611d18565b60035460408051646d6174696360d81b8152815190819003600501812063cac39a0560e01b8252600482015290516000926001600160a01b03169163cac39a05916024808301926020929190829003018186803b1580156119b257600080fd5b505afa1580156119c6573d6000803e3d6000fd5b505050506040513d60208110156119dc57600080fd5b505190506001600160a01b038481169082161415611a02576119fd836115ff565b611aa2565b6003805460408051621c1bdb60ea1b8152815190819003909301832063cac39a0560e01b84526004840152516001600160a01b039091169163cac39a05916024808301926020929190829003018186803b158015611a5f57600080fd5b505afa158015611a73573d6000803e3d6000fd5b505050506040513d6020811015611a8957600080fd5b50516001600160a01b0385811691161415611aa2578093505b604080518082018252606087811b6bffffffffffffffffffffffff199081168284015287821b16607483015260888083018790528351808403909101815260a883018452805160209182012083524281840190815260008781526006835285812094518555905160019094019390935560055460075485516001600160a01b03808d1682860152808c16828901529481018a905260808082018a90528751808303909101815260a082018089526316f1983160e01b905291851660a4820181815260c48301988952835160e4840152835196909416976316f198319791969395909361010490930192908601918190849084905b83811015611bae578181015183820152602001611b96565b50505050905090810190601f168015611bdb5780820380516001836020036101000a031916815260200191505b509350505050600060405180830381600087803b158015611bfb57600080fd5b505af1158015611c0f573d6000803e3d6000fd5b50505050836001600160a01b0316856001600160a01b03167f1dadc8d0683c6f9824e885935c1bec6f76816730dcec148dda8cf25a7b9f797b8585604051808381526020018281526020019250505060405180910390a35050505050565b600082820183811015611c7f57600080fd5b9392505050565b6001805460ff60a01b19169055565b6001600160a01b038116611ca857600080fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001805460ff60a01b1916600160a01b179055565b611d2a826001600160a01b0316611e0e565b611d3357600080fd5b60006060836001600160a01b0316836040518082805190602001908083835b60208310611d715780518252601f199092019160209182019101611d52565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611dd3576040519150601f19603f3d011682016040523d82523d6000602084013e611dd8565b606091505b509150915081611de757600080fd5b805115610f3c57808060200190516020811015611e0357600080fd5b5051610f3c57600080fd5b3b15159056fe616d6f756e742065786365656473207468697320636f6e74726163742773204d415449432062616c616e636541746c65617374206f6e65206f6620737461746553656e646572206f72206368696c64436861696e20616464726573732073686f756c64206368616e67654f6e6c7920676f7665726e616e636520636f6e747261637420697320617574686f72697a6564a265627a7a72315820af90bf4264f58eb743bcfe1f448541fe7693fe6821f29e1b76d985e33a522baa64736f6c63430005110032", - "nonce": "0x8b", - "chainId": "0xaa36a7" - }, - "additionalContracts": [], - "isFixedGasLimit": false - } - ], - "receipts": [ - { - "status": "0x1", - "cumulativeGasUsed": "0x10b4441", - "logs": [ - { - "address": "0x332d42a3c83fbc46f27137278018a589c637ce3b", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000724d72eb61e508d81ca701881f2248f092953bf" - ], - "data": "0x", - "blockHash": "0x28a89052310fadb5f07811332a8c04d1752870b21e8ef659a712ce0a7c7ba782", - "blockNumber": "0x605ef4", - "transactionHash": "0x7791e1d6b77d0b8483bc9294d1562089b2257f9e478014154dc9dc6e70ca7afc", - "transactionIndex": "0x63", - "logIndex": "0xde", - "removed": false - } - ], - "logsBloom": "0x00000000000000000000000000000000000000000004000000800000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000001000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000010000000000000000000000000000000000000000000000000000000000000", - "type": "0x2", - "transactionHash": "0x7791e1d6b77d0b8483bc9294d1562089b2257f9e478014154dc9dc6e70ca7afc", - "transactionIndex": "0x63", - "blockHash": "0x28a89052310fadb5f07811332a8c04d1752870b21e8ef659a712ce0a7c7ba782", - "blockNumber": "0x605ef4", - "gasUsed": "0x1b98a2", - "effectiveGasPrice": "0x2e2fa16bc", - "from": "0x0724d72eb61e508d81ca701881f2248f092953bf", - "to": null, - "contractAddress": "0x332d42a3c83fbc46f27137278018a589c637ce3b" - } - ], - "libraries": [], - "pending": [], - "returns": {}, - "timestamp": 1721057237, - "chain": 11155111, - "commit": "a5fd7d69" -} \ No newline at end of file diff --git a/broadcast/UpgradeDepositManager_Sepolia.s.sol/11155111/run-latest.json b/broadcast/UpgradeDepositManager_Sepolia.s.sol/11155111/run-latest.json deleted file mode 100644 index b0c4eb8b..00000000 --- a/broadcast/UpgradeDepositManager_Sepolia.s.sol/11155111/run-latest.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "transactions": [ - { - "hash": "0x7791e1d6b77d0b8483bc9294d1562089b2257f9e478014154dc9dc6e70ca7afc", - "transactionType": "CREATE", - "contractName": null, - "contractAddress": "0x332d42a3c83fbc46f27137278018a589c637ce3b", - "function": null, - "arguments": null, - "transaction": { - "from": "0x0724d72eb61e508d81ca701881f2248f092953bf", - "gas": "0x23dd76", - "value": "0x0", - "input": "0x608060405268056bc75e2d6310000060085534801561001d57600080fd5b50600080546001600160a01b031916331780825560405182916001600160a01b03169082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3600280546001600160a01b0319166001600160a01b039290921691909117905550611ed9806100976000396000f3fe6080604052600436106101815760003560e01c80638f32d59b116100d1578063cb10f94c1161008a578063e7af7ba111610064578063e7af7ba11461063c578063f220371114610663578063f2fde38b14610696578063f83d08ba146106c957610181565b8063cb10f94c146105d9578063cf309012146105ee578063d29a4bf61461060357610181565b80638f32d59b1461050a57806397feb92614610533578063987ab9db1461056c57806398ea5fca14610181578063a69df4b514610581578063b02c43d01461059657610181565b80635aa6e6751161013e5780637b103999116101185780637b103999146103c55780637b1f7117146103da5780638b9e4f93146104b25780638da5cb5b146104f557610181565b80635aa6e675146103715780636567082814610386578063715018a6146103b057610181565b8063072b15351461018b578063150b7a02146101ce57806342be8379146102be57806342fc47fb146102d357806349f4cc17146103045780634b56c07114610347575b6101896106de565b005b34801561019757600080fd5b50610189600480360360608110156101ae57600080fd5b506001600160a01b038135811691602081013590911690604001356107c0565b3480156101da57600080fd5b506102a1600480360360808110156101f157600080fd5b6001600160a01b0382358116926020810135909116916040820135919081019060808101606082013564010000000081111561022c57600080fd5b82018360208201111561023e57600080fd5b8035906020019184600183028401116401000000008311171561026057600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610892945050505050565b604080516001600160e01b03199092168252519081900360200190f35b3480156102ca57600080fd5b506101896108a2565b3480156102df57600080fd5b506102e86109b3565b604080516001600160a01b039092168252519081900360200190f35b34801561031057600080fd5b506101896004803603606081101561032757600080fd5b506001600160a01b038135811691602081013590911690604001356109c2565b34801561035357600080fd5b506101896004803603602081101561036a57600080fd5b5035610f42565b34801561037d57600080fd5b506102e8610f88565b34801561039257600080fd5b50610189600480360360208110156103a957600080fd5b5035610f97565b3480156103bc57600080fd5b50610189610fab565b3480156103d157600080fd5b506102e8611006565b3480156103e657600080fd5b50610189600480360360608110156103fd57600080fd5b81019060208101813564010000000081111561041857600080fd5b82018360208201111561042a57600080fd5b8035906020019184602083028401116401000000008311171561044c57600080fd5b91939092909160208101903564010000000081111561046a57600080fd5b82018360208201111561047c57600080fd5b8035906020019184602083028401116401000000008311171561049e57600080fd5b9193509150356001600160a01b0316611015565b3480156104be57600080fd5b50610189600480360360608110156104d557600080fd5b506001600160a01b0381358116916020810135909116906040013561127f565b34801561050157600080fd5b506102e86112f1565b34801561051657600080fd5b5061051f611300565b604080519115158252519081900360200190f35b34801561053f57600080fd5b506101896004803603604081101561055657600080fd5b506001600160a01b038135169060200135611311565b34801561057857600080fd5b506102e861131c565b34801561058d57600080fd5b5061018961132b565b3480156105a257600080fd5b506105c0600480360360208110156105b957600080fd5b503561133d565b6040805192835260208301919091528051918290030190f35b3480156105e557600080fd5b506102e8611356565b3480156105fa57600080fd5b5061051f611365565b34801561060f57600080fd5b506101896004803603604081101561062657600080fd5b506001600160a01b038135169060200135611375565b34801561064857600080fd5b50610651611380565b60408051918252519081900360200190f35b34801561066f57600080fd5b506101896004803603602081101561068657600080fd5b50356001600160a01b0316611386565b3480156106a257600080fd5b50610189600480360360208110156106b957600080fd5b50356001600160a01b03166113b9565b3480156106d557600080fd5b506101896113d3565b60035460408051638b9c948960e01b815290516000926001600160a01b031691638b9c9489916004808301926020929190829003018186803b15801561072357600080fd5b505afa158015610737573d6000803e3d6000fd5b505050506040513d602081101561074d57600080fd5b505160408051630d0e30db60e41b8152905191925082916001600160a01b0383169163d0e30db091349160048082019260009290919082900301818588803b15801561079857600080fd5b505af11580156107ac573d6000803e3d6000fd5b50505050506107bc3383346113e3565b5050565b600354604080516301f07db560e01b81526001600160a01b038681166004830152915191909216916301f07db5916024808301926020929190829003018186803b15801561080d57600080fd5b505afa158015610821573d6000803e3d6000fd5b505050506040513d602081101561083757600080fd5b5051610877576040805162461bcd60e51b815260206004820152600a6024820152696e6f742065726337323160b01b604482015290519081900360640190fd5b610882338483611541565b61088d8284836113e3565b505050565b630a85bd0160e11b949350505050565b60035460408051630c91702f60e31b8152815160009384936001600160a01b039091169263648b81789260048083019392829003018186803b1580156108e757600080fd5b505afa1580156108fb573d6000803e3d6000fd5b505050506040513d604081101561091157600080fd5b50805160209091015160055491935091506001600160a01b03808316911614158061094a57506007546001600160a01b03838116911614155b6109855760405162461bcd60e51b815260040180806020018281038252603e815260200180611e41603e913960400191505060405180910390fd5b600780546001600160a01b039384166001600160a01b03199182161790915560058054929093169116179055565b6007546001600160a01b031681565b600354604080516337b1d58560e01b815233600482015290516001600160a01b03909216916337b1d58591602480820192602092909190829003018186803b158015610a0d57600080fd5b505afa158015610a21573d6000803e3d6000fd5b505050506040513d6020811015610a3757600080fd5b50516003811115610a4457fe5b60ff16610a90576040805162461bcd60e51b81526020600482015260156024820152744e6f7420612076616c69642070726564696361746560581b604482015290519081900360640190fd5b60035460408051638b9c948960e01b815290516000926001600160a01b031691638b9c9489916004808301926020929190829003018186803b158015610ad557600080fd5b505afa158015610ae9573d6000803e3d6000fd5b505050506040513d6020811015610aff57600080fd5b5051600354604080516336a8279560e21b81526001600160a01b038881166004830152915193945091169163daa09e5491602480820192602092909190829003018186803b158015610b5057600080fd5b505afa158015610b64573d6000803e3d6000fd5b505050506040513d6020811015610b7a57600080fd5b505115610bf657604080516323b872dd60e01b81523060048201526001600160a01b038581166024830152604482018590529151918616916323b872dd9160648082019260009290919082900301818387803b158015610bd957600080fd5b505af1158015610bed573d6000803e3d6000fd5b50505050610f3c565b806001600160a01b0316846001600160a01b03161415610c7e5760408051627b8a6760e11b8152600481018490526001600160a01b0385811660248301529151869283169162f714ce91604480830192600092919082900301818387803b158015610c6057600080fd5b505af1158015610c74573d6000803e3d6000fd5b5050505050610f3c565b60035460408051646d6174696360d81b8152815190819003600501812063cac39a0560e01b8252600482015290516001600160a01b039092169163cac39a0591602480820192602092909190829003018186803b158015610cde57600080fd5b505afa158015610cf2573d6000803e3d6000fd5b505050506040513d6020811015610d0857600080fd5b50516001600160a01b0385811691161415610e6d576003805460408051621c1bdb60ea1b8152815190819003909301832063cac39a0560e01b84526004840152516001600160a01b039091169163cac39a05916024808301926020929190829003018186803b158015610d7a57600080fd5b505afa158015610d8e573d6000803e3d6000fd5b505050506040513d6020811015610da457600080fd5b50516040805163a9059cbb60e01b81526001600160a01b038681166004830152602482018690529151919092169163a9059cbb9160448083019260209291908290030181600087803b158015610df957600080fd5b505af1158015610e0d573d6000803e3d6000fd5b505050506040513d6020811015610e2357600080fd5b5051610e68576040805162461bcd60e51b815260206004820152600f60248201526e1514905394d1915497d19052531151608a1b604482015290519081900360640190fd5b610f3c565b836001600160a01b031663a9059cbb84846040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610ecd57600080fd5b505af1158015610ee1573d6000803e3d6000fd5b505050506040513d6020811015610ef757600080fd5b5051610f3c576040805162461bcd60e51b815260206004820152600f60248201526e1514905394d1915497d19052531151608a1b604482015290519081900360640190fd5b50505050565b610f4a6115b6565b80610f5457600080fd5b6008546040518291907f010c0265813c273963aa5e8683cf5c45a3b744ba6369c22af0958ec5fcf16b2090600090a3600855565b6002546001600160a01b031681565b610f9f6115b6565b610fa8816115ff565b50565b610fb3611300565b610fbc57600080fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6003546001600160a01b031681565b61101d6118b0565b838214611061576040805162461bcd60e51b815260206004820152600d60248201526c125b9d985b1a5908125b9c1d5d609a1b604482015290519081900360640190fd5b6004805460408051635391f48360e01b8152928301879052516000926001600160a01b0390921691635391f48391602480830192602092919082900301818787803b1580156110af57600080fd5b505af11580156110c3573d6000803e3d6000fd5b505050506040513d60208110156110d957600080fd5b50516003549091506001600160a01b031660005b8681101561127557816001600160a01b03166301f07db589898481811061111057fe5b905060200201356001600160a01b03166040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b15801561116657600080fd5b505afa15801561117a573d6000803e3d6000fd5b505050506040513d602081101561119057600080fd5b5051156111d4576111cf338989848181106111a757fe5b905060200201356001600160a01b03168888858181106111c357fe5b90506020020135611541565b611221565b61122133308888858181106111e557fe5b905060200201358b8b868181106111f857fe5b905060200201356001600160a01b03166001600160a01b03166118f8909392919063ffffffff16565b61125a8489898481811061123157fe5b905060200201356001600160a01b031688888581811061124d57fe5b9050602002013586611952565b61126b83600163ffffffff611c6d16565b92506001016110ed565b5050505050505050565b6008548111156112d6576040805162461bcd60e51b815260206004820152601d60248201527f657863656564206d6178696d756d206465706f73697420616d6f756e74000000604482015290519081900360640190fd5b6108826001600160a01b03841633308463ffffffff6118f816565b6000546001600160a01b031690565b6000546001600160a01b0316331490565b6107bc82338361127f565b6004546001600160a01b031681565b6113336115b6565b61133b611c86565b565b6006602052600090815260409020805460019091015482565b6005546001600160a01b031681565b600154600160a01b900460ff1681565b6107bc8233836107c0565b60085481565b61138e611300565b61139757600080fd5b600480546001600160a01b0319166001600160a01b0392909216919091179055565b6113c1611300565b6113ca57600080fd5b610fa881611c95565b6113db6115b6565b61133b611d03565b6113eb6118b0565b60035460408051636416c18360e01b81526001600160a01b038086166004830152915185939290921691636416c18391602480820192602092909190829003018186803b15801561143b57600080fd5b505afa15801561144f573d6000803e3d6000fd5b505050506040513d602081101561146557600080fd5b50516114ae576040805162461bcd60e51b81526020600482015260136024820152721513d2d15397d393d517d4d5541413d4951151606a1b604482015290519081900360640190fd5b610f3c848484600460009054906101000a90046001600160a01b03166001600160a01b0316635391f48360016040518263ffffffff1660e01b815260040180828152602001915050602060405180830381600087803b15801561151057600080fd5b505af1158015611524573d6000803e3d6000fd5b505050506040513d602081101561153a57600080fd5b5051611952565b60408051632142170760e11b81526001600160a01b038581166004830152306024830152604482018490529151918416916342842e0e9160648082019260009290919082900301818387803b15801561159957600080fd5b505af11580156115ad573d6000803e3d6000fd5b50505050505050565b6002546001600160a01b0316331461133b5760405162461bcd60e51b8152600401808060200182810382526026815260200180611e7f6026913960400191505060405180910390fd5b60035460408051646d6174696360d81b8152815190819003600501812063cac39a0560e01b8252600482015290516000926001600160a01b03169163cac39a05916024808301926020929190829003018186803b15801561165f57600080fd5b505afa158015611673573d6000803e3d6000fd5b505050506040513d602081101561168957600080fd5b5051600354604080516f3837b63cb3b7b726b4b3b930ba34b7b760811b8152815190819003601001812063cac39a0560e01b8252600482015290519293506000926001600160a01b039092169163cac39a0591602480820192602092909190829003018186803b1580156116fc57600080fd5b505afa158015611710573d6000803e3d6000fd5b505050506040513d602081101561172657600080fd5b5051604080516370a0823160e01b8152306004820152905191925084916001600160a01b038516916370a08231916024808301926020929190829003018186803b15801561177357600080fd5b505afa158015611787573d6000803e3d6000fd5b505050506040513d602081101561179d57600080fd5b505110156117dc5760405162461bcd60e51b815260040180806020018281038252602c815260200180611e15602c913960400191505060405180910390fd5b816001600160a01b031663095ea7b382856040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561183c57600080fd5b505af1158015611850573d6000803e3d6000fd5b505050506040513d602081101561186657600080fd5b5050604080516308a960c160e31b81526004810185905290516001600160a01b0383169163454b060891602480830192600092919082900301818387803b15801561159957600080fd5b600154600160a01b900460ff161561133b576040805162461bcd60e51b81526020600482015260066024820152651b1bd8dad95960d21b604482015290519081900360640190fd5b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052610f3c908590611d18565b60035460408051646d6174696360d81b8152815190819003600501812063cac39a0560e01b8252600482015290516000926001600160a01b03169163cac39a05916024808301926020929190829003018186803b1580156119b257600080fd5b505afa1580156119c6573d6000803e3d6000fd5b505050506040513d60208110156119dc57600080fd5b505190506001600160a01b038481169082161415611a02576119fd836115ff565b611aa2565b6003805460408051621c1bdb60ea1b8152815190819003909301832063cac39a0560e01b84526004840152516001600160a01b039091169163cac39a05916024808301926020929190829003018186803b158015611a5f57600080fd5b505afa158015611a73573d6000803e3d6000fd5b505050506040513d6020811015611a8957600080fd5b50516001600160a01b0385811691161415611aa2578093505b604080518082018252606087811b6bffffffffffffffffffffffff199081168284015287821b16607483015260888083018790528351808403909101815260a883018452805160209182012083524281840190815260008781526006835285812094518555905160019094019390935560055460075485516001600160a01b03808d1682860152808c16828901529481018a905260808082018a90528751808303909101815260a082018089526316f1983160e01b905291851660a4820181815260c48301988952835160e4840152835196909416976316f198319791969395909361010490930192908601918190849084905b83811015611bae578181015183820152602001611b96565b50505050905090810190601f168015611bdb5780820380516001836020036101000a031916815260200191505b509350505050600060405180830381600087803b158015611bfb57600080fd5b505af1158015611c0f573d6000803e3d6000fd5b50505050836001600160a01b0316856001600160a01b03167f1dadc8d0683c6f9824e885935c1bec6f76816730dcec148dda8cf25a7b9f797b8585604051808381526020018281526020019250505060405180910390a35050505050565b600082820183811015611c7f57600080fd5b9392505050565b6001805460ff60a01b19169055565b6001600160a01b038116611ca857600080fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001805460ff60a01b1916600160a01b179055565b611d2a826001600160a01b0316611e0e565b611d3357600080fd5b60006060836001600160a01b0316836040518082805190602001908083835b60208310611d715780518252601f199092019160209182019101611d52565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611dd3576040519150601f19603f3d011682016040523d82523d6000602084013e611dd8565b606091505b509150915081611de757600080fd5b805115610f3c57808060200190516020811015611e0357600080fd5b5051610f3c57600080fd5b3b15159056fe616d6f756e742065786365656473207468697320636f6e74726163742773204d415449432062616c616e636541746c65617374206f6e65206f6620737461746553656e646572206f72206368696c64436861696e20616464726573732073686f756c64206368616e67654f6e6c7920676f7665726e616e636520636f6e747261637420697320617574686f72697a6564a265627a7a72315820af90bf4264f58eb743bcfe1f448541fe7693fe6821f29e1b76d985e33a522baa64736f6c63430005110032", - "nonce": "0x8b", - "chainId": "0xaa36a7" - }, - "additionalContracts": [], - "isFixedGasLimit": false - } - ], - "receipts": [ - { - "status": "0x1", - "cumulativeGasUsed": "0x10b4441", - "logs": [ - { - "address": "0x332d42a3c83fbc46f27137278018a589c637ce3b", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000724d72eb61e508d81ca701881f2248f092953bf" - ], - "data": "0x", - "blockHash": "0x28a89052310fadb5f07811332a8c04d1752870b21e8ef659a712ce0a7c7ba782", - "blockNumber": "0x605ef4", - "transactionHash": "0x7791e1d6b77d0b8483bc9294d1562089b2257f9e478014154dc9dc6e70ca7afc", - "transactionIndex": "0x63", - "logIndex": "0xde", - "removed": false - } - ], - "logsBloom": "0x00000000000000000000000000000000000000000004000000800000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000001000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000010000000000000000000000000000000000000000000000000000000000000", - "type": "0x2", - "transactionHash": "0x7791e1d6b77d0b8483bc9294d1562089b2257f9e478014154dc9dc6e70ca7afc", - "transactionIndex": "0x63", - "blockHash": "0x28a89052310fadb5f07811332a8c04d1752870b21e8ef659a712ce0a7c7ba782", - "blockNumber": "0x605ef4", - "gasUsed": "0x1b98a2", - "effectiveGasPrice": "0x2e2fa16bc", - "from": "0x0724d72eb61e508d81ca701881f2248f092953bf", - "to": null, - "contractAddress": "0x332d42a3c83fbc46f27137278018a589c637ce3b" - } - ], - "libraries": [], - "pending": [], - "returns": {}, - "timestamp": 1721057237, - "chain": 11155111, - "commit": "a5fd7d69" -} \ No newline at end of file diff --git a/broadcast/UpgradeStakeManager_Sepolia.s.sol/11155111/run-1721057742.json b/broadcast/UpgradeStakeManager_Sepolia.s.sol/11155111/run-1721057742.json deleted file mode 100644 index eceb3423..00000000 --- a/broadcast/UpgradeStakeManager_Sepolia.s.sol/11155111/run-1721057742.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "transactions": [ - { - "hash": "0x4499d0ecf70c3a39927d5245cac653c02f0f0c33dc82be6a9ce5d37d4615c70a", - "transactionType": "CREATE", - "contractName": null, - "contractAddress": "0x777badc2c75bd4ee5303bf6e90009bd31d8fd3d1", - "function": null, - "arguments": null, - "transaction": { - "from": "0x0724d72eb61e508d81ca701881f2248f092953bf", - "gas": "0x6b19b6", - "value": "0x0", - "input": "0x60806040526023805460ff191690553480156200001b57600080fd5b5060008054610100600160a81b0319168155600180546001600160a01b0319163317908190556040516001600160a01b039190911691907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a360235460ff1615620000c1576040805162461bcd60e51b815260206004820152600e60248201526d185b1c9958591e481a5b9a5d195960921b604482015290519081900360640190fd5b6023805460ff19166001179055615fc580620000de6000396000f3fe608060405234801561001057600080fd5b50600436106107175760003560e01c80637d669752116103a8578063b1d23f02116101f4578063e8afa8e81161011a578063f5e95acb116100b8578063fb1ef52c11610087578063fb1ef52c14611826578063fba58f341461184f578063fc0c546a14611857578063ff3db8e31461185f57610717565b8063f5e95acb1461178f578063f771fc87146117f9578063f83d08ba14611816578063f8a3176c1461181e57610717565b8063f24ccbfe116100f4578063f24ccbfe14611697578063f28699fa1461169f578063f2fde38b146116be578063f41a9642146116e457610717565b8063e8afa8e81461164c578063eceec1d314611672578063f1674fdf1461168f57610717565b8063cf30901211610192578063dcd962b211610161578063dcd962b2146115fc578063e568959a1461161f578063e59ee0c614611627578063e6692f491461162f57610717565b8063cf3090121461159b578063d6de07d0146115a3578063d7f5549d146115c2578063d86d53e7146115df57610717565b8063c710e922116101ce578063c710e92214611518578063c7f067cb14611544578063cbf383d514611576578063cd6b83881461159357610717565b8063b1d23f02146114a6578063b65de35e146114c9578063bc8756a9146114e657610717565b80639342c8f4116102d95780639ff1150011610277578063a69df4b511610246578063a69df4b514611462578063a7ab69611461146a578063a8dc889b14611472578063b184be811461147a57610717565b80639ff1150014611397578063a440ab1e146113ba578063a4769071146113d7578063a6854877146113df57610717565b806399d18f6f116102b357806399d18f6f1461132c5780639a8a62431461134f5780639b33f434146113575780639ddbbf851461137457610717565b80639342c8f4146112dc57806396a93224146112f9578063987ab9db1461132457610717565b806386a22666116103465780638f32d59b116103205780638f32d59b146112a7578063900cf0cf146112af57806391460149146112b757806391f1a3a5146112d457610717565b806386a226661461127a578063883b455f146112975780638da5cb5b1461129f57610717565b80637f952d95116103825780637f952d951461118057806381254e1214611188578063817b1cd21461124f578063858a7c031461125757610717565b80637d6697521461113e5780637ed4b27c146111465780637f4b43231461116357610717565b806341b3d185116105675780635ab1bd53116104985780637060054d116104365780637854f354116104055780637854f354146110eb57806378f84a44146111085780637b1039991461112e5780637c7eaf1a1461113657610717565b80637060054d146110cb578063715018a6146110d357806376671808146110db57806377939d10146110e357610717565b80636352211e116104725780636352211e14610fa05780636365679814610fbd57806368cb812a14610fe95780636901b2531461109957610717565b80635ab1bd5314610f015780635e47655f14610f0957806360c8d12214610f7757610717565b80634fdd20f11161050557806354b8c601116104df57806354b8c60114610ecc5780635508d8e114610ed457806356342d8c14610edc5780635aa6e67514610ef957610717565b80634fdd20f114610ca657806352b8115d14610d6d5780635325e14414610e0557610717565b80634b341aed116105415780634b341aed14610c3e5780634c02550014610c645780634e3c83f114610c965780634fd101d714610c9e57610717565b806341b3d18514610bf2578063451b598514610bfa57806348ab8b2a14610c0257610717565b80632079fb9a1161064c5780632fa9d18b116105ea57806335aa2e44116105b957806335aa2e4414610ac85780633862da0b14610b8157806339610f7814610ba75780633c34355614610bc457610717565b80632fa9d18b14610a0c57806330cbe57114610a9b57806331c2273b14610ab85780633427458614610ac057610717565b80632649263a116106265780632649263a146108f257806328cc4e41146109235780632cf44a431461094e5780632e17de78146109ef57610717565b80632079fb9a1461089757806325316411146108b457806325726df2146108bc57610717565b8063174e6832116106b95780631ae4818f116106935780631ae4818f1461082f5780631c404cec146108375780631dd6b9b1146108545780631e9b12ef1461087157610717565b8063174e6832146107e4578063178c2c831461080a57806317c2b9101461082757610717565b80630e15561a116106f55780630e15561a146107935780630ebb172a1461079b57806316827b1b146107a35780631705a3bd146107c057610717565b806306cfb1041461071c578063078a13b11461073b5780630cccfc5814610779575b600080fd5b6107396004803603602081101561073257600080fd5b503561187c565b005b6107396004803603608081101561075157600080fd5b506001600160a01b038135811691602081013582169160408201358116916060013516611889565b610781611901565b60408051918252519081900360200190f35b610781611907565b61078161190d565b610739600480360360208110156107b957600080fd5b5035611913565b6107c861199c565b604080516001600160a01b039092168252519081900360200190f35b610781600480360360208110156107fa57600080fd5b50356001600160a01b03166119ab565b6107396004803603602081101561082057600080fd5b5035611a35565b610781611cc2565b6107c8611cc8565b6107396004803603602081101561084d57600080fd5b5035611cd7565b6107396004803603602081101561086a57600080fd5b5035611cf0565b6107396004803603602081101561088757600080fd5b50356001600160a01b0316611cfd565b6107c8600480360360208110156108ad57600080fd5b5035611d3a565b610781611d61565b6108d9600480360360208110156108d257600080fd5b5035611d67565b6040805192835260208301919091528051918290030190f35b61090f6004803603602081101561090857600080fd5b5035611d80565b604080519115158252519081900360200190f35b6107396004803603606081101561093957600080fd5b50803590602081013590604001351515611dbb565b6107396004803603602081101561096457600080fd5b810190602081018135600160201b81111561097e57600080fd5b82018360208201111561099057600080fd5b803590602001918460208302840111600160201b831117156109b157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611de0945050505050565b61073960048036036020811015610a0557600080fd5b5035611e04565b610781600480360360a0811015610a2257600080fd5b8135916020810135916040820135916001600160a01b036060820135169181019060a081016080820135600160201b811115610a5d57600080fd5b820183602082011115610a6f57600080fd5b803590602001918460608302840111600160201b83111715610a9057600080fd5b509092509050611e19565b61073960048036036020811015610ab157600080fd5b503561212a565b6107c861213f565b61078161214e565b610ae560048036036020811015610ade57600080fd5b5035612154565b604051808e81526020018d81526020018c81526020018b81526020018a8152602001896001600160a01b03166001600160a01b03168152602001886001600160a01b03166001600160a01b03168152602001876003811115610b4357fe5b60ff1681526020018681526020018581526020018481526020018381526020018281526020019d505050505050505050505050505060405180910390f35b61078160048036036020811015610b9757600080fd5b50356001600160a01b03166121c5565b61078160048036036020811015610bbd57600080fd5b50356121d7565b61073960048036036040811015610bda57600080fd5b506001600160a01b0381358116916020013516612238565b6107816122f1565b6107816122f7565b61073960048036036080811015610c1857600080fd5b508035906001600160a01b036020820135811691604081013590911690606001356122fd565b61078160048036036020811015610c5457600080fd5b50356001600160a01b03166123a3565b61090f60048036036060811015610c7a57600080fd5b50803590602081013590604001356001600160a01b03166124da565b6107816124fb565b610781612501565b610739600480360360a0811015610cbc57600080fd5b6001600160a01b0382351691602081013591604082013591606081013515159181019060a081016080820135600160201b811115610cf957600080fd5b820183602082011115610d0b57600080fd5b803590602001918460018302840111600160201b83111715610d2c57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550612507945050505050565b610739600480360360c0811015610d8357600080fd5b6001600160a01b038235169160208101359160408201359160608101359160808201351515919081019060c0810160a0820135600160201b811115610dc757600080fd5b820183602082011115610dd957600080fd5b803590602001918460018302840111600160201b83111715610dfa57600080fd5b509092509050612525565b610e2260048036036020811015610e1b57600080fd5b5035612648565b60405180868152602001858152602001846001600160a01b03166001600160a01b031681526020018315151515815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610e8d578181015183820152602001610e75565b50505050905090810190601f168015610eba5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390f35b61090f61270e565b610781612717565b6107c860048036036020811015610ef257600080fd5b503561271d565b6107c861273b565b6107c861274f565b61078160048036036020811015610f1f57600080fd5b810190602081018135600160201b811115610f3957600080fd5b820183602082011115610f4b57600080fd5b803590602001918460018302840111600160201b83111715610f6c57600080fd5b50909250905061275f565b61073960048036036060811015610f8d57600080fd5b5080359060208101359060400135612766565b6107c860048036036020811015610fb657600080fd5b50356127cf565b61073960048036036040811015610fd357600080fd5b506001600160a01b03813516906020013561281b565b61073960048036036060811015610fff57600080fd5b813591602081013591810190606081016040820135600160201b81111561102557600080fd5b82018360208201111561103757600080fd5b803590602001918460018302840111600160201b8311171561105857600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550612832945050505050565b61090f600480360360608110156110af57600080fd5b50803590602081013590604001356001600160a01b0316612978565b610781612990565b610739612996565b6107816129f1565b6107816129f7565b6107396004803603602081101561110157600080fd5b50356129fd565b6107816004803603602081101561111e57600080fd5b50356001600160a01b0316612a16565b6107c8612a28565b610781612a37565b610781612a3d565b6107816004803603602081101561115c57600080fd5b5035612a43565b6107816004803603602081101561117957600080fd5b5035612a9a565b610781612aaf565b610739600480360360a081101561119e57600080fd5b6001600160a01b0382351691602081013591604082013591606081013515159181019060a081016080820135600160201b8111156111db57600080fd5b8201836020820111156111ed57600080fd5b803590602001918460018302840111600160201b8311171561120e57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550612ab5945050505050565b610781612acc565b6107396004803603604081101561126d57600080fd5b5080359060200135612ad2565b6107396004803603602081101561129057600080fd5b5035612b18565b6107c8612b29565b6107c8612b3d565b61090f612b4c565b610781612b8f565b610739600480360360208110156112cd57600080fd5b5035612b95565b610781612bab565b610739600480360360208110156112f257600080fd5b5035612bb1565b6107396004803603606081101561130f57600080fd5b50803590602081013590604001351515612bc6565b6107c8612be5565b6107396004803603604081101561134257600080fd5b5080359060200135612bf4565b610781612c5a565b6107396004803603602081101561136d57600080fd5b5035612c60565b6107396004803603604081101561138a57600080fd5b5080359060200135612d1c565b610739600480360360408110156113ad57600080fd5b5080359060200135612d82565b610739600480360360208110156113d057600080fd5b5035612e75565b610781612e8c565b610739600480360360808110156113f557600080fd5b813591602081013591604082013515159190810190608081016060820135600160201b81111561142457600080fd5b82018360208201111561143657600080fd5b803590602001918460018302840111600160201b8311171561145757600080fd5b509092509050612e92565b610739612f43565b610781612f55565b610781612f5b565b6107396004803603604081101561149057600080fd5b506001600160a01b038135169060200135612f61565b610739600480360360408110156114bc57600080fd5b5080359060200135612f75565b610781600480360360208110156114df57600080fd5b5035612f88565b61090f600480360360608110156114fc57600080fd5b50803590602081013590604001356001600160a01b0316612fd6565b6107396004803603604081101561152e57600080fd5b50803590602001356001600160a01b0316612fed565b61090f6004803603606081101561155a57600080fd5b50803590602081013590604001356001600160a01b03166130a8565b6107396004803603602081101561158c57600080fd5b50356130b7565b610781613140565b61090f613146565b610739600480360360208110156115b957600080fd5b5035151561314f565b610781600480360360208110156115d857600080fd5b50356132a1565b610739600480360360208110156115f557600080fd5b50356132b3565b6107396004803603604081101561161257600080fd5b50803590602001356132c8565b610781613330565b6108d9613336565b6107396004803603602081101561164557600080fd5b503561333f565b6107396004803603602081101561166257600080fd5b50356001600160a01b03166133fb565b6107816004803603602081101561168857600080fd5b503561347b565b6107c861348d565b6107c861349c565b610739600480360360208110156116b557600080fd5b503515156134ab565b610739600480360360208110156116d457600080fd5b50356001600160a01b03166134c6565b610739600480360360408110156116fa57600080fd5b81359190810190604081016020820135600160201b81111561171b57600080fd5b82018360208201111561172d57600080fd5b803590602001918460018302840111600160201b8311171561174e57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506134e0945050505050565b61073960048036036101208110156117a657600080fd5b506001600160a01b038135811691602081013582169160408201358116916060810135821691608082013581169160a081013582169160c082013581169160e081013582169161010090910135166136e5565b6107396004803603602081101561180f57600080fd5b5035613888565b6107396138a3565b6107c86138b3565b6107396004803603606081101561183c57600080fd5b50803590602081013590604001356138c2565b6107816139dd565b6107c86139e3565b6107396004803603602081101561187557600080fd5b50356139f2565b611884613a07565b600f55565b611891613a07565b61189a81613a55565b6118a357600080fd5b60238054610100600160a81b0319169055602580546001600160a01b03199081166001600160a01b03938416179091556006805482169583169590951790945560058054851693821693909317909255600780549093169116179055565b60155481565b60135481565b60085481565b61191b613a07565b8061192557600080fd5b60055460105460408051630f1980a560e41b8152600481018590526024810192909252516001600160a01b039092169163f1980a509160448082019260009290919082900301818387803b15801561197c57600080fd5b505af1158015611990573d6000803e3d6000fd5b50505060109190915550565b602c546001600160a01b031681565b60065460408051632f745c5960e01b81526001600160a01b038481166004830152600060248301819052925192931691632f745c5991604480820192602092909190829003018186803b158015611a0157600080fd5b505afa158015611a15573d6000803e3d6000fd5b505050506040513d6020811015611a2b57600080fd5b505190505b919050565b80611a3f81613a74565b60026000838152601a6020526040902060060154600160a01b900460ff166003811115611a6857fe5b14611aa7576040805162461bcd60e51b815260206004820152600a602482015269139bdd081a985a5b195960b21b604482015290519081900360640190fd5b6000828152601a602052604090206003015415611aff576040805162461bcd60e51b8152602060048201526011602482015270416c726561647920756e7374616b696e6760781b604482015290519081900360640190fd5b6009546000838152601a6020526040902060040154811015611b61576040805162461bcd60e51b8152602060048201526016602482015275125b98dbdb5c1b195d19481a985a5b081c195c9a5bd960521b604482015290519081900360640190fd5b6000838152601a6020526040902054600c54811015611b7f57600080fd5b6000848152601a60205260409020600601546001600160a01b03168015611bf457806001600160a01b031663a69df4b56040518163ffffffff1660e01b8152600401600060405180830381600087803b158015611bdb57600080fd5b505af1158015611bef573d6000803e3d6000fd5b505050505b6000858152601a60205260409020600a0154611c2490611c1b90849063ffffffff613afe16565b60016000613b10565b6000858152601a602052604080822060068101805460ff60a01b1916600160a01b1790556005908101549054825163f92ec5af60e01b8152600481018a90526001600160a01b039283166024820181905293519394929091169263f92ec5af9260448084019391929182900301818387803b158015611ca257600080fd5b505af1158015611cb6573d6000803e3d6000fd5b50505050505050505050565b60175481565b6007546001600160a01b031681565b80611ce181613a74565b611cec826001613bcc565b5050565b611cf8613a07565b600955565b611d05613a07565b6001600160a01b038116611d1857600080fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b60268181548110611d4757fe5b6000918252602090912001546001600160a01b0316905081565b600e5481565b601e602052600090815260409020805460019091015482565b6000818152601a6020526040812060068101548154600390920154600954611db593600160a01b90930460ff16929190613be0565b92915050565b611dc3613c17565b82611dcd81613a74565b611dda8484846000613c58565b50505050565b611de8612b4c565b611df157600080fd5b8051611cec906026906020840190615e39565b80611e0e81613a74565b611cec826000613e32565b6002546000906001600160a01b03163314611e3357600080fd5b600954601d546000908190611e46615e9e565b6026546040805191840180835260208082028401019091528015611e74578160200160208202803883390190505b5060408083019190915260268054825160208083028201810190945281815292830182828015611ecd57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611eaf575b50505050506060820152600060208201526026546080820152611eee615ecd565b6026546040805191850180835260208082028401019091528015611f1c578160200160208202803883390190505b50602082015260005b888110156120eb576000611f738e8c8c85818110611f3f57fe5b9050606002016003806020026040519081016040528092919082600360200280828437600092019190915250613ee5915050565b9050856001600160a01b0316816001600160a01b03161415611f9557506120e3565b856001600160a01b0316816001600160a01b03161015611fb557506120eb565b6001600160a01b0381166000908152601b6020908152604080832054808452601a909252909120805460068201546003909201548087529091600160a01b900460ff169061200790829084908e613be0565b15612092576000838152601a60205260409020600a0154939850889361204690839061203a908d9063ffffffff613afe16565b9063ffffffff613afe16565b8651909a50156120805782866020015187604001518151811061206557fe5b6020908102919091010152604086018051600101905261208d565b61208a8785613fe8565b96505b6120de565b60028160038111156120a057fe5b14156120de578287604001518860000151815181106120bb57fe5b602090810291909101810191909152875160019081018952908801805190910190525b505050505b600101611f25565b506120f7826000613fe8565b91506121198d8b878e86604001518760000151876020015188604001516140c5565b9d9c50505050505050505050505050565b8061213481613a74565b611cec826001613e32565b6006546001600160a01b031681565b60165481565b601a60205260009081526040902080546001820154600283015460038401546004850154600586015460068701546007880154600889015460098a0154600a8b0154600b909b0154999a98999798969795966001600160a01b039586169695851695600160a01b90950460ff16948d565b601b6020526000908152604090205481565b6000818152601a602052604081206003015481906121fc576121f88361422d565b9150505b6000838152601a602052604090206009015461223190600190612225908463ffffffff613afe16565b9063ffffffff6142a916565b9392505050565b612240613a07565b60038054602b80546001600160a01b038084166001600160a01b0319928316179283905592811686841617909355602c805490931684831617909255604080516370a0823160e01b81523060048201529051611cec93909216916370a0823191602480820192602092909190829003018186803b1580156122c057600080fd5b505afa1580156122d4573d6000803e3d6000fd5b505050506040513d60208110156122ea57600080fd5b50516142be565b600c5481565b60295481565b612305613a07565b6000848152601a60205260409020600601546001600160a01b03168061232a57600080fd5b6040805163abf59fc960e01b81526001600160a01b03868116600483015285811660248301526044820185905291519183169163abf59fc99160648082019260009290919082900301818387803b15801561238457600080fd5b505af1158015612398573d6000803e3d6000fd5b505050505050505050565b60006001600160a01b03821615806124315750600654604080516370a0823160e01b81526001600160a01b038581166004830152915191909216916370a08231916024808301926020929190829003018186803b15801561240357600080fd5b505afa158015612417573d6000803e3d6000fd5b505050506040513d602081101561242d57600080fd5b5051155b1561243e57506000611a30565b60065460408051632f745c5960e01b81526001600160a01b0385811660048301526000602483018190529251601a949190911691632f745c59916044808301926020929190829003018186803b15801561249757600080fd5b505afa1580156124ab573d6000803e3d6000fd5b505050506040513d60208110156124c157600080fd5b5051815260208101919091526040016000205492915050565b6000836124e68161445d565b6124f2848460016144cb565b95945050505050565b600f5481565b60105481565b61250f613c17565b61251e85858585856000614571565b5050505050565b333014612567576040805162461bcd60e51b815260206004820152600b60248201526a1b9bdd08185b1b1bddd95960aa1b604482015290519081900360640190fd5b61257687888860006001614623565b6125848560095460016146f0565b60006125c888868686868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061485492505050565b6005546040805163e12ab1af60e01b815260048101849052602481018a90526044810189905290519293506001600160a01b039091169163e12ab1af9160648082019260009290919082900301818387803b15801561262657600080fd5b505af115801561263a573d6000803e3d6000fd5b505050505050505050505050565b60208080526000918252604091829020805460018083015460028085015460038601805489516101009682161596909602600019011692909204601f8101889004880285018801909852878452939691956001600160a01b03851695600160a01b90950460ff16949392908301828280156127045780601f106126d957610100808354040283529160200191612704565b820191906000526020600020905b8154815290600101906020018083116126e757829003601f168201915b5050505050905085565b60195460ff1681565b60125481565b6000908152601a60205260409020600601546001600160a01b031690565b60005461010090046001600160a01b031681565b6004546001600160a01b03165b90565b6000806000fd5b61276e613a07565b60255460408051602481018690526044810185905260648082018590528251808303909101815260849091019091526020810180516001600160e01b0316633064689160e11b1790526127ca916001600160a01b031690614c61565b505050565b600654604080516331a9108f60e11b81526004810184905290516000926001600160a01b031691636352211e916024808301926020929190829003018186803b158015611a0157600080fd5b612823613c17565b611cec82338360006001614623565b6017546040805133602080830191909152818301879052825180830384018152606090920190925280519101206128719184908463ffffffff614c8916565b6128b4576040805162461bcd60e51b815260206004820152600f60248201526e2bb937b7339030b1b190383937b7b360891b604482015290519081900360640190fd5b336000908152601f60205260408120546128d590859063ffffffff6142a916565b6022549091506128eb908263ffffffff6142a916565b6022556005546040805163122b648160e01b81523360048201526024810184905290516001600160a01b039092169163122b64819160448082019260009290919082900301818387803b15801561294157600080fd5b505af1158015612955573d6000803e3d6000fd5b5050336000818152601f60205260408120889055611dda93509091508390614ddf565b6000836129848161445d565b6124f2848460006144cb565b600a5481565b61299e612b4c565b6129a757600080fd5b6001546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600180546001600160a01b0319169055565b60095481565b60185481565b612a05613a07565b612a138160095460016146f0565b50565b601f6020526000908152604090205481565b6004546001600160a01b031681565b602a5481565b600b5481565b600081612a4f8161445d565b612a5883614ec9565b6000838152601a6020526040812060090154612a7b90600163ffffffff6142a916565b6000858152601a60205260409020600160099091015592505050919050565b6000908152601a60205260409020600a015490565b601d5490565b612abd613c17565b61251e85858585856001614571565b60115481565b81612adc8161445d565b6000838152601a60205260409020600a0154612afe908363ffffffff6142a916565b6000938452601a6020526040909320600a01929092555050565b612b20613a07565b612a13816142be565b60235461010090046001600160a01b031681565b6001546001600160a01b031690565b604080517f6d617469632e6e6574776f726b2e70726f78792e6f776e6572000000000000008152905190819003601901902054336001600160a01b039091161490565b60095490565b612b9d613a07565b612a138160095460006146f0565b60275481565b80612bbb81613a74565b611cec826000613bcc565b612bce613c17565b82612bd881613a74565b611dda8484846001613c58565b6002546001600160a01b031681565b612bfc613c17565b602554604080516024810185905260448101849052306064808301919091528251808303909101815260849091019091526020810180516001600160e01b031663561ad5c960e11b179052611cec916001600160a01b031690614c61565b60225481565b612c68613a07565b6005546016546040805163a3b1d8cb60e01b8152600481018590526024810192909252516001600160a01b039092169163a3b1d8cb9160448082019260009290919082900301818387803b158015612cbf57600080fd5b505af1158015612cd3573d6000803e3d6000fd5b505050506064811115612d17576040805162461bcd60e51b8152602060048201526007602482015266746f6f2062696760c81b604482015290519081900360640190fd5b601655565b612d24612b4c565b612d2d57600080fd5b602554604080516024810185905260448082018590528251808303909101815260649091019091526020810180516001600160e01b0316639ddbbf8560e01b179052611cec916001600160a01b031690614c61565b81612d8c8161445d565b6000821315612de55760195460ff16612de5576040805162461bcd60e51b815260206004820152601660248201527511195b1959d85d1a5bdb881a5cc8191a5cd8589b195960521b604482015290519081900360640190fd5b6000838152601a602052604090206003015480612e0d57612e0883600080613b10565b612e50565b600954811115612e50576040805162461bcd60e51b8152602060048201526009602482015268756e7374616b696e6760b81b604482015290519081900360640190fd5b60008312612e6757612e628484614ed8565b611dda565b611dda848460001902612ad2565b612e7d613a07565b80612e8757600080fd5b600e55565b601c5490565b612e9a613c17565b6025546040516024810187815260448201879052851515606483015260806084830190815260a4830185905261251e936001600160a01b03169263a685487760e01b928a928a928a928a928a9260c40184848082843760008184015260408051601f19601f9093018316909401848103909201845252506020810180516001600160e01b03199a909a166001600160e01b03909a169990991790985250614c6195505050505050565b612f4b613a07565b612f53614f13565b565b60085490565b60245481565b612f69613a07565b611cec82826001614ddf565b612f7d613a07565b600c91909155600d55565b6000818152601a60205260408120600301548190612fad57612fa98361422d565b5090505b6000838152601a602052604090206001908101546122319190612225908463ffffffff613afe16565b6000612fe58484846000614f1f565b949350505050565b612ff5613a07565b306001600160a01b0316816001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561303857600080fd5b505afa15801561304c573d6000803e3d6000fd5b505050506040513d602081101561306257600080fd5b50516001600160a01b03161461307757600080fd5b6000918252601a602052604090912060060180546001600160a01b0319166001600160a01b03909216919091179055565b6000612fe58484846001614f1f565b6130bf613a07565b806130c957600080fd5b600554600b5460408051632dbe9d3160e21b8152600481018590526024810192909252516001600160a01b039092169163b6fa74c49160448082019260009290919082900301818387803b15801561312057600080fd5b505af1158015613134573d6000803e3d6000fd5b505050600b9190915550565b60145481565b60005460ff1681565b336000908152601b6020908152604080832054808452601a9092529091206006810154815460039092015460095461319493600160a01b90930460ff16929190613be0565b6131d5576040805162461bcd60e51b815260206004820152600d60248201526c3737ba103b30b634b230ba37b960991b604482015290519081900360640190fd5b6000818152601a60205260409020600601546001600160a01b03168061323b576040805162461bcd60e51b815260206004820152601660248201527511195b1959d85d1a5bdb881a5cc8191a5cd8589b195960521b604482015290519081900360640190fd5b604080516303dd464160e51b8152841515600482015290516001600160a01b03831691637ba8c82091602480830192600092919082900301818387803b15801561328457600080fd5b505af1158015613298573d6000803e3d6000fd5b50505050505050565b60216020526000908152604090205481565b806132bd81613a74565b611cec8260006150ae565b816132d281613a74565b6132db83614ec9565b602554604080516024810186905260448082018690528251808303909101815260649091019091526020810180516001600160e01b0316636e6cb15960e11b1790526127ca916001600160a01b031690614c61565b60285481565b601c54601d5482565b613347613a07565b6000811161335457600080fd5b600554600a5460408051635071805360e11b8152600481018590526024810192909252516001600160a01b039092169163a0e300a69160448082019260009290919082900301818387803b1580156133ab57600080fd5b505af11580156133bf573d6000803e3d6000fd5b505050600a8290555060088190556133de81600463ffffffff61528c16565b60158190556009546133f59163ffffffff613afe16565b60185550565b613403612b4c565b61340c57600080fd5b6001600160a01b03811661341f57600080fd5b6002546040516001600160a01b038084169216907f211c9015fc81c0dbd45bd99f0f29fc1c143bfd53442d5ffd722bbbef7a887fe990600090a3600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000908152601a602052604090205490565b602b546001600160a01b031681565b6005546001600160a01b031681565b6134b3613a07565b6019805460ff1916911515919091179055565b6134ce612b4c565b6134d757600080fd5b612a13816152ae565b816134ea81613a74565b60006134f58361531d565b600954600f54600087815260216020526040902054929350909161351e9163ffffffff613afe16565b811015613560576040805162461bcd60e51b815260206004820152600b60248201526a139bdd08185b1b1bddd95960aa1b604482015290519081900360640190fd5b6000858152601a602090815260408083206005908101549054915163b80fbce560e01b8152600481018a81526001600160a01b039283166024830181905288841660448401526080606484019081528b5160848501528b519197949095169563b80fbce5958d9589958c958f95909460a490920192918601918190849084905b838110156135f85781810151838201526020016135e0565b50505050905090810190601f1680156136255780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561364757600080fd5b505af115801561365b573d6000803e3d6000fd5b5050506000878152601a60205260409020600301541515905061368a57613681816153d6565b61368a836154e0565b6001600160a01b039081166000908152601b60209081526040808320600019905594909216808252848220889055968152601a825283812060050180546001600160a01b031916909717909655602190529320929092555050565b60235460ff161561372e576040805162461bcd60e51b815260206004820152600e60248201526d185b1c9958591e481a5b9a5d195960921b604482015290519081900360640190fd5b6023805460ff1916600117905561374481613a55565b61378e576040805162461bcd60e51b8152602060048201526016602482015275185d58dd1a5bdb881a5b5c1b081a5b98dbdc9c9958dd60521b604482015290519081900360640190fd5b602580546001600160a01b03199081166001600160a01b038481169190911790925560008054610100600160a81b031916610100878516021790556004805482168c84161790556002805482168b84161790556003805482168a84161790556006805482168984161790556005805482168884161790556007805490911691861691909117905561381e826152ae565b5050612000600855505060016009819055610376600a90815569044664c7bf6451f00000600b55670de0b6b3a7640000600c819055600d55610400600e556064600f55600760105560128290556108006015556016556019805460ff191690911790555050505050565b613890613a07565b6009546133f5908263ffffffff613afe16565b6138ab613a07565b612f536155fa565b6025546001600160a01b031681565b6007821161390b576040805162461bcd60e51b815260206004820152601160248201527024b73b30b634b21036b4b3b930ba34b7b760791b604482015290519081900360640190fd5b6000838152601a6020526040808220600601548151636e7ce59160e01b81523360048201526024810185905291516001600160a01b0390911692636e7ce591926044808201939182900301818387803b15801561396757600080fd5b505af115801561397b573d6000803e3d6000fd5b5050506000838152601a6020526040808220600601548151632830728d60e21b81523360048201526024810186905291516001600160a01b03909116935063a0c1ca349260448084019391929182900301818387803b15801561328457600080fd5b600d5481565b6003546001600160a01b031681565b806139fc81613a74565b611cec8260016150ae565b60005461010090046001600160a01b03163314612f535760405162461bcd60e51b8152600401808060200182810382526026815260200180615f6b6026913960400191505060405180910390fd5b60006001600160a01b038216613a6d57506000611a30565b503b151590565b600654604080516331a9108f60e11b815260048101849052905133926001600160a01b031691636352211e916024808301926020929190829003018186803b158015613abf57600080fd5b505afa158015613ad3573d6000803e3d6000fd5b505050506040513d6020811015613ae957600080fd5b50516001600160a01b031614612a1357600080fd5b60008282018381101561223157600080fd5b80613baa576000831315613b3957601c54613b31908463ffffffff613afe16565b601c55613b5d565b6000831215613b5d57601c54613b5990600085900363ffffffff6142a916565b601c555b6000821315613b8157601d54613b79908363ffffffff613afe16565b601d55613ba5565b6000821215613ba557601d54613ba190600084900363ffffffff6142a916565b601d555b6127ca565b6000818152601e60205260409020805484018155600101805483019055505050565b613bd582614ec9565b611cec823383615609565b60008084118015613bf85750821580613bf857508183115b80156124f257506001856003811115613c0d57fe5b1495945050505050565b60005460ff1615612f53576040805162461bcd60e51b81526020600482015260066024820152651b1bd8dad95960d21b604482015290519081900360640190fd5b6000848152601a602052604090206003015415613cab576040805162461bcd60e51b815260206004820152600c60248201526b4e6f2072657374616b696e6760a01b604482015290519081900360640190fd5b8215613cbd57613cbd333085846156e0565b613cc684614ec9565b8115613d0d576000848152601a60205260409020600190810154613cf6919061222590869063ffffffff613afe16565b6000858152601a6020526040902060019081015592505b601154600090613d23908563ffffffff613afe16565b60118190556000868152601a6020526040902054909150613d4a908563ffffffff613afe16565b6000868152601a6020526040812091909155613d6890859080613b10565b6005546040805163532e19a960e01b81526004810188905290516001600160a01b039092169163532e19a99160248082019260009290919082900301818387803b158015613db557600080fd5b505af1158015613dc9573d6000803e3d6000fd5b50506005546000888152601a6020526040808220548151631585a9f360e21b8152600481018c905260248101919091526044810187905290516001600160a01b039093169450635616a7cc93506064808201939182900301818387803b15801561238457600080fd5b600082815260208052604090205415613e4a57600080fd5b6000828152601a602052604090206006810154600290910154600160a01b90910460ff169015801590613e8c57506000838152601a6020526040902060030154155b8015613eb857506001816003811115613ea157fe5b1480613eb857506002816003811115613eb657fe5b145b613ec157600080fd5b600954600090613ed890600163ffffffff613afe16565b9050611dda8482856146f0565b805160208201516040830151600092919060ff167f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0821115613f2d5760009350505050611db5565b601b8160ff161015613f3d57601b015b8060ff16601b14158015613f5557508060ff16601c14155b15613f665760009350505050611db5565b60408051600080825260208083018085528a905260ff85168385015260608301879052608083018690529251909260019260a080820193601f1981019281900390910190855afa158015613fbe573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116613fde57600080fd5b9695505050505050565b613ff0615e9e565b826080015183602001511080156140345750816001600160a01b0316836060015184602001518151811061402057fe5b60200260200101516001600160a01b031614155b156140b557601b6000846060015185602001518151811061405157fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002054836040015184600001518151811061408e57fe5b60209081029190910181019190915283516001908101855290840180519091019052613ff0565b5050602081018051600101905290565b601c546000906140f2600161203a60036140e685600263ffffffff6157e116565b9063ffffffff61528c16565b88101561413c576040805162461bcd60e51b8152602060048201526013602482015272322f332b31206e6f6e2d6d616a6f726974792160681b604482015290519081900360640190fd5b60006141498b8a84615808565b9050600061416760646140e6601654856157e190919063ffffffff16565b6001600160a01b038c166000908152601b6020908152604080832054808452601a909252909120600181015492935090916141a8908463ffffffff613afe16565b600182015560178b905560006141f56141e68e6140e66a084595161401484a0000006141da8a8a63ffffffff6142a916565b9063ffffffff6157e116565b6024549063ffffffff613afe16565b90506142028b8b8361595c565b602481905561421289898361595c565b61421a615990565b50929d9c50505050505050505050505050565b6000818152601a602052604081208054600a90910154829190829061425990839063ffffffff613afe16565b6000868152601a60205260409020600b0154602454919250900361429d86846142976a084595161401484a0000006140e6868863ffffffff6157e116565b85615a05565b94509450505050915091565b6000828211156142b857600080fd5b50900390565b602b54604080516370a0823160e01b8152306004820152905183926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561430857600080fd5b505afa15801561431c573d6000803e3d6000fd5b505050506040513d602081101561433257600080fd5b50511015614377576040805162461bcd60e51b815260206004820152600d60248201526c4c61636b696e67204d4154494360981b604482015290519081900360640190fd5b602b54602c546040805163095ea7b360e01b81526001600160a01b039283166004820152602481018590529051919092169163095ea7b39160448083019260209291908290030181600087803b1580156143d057600080fd5b505af11580156143e4573d6000803e3d6000fd5b505050506040513d60208110156143fa57600080fd5b5050602c54604080516308a960c160e31b81526004810184905290516001600160a01b039092169163454b06089160248082019260009290919082900301818387803b15801561444957600080fd5b505af115801561251e573d6000803e3d6000fd5b6000818152601a60205260409020600601546001600160a01b03163314612a13576040805162461bcd60e51b815260206004820152601860248201527f496e76616c696420636f6e747261637420616464726573730000000000000000604482015290519081900360640190fd5b6000806144d783615a99565b604080516323b872dd60e01b81526001600160a01b038781166004830152306024830152604482018990529151929350600092918416916323b872dd9160648082019260209290919082900301818787803b15801561453557600080fd5b505af1158015614549573d6000803e3d6000fd5b505050506040513d602081101561455f57600080fd5b50519050836124f2576124f2866142be565b60105461457c612aaf565b106145be576040805162461bcd60e51b815260206004820152600d60248201526c6e6f206d6f726520736c6f747360981b604482015290519081900360640190fd5b600c5485101561460a576040805162461bcd60e51b81526020600482015260126024820152711b9bdd08195b9bdd59da0819195c1bdcda5d60721b604482015290519081900360640190fd5b6146178633868885614623565b61329886868585614854565b600d5483101561466a576040805162461bcd60e51b815260206004820152600d60248201526c199959481d1bdbc81cdb585b1b609a1b604482015290519081900360640190fd5b614685843061467f868663ffffffff613afe16565b846156e0565b602254614698908463ffffffff613afe16565b6022556005546040805163a449d79560e01b81526001600160a01b038881166004830152602482018790529151919092169163a449d79591604480830192600092919082900301818387803b15801561238457600080fd5b6146f983614ec9565b6000838152601a602052604081205490614712856127cf565b6000868152601a6020526040902060038101869055600a810154600690910154919250906001600160a01b0316801561479957806001600160a01b031663f83d08ba6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561478057600080fd5b505af1158015614794573d6000803e3d6000fd5b505050505b6000878152601a60205260409020600501546147bd906001600160a01b03166153d6565b6147c8878487615609565b60006009548711156147da57866147dd565b60005b90506147f183860160000360001983613b10565b60055460408051635e04d48360e01b81526001600160a01b038781166004830152602482018c9052604482018b90526064820189905291519190921691635e04d48391608480830192600092919082900301818387803b15801561262657600080fd5b6000806148608361531d565b600954601254600554601154939450919290916001600160a01b031690600090614890908a63ffffffff613afe16565b905080601181905550604051806101a001604052808a8152602001600181526020018581526020016000815260200160008152602001866001600160a01b03168152602001896148e157600061496d565b600754600480546040805163d4ad267360e01b81529283018990526001600160a01b03888116602485015291821660448401525192169163d4ad2673916064808201926020929091908290030181600087803b15801561494057600080fd5b505af1158015614954573d6000803e3d6000fd5b505050506040513d602081101561496a57600080fd5b50515b6001600160a01b031681526020016001815260006020808301829052604080840183905260016060808601829052608080870186905260245460a0978801528a8652601a855294839020875181559387015191840191909155908501516002830155840151600380830191909155918401516004820155918301516005830180546001600160a01b039283166001600160a01b03199182161790915560c08501516006850180549190931691161780825560e08501519260ff60a01b1990911690600160a01b908490811115614a3f57fe5b0217905550610100820151600782015561012082015160088201556101408201516009820155610160820151600a82015561018090910151600b9091015560008381526021602052604080822086905560065481516340c10f1960e01b81526001600160a01b038e8116600483015260248201889052925192909116926340c10f199260448084019382900301818387803b158015614add57600080fd5b505af1158015614af1573d6000803e3d6000fd5b5050506001600160a01b0386166000908152601b60205260408120859055614b1e91508a90600190613b10565b836020600085815260200190815260200160002060010181905550816001600160a01b03166333a8383c868986888e876040518763ffffffff1660e01b815260040180876001600160a01b03166001600160a01b0316815260200180602001868152602001858152602001848152602001838152602001828103825287818151815260200191508051906020019080838360005b83811015614bca578181015183820152602001614bb2565b50505050905090810190601f168015614bf75780820380516001836020036101000a031916815260200191505b50975050505050505050600060405180830381600087803b158015614c1b57600080fd5b505af1158015614c2f573d6000803e3d6000fd5b50505050614c47600184613afe90919063ffffffff16565b601255614c53856154e0565b509098975050505050505050565b600080825160208401856127105a03f43d604051816000823e828015614c85578282f35b8282fd5b60006020825181614c9657fe5b0615614ce0576040805162461bcd60e51b8152602060048201526014602482015273092dcecc2d8d2c840e0e4dedecc40d8cadccee8d60631b604482015290519081900360640190fd5b60006020835181614ced57fe5b0490508060020a8510614d3f576040805162461bcd60e51b81526020600482015260156024820152744c65616620696e64657820697320746f6f2062696760581b604482015290519081900360640190fd5b60008660205b85518111614dd15785810151925060028806614d915781836040516020018083815260200182815260200192505050604051602081830303815290604052805190602001209150614dc3565b828260405160200180838152602001828152602001925050506040516020818303038152906040528051906020012091505b600288049750602001614d45565b509094149695505050505050565b80614ded57614ded82615ac2565b6000614df882615a99565b9050806001600160a01b031663a9059cbb85856040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015614e5a57600080fd5b505af1158015614e6e573d6000803e3d6000fd5b505050506040513d6020811015614e8457600080fd5b5051611dda576040805162461bcd60e51b815260206004820152600f60248201526e1d1c985b9cd9995c8819985a5b1959608a1b604482015290519081900360640190fd5b612a1381602454602454615c4b565b6000828152601a60205260409020600a0154614efa908263ffffffff613afe16565b6000928352601a6020526040909220600a019190915550565b6000805460ff19169055565b6000848152601a60205260408120600601546001600160a01b0316331480614fbe57506004805460408051631ab0168360e31b8152905133936001600160a01b039093169263d580b41892808201926020929091829003018186803b158015614f8757600080fd5b505afa158015614f9b573d6000803e3d6000fd5b505050506040513d6020811015614fb157600080fd5b50516001600160a01b0316145b614ffd576040805162461bcd60e51b815260206004820152600b60248201526a1b9bdd08185b1b1bddd95960aa1b604482015290519081900360640190fd5b8161500b5761500b84615ac2565b600061501683615a99565b9050806001600160a01b031663a9059cbb85876040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561507857600080fd5b505af115801561508c573d6000803e3d6000fd5b505050506040513d60208110156150a257600080fd5b50519695505050505050565b6000828152601a602052604090206003015480158015906150e457506009546008546150e190839063ffffffff613afe16565b11155b8015615117575060036000848152601a6020526040902060060154600160a01b900460ff16600381111561511457fe5b14155b61512057600080fd5b6000838152601a6020526040812054601154909190615145908363ffffffff6142a916565b60118190559050615157853386615609565b60065460408051630852cd8d60e31b81526004810188905290516001600160a01b03909216916342966c689160248082019260009290919082900301818387803b1580156151a457600080fd5b505af11580156151b8573d6000803e3d6000fd5b5050506000868152601a6020526040812081815560048101919091556005810180546001600160a01b03191690556000197f584f46c60af19681376031579adb04a2416e54ee5505351c2a8435e3766026ea55600601805460ff60a01b1916600360a01b1790555061522b338386614ddf565b6005546040805163ae2e26b160e01b815233600482015260248101889052604481018590526064810184905290516001600160a01b039092169163ae2e26b19160848082019260009290919082900301818387803b15801561238457600080fd5b600080821161529a57600080fd5b60008284816152a557fe5b04949350505050565b6001600160a01b0381166152c157600080fd5b6001546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000815160401461535f576040805162461bcd60e51b81526020600482015260076024820152663737ba10383ab160c91b604482015290519081900360640190fd5b815160208301206001600160a01b0381161580159061539457506001600160a01b0381166000908152601b6020526040902054155b611db5576040805162461bcd60e51b815260206004820152600e60248201526d24b73b30b634b21039b4b3b732b960911b604482015290519081900360640190fd5b602680549060009060001983018381106153ec57fe5b600091825260209091200154602680546001600160a01b03909216925090600019840190811061541857fe5b600091825260209091200180546001600160a01b031916905560001982015b80156154cf57836001600160a01b0316826001600160a01b0316141561545c576154cf565b6026600182038154811061546c57fe5b9060005260206000200160009054906101000a90046001600160a01b0316826026600184038154811061549b57fe5b600091825260209091200180546001600160a01b0319166001600160a01b0392909216919091179055915060001901615437565b506000198201611dda602682615eee565b6026805460018101825560008290527f744a2cf8fd7008e3d53b67916e73460df9fa5214e3ef23dd4259ca09493a35940180546001600160a01b0319166001600160a01b0384161790555460001901805b80156155b25760006026600183038154811061554957fe5b6000918252602090912001546001600160a01b039081169150841681101561557157506155b2565b806026838154811061557f57fe5b600091825260209091200180546001600160a01b0319166001600160a01b03929092169190911790555060001901615531565b8181146127ca5782602682815481106155c757fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550505050565b6000805460ff19166001179055565b6000838152601a6020526040812060019081015461562c9163ffffffff6142a916565b601454909150615642908263ffffffff613afe16565b6014556000848152601a60205260409020600190810155615664838284614ddf565b60055460145460408051635b42d93560e11b815260048101889052602481018590526044810192909252516001600160a01b039092169163b685b26a9160648082019260009290919082900301818387803b1580156156c257600080fd5b505af11580156156d6573d6000803e3d6000fd5b5050505050505050565b60006156eb82615a99565b604080516323b872dd60e01b81526001600160a01b0388811660048301528781166024830152604482018790529151929350908316916323b872dd916064808201926020929091908290030181600087803b15801561574957600080fd5b505af115801561575d573d6000803e3d6000fd5b505050506040513d602081101561577357600080fd5b50516157bd576040805162461bcd60e51b81526020600482015260146024820152731d1c985b9cd9995c88199c9bdb4819985a5b195960621b604482015290519081900360640190fd5b811580156157d357506001600160a01b03841630145b1561251e5761251e836142be565b6000826157f057506000611db5565b828202828482816157fd57fe5b041461223157600080fd5b600e54600b54600091908261582883888161581f57fe5b04602954615d1b565b905060008111801561583c57506027548114155b1561587d57602754156158775760006064602a5484028161585957fe5b04905081602754111561586f5791820191615875565b80830392505b505b60278190555b600083881115615916576028546158c56158b560646140e66158a860026000198901890204866157e1565b889063ffffffff6157e116565b612225868663ffffffff6157e116565b91506158e76158da848763ffffffff6157e116565b8a9063ffffffff6142a916565b985061591261590560646140e6846141da898963ffffffff6157e116565b859063ffffffff6142a916565b9350505b61593a61592d856140e68b8763ffffffff6157e116565b829063ffffffff613afe16565b9050615950866140e6838a63ffffffff6157e116565b98975050505050505050565b60245460005b8381101561251e5761598885828151811061597957fe5b60200260200101518385615c4b565b600101615962565b60095460006159a682600163ffffffff613afe16565b90506159b0615f12565b506000818152601e602090815260408083208151808301909252805480835260019091015492820183905290926159e79290613b10565b506000918252601e6020526040822082815560010191909155600955565b60008082615a1857506000905080615a90565b6000615a2e846140e6888863ffffffff6157e116565b6000888152601a60205260409020600701549091508015615a7557615a72615a6560646140e6846141da8b8863ffffffff6142a916565b839063ffffffff613afe16565b91505b6000615a87878463ffffffff6142a916565b92945091925050505b94509492505050565b600081615ab157602b546001600160a01b0316611db5565b50506003546001600160a01b031690565b600354604080516370a0823160e01b8152306004820152905183926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015615b0c57600080fd5b505afa158015615b20573d6000803e3d6000fd5b505050506040513d6020811015615b3657600080fd5b50511015615b79576040805162461bcd60e51b815260206004820152600b60248201526a131858dada5b99c81413d360aa1b604482015290519081900360640190fd5b600354602c546040805163095ea7b360e01b81526001600160a01b039283166004820152602481018590529051919092169163095ea7b39160448083019260209291908290030181600087803b158015615bd257600080fd5b505af1158015615be6573d6000803e3d6000fd5b505050506040513d6020811015615bfc57600080fd5b5050602c546040805163efeff0c160e01b81526004810184905290516001600160a01b039092169163efeff0c19160248082019260009290919082900301818387803b15801561444957600080fd5b6000838152601a60205260409020600301548015801590615c6e57508060095410155b15615c7957506127ca565b6000848152601a60205260409020600b015483811015615cf8576000858152601a602052604090208054600a909101548015615ce0576000615cc1838363ffffffff613afe16565b9050615cda888484615cd58c868d8b615d31565b615d55565b50615cf5565b615cf587615cf089858a88615d31565b615dfb565b50505b8083111561251e576000858152601a60205260409020600b018390555050505050565b6000818310615d2a5781612231565b5090919050565b6000818303613fde6a084595161401484a0000006140e6838863ffffffff6157e116565b6000615d67838563ffffffff613afe16565b9050600080615d7887878686615a05565b90925090508015615db8576000878152601a6020526040902060090154615da5908263ffffffff613afe16565b6000888152601a60205260409020600901555b8115613298576000878152601a6020526040902060010154615de0908363ffffffff613afe16565b6000888152601a602052604090206001015550505050505050565b8015611cec576000828152601a6020526040902060010154615e23908263ffffffff613afe16565b6000838152601a60205260409020600101555050565b828054828255906000526020600020908101928215615e8e579160200282015b82811115615e8e57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190615e59565b50615e9a929150615f2c565b5090565b6040518060a0016040528060008152602001600081526020016060815260200160608152602001600081525090565b60405180606001604052806000815260200160608152602001600081525090565b8154818355818111156127ca576000838152602090206127ca918101908301615f50565b604051806040016040528060008152602001600081525090565b61275c91905b80821115615e9a5780546001600160a01b0319168155600101615f32565b61275c91905b80821115615e9a5760008155600101615f5656fe4f6e6c7920676f7665726e616e636520636f6e747261637420697320617574686f72697a6564a265627a7a723158202144f16fe19a38e4b93eaa1e2c04f33e2a9f779412c9defdf18d621af20c242664736f6c63430005110032", - "nonce": "0x8c", - "chainId": "0xaa36a7" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0xae07c932b4a5459bd683767dde161e9fa7ad1cc9b0ac83a39f9c291bcb22b79f", - "transactionType": "CREATE", - "contractName": null, - "contractAddress": "0x19b0b3256b22116096a2ef8cafc6e832ba18a947", - "function": null, - "arguments": null, - "transaction": { - "from": "0x0724d72eb61e508d81ca701881f2248f092953bf", - "gas": "0x3b3afb", - "value": "0x0", - "input": "0x60806040526003805460ff60a81b191690553480156200001e57600080fd5b5060038054610100338102610100600160a81b0319909216919091179182905560405191046001600160a01b0316906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3620000886001600160e01b036200008e16565b620000a3565b6003805460ff60a81b1916600160a81b179055565b61349680620000b36000396000f3fe608060405234801561001057600080fd5b50600436106103c55760003560e01c80638759c234116101ff578063b6658d071161011a578063e0db556b116100ad578063e97fddc21161007c578063e97fddc2146109aa578063eaf43bb5146109c7578063f2fde38b14610a05578063f83d08ba14610a2b576103c5565b8063e0db556b14610936578063e4457a8a1461093e578063e4cd1aec14610961578063e570b78b14610987576103c5565b8063c83ec04d116100e9578063c83ec04d146108d5578063cf309012146108f8578063dd62ed3e14610900578063df5cf7231461092e576103c5565b8063b6658d071461089a578063b89b63c1146108a2578063bfb18f29146108c5578063c7b8981c146108cd576103c5565b80639b2cb5d811610192578063a9059cbb11610161578063a9059cbb146107d8578063abf59fc914610804578063b4988fd01461083a578063b60c76fa1461086e576103c5565b80639b2cb5d814610770578063a0c1ca3414610778578063a457c2d7146107a4578063a69df4b5146107d0576103c5565b80638d16a14a116101ce5780638d16a14a146107505780638da5cb5b146107585780638f32d59b146107605780639ad5f5a414610768576103c5565b80638759c2341461071b578063883b455f146107385780638ccdd289146107405780638d086da414610748576103c5565b80634f91440d116102ef5780636ab1507111610282578063715018a611610251578063715018a6146106c05780637542ff95146106c8578063795be587146106d05780637ba8c820146106fc576103c5565b80636ab15071146106225780636cbb6050146106455780636e7ce5911461066e57806370a082311461069a576103c5565b80635f0c80cc116102be5780635f0c80cc146105a35780636035083f146105ab578063653ec134146105d6578063676e5550146105fc576103c5565b80634f91440d1461056c5780635adc6dde146105745780635c42c733146105935780635c5f7dae1461059b576103c5565b806323b872dd116103675780633a09bf44116103365780633a09bf44146105305780633ba0b9a9146105385780633d94eb0514610540578063446a2ec814610564576103c5565b806323b872dd146104a05780633046c204146104d657806339509351146104fc57806339c31e9314610528576103c5565b80631bf494a7116103a35780631bf494a7146104495780631e7ff8f614610451578063232e5415146104905780632344067914610498576103c5565b8063029d3040146103ca578063095ea7b3146103ef57806318160ddd1461042f575b600080fd5b6103ed600480360360408110156103e057600080fd5b5080359060200135610a33565b005b61041b6004803603604081101561040557600080fd5b506001600160a01b038135169060200135610a43565b604080519115158252519081900360200190f35b610437610a5a565b60408051918252519081900360200190f35b610437610a61565b6104776004803603602081101561046757600080fd5b50356001600160a01b0316610aed565b6040805192835260208301919091528051918290030190f35b6103ed610b4d565b610437610b59565b61041b600480360360608110156104b657600080fd5b506001600160a01b03813581169160208101359091169060400135610b5f565b610437600480360360208110156104ec57600080fd5b50356001600160a01b0316610bb7565b61041b6004803603604081101561051257600080fd5b506001600160a01b038135169060200135610bc9565b610437610c05565b610437610c0b565b610437610c11565b610548610cce565b604080516001600160a01b039092168252519081900360200190f35b610437610cdd565b610477610ce3565b6104776004803603602081101561058a57600080fd5b50351515610cf8565b610437610ff1565b610437610ff7565b610437610ffd565b6103ed600480360360608110156105c157600080fd5b50803590602081013590604001351515611003565b610477600480360360208110156105ec57600080fd5b50356001600160a01b03166111fe565b6104376004803603602081101561061257600080fd5b50356001600160a01b0316611217565b6104376004803603604081101561063857600080fd5b508035906020013561122a565b6104376004803603606081101561065b57600080fd5b5080359060208101359060400135611238565b6103ed6004803603604081101561068457600080fd5b506001600160a01b03813516906020013561136f565b610437600480360360208110156106b057600080fd5b50356001600160a01b03166115fb565b6103ed611616565b610548611677565b610477600480360360408110156106e657600080fd5b506001600160a01b038135169060200135611686565b6103ed6004803603602081101561071257600080fd5b503515156116aa565b6103ed6004803603602081101561073157600080fd5b50356116ce565b6105486116dc565b6104376116eb565b6104376116f1565b6103ed6116f7565b610548611701565b61041b611715565b61047761172b565b610437611738565b6103ed6004803603604081101561078e57600080fd5b506001600160a01b03813516906020013561173e565b61041b600480360360408110156107ba57600080fd5b506001600160a01b03813516906020013561176c565b6103ed6117a8565b61041b600480360360408110156107ee57600080fd5b506001600160a01b0381351690602001356117c1565b6103ed6004803603606081101561081a57600080fd5b506001600160a01b038135811691602081013590911690604001356117cf565b6103ed6004803603606081101561085057600080fd5b508035906001600160a01b03602082013581169160400135166118f6565b61041b6004803603604081101561088457600080fd5b506001600160a01b0381351690602001356119be565b6105486119cc565b6103ed600480360360408110156108b857600080fd5b50803590602001356119db565b6104376119e7565b6103ed611a2e565b6103ed600480360360408110156108eb57600080fd5b5080359060200135611a38565b61041b611a44565b6104376004803603604081101561091657600080fd5b506001600160a01b0381358116916020013516611a4d565b61041b611a78565b6103ed611a81565b6104376004803603604081101561095457600080fd5b5080359060200135611a8b565b6104376004803603602081101561097757600080fd5b50356001600160a01b0316611a99565b6103ed6004803603604081101561099d57600080fd5b5080359060200135611aab565b6103ed600480360360208110156109c057600080fd5b5035611ab7565b610437600480360360c08110156109dd57600080fd5b5080359060208101359060408101359060ff6060820135169060808101359060a00135611ac2565b6103ed60048036036020811015610a1b57600080fd5b50356001600160a01b0316611cab565b6103ed611cc5565b610a3f82826000611cde565b5050565b6000610a50338484611e8e565b5060015b92915050565b6002545b90565b6005546006546040805163072c21ef60e31b8152600481019290925251600092610ae8926001600160a01b03909116916339610f7891602480820192602092909190829003018186803b158015610ab757600080fd5b505afa158015610acb573d6000803e3d6000fd5b505050506040513d6020811015610ae157600080fd5b5051611ec6565b905090565b6000806000610afb846115fb565b90506000610b07610c11565b905081610b1b57600093509150610b489050565b610b42610b26611f1d565b610b36838563ffffffff611f4416565b9063ffffffff611f6b16565b93509150505b915091565b610b576001611f8d565b565b60095481565b6000610b6c84848461205a565b6001600160a01b038416600090815260016020908152604080832033808552925290912054610bac918691610ba7908663ffffffff61212516565b611e8e565b5060015b9392505050565b60146020526000908152604090205481565b3360008181526001602090815260408083206001600160a01b03871684529091528120549091610a50918590610ba7908663ffffffff61213a16565b60075481565b600d5481565b600080610c1c610a5a565b90506000610c28611f1d565b90508115610cc55760055460065460408051637f4b432360e01b8152600481019290925251610cc0928592610b369286926001600160a01b031691637f4b4323916024808301926020929190829003018186803b158015610c8857600080fd5b505afa158015610c9c573d6000803e3d6000fd5b505050506040513d6020811015610cb257600080fd5b50519063ffffffff611f4416565b610cc7565b805b9250505090565b6004546001600160a01b031681565b600c5481565b600080610cf06000610cf8565b915091509091565b6000803381610d068261214c565b90506000600a54821015610d61576040805162461bcd60e51b815260206004820152601c60248201527f546f6f20736d616c6c207265776172647320746f2072657374616b6500000000604482015290519081900360640190fd5b8115610b4257610d73826000856121fa565b905080821115610f615785610e14576005546006546040805163bc8756a960e01b8152600481019290925283850360248301526001600160a01b038681166044840152905192169163bc8756a9916064808201926020929091908290030181600087803b158015610de357600080fd5b505af1158015610df7573d6000803e3d6000fd5b505050506040513d6020811015610e0d57600080fd5b5051610ea2565b6005546006546040805163c7f067cb60e01b8152600481019290925283850360248301526001600160a01b038681166044840152905192169163c7f067cb916064808201926020929091908290030181600087803b158015610e7557600080fd5b505af1158015610e89573d6000803e3d6000fd5b505050506040513d6020811015610e9f57600080fd5b50515b610ee9576040805162461bcd60e51b8152602060048201526013602482015272496e737566666963656e74207265776172647360681b604482015290519081900360640190fd5b600480546006546040805163b7721d2d60e01b8152938401919091526001600160a01b0386811660248501528486036044850152905191169163b7721d2d91606480830192600092919082900301818387803b158015610f4857600080fd5b505af1158015610f5c573d6000803e3d6000fd5b505050505b6000610f6c84610aed565b506004805460065460408051637f88a95760e01b8152938401919091526001600160a01b0388811660248501526044840185905290519394501691637f88a9579160648082019260009290919082900301818387803b158015610fce57600080fd5b505af1158015610fe2573d6000803e3d6000fd5b50505050509350915050915091565b600f5481565b60065481565b600b5481565b6000806110118585856124b9565b336000908152601460205260408120549294509092509061103990600163ffffffff61213a16565b9050611043613447565b6040518060400160405280848152602001600560009054906101000a90046001600160a01b03166001600160a01b031663900cf0cf6040518163ffffffff1660e01b815260040160206040518083038186803b1580156110a257600080fd5b505afa1580156110b6573d6000803e3d6000fd5b505050506040513d60208110156110cc57600080fd5b50519052336000818152601560209081526040808320878452825280832085518155858301516001909101559282526014905220839055905061110d612685565b60065460408051632a9b5b4160e11b81526004810192909252336024830152604482018a90526064820187905260848201859052516001600160a01b039290921691635536b6829160a48082019260009290919082900301818387803b15801561117657600080fd5b505af115801561118a573d6000803e3d6000fd5b5050600480546006546040805163532e19a960e01b815293840191909152516001600160a01b03909116935063532e19a99250602480830192600092919082900301818387803b1580156111dd57600080fd5b505af11580156111f1573d6000803e3d6000fd5b5050505050505050505050565b6012602052600090815260409020805460019091015482565b6000610a5482611225610a61565b6127c2565b6000610bb083836000612843565b6000611242611715565b61124b57600080fd5b600f546000611260858363ffffffff61213a16565b90508061127257600092505050610bb0565b6000611297611287888463ffffffff61213a16565b610b36848863ffffffff611f4416565b905060006112af83610b36868563ffffffff611f4416565b905060006112c3838363ffffffff61212516565b6005546006546040805163858a7c0360e01b8152600481019290925260248201849052519293506001600160a01b039091169163858a7c039160448082019260009290919082900301818387803b15801561131d57600080fd5b505af1158015611331573d6000803e3d6000fd5b5050600d54611349925090508263ffffffff61212516565b600d55600f5461135f908363ffffffff61212516565b600f555090979650505050505050565b611377611715565b61138057600080fd5b61138b8260016129bd565b5060008061139884610aed565b91509150828210156113e6576040805162461bcd60e51b815260206004820152601260248201527109ad2cee4c2e8d2dcce40e8dede40daeac6d60731b604482015290519081900360640190fd5b60006113f0611f1d565b9050600061140883610b36878563ffffffff611f4416565b90506114148682612bb9565b60055460065460408051629ff11560e81b815260048101929092526000888103602484015290516001600160a01b0390931692639ff1150092604480820193929182900301818387803b15801561146a57600080fd5b505af115801561147e573d6000803e3d6000fd5b5050600d54611496925090508663ffffffff61212516565b600d55600480546006546040805163f1382b5360e01b8152938401919091526001600160a01b0389811660248501526044840189905260648401859052905191169163f1382b5391608480830192600092919082900301818387803b1580156114fe57600080fd5b505af1158015611512573d6000803e3d6000fd5b5050600480546006546040805163532e19a960e01b815293840191909152516001600160a01b03909116935063532e19a99250602480830192600092919082900301818387803b15801561156557600080fd5b505af1158015611579573d6000803e3d6000fd5b5050600480546006546040805163302df4df60e11b8152938401919091526001600160a01b038b81166024850152604484018b905290519116935063605be9be9250606480830192600092919082900301818387803b1580156115db57600080fd5b505af11580156115ef573d6000803e3d6000fd5b50505050505050505050565b6001600160a01b031660009081526020819052604090205490565b61161e611715565b61162757600080fd5b60035460405160009161010090046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a360038054610100600160a81b0319169055565b6005546001600160a01b031681565b60156020908152600092835260408084209091529082529020805460019091015482565b6116b2611715565b6116bb57600080fd5b600e805460ff1916911515919091179055565b6116d9816001612c60565b50565b6016546001600160a01b031681565b60085481565b60105481565b610b576000611f8d565b60035461010090046001600160a01b031690565b60035461010090046001600160a01b0316331490565b600080610cf06001610cf8565b600a5481565b611746611715565b61174f57600080fd5b61175a8260016129bd565b50611767816000846121fa565b505050565b3360008181526001602090815260408083206001600160a01b03871684529091528120549091610a50918590610ba7908663ffffffff61212516565b6117b0611715565b6117b957600080fd5b610b57612d50565b6000610a5083836000612d5c565b6117d7611715565b6117e057600080fd5b6001600160a01b03831661182a576040516001600160a01b0383169082156108fc029083906000818181858888f19350505050158015611824573d6000803e3d6000fd5b50611767565b826001600160a01b031663a9059cbb83836040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561188a57600080fd5b505af115801561189e573d6000803e3d6000fd5b505050506040513d60208110156118b457600080fd5b5051611767576040805162461bcd60e51b815260206004820152600c60248201526b111c985a5b8819985a5b195960a21b604482015290519081900360640190fd5b600354600160a81b900460ff1615611946576040805162461bcd60e51b815260206004820152600e60248201526d185b1c9958591e481a5b9a5d195960921b604482015290519081900360640190fd5b6003805460ff60a81b1916600160a81b1790556006839055600480546001600160a01b038085166001600160a01b031992831617909255600580549284169290911691909117905561199781612dea565b61199f612685565b5050670de0b6b3a7640000600a555050600e805460ff19166001179055565b6000610a5083836001612d5c565b6017546001600160a01b031681565b610a3f82826001611cde565b6000806119f2611f1d565b905060086006541015611a06579050610a5e565b6010548015611a2857610cc081610b3684600f54611f4490919063ffffffff16565b50919050565b610b576000612e64565b610a3f82826000611003565b60035460ff1681565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b600e5460ff1681565b610b576001612e64565b6000610bb083836001612843565b60136020526000908152604090205481565b610a3f82826001611003565b6116d9816000612c60565b600080611acd612ec9565b60408051623f675f60e91b815233600482015290519192506000916001600160a01b03841691637ecebe00916024808301926020929190829003018186803b158015611b1857600080fd5b505afa158015611b2c573d6000803e3d6000fd5b505050506040513d6020811015611b4257600080fd5b50516005546040805163d505accf60e01b81523360048201526001600160a01b039283166024820152604481018d9052606481018b905260ff8a16608482015260a4810189905260c4810188905290519293509084169163d505accf9160e48082019260009290919082900301818387803b158015611bc057600080fd5b505af1158015611bd4573d6000803e3d6000fd5b505060408051623f675f60e91b815233600482015290516001850193506001600160a01b0386169250637ecebe0091602480820192602092909190829003018186803b158015611c2357600080fd5b505afa158015611c37573d6000803e3d6000fd5b505050506040513d6020811015611c4d57600080fd5b505114611c92576040805162461bcd60e51b815260206004820152600e60248201526d125b9d985b1a59081c195c9b5a5d60921b604482015290519081900360640190fd5b611c9e89896001612843565b9998505050505050505050565b611cb3611715565b611cbc57600080fd5b6116d981612dea565b611ccd611715565b611cd657600080fd5b610b57613043565b600080611cec8585856124b9565b91509150611cf8613447565b50336000908152601260209081526040918290208251808401909352805480845260019091015491830191909152611d36908363ffffffff61213a16565b81526005546040805163900cf0cf60e01b815290516001600160a01b039092169163900cf0cf91600480820192602092909190829003018186803b158015611d7d57600080fd5b505afa158015611d91573d6000803e3d6000fd5b505050506040513d6020811015611da757600080fd5b505160208281019182523360008181526012909252604080832085518155935160019094019390935560048054600654855163f1382b5360e01b8152928301526024820192909252604481018a90526064810187905292516001600160a01b0390911692839263f1382b539260848084019382900301818387803b158015611e2e57600080fd5b505af1158015611e42573d6000803e3d6000fd5b50505050806001600160a01b031663532e19a96006546040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156111dd57600080fd5b6040805162461bcd60e51b8152602060048201526008602482015267191a5cd8589b195960c21b604482015290519081900360640190fd5b600c546000908215610a54576000611edc610a5a565b90508015611f1657611f13611f0682610b36876a084595161401484a00000063ffffffff611f4416565b839063ffffffff61213a16565b91505b5092915050565b600060086006541015611f3257506064610a5e565b506c01431e0fae6d7217caa000000090565b600082611f5357506000610a54565b82820282848281611f6057fe5b0414610bb057600080fd5b6000808211611f7957600080fd5b6000828481611f8457fe5b04949350505050565b611f95613447565b50336000908152601260209081526040808320815180830190925280548252600101549181019190915290611fca8284613052565b3360008181526012602052604080822082815560010182905560048054600654835163302df4df60e11b81529283015260248201949094526044810185905290519394506001600160a01b039092169263605be9be92606480820193929182900301818387803b15801561203d57600080fd5b505af1158015612051573d6000803e3d6000fd5b50505050505050565b6001600160a01b03821661206d57600080fd5b6001600160a01b038316600090815260208190526040902054612096908263ffffffff61212516565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546120cb908263ffffffff61213a16565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b60008282111561213457600080fd5b50900390565b600082820183811015610bb057600080fd5b6000806121c3600560009054906101000a90046001600160a01b03166001600160a01b0316637ed4b27c6006546040518263ffffffff1660e01b815260040180828152602001915050602060405180830381600087803b1580156121af57600080fd5b505af1158015610acb573d6000803e3d6000fd5b905060006121d184836127c2565b600c8390556001600160a01b038516600090815260136020526040902092909255509050919050565b600061220461335e565b600e5460ff16612254576040805162461bcd60e51b815260206004820152601660248201527511195b1959d85d1a5bdb881a5cc8191a5cd8589b195960521b604482015290519081900360640190fd5b600061225e610c11565b9050600061226a611f1d565b9050600061228283610b36898563ffffffff611f4416565b9050858110156122cd576040805162461bcd60e51b8152602060048201526011602482015270546f6f206d75636820736c69707061676560781b604482015290519081900360640190fd5b6001600160a01b03851660009081526012602052604090205415612327576040805162461bcd60e51b815260206004820152600c60248201526b13db99dbda5b99c8195e1a5d60a21b604482015290519081900360640190fd5b612331858261339f565b61234582610b36858463ffffffff611f4416565b60055460065460408051629ff11560e81b8152600481019290925260248201849052519299506001600160a01b0390911691639ff115009160448082019260009290919082900301818387803b15801561239e57600080fd5b505af11580156123b2573d6000803e3d6000fd5b5050600d546123ca925090508863ffffffff61213a16565b600d55600480546006546040805163c69d057360e01b8152938401919091526001600160a01b038881166024850152604484018b9052606484018590529051911691829163c69d05739160848082019260009290919082900301818387803b15801561243557600080fd5b505af1158015612449573d6000803e3d6000fd5b50505050806001600160a01b031663532e19a96006546040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561249557600080fd5b505af11580156124a9573d6000803e3d6000fd5b50999a9950505050505050505050565b6000806000806124c833610aed565b91509150816000141580156124dd5750868210155b612523576040805162461bcd60e51b8152602060048201526012602482015271151bdbc81b5d58da081c995c5d595cdd195960721b604482015290519081900360640190fd5b600061252d611f1d565b9050600061254583610b368b8563ffffffff611f4416565b905087811115612590576040805162461bcd60e51b8152602060048201526011602482015270746f6f206d75636820736c69707061676560781b604482015290519081900360640190fd5b61259a33886129bd565b506125a53382612bb9565b60055460065460408051629ff11560e81b8152600481019290925260008c8103602484015290516001600160a01b0390931692639ff1150092604480820193929182900301818387803b1580156125fb57600080fd5b505af115801561260f573d6000803e3d6000fd5b5050600d54612627925090508a63ffffffff61212516565b600d5560006126476126376119e7565b610b368c8663ffffffff611f4416565b600f5490915061265d908b63ffffffff61213a16565b600f55601054612673908263ffffffff61213a16565b60105590999098509650505050505050565b6016546000906001600160a01b031680610ae857600560009054906101000a90046001600160a01b03166001600160a01b0316635ab1bd536040518163ffffffff1660e01b815260040160206040518083038186803b1580156126e757600080fd5b505afa1580156126fb573d6000803e3d6000fd5b505050506040513d602081101561271157600080fd5b5051604080516832bb32b73a39a43ab160b91b8152815190819003600901812063cac39a0560e01b8252600482015290516001600160a01b039092169163cac39a0591602480820192602092909190829003018186803b15801561277457600080fd5b505afa158015612788573d6000803e3d6000fd5b505050506040513d602081101561279e57600080fd5b5051601680546001600160a01b0319166001600160a01b0383161790559050905090565b6000806127ce846115fb565b9050806127df576000915050610a54565b6001600160a01b0384166000908152601360205260409020548381141561280b57600092505050610a54565b61283a6a084595161401484a000000610b368461282e888663ffffffff61212516565b9063ffffffff611f4416565b95945050505050565b600061284f33836129bd565b5061285b8484336121fa565b9050816128f15760055460065460408051636901b25360e01b8152600481019290925260248201849052336044830152516001600160a01b0390921691636901b253916064808201926020929091908290030181600087803b1580156128c057600080fd5b505af11580156128d4573d6000803e3d6000fd5b505050506040513d60208110156128ea57600080fd5b505161297b565b60055460065460408051624c025560e81b8152600481019290925260248201849052336044830152516001600160a01b0390921691634c025500916064808201926020929091908290030181600087803b15801561294e57600080fd5b505af1158015612962573d6000803e3d6000fd5b505050506040513d602081101561297857600080fd5b50515b610bb0576040805162461bcd60e51b815260206004820152600e60248201526d19195c1bdcda5d0819985a5b195960921b604482015290519081900360640190fd5b6000806129c98461214c565b90508015610bb05782612a67576005546006546040805163bc8756a960e01b81526004810192909252602482018490526001600160a01b038781166044840152905192169163bc8756a9916064808201926020929091908290030181600087803b158015612a3657600080fd5b505af1158015612a4a573d6000803e3d6000fd5b505050506040513d6020811015612a6057600080fd5b5051612af4565b6005546006546040805163c7f067cb60e01b81526004810192909252602482018490526001600160a01b038781166044840152905192169163c7f067cb916064808201926020929091908290030181600087803b158015612ac757600080fd5b505af1158015612adb573d6000803e3d6000fd5b505050506040513d6020811015612af157600080fd5b50515b612b3b576040805162461bcd60e51b8152602060048201526013602482015272496e737566666963656e74207265776172647360681b604482015290519081900360640190fd5b600480546006546040805163b7721d2d60e01b8152938401919091526001600160a01b03878116602485015260448401859052905191169163b7721d2d91606480830192600092919082900301818387803b158015612b9957600080fd5b505af1158015612bad573d6000803e3d6000fd5b50505050905092915050565b6001600160a01b038216612bcc57600080fd5b600254612bdf908263ffffffff61212516565b6002556001600160a01b038216600090815260208190526040902054612c0b908263ffffffff61212516565b6001600160a01b038316600081815260208181526040808320949094558351858152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35050565b612c68613447565b503360009081526015602090815260408083208584528252808320815180830190925280548252600101549181019190915290612ca58284613052565b3360009081526015602090815260408083208884529091528120818155600101559050612cd0612685565b60065460408051636e699d8760e01b815260048101929092523360248301526044820184905260648201879052516001600160a01b039290921691636e699d879160848082019260009290919082900301818387803b158015612d3257600080fd5b505af1158015612d46573d6000803e3d6000fd5b5050505050505050565b6003805460ff19169055565b33612d6784836129bd565b50612d7281836129bd565b50612d7e81858561205a565b612d86612685565b6006546040805163c08b3f9d60e01b815260048101929092526001600160a01b038481166024840152878116604484015260648301879052905192169163c08b3f9d9160848082019260009290919082900301818387803b158015612d3257600080fd5b6001600160a01b038116612dfd57600080fd5b6003546040516001600160a01b0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600380546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b6000612e7033836129bd565b9050600a54811015610a3f576040805162461bcd60e51b815260206004820152601860248201527f546f6f20736d616c6c207265776172647320616d6f756e740000000000000000604482015290519081900360640190fd5b6017546000906001600160a01b031680610ae857600560009054906101000a90046001600160a01b03166001600160a01b0316635ab1bd536040518163ffffffff1660e01b815260040160206040518083038186803b158015612f2b57600080fd5b505afa158015612f3f573d6000803e3d6000fd5b505050506040513d6020811015612f5557600080fd5b505160408051621c1bdb60ea1b8152815190819003600301812063cac39a0560e01b8252600482015290516001600160a01b039092169163cac39a0591602480820192602092909190829003018186803b158015612fb257600080fd5b505afa158015612fc6573d6000803e3d6000fd5b505050506040513d6020811015612fdc57600080fd5b505190506001600160a01b038116613023576040805162461bcd60e51b81526020600482015260056024820152641d5b9cd95d60da1b604482015290519081900360640190fd5b601780546001600160a01b0319166001600160a01b038316179055919050565b6003805460ff19166001179055565b81516005546040805163900cf0cf60e01b81529051600093926001600160a01b03169163900cf0cf916004808301926020929190829003018186803b15801561309a57600080fd5b505afa1580156130ae573d6000803e3d6000fd5b505050506040513d60208110156130c457600080fd5b50516005546040805163a7ab696160e01b81529051613149926001600160a01b03169163a7ab6961916004808301926020929190829003018186803b15801561310c57600080fd5b505afa158015613120573d6000803e3d6000fd5b505050506040513d602081101561313657600080fd5b505160208701519063ffffffff61213a16565b111580156131575750600081115b6131a8576040805162461bcd60e51b815260206004820152601c60248201527f496e636f6d706c657465207769746864726177616c20706572696f6400000000604482015290519081900360640190fd5b60006131c16131b5611f1d565b610b368461282e6119e7565b6010549091506131d7908363ffffffff61212516565b601055600f546131ed908263ffffffff61212516565b600f5583613284576005546006546040805163bc8756a960e01b8152600481019290925260248201849052336044830152516001600160a01b039092169163bc8756a9916064808201926020929091908290030181600087803b15801561325357600080fd5b505af1158015613267573d6000803e3d6000fd5b505050506040513d602081101561327d57600080fd5b505161330f565b6005546006546040805163c7f067cb60e01b8152600481019290925260248201849052336044830152516001600160a01b039092169163c7f067cb916064808201926020929091908290030181600087803b1580156132e257600080fd5b505af11580156132f6573d6000803e3d6000fd5b505050506040513d602081101561330c57600080fd5b50515b613356576040805162461bcd60e51b8152602060048201526013602482015272496e737566666963656e74207265776172647360681b604482015290519081900360640190fd5b949350505050565b60035460ff1615610b57576040805162461bcd60e51b81526020600482015260066024820152651b1bd8dad95960d21b604482015290519081900360640190fd5b6001600160a01b0382166133b257600080fd5b6002546133c5908263ffffffff61213a16565b6002556001600160a01b0382166000908152602081905260409020546133f1908263ffffffff61213a16565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b60405180604001604052806000815260200160008152509056fea265627a7a723158204218c2c8b2e87f177283c78647790865bea3a76c3c8e35d83898fc32476d052564736f6c63430005110032", - "nonce": "0x8d", - "chainId": "0xaa36a7" - }, - "additionalContracts": [], - "isFixedGasLimit": false - } - ], - "receipts": [ - { - "status": "0x1", - "cumulativeGasUsed": "0xcf4a40", - "logs": [ - { - "address": "0x777badc2c75bd4ee5303bf6e90009bd31d8fd3d1", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000724d72eb61e508d81ca701881f2248f092953bf" - ], - "data": "0x", - "blockHash": "0x80bb5b7121caad8c640dafc4e50623df1bc4757fbe8f5cd035bd702d975119ec", - "blockNumber": "0x605f17", - "transactionHash": "0x4499d0ecf70c3a39927d5245cac653c02f0f0c33dc82be6a9ce5d37d4615c70a", - "transactionIndex": "0x40", - "logIndex": "0x73", - "removed": false - } - ], - "logsBloom": "0x00000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000002000001000000000000004000000000000000000000000000000000000001000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000020000010000000000000000000000000000000000000000000000000000000000000", - "type": "0x2", - "transactionHash": "0x4499d0ecf70c3a39927d5245cac653c02f0f0c33dc82be6a9ce5d37d4615c70a", - "transactionIndex": "0x40", - "blockHash": "0x80bb5b7121caad8c640dafc4e50623df1bc4757fbe8f5cd035bd702d975119ec", - "blockNumber": "0x605f17", - "gasUsed": "0x526898", - "effectiveGasPrice": "0x3be653915", - "from": "0x0724d72eb61e508d81ca701881f2248f092953bf", - "to": null, - "contractAddress": "0x777badc2c75bd4ee5303bf6e90009bd31d8fd3d1" - }, - { - "status": "0x1", - "cumulativeGasUsed": "0xfcdd6b", - "logs": [ - { - "address": "0x19b0b3256b22116096a2ef8cafc6e832ba18a947", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000724d72eb61e508d81ca701881f2248f092953bf" - ], - "data": "0x", - "blockHash": "0x80bb5b7121caad8c640dafc4e50623df1bc4757fbe8f5cd035bd702d975119ec", - "blockNumber": "0x605f17", - "transactionHash": "0xae07c932b4a5459bd683767dde161e9fa7ad1cc9b0ac83a39f9c291bcb22b79f", - "transactionIndex": "0x41", - "logIndex": "0x74", - "removed": false - } - ], - "logsBloom": "0x00000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000001000000000000000000000000000000000000020000000000000000000800000000000000000000000000100100400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000020000010000000000000000000000000000000000000000000000000000000000000", - "type": "0x2", - "transactionHash": "0xae07c932b4a5459bd683767dde161e9fa7ad1cc9b0ac83a39f9c291bcb22b79f", - "transactionIndex": "0x41", - "blockHash": "0x80bb5b7121caad8c640dafc4e50623df1bc4757fbe8f5cd035bd702d975119ec", - "blockNumber": "0x605f17", - "gasUsed": "0x2d932b", - "effectiveGasPrice": "0x3be653915", - "from": "0x0724d72eb61e508d81ca701881f2248f092953bf", - "to": null, - "contractAddress": "0x19b0b3256b22116096a2ef8cafc6e832ba18a947" - } - ], - "libraries": [], - "pending": [], - "returns": {}, - "timestamp": 1721057742, - "chain": 11155111, - "commit": "a5fd7d69" -} \ No newline at end of file diff --git a/broadcast/UpgradeStakeManager_Sepolia.s.sol/11155111/run-latest.json b/broadcast/UpgradeStakeManager_Sepolia.s.sol/11155111/run-latest.json deleted file mode 100644 index eceb3423..00000000 --- a/broadcast/UpgradeStakeManager_Sepolia.s.sol/11155111/run-latest.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "transactions": [ - { - "hash": "0x4499d0ecf70c3a39927d5245cac653c02f0f0c33dc82be6a9ce5d37d4615c70a", - "transactionType": "CREATE", - "contractName": null, - "contractAddress": "0x777badc2c75bd4ee5303bf6e90009bd31d8fd3d1", - "function": null, - "arguments": null, - "transaction": { - "from": "0x0724d72eb61e508d81ca701881f2248f092953bf", - "gas": "0x6b19b6", - "value": "0x0", - "input": "0x60806040526023805460ff191690553480156200001b57600080fd5b5060008054610100600160a81b0319168155600180546001600160a01b0319163317908190556040516001600160a01b039190911691907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a360235460ff1615620000c1576040805162461bcd60e51b815260206004820152600e60248201526d185b1c9958591e481a5b9a5d195960921b604482015290519081900360640190fd5b6023805460ff19166001179055615fc580620000de6000396000f3fe608060405234801561001057600080fd5b50600436106107175760003560e01c80637d669752116103a8578063b1d23f02116101f4578063e8afa8e81161011a578063f5e95acb116100b8578063fb1ef52c11610087578063fb1ef52c14611826578063fba58f341461184f578063fc0c546a14611857578063ff3db8e31461185f57610717565b8063f5e95acb1461178f578063f771fc87146117f9578063f83d08ba14611816578063f8a3176c1461181e57610717565b8063f24ccbfe116100f4578063f24ccbfe14611697578063f28699fa1461169f578063f2fde38b146116be578063f41a9642146116e457610717565b8063e8afa8e81461164c578063eceec1d314611672578063f1674fdf1461168f57610717565b8063cf30901211610192578063dcd962b211610161578063dcd962b2146115fc578063e568959a1461161f578063e59ee0c614611627578063e6692f491461162f57610717565b8063cf3090121461159b578063d6de07d0146115a3578063d7f5549d146115c2578063d86d53e7146115df57610717565b8063c710e922116101ce578063c710e92214611518578063c7f067cb14611544578063cbf383d514611576578063cd6b83881461159357610717565b8063b1d23f02146114a6578063b65de35e146114c9578063bc8756a9146114e657610717565b80639342c8f4116102d95780639ff1150011610277578063a69df4b511610246578063a69df4b514611462578063a7ab69611461146a578063a8dc889b14611472578063b184be811461147a57610717565b80639ff1150014611397578063a440ab1e146113ba578063a4769071146113d7578063a6854877146113df57610717565b806399d18f6f116102b357806399d18f6f1461132c5780639a8a62431461134f5780639b33f434146113575780639ddbbf851461137457610717565b80639342c8f4146112dc57806396a93224146112f9578063987ab9db1461132457610717565b806386a22666116103465780638f32d59b116103205780638f32d59b146112a7578063900cf0cf146112af57806391460149146112b757806391f1a3a5146112d457610717565b806386a226661461127a578063883b455f146112975780638da5cb5b1461129f57610717565b80637f952d95116103825780637f952d951461118057806381254e1214611188578063817b1cd21461124f578063858a7c031461125757610717565b80637d6697521461113e5780637ed4b27c146111465780637f4b43231461116357610717565b806341b3d185116105675780635ab1bd53116104985780637060054d116104365780637854f354116104055780637854f354146110eb57806378f84a44146111085780637b1039991461112e5780637c7eaf1a1461113657610717565b80637060054d146110cb578063715018a6146110d357806376671808146110db57806377939d10146110e357610717565b80636352211e116104725780636352211e14610fa05780636365679814610fbd57806368cb812a14610fe95780636901b2531461109957610717565b80635ab1bd5314610f015780635e47655f14610f0957806360c8d12214610f7757610717565b80634fdd20f11161050557806354b8c601116104df57806354b8c60114610ecc5780635508d8e114610ed457806356342d8c14610edc5780635aa6e67514610ef957610717565b80634fdd20f114610ca657806352b8115d14610d6d5780635325e14414610e0557610717565b80634b341aed116105415780634b341aed14610c3e5780634c02550014610c645780634e3c83f114610c965780634fd101d714610c9e57610717565b806341b3d18514610bf2578063451b598514610bfa57806348ab8b2a14610c0257610717565b80632079fb9a1161064c5780632fa9d18b116105ea57806335aa2e44116105b957806335aa2e4414610ac85780633862da0b14610b8157806339610f7814610ba75780633c34355614610bc457610717565b80632fa9d18b14610a0c57806330cbe57114610a9b57806331c2273b14610ab85780633427458614610ac057610717565b80632649263a116106265780632649263a146108f257806328cc4e41146109235780632cf44a431461094e5780632e17de78146109ef57610717565b80632079fb9a1461089757806325316411146108b457806325726df2146108bc57610717565b8063174e6832116106b95780631ae4818f116106935780631ae4818f1461082f5780631c404cec146108375780631dd6b9b1146108545780631e9b12ef1461087157610717565b8063174e6832146107e4578063178c2c831461080a57806317c2b9101461082757610717565b80630e15561a116106f55780630e15561a146107935780630ebb172a1461079b57806316827b1b146107a35780631705a3bd146107c057610717565b806306cfb1041461071c578063078a13b11461073b5780630cccfc5814610779575b600080fd5b6107396004803603602081101561073257600080fd5b503561187c565b005b6107396004803603608081101561075157600080fd5b506001600160a01b038135811691602081013582169160408201358116916060013516611889565b610781611901565b60408051918252519081900360200190f35b610781611907565b61078161190d565b610739600480360360208110156107b957600080fd5b5035611913565b6107c861199c565b604080516001600160a01b039092168252519081900360200190f35b610781600480360360208110156107fa57600080fd5b50356001600160a01b03166119ab565b6107396004803603602081101561082057600080fd5b5035611a35565b610781611cc2565b6107c8611cc8565b6107396004803603602081101561084d57600080fd5b5035611cd7565b6107396004803603602081101561086a57600080fd5b5035611cf0565b6107396004803603602081101561088757600080fd5b50356001600160a01b0316611cfd565b6107c8600480360360208110156108ad57600080fd5b5035611d3a565b610781611d61565b6108d9600480360360208110156108d257600080fd5b5035611d67565b6040805192835260208301919091528051918290030190f35b61090f6004803603602081101561090857600080fd5b5035611d80565b604080519115158252519081900360200190f35b6107396004803603606081101561093957600080fd5b50803590602081013590604001351515611dbb565b6107396004803603602081101561096457600080fd5b810190602081018135600160201b81111561097e57600080fd5b82018360208201111561099057600080fd5b803590602001918460208302840111600160201b831117156109b157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611de0945050505050565b61073960048036036020811015610a0557600080fd5b5035611e04565b610781600480360360a0811015610a2257600080fd5b8135916020810135916040820135916001600160a01b036060820135169181019060a081016080820135600160201b811115610a5d57600080fd5b820183602082011115610a6f57600080fd5b803590602001918460608302840111600160201b83111715610a9057600080fd5b509092509050611e19565b61073960048036036020811015610ab157600080fd5b503561212a565b6107c861213f565b61078161214e565b610ae560048036036020811015610ade57600080fd5b5035612154565b604051808e81526020018d81526020018c81526020018b81526020018a8152602001896001600160a01b03166001600160a01b03168152602001886001600160a01b03166001600160a01b03168152602001876003811115610b4357fe5b60ff1681526020018681526020018581526020018481526020018381526020018281526020019d505050505050505050505050505060405180910390f35b61078160048036036020811015610b9757600080fd5b50356001600160a01b03166121c5565b61078160048036036020811015610bbd57600080fd5b50356121d7565b61073960048036036040811015610bda57600080fd5b506001600160a01b0381358116916020013516612238565b6107816122f1565b6107816122f7565b61073960048036036080811015610c1857600080fd5b508035906001600160a01b036020820135811691604081013590911690606001356122fd565b61078160048036036020811015610c5457600080fd5b50356001600160a01b03166123a3565b61090f60048036036060811015610c7a57600080fd5b50803590602081013590604001356001600160a01b03166124da565b6107816124fb565b610781612501565b610739600480360360a0811015610cbc57600080fd5b6001600160a01b0382351691602081013591604082013591606081013515159181019060a081016080820135600160201b811115610cf957600080fd5b820183602082011115610d0b57600080fd5b803590602001918460018302840111600160201b83111715610d2c57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550612507945050505050565b610739600480360360c0811015610d8357600080fd5b6001600160a01b038235169160208101359160408201359160608101359160808201351515919081019060c0810160a0820135600160201b811115610dc757600080fd5b820183602082011115610dd957600080fd5b803590602001918460018302840111600160201b83111715610dfa57600080fd5b509092509050612525565b610e2260048036036020811015610e1b57600080fd5b5035612648565b60405180868152602001858152602001846001600160a01b03166001600160a01b031681526020018315151515815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610e8d578181015183820152602001610e75565b50505050905090810190601f168015610eba5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390f35b61090f61270e565b610781612717565b6107c860048036036020811015610ef257600080fd5b503561271d565b6107c861273b565b6107c861274f565b61078160048036036020811015610f1f57600080fd5b810190602081018135600160201b811115610f3957600080fd5b820183602082011115610f4b57600080fd5b803590602001918460018302840111600160201b83111715610f6c57600080fd5b50909250905061275f565b61073960048036036060811015610f8d57600080fd5b5080359060208101359060400135612766565b6107c860048036036020811015610fb657600080fd5b50356127cf565b61073960048036036040811015610fd357600080fd5b506001600160a01b03813516906020013561281b565b61073960048036036060811015610fff57600080fd5b813591602081013591810190606081016040820135600160201b81111561102557600080fd5b82018360208201111561103757600080fd5b803590602001918460018302840111600160201b8311171561105857600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550612832945050505050565b61090f600480360360608110156110af57600080fd5b50803590602081013590604001356001600160a01b0316612978565b610781612990565b610739612996565b6107816129f1565b6107816129f7565b6107396004803603602081101561110157600080fd5b50356129fd565b6107816004803603602081101561111e57600080fd5b50356001600160a01b0316612a16565b6107c8612a28565b610781612a37565b610781612a3d565b6107816004803603602081101561115c57600080fd5b5035612a43565b6107816004803603602081101561117957600080fd5b5035612a9a565b610781612aaf565b610739600480360360a081101561119e57600080fd5b6001600160a01b0382351691602081013591604082013591606081013515159181019060a081016080820135600160201b8111156111db57600080fd5b8201836020820111156111ed57600080fd5b803590602001918460018302840111600160201b8311171561120e57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550612ab5945050505050565b610781612acc565b6107396004803603604081101561126d57600080fd5b5080359060200135612ad2565b6107396004803603602081101561129057600080fd5b5035612b18565b6107c8612b29565b6107c8612b3d565b61090f612b4c565b610781612b8f565b610739600480360360208110156112cd57600080fd5b5035612b95565b610781612bab565b610739600480360360208110156112f257600080fd5b5035612bb1565b6107396004803603606081101561130f57600080fd5b50803590602081013590604001351515612bc6565b6107c8612be5565b6107396004803603604081101561134257600080fd5b5080359060200135612bf4565b610781612c5a565b6107396004803603602081101561136d57600080fd5b5035612c60565b6107396004803603604081101561138a57600080fd5b5080359060200135612d1c565b610739600480360360408110156113ad57600080fd5b5080359060200135612d82565b610739600480360360208110156113d057600080fd5b5035612e75565b610781612e8c565b610739600480360360808110156113f557600080fd5b813591602081013591604082013515159190810190608081016060820135600160201b81111561142457600080fd5b82018360208201111561143657600080fd5b803590602001918460018302840111600160201b8311171561145757600080fd5b509092509050612e92565b610739612f43565b610781612f55565b610781612f5b565b6107396004803603604081101561149057600080fd5b506001600160a01b038135169060200135612f61565b610739600480360360408110156114bc57600080fd5b5080359060200135612f75565b610781600480360360208110156114df57600080fd5b5035612f88565b61090f600480360360608110156114fc57600080fd5b50803590602081013590604001356001600160a01b0316612fd6565b6107396004803603604081101561152e57600080fd5b50803590602001356001600160a01b0316612fed565b61090f6004803603606081101561155a57600080fd5b50803590602081013590604001356001600160a01b03166130a8565b6107396004803603602081101561158c57600080fd5b50356130b7565b610781613140565b61090f613146565b610739600480360360208110156115b957600080fd5b5035151561314f565b610781600480360360208110156115d857600080fd5b50356132a1565b610739600480360360208110156115f557600080fd5b50356132b3565b6107396004803603604081101561161257600080fd5b50803590602001356132c8565b610781613330565b6108d9613336565b6107396004803603602081101561164557600080fd5b503561333f565b6107396004803603602081101561166257600080fd5b50356001600160a01b03166133fb565b6107816004803603602081101561168857600080fd5b503561347b565b6107c861348d565b6107c861349c565b610739600480360360208110156116b557600080fd5b503515156134ab565b610739600480360360208110156116d457600080fd5b50356001600160a01b03166134c6565b610739600480360360408110156116fa57600080fd5b81359190810190604081016020820135600160201b81111561171b57600080fd5b82018360208201111561172d57600080fd5b803590602001918460018302840111600160201b8311171561174e57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506134e0945050505050565b61073960048036036101208110156117a657600080fd5b506001600160a01b038135811691602081013582169160408201358116916060810135821691608082013581169160a081013582169160c082013581169160e081013582169161010090910135166136e5565b6107396004803603602081101561180f57600080fd5b5035613888565b6107396138a3565b6107c86138b3565b6107396004803603606081101561183c57600080fd5b50803590602081013590604001356138c2565b6107816139dd565b6107c86139e3565b6107396004803603602081101561187557600080fd5b50356139f2565b611884613a07565b600f55565b611891613a07565b61189a81613a55565b6118a357600080fd5b60238054610100600160a81b0319169055602580546001600160a01b03199081166001600160a01b03938416179091556006805482169583169590951790945560058054851693821693909317909255600780549093169116179055565b60155481565b60135481565b60085481565b61191b613a07565b8061192557600080fd5b60055460105460408051630f1980a560e41b8152600481018590526024810192909252516001600160a01b039092169163f1980a509160448082019260009290919082900301818387803b15801561197c57600080fd5b505af1158015611990573d6000803e3d6000fd5b50505060109190915550565b602c546001600160a01b031681565b60065460408051632f745c5960e01b81526001600160a01b038481166004830152600060248301819052925192931691632f745c5991604480820192602092909190829003018186803b158015611a0157600080fd5b505afa158015611a15573d6000803e3d6000fd5b505050506040513d6020811015611a2b57600080fd5b505190505b919050565b80611a3f81613a74565b60026000838152601a6020526040902060060154600160a01b900460ff166003811115611a6857fe5b14611aa7576040805162461bcd60e51b815260206004820152600a602482015269139bdd081a985a5b195960b21b604482015290519081900360640190fd5b6000828152601a602052604090206003015415611aff576040805162461bcd60e51b8152602060048201526011602482015270416c726561647920756e7374616b696e6760781b604482015290519081900360640190fd5b6009546000838152601a6020526040902060040154811015611b61576040805162461bcd60e51b8152602060048201526016602482015275125b98dbdb5c1b195d19481a985a5b081c195c9a5bd960521b604482015290519081900360640190fd5b6000838152601a6020526040902054600c54811015611b7f57600080fd5b6000848152601a60205260409020600601546001600160a01b03168015611bf457806001600160a01b031663a69df4b56040518163ffffffff1660e01b8152600401600060405180830381600087803b158015611bdb57600080fd5b505af1158015611bef573d6000803e3d6000fd5b505050505b6000858152601a60205260409020600a0154611c2490611c1b90849063ffffffff613afe16565b60016000613b10565b6000858152601a602052604080822060068101805460ff60a01b1916600160a01b1790556005908101549054825163f92ec5af60e01b8152600481018a90526001600160a01b039283166024820181905293519394929091169263f92ec5af9260448084019391929182900301818387803b158015611ca257600080fd5b505af1158015611cb6573d6000803e3d6000fd5b50505050505050505050565b60175481565b6007546001600160a01b031681565b80611ce181613a74565b611cec826001613bcc565b5050565b611cf8613a07565b600955565b611d05613a07565b6001600160a01b038116611d1857600080fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b60268181548110611d4757fe5b6000918252602090912001546001600160a01b0316905081565b600e5481565b601e602052600090815260409020805460019091015482565b6000818152601a6020526040812060068101548154600390920154600954611db593600160a01b90930460ff16929190613be0565b92915050565b611dc3613c17565b82611dcd81613a74565b611dda8484846000613c58565b50505050565b611de8612b4c565b611df157600080fd5b8051611cec906026906020840190615e39565b80611e0e81613a74565b611cec826000613e32565b6002546000906001600160a01b03163314611e3357600080fd5b600954601d546000908190611e46615e9e565b6026546040805191840180835260208082028401019091528015611e74578160200160208202803883390190505b5060408083019190915260268054825160208083028201810190945281815292830182828015611ecd57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611eaf575b50505050506060820152600060208201526026546080820152611eee615ecd565b6026546040805191850180835260208082028401019091528015611f1c578160200160208202803883390190505b50602082015260005b888110156120eb576000611f738e8c8c85818110611f3f57fe5b9050606002016003806020026040519081016040528092919082600360200280828437600092019190915250613ee5915050565b9050856001600160a01b0316816001600160a01b03161415611f9557506120e3565b856001600160a01b0316816001600160a01b03161015611fb557506120eb565b6001600160a01b0381166000908152601b6020908152604080832054808452601a909252909120805460068201546003909201548087529091600160a01b900460ff169061200790829084908e613be0565b15612092576000838152601a60205260409020600a0154939850889361204690839061203a908d9063ffffffff613afe16565b9063ffffffff613afe16565b8651909a50156120805782866020015187604001518151811061206557fe5b6020908102919091010152604086018051600101905261208d565b61208a8785613fe8565b96505b6120de565b60028160038111156120a057fe5b14156120de578287604001518860000151815181106120bb57fe5b602090810291909101810191909152875160019081018952908801805190910190525b505050505b600101611f25565b506120f7826000613fe8565b91506121198d8b878e86604001518760000151876020015188604001516140c5565b9d9c50505050505050505050505050565b8061213481613a74565b611cec826001613e32565b6006546001600160a01b031681565b60165481565b601a60205260009081526040902080546001820154600283015460038401546004850154600586015460068701546007880154600889015460098a0154600a8b0154600b909b0154999a98999798969795966001600160a01b039586169695851695600160a01b90950460ff16948d565b601b6020526000908152604090205481565b6000818152601a602052604081206003015481906121fc576121f88361422d565b9150505b6000838152601a602052604090206009015461223190600190612225908463ffffffff613afe16565b9063ffffffff6142a916565b9392505050565b612240613a07565b60038054602b80546001600160a01b038084166001600160a01b0319928316179283905592811686841617909355602c805490931684831617909255604080516370a0823160e01b81523060048201529051611cec93909216916370a0823191602480820192602092909190829003018186803b1580156122c057600080fd5b505afa1580156122d4573d6000803e3d6000fd5b505050506040513d60208110156122ea57600080fd5b50516142be565b600c5481565b60295481565b612305613a07565b6000848152601a60205260409020600601546001600160a01b03168061232a57600080fd5b6040805163abf59fc960e01b81526001600160a01b03868116600483015285811660248301526044820185905291519183169163abf59fc99160648082019260009290919082900301818387803b15801561238457600080fd5b505af1158015612398573d6000803e3d6000fd5b505050505050505050565b60006001600160a01b03821615806124315750600654604080516370a0823160e01b81526001600160a01b038581166004830152915191909216916370a08231916024808301926020929190829003018186803b15801561240357600080fd5b505afa158015612417573d6000803e3d6000fd5b505050506040513d602081101561242d57600080fd5b5051155b1561243e57506000611a30565b60065460408051632f745c5960e01b81526001600160a01b0385811660048301526000602483018190529251601a949190911691632f745c59916044808301926020929190829003018186803b15801561249757600080fd5b505afa1580156124ab573d6000803e3d6000fd5b505050506040513d60208110156124c157600080fd5b5051815260208101919091526040016000205492915050565b6000836124e68161445d565b6124f2848460016144cb565b95945050505050565b600f5481565b60105481565b61250f613c17565b61251e85858585856000614571565b5050505050565b333014612567576040805162461bcd60e51b815260206004820152600b60248201526a1b9bdd08185b1b1bddd95960aa1b604482015290519081900360640190fd5b61257687888860006001614623565b6125848560095460016146f0565b60006125c888868686868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061485492505050565b6005546040805163e12ab1af60e01b815260048101849052602481018a90526044810189905290519293506001600160a01b039091169163e12ab1af9160648082019260009290919082900301818387803b15801561262657600080fd5b505af115801561263a573d6000803e3d6000fd5b505050505050505050505050565b60208080526000918252604091829020805460018083015460028085015460038601805489516101009682161596909602600019011692909204601f8101889004880285018801909852878452939691956001600160a01b03851695600160a01b90950460ff16949392908301828280156127045780601f106126d957610100808354040283529160200191612704565b820191906000526020600020905b8154815290600101906020018083116126e757829003601f168201915b5050505050905085565b60195460ff1681565b60125481565b6000908152601a60205260409020600601546001600160a01b031690565b60005461010090046001600160a01b031681565b6004546001600160a01b03165b90565b6000806000fd5b61276e613a07565b60255460408051602481018690526044810185905260648082018590528251808303909101815260849091019091526020810180516001600160e01b0316633064689160e11b1790526127ca916001600160a01b031690614c61565b505050565b600654604080516331a9108f60e11b81526004810184905290516000926001600160a01b031691636352211e916024808301926020929190829003018186803b158015611a0157600080fd5b612823613c17565b611cec82338360006001614623565b6017546040805133602080830191909152818301879052825180830384018152606090920190925280519101206128719184908463ffffffff614c8916565b6128b4576040805162461bcd60e51b815260206004820152600f60248201526e2bb937b7339030b1b190383937b7b360891b604482015290519081900360640190fd5b336000908152601f60205260408120546128d590859063ffffffff6142a916565b6022549091506128eb908263ffffffff6142a916565b6022556005546040805163122b648160e01b81523360048201526024810184905290516001600160a01b039092169163122b64819160448082019260009290919082900301818387803b15801561294157600080fd5b505af1158015612955573d6000803e3d6000fd5b5050336000818152601f60205260408120889055611dda93509091508390614ddf565b6000836129848161445d565b6124f2848460006144cb565b600a5481565b61299e612b4c565b6129a757600080fd5b6001546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600180546001600160a01b0319169055565b60095481565b60185481565b612a05613a07565b612a138160095460016146f0565b50565b601f6020526000908152604090205481565b6004546001600160a01b031681565b602a5481565b600b5481565b600081612a4f8161445d565b612a5883614ec9565b6000838152601a6020526040812060090154612a7b90600163ffffffff6142a916565b6000858152601a60205260409020600160099091015592505050919050565b6000908152601a60205260409020600a015490565b601d5490565b612abd613c17565b61251e85858585856001614571565b60115481565b81612adc8161445d565b6000838152601a60205260409020600a0154612afe908363ffffffff6142a916565b6000938452601a6020526040909320600a01929092555050565b612b20613a07565b612a13816142be565b60235461010090046001600160a01b031681565b6001546001600160a01b031690565b604080517f6d617469632e6e6574776f726b2e70726f78792e6f776e6572000000000000008152905190819003601901902054336001600160a01b039091161490565b60095490565b612b9d613a07565b612a138160095460006146f0565b60275481565b80612bbb81613a74565b611cec826000613bcc565b612bce613c17565b82612bd881613a74565b611dda8484846001613c58565b6002546001600160a01b031681565b612bfc613c17565b602554604080516024810185905260448101849052306064808301919091528251808303909101815260849091019091526020810180516001600160e01b031663561ad5c960e11b179052611cec916001600160a01b031690614c61565b60225481565b612c68613a07565b6005546016546040805163a3b1d8cb60e01b8152600481018590526024810192909252516001600160a01b039092169163a3b1d8cb9160448082019260009290919082900301818387803b158015612cbf57600080fd5b505af1158015612cd3573d6000803e3d6000fd5b505050506064811115612d17576040805162461bcd60e51b8152602060048201526007602482015266746f6f2062696760c81b604482015290519081900360640190fd5b601655565b612d24612b4c565b612d2d57600080fd5b602554604080516024810185905260448082018590528251808303909101815260649091019091526020810180516001600160e01b0316639ddbbf8560e01b179052611cec916001600160a01b031690614c61565b81612d8c8161445d565b6000821315612de55760195460ff16612de5576040805162461bcd60e51b815260206004820152601660248201527511195b1959d85d1a5bdb881a5cc8191a5cd8589b195960521b604482015290519081900360640190fd5b6000838152601a602052604090206003015480612e0d57612e0883600080613b10565b612e50565b600954811115612e50576040805162461bcd60e51b8152602060048201526009602482015268756e7374616b696e6760b81b604482015290519081900360640190fd5b60008312612e6757612e628484614ed8565b611dda565b611dda848460001902612ad2565b612e7d613a07565b80612e8757600080fd5b600e55565b601c5490565b612e9a613c17565b6025546040516024810187815260448201879052851515606483015260806084830190815260a4830185905261251e936001600160a01b03169263a685487760e01b928a928a928a928a928a9260c40184848082843760008184015260408051601f19601f9093018316909401848103909201845252506020810180516001600160e01b03199a909a166001600160e01b03909a169990991790985250614c6195505050505050565b612f4b613a07565b612f53614f13565b565b60085490565b60245481565b612f69613a07565b611cec82826001614ddf565b612f7d613a07565b600c91909155600d55565b6000818152601a60205260408120600301548190612fad57612fa98361422d565b5090505b6000838152601a602052604090206001908101546122319190612225908463ffffffff613afe16565b6000612fe58484846000614f1f565b949350505050565b612ff5613a07565b306001600160a01b0316816001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561303857600080fd5b505afa15801561304c573d6000803e3d6000fd5b505050506040513d602081101561306257600080fd5b50516001600160a01b03161461307757600080fd5b6000918252601a602052604090912060060180546001600160a01b0319166001600160a01b03909216919091179055565b6000612fe58484846001614f1f565b6130bf613a07565b806130c957600080fd5b600554600b5460408051632dbe9d3160e21b8152600481018590526024810192909252516001600160a01b039092169163b6fa74c49160448082019260009290919082900301818387803b15801561312057600080fd5b505af1158015613134573d6000803e3d6000fd5b505050600b9190915550565b60145481565b60005460ff1681565b336000908152601b6020908152604080832054808452601a9092529091206006810154815460039092015460095461319493600160a01b90930460ff16929190613be0565b6131d5576040805162461bcd60e51b815260206004820152600d60248201526c3737ba103b30b634b230ba37b960991b604482015290519081900360640190fd5b6000818152601a60205260409020600601546001600160a01b03168061323b576040805162461bcd60e51b815260206004820152601660248201527511195b1959d85d1a5bdb881a5cc8191a5cd8589b195960521b604482015290519081900360640190fd5b604080516303dd464160e51b8152841515600482015290516001600160a01b03831691637ba8c82091602480830192600092919082900301818387803b15801561328457600080fd5b505af1158015613298573d6000803e3d6000fd5b50505050505050565b60216020526000908152604090205481565b806132bd81613a74565b611cec8260006150ae565b816132d281613a74565b6132db83614ec9565b602554604080516024810186905260448082018690528251808303909101815260649091019091526020810180516001600160e01b0316636e6cb15960e11b1790526127ca916001600160a01b031690614c61565b60285481565b601c54601d5482565b613347613a07565b6000811161335457600080fd5b600554600a5460408051635071805360e11b8152600481018590526024810192909252516001600160a01b039092169163a0e300a69160448082019260009290919082900301818387803b1580156133ab57600080fd5b505af11580156133bf573d6000803e3d6000fd5b505050600a8290555060088190556133de81600463ffffffff61528c16565b60158190556009546133f59163ffffffff613afe16565b60185550565b613403612b4c565b61340c57600080fd5b6001600160a01b03811661341f57600080fd5b6002546040516001600160a01b038084169216907f211c9015fc81c0dbd45bd99f0f29fc1c143bfd53442d5ffd722bbbef7a887fe990600090a3600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000908152601a602052604090205490565b602b546001600160a01b031681565b6005546001600160a01b031681565b6134b3613a07565b6019805460ff1916911515919091179055565b6134ce612b4c565b6134d757600080fd5b612a13816152ae565b816134ea81613a74565b60006134f58361531d565b600954600f54600087815260216020526040902054929350909161351e9163ffffffff613afe16565b811015613560576040805162461bcd60e51b815260206004820152600b60248201526a139bdd08185b1b1bddd95960aa1b604482015290519081900360640190fd5b6000858152601a602090815260408083206005908101549054915163b80fbce560e01b8152600481018a81526001600160a01b039283166024830181905288841660448401526080606484019081528b5160848501528b519197949095169563b80fbce5958d9589958c958f95909460a490920192918601918190849084905b838110156135f85781810151838201526020016135e0565b50505050905090810190601f1680156136255780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561364757600080fd5b505af115801561365b573d6000803e3d6000fd5b5050506000878152601a60205260409020600301541515905061368a57613681816153d6565b61368a836154e0565b6001600160a01b039081166000908152601b60209081526040808320600019905594909216808252848220889055968152601a825283812060050180546001600160a01b031916909717909655602190529320929092555050565b60235460ff161561372e576040805162461bcd60e51b815260206004820152600e60248201526d185b1c9958591e481a5b9a5d195960921b604482015290519081900360640190fd5b6023805460ff1916600117905561374481613a55565b61378e576040805162461bcd60e51b8152602060048201526016602482015275185d58dd1a5bdb881a5b5c1b081a5b98dbdc9c9958dd60521b604482015290519081900360640190fd5b602580546001600160a01b03199081166001600160a01b038481169190911790925560008054610100600160a81b031916610100878516021790556004805482168c84161790556002805482168b84161790556003805482168a84161790556006805482168984161790556005805482168884161790556007805490911691861691909117905561381e826152ae565b5050612000600855505060016009819055610376600a90815569044664c7bf6451f00000600b55670de0b6b3a7640000600c819055600d55610400600e556064600f55600760105560128290556108006015556016556019805460ff191690911790555050505050565b613890613a07565b6009546133f5908263ffffffff613afe16565b6138ab613a07565b612f536155fa565b6025546001600160a01b031681565b6007821161390b576040805162461bcd60e51b815260206004820152601160248201527024b73b30b634b21036b4b3b930ba34b7b760791b604482015290519081900360640190fd5b6000838152601a6020526040808220600601548151636e7ce59160e01b81523360048201526024810185905291516001600160a01b0390911692636e7ce591926044808201939182900301818387803b15801561396757600080fd5b505af115801561397b573d6000803e3d6000fd5b5050506000838152601a6020526040808220600601548151632830728d60e21b81523360048201526024810186905291516001600160a01b03909116935063a0c1ca349260448084019391929182900301818387803b15801561328457600080fd5b600d5481565b6003546001600160a01b031681565b806139fc81613a74565b611cec8260016150ae565b60005461010090046001600160a01b03163314612f535760405162461bcd60e51b8152600401808060200182810382526026815260200180615f6b6026913960400191505060405180910390fd5b60006001600160a01b038216613a6d57506000611a30565b503b151590565b600654604080516331a9108f60e11b815260048101849052905133926001600160a01b031691636352211e916024808301926020929190829003018186803b158015613abf57600080fd5b505afa158015613ad3573d6000803e3d6000fd5b505050506040513d6020811015613ae957600080fd5b50516001600160a01b031614612a1357600080fd5b60008282018381101561223157600080fd5b80613baa576000831315613b3957601c54613b31908463ffffffff613afe16565b601c55613b5d565b6000831215613b5d57601c54613b5990600085900363ffffffff6142a916565b601c555b6000821315613b8157601d54613b79908363ffffffff613afe16565b601d55613ba5565b6000821215613ba557601d54613ba190600084900363ffffffff6142a916565b601d555b6127ca565b6000818152601e60205260409020805484018155600101805483019055505050565b613bd582614ec9565b611cec823383615609565b60008084118015613bf85750821580613bf857508183115b80156124f257506001856003811115613c0d57fe5b1495945050505050565b60005460ff1615612f53576040805162461bcd60e51b81526020600482015260066024820152651b1bd8dad95960d21b604482015290519081900360640190fd5b6000848152601a602052604090206003015415613cab576040805162461bcd60e51b815260206004820152600c60248201526b4e6f2072657374616b696e6760a01b604482015290519081900360640190fd5b8215613cbd57613cbd333085846156e0565b613cc684614ec9565b8115613d0d576000848152601a60205260409020600190810154613cf6919061222590869063ffffffff613afe16565b6000858152601a6020526040902060019081015592505b601154600090613d23908563ffffffff613afe16565b60118190556000868152601a6020526040902054909150613d4a908563ffffffff613afe16565b6000868152601a6020526040812091909155613d6890859080613b10565b6005546040805163532e19a960e01b81526004810188905290516001600160a01b039092169163532e19a99160248082019260009290919082900301818387803b158015613db557600080fd5b505af1158015613dc9573d6000803e3d6000fd5b50506005546000888152601a6020526040808220548151631585a9f360e21b8152600481018c905260248101919091526044810187905290516001600160a01b039093169450635616a7cc93506064808201939182900301818387803b15801561238457600080fd5b600082815260208052604090205415613e4a57600080fd5b6000828152601a602052604090206006810154600290910154600160a01b90910460ff169015801590613e8c57506000838152601a6020526040902060030154155b8015613eb857506001816003811115613ea157fe5b1480613eb857506002816003811115613eb657fe5b145b613ec157600080fd5b600954600090613ed890600163ffffffff613afe16565b9050611dda8482856146f0565b805160208201516040830151600092919060ff167f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0821115613f2d5760009350505050611db5565b601b8160ff161015613f3d57601b015b8060ff16601b14158015613f5557508060ff16601c14155b15613f665760009350505050611db5565b60408051600080825260208083018085528a905260ff85168385015260608301879052608083018690529251909260019260a080820193601f1981019281900390910190855afa158015613fbe573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116613fde57600080fd5b9695505050505050565b613ff0615e9e565b826080015183602001511080156140345750816001600160a01b0316836060015184602001518151811061402057fe5b60200260200101516001600160a01b031614155b156140b557601b6000846060015185602001518151811061405157fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002054836040015184600001518151811061408e57fe5b60209081029190910181019190915283516001908101855290840180519091019052613ff0565b5050602081018051600101905290565b601c546000906140f2600161203a60036140e685600263ffffffff6157e116565b9063ffffffff61528c16565b88101561413c576040805162461bcd60e51b8152602060048201526013602482015272322f332b31206e6f6e2d6d616a6f726974792160681b604482015290519081900360640190fd5b60006141498b8a84615808565b9050600061416760646140e6601654856157e190919063ffffffff16565b6001600160a01b038c166000908152601b6020908152604080832054808452601a909252909120600181015492935090916141a8908463ffffffff613afe16565b600182015560178b905560006141f56141e68e6140e66a084595161401484a0000006141da8a8a63ffffffff6142a916565b9063ffffffff6157e116565b6024549063ffffffff613afe16565b90506142028b8b8361595c565b602481905561421289898361595c565b61421a615990565b50929d9c50505050505050505050505050565b6000818152601a602052604081208054600a90910154829190829061425990839063ffffffff613afe16565b6000868152601a60205260409020600b0154602454919250900361429d86846142976a084595161401484a0000006140e6868863ffffffff6157e116565b85615a05565b94509450505050915091565b6000828211156142b857600080fd5b50900390565b602b54604080516370a0823160e01b8152306004820152905183926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561430857600080fd5b505afa15801561431c573d6000803e3d6000fd5b505050506040513d602081101561433257600080fd5b50511015614377576040805162461bcd60e51b815260206004820152600d60248201526c4c61636b696e67204d4154494360981b604482015290519081900360640190fd5b602b54602c546040805163095ea7b360e01b81526001600160a01b039283166004820152602481018590529051919092169163095ea7b39160448083019260209291908290030181600087803b1580156143d057600080fd5b505af11580156143e4573d6000803e3d6000fd5b505050506040513d60208110156143fa57600080fd5b5050602c54604080516308a960c160e31b81526004810184905290516001600160a01b039092169163454b06089160248082019260009290919082900301818387803b15801561444957600080fd5b505af115801561251e573d6000803e3d6000fd5b6000818152601a60205260409020600601546001600160a01b03163314612a13576040805162461bcd60e51b815260206004820152601860248201527f496e76616c696420636f6e747261637420616464726573730000000000000000604482015290519081900360640190fd5b6000806144d783615a99565b604080516323b872dd60e01b81526001600160a01b038781166004830152306024830152604482018990529151929350600092918416916323b872dd9160648082019260209290919082900301818787803b15801561453557600080fd5b505af1158015614549573d6000803e3d6000fd5b505050506040513d602081101561455f57600080fd5b50519050836124f2576124f2866142be565b60105461457c612aaf565b106145be576040805162461bcd60e51b815260206004820152600d60248201526c6e6f206d6f726520736c6f747360981b604482015290519081900360640190fd5b600c5485101561460a576040805162461bcd60e51b81526020600482015260126024820152711b9bdd08195b9bdd59da0819195c1bdcda5d60721b604482015290519081900360640190fd5b6146178633868885614623565b61329886868585614854565b600d5483101561466a576040805162461bcd60e51b815260206004820152600d60248201526c199959481d1bdbc81cdb585b1b609a1b604482015290519081900360640190fd5b614685843061467f868663ffffffff613afe16565b846156e0565b602254614698908463ffffffff613afe16565b6022556005546040805163a449d79560e01b81526001600160a01b038881166004830152602482018790529151919092169163a449d79591604480830192600092919082900301818387803b15801561238457600080fd5b6146f983614ec9565b6000838152601a602052604081205490614712856127cf565b6000868152601a6020526040902060038101869055600a810154600690910154919250906001600160a01b0316801561479957806001600160a01b031663f83d08ba6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561478057600080fd5b505af1158015614794573d6000803e3d6000fd5b505050505b6000878152601a60205260409020600501546147bd906001600160a01b03166153d6565b6147c8878487615609565b60006009548711156147da57866147dd565b60005b90506147f183860160000360001983613b10565b60055460408051635e04d48360e01b81526001600160a01b038781166004830152602482018c9052604482018b90526064820189905291519190921691635e04d48391608480830192600092919082900301818387803b15801561262657600080fd5b6000806148608361531d565b600954601254600554601154939450919290916001600160a01b031690600090614890908a63ffffffff613afe16565b905080601181905550604051806101a001604052808a8152602001600181526020018581526020016000815260200160008152602001866001600160a01b03168152602001896148e157600061496d565b600754600480546040805163d4ad267360e01b81529283018990526001600160a01b03888116602485015291821660448401525192169163d4ad2673916064808201926020929091908290030181600087803b15801561494057600080fd5b505af1158015614954573d6000803e3d6000fd5b505050506040513d602081101561496a57600080fd5b50515b6001600160a01b031681526020016001815260006020808301829052604080840183905260016060808601829052608080870186905260245460a0978801528a8652601a855294839020875181559387015191840191909155908501516002830155840151600380830191909155918401516004820155918301516005830180546001600160a01b039283166001600160a01b03199182161790915560c08501516006850180549190931691161780825560e08501519260ff60a01b1990911690600160a01b908490811115614a3f57fe5b0217905550610100820151600782015561012082015160088201556101408201516009820155610160820151600a82015561018090910151600b9091015560008381526021602052604080822086905560065481516340c10f1960e01b81526001600160a01b038e8116600483015260248201889052925192909116926340c10f199260448084019382900301818387803b158015614add57600080fd5b505af1158015614af1573d6000803e3d6000fd5b5050506001600160a01b0386166000908152601b60205260408120859055614b1e91508a90600190613b10565b836020600085815260200190815260200160002060010181905550816001600160a01b03166333a8383c868986888e876040518763ffffffff1660e01b815260040180876001600160a01b03166001600160a01b0316815260200180602001868152602001858152602001848152602001838152602001828103825287818151815260200191508051906020019080838360005b83811015614bca578181015183820152602001614bb2565b50505050905090810190601f168015614bf75780820380516001836020036101000a031916815260200191505b50975050505050505050600060405180830381600087803b158015614c1b57600080fd5b505af1158015614c2f573d6000803e3d6000fd5b50505050614c47600184613afe90919063ffffffff16565b601255614c53856154e0565b509098975050505050505050565b600080825160208401856127105a03f43d604051816000823e828015614c85578282f35b8282fd5b60006020825181614c9657fe5b0615614ce0576040805162461bcd60e51b8152602060048201526014602482015273092dcecc2d8d2c840e0e4dedecc40d8cadccee8d60631b604482015290519081900360640190fd5b60006020835181614ced57fe5b0490508060020a8510614d3f576040805162461bcd60e51b81526020600482015260156024820152744c65616620696e64657820697320746f6f2062696760581b604482015290519081900360640190fd5b60008660205b85518111614dd15785810151925060028806614d915781836040516020018083815260200182815260200192505050604051602081830303815290604052805190602001209150614dc3565b828260405160200180838152602001828152602001925050506040516020818303038152906040528051906020012091505b600288049750602001614d45565b509094149695505050505050565b80614ded57614ded82615ac2565b6000614df882615a99565b9050806001600160a01b031663a9059cbb85856040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015614e5a57600080fd5b505af1158015614e6e573d6000803e3d6000fd5b505050506040513d6020811015614e8457600080fd5b5051611dda576040805162461bcd60e51b815260206004820152600f60248201526e1d1c985b9cd9995c8819985a5b1959608a1b604482015290519081900360640190fd5b612a1381602454602454615c4b565b6000828152601a60205260409020600a0154614efa908263ffffffff613afe16565b6000928352601a6020526040909220600a019190915550565b6000805460ff19169055565b6000848152601a60205260408120600601546001600160a01b0316331480614fbe57506004805460408051631ab0168360e31b8152905133936001600160a01b039093169263d580b41892808201926020929091829003018186803b158015614f8757600080fd5b505afa158015614f9b573d6000803e3d6000fd5b505050506040513d6020811015614fb157600080fd5b50516001600160a01b0316145b614ffd576040805162461bcd60e51b815260206004820152600b60248201526a1b9bdd08185b1b1bddd95960aa1b604482015290519081900360640190fd5b8161500b5761500b84615ac2565b600061501683615a99565b9050806001600160a01b031663a9059cbb85876040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561507857600080fd5b505af115801561508c573d6000803e3d6000fd5b505050506040513d60208110156150a257600080fd5b50519695505050505050565b6000828152601a602052604090206003015480158015906150e457506009546008546150e190839063ffffffff613afe16565b11155b8015615117575060036000848152601a6020526040902060060154600160a01b900460ff16600381111561511457fe5b14155b61512057600080fd5b6000838152601a6020526040812054601154909190615145908363ffffffff6142a916565b60118190559050615157853386615609565b60065460408051630852cd8d60e31b81526004810188905290516001600160a01b03909216916342966c689160248082019260009290919082900301818387803b1580156151a457600080fd5b505af11580156151b8573d6000803e3d6000fd5b5050506000868152601a6020526040812081815560048101919091556005810180546001600160a01b03191690556000197f584f46c60af19681376031579adb04a2416e54ee5505351c2a8435e3766026ea55600601805460ff60a01b1916600360a01b1790555061522b338386614ddf565b6005546040805163ae2e26b160e01b815233600482015260248101889052604481018590526064810184905290516001600160a01b039092169163ae2e26b19160848082019260009290919082900301818387803b15801561238457600080fd5b600080821161529a57600080fd5b60008284816152a557fe5b04949350505050565b6001600160a01b0381166152c157600080fd5b6001546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000815160401461535f576040805162461bcd60e51b81526020600482015260076024820152663737ba10383ab160c91b604482015290519081900360640190fd5b815160208301206001600160a01b0381161580159061539457506001600160a01b0381166000908152601b6020526040902054155b611db5576040805162461bcd60e51b815260206004820152600e60248201526d24b73b30b634b21039b4b3b732b960911b604482015290519081900360640190fd5b602680549060009060001983018381106153ec57fe5b600091825260209091200154602680546001600160a01b03909216925090600019840190811061541857fe5b600091825260209091200180546001600160a01b031916905560001982015b80156154cf57836001600160a01b0316826001600160a01b0316141561545c576154cf565b6026600182038154811061546c57fe5b9060005260206000200160009054906101000a90046001600160a01b0316826026600184038154811061549b57fe5b600091825260209091200180546001600160a01b0319166001600160a01b0392909216919091179055915060001901615437565b506000198201611dda602682615eee565b6026805460018101825560008290527f744a2cf8fd7008e3d53b67916e73460df9fa5214e3ef23dd4259ca09493a35940180546001600160a01b0319166001600160a01b0384161790555460001901805b80156155b25760006026600183038154811061554957fe5b6000918252602090912001546001600160a01b039081169150841681101561557157506155b2565b806026838154811061557f57fe5b600091825260209091200180546001600160a01b0319166001600160a01b03929092169190911790555060001901615531565b8181146127ca5782602682815481106155c757fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550505050565b6000805460ff19166001179055565b6000838152601a6020526040812060019081015461562c9163ffffffff6142a916565b601454909150615642908263ffffffff613afe16565b6014556000848152601a60205260409020600190810155615664838284614ddf565b60055460145460408051635b42d93560e11b815260048101889052602481018590526044810192909252516001600160a01b039092169163b685b26a9160648082019260009290919082900301818387803b1580156156c257600080fd5b505af11580156156d6573d6000803e3d6000fd5b5050505050505050565b60006156eb82615a99565b604080516323b872dd60e01b81526001600160a01b0388811660048301528781166024830152604482018790529151929350908316916323b872dd916064808201926020929091908290030181600087803b15801561574957600080fd5b505af115801561575d573d6000803e3d6000fd5b505050506040513d602081101561577357600080fd5b50516157bd576040805162461bcd60e51b81526020600482015260146024820152731d1c985b9cd9995c88199c9bdb4819985a5b195960621b604482015290519081900360640190fd5b811580156157d357506001600160a01b03841630145b1561251e5761251e836142be565b6000826157f057506000611db5565b828202828482816157fd57fe5b041461223157600080fd5b600e54600b54600091908261582883888161581f57fe5b04602954615d1b565b905060008111801561583c57506027548114155b1561587d57602754156158775760006064602a5484028161585957fe5b04905081602754111561586f5791820191615875565b80830392505b505b60278190555b600083881115615916576028546158c56158b560646140e66158a860026000198901890204866157e1565b889063ffffffff6157e116565b612225868663ffffffff6157e116565b91506158e76158da848763ffffffff6157e116565b8a9063ffffffff6142a916565b985061591261590560646140e6846141da898963ffffffff6157e116565b859063ffffffff6142a916565b9350505b61593a61592d856140e68b8763ffffffff6157e116565b829063ffffffff613afe16565b9050615950866140e6838a63ffffffff6157e116565b98975050505050505050565b60245460005b8381101561251e5761598885828151811061597957fe5b60200260200101518385615c4b565b600101615962565b60095460006159a682600163ffffffff613afe16565b90506159b0615f12565b506000818152601e602090815260408083208151808301909252805480835260019091015492820183905290926159e79290613b10565b506000918252601e6020526040822082815560010191909155600955565b60008082615a1857506000905080615a90565b6000615a2e846140e6888863ffffffff6157e116565b6000888152601a60205260409020600701549091508015615a7557615a72615a6560646140e6846141da8b8863ffffffff6142a916565b839063ffffffff613afe16565b91505b6000615a87878463ffffffff6142a916565b92945091925050505b94509492505050565b600081615ab157602b546001600160a01b0316611db5565b50506003546001600160a01b031690565b600354604080516370a0823160e01b8152306004820152905183926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015615b0c57600080fd5b505afa158015615b20573d6000803e3d6000fd5b505050506040513d6020811015615b3657600080fd5b50511015615b79576040805162461bcd60e51b815260206004820152600b60248201526a131858dada5b99c81413d360aa1b604482015290519081900360640190fd5b600354602c546040805163095ea7b360e01b81526001600160a01b039283166004820152602481018590529051919092169163095ea7b39160448083019260209291908290030181600087803b158015615bd257600080fd5b505af1158015615be6573d6000803e3d6000fd5b505050506040513d6020811015615bfc57600080fd5b5050602c546040805163efeff0c160e01b81526004810184905290516001600160a01b039092169163efeff0c19160248082019260009290919082900301818387803b15801561444957600080fd5b6000838152601a60205260409020600301548015801590615c6e57508060095410155b15615c7957506127ca565b6000848152601a60205260409020600b015483811015615cf8576000858152601a602052604090208054600a909101548015615ce0576000615cc1838363ffffffff613afe16565b9050615cda888484615cd58c868d8b615d31565b615d55565b50615cf5565b615cf587615cf089858a88615d31565b615dfb565b50505b8083111561251e576000858152601a60205260409020600b018390555050505050565b6000818310615d2a5781612231565b5090919050565b6000818303613fde6a084595161401484a0000006140e6838863ffffffff6157e116565b6000615d67838563ffffffff613afe16565b9050600080615d7887878686615a05565b90925090508015615db8576000878152601a6020526040902060090154615da5908263ffffffff613afe16565b6000888152601a60205260409020600901555b8115613298576000878152601a6020526040902060010154615de0908363ffffffff613afe16565b6000888152601a602052604090206001015550505050505050565b8015611cec576000828152601a6020526040902060010154615e23908263ffffffff613afe16565b6000838152601a60205260409020600101555050565b828054828255906000526020600020908101928215615e8e579160200282015b82811115615e8e57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190615e59565b50615e9a929150615f2c565b5090565b6040518060a0016040528060008152602001600081526020016060815260200160608152602001600081525090565b60405180606001604052806000815260200160608152602001600081525090565b8154818355818111156127ca576000838152602090206127ca918101908301615f50565b604051806040016040528060008152602001600081525090565b61275c91905b80821115615e9a5780546001600160a01b0319168155600101615f32565b61275c91905b80821115615e9a5760008155600101615f5656fe4f6e6c7920676f7665726e616e636520636f6e747261637420697320617574686f72697a6564a265627a7a723158202144f16fe19a38e4b93eaa1e2c04f33e2a9f779412c9defdf18d621af20c242664736f6c63430005110032", - "nonce": "0x8c", - "chainId": "0xaa36a7" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0xae07c932b4a5459bd683767dde161e9fa7ad1cc9b0ac83a39f9c291bcb22b79f", - "transactionType": "CREATE", - "contractName": null, - "contractAddress": "0x19b0b3256b22116096a2ef8cafc6e832ba18a947", - "function": null, - "arguments": null, - "transaction": { - "from": "0x0724d72eb61e508d81ca701881f2248f092953bf", - "gas": "0x3b3afb", - "value": "0x0", - "input": "0x60806040526003805460ff60a81b191690553480156200001e57600080fd5b5060038054610100338102610100600160a81b0319909216919091179182905560405191046001600160a01b0316906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3620000886001600160e01b036200008e16565b620000a3565b6003805460ff60a81b1916600160a81b179055565b61349680620000b36000396000f3fe608060405234801561001057600080fd5b50600436106103c55760003560e01c80638759c234116101ff578063b6658d071161011a578063e0db556b116100ad578063e97fddc21161007c578063e97fddc2146109aa578063eaf43bb5146109c7578063f2fde38b14610a05578063f83d08ba14610a2b576103c5565b8063e0db556b14610936578063e4457a8a1461093e578063e4cd1aec14610961578063e570b78b14610987576103c5565b8063c83ec04d116100e9578063c83ec04d146108d5578063cf309012146108f8578063dd62ed3e14610900578063df5cf7231461092e576103c5565b8063b6658d071461089a578063b89b63c1146108a2578063bfb18f29146108c5578063c7b8981c146108cd576103c5565b80639b2cb5d811610192578063a9059cbb11610161578063a9059cbb146107d8578063abf59fc914610804578063b4988fd01461083a578063b60c76fa1461086e576103c5565b80639b2cb5d814610770578063a0c1ca3414610778578063a457c2d7146107a4578063a69df4b5146107d0576103c5565b80638d16a14a116101ce5780638d16a14a146107505780638da5cb5b146107585780638f32d59b146107605780639ad5f5a414610768576103c5565b80638759c2341461071b578063883b455f146107385780638ccdd289146107405780638d086da414610748576103c5565b80634f91440d116102ef5780636ab1507111610282578063715018a611610251578063715018a6146106c05780637542ff95146106c8578063795be587146106d05780637ba8c820146106fc576103c5565b80636ab15071146106225780636cbb6050146106455780636e7ce5911461066e57806370a082311461069a576103c5565b80635f0c80cc116102be5780635f0c80cc146105a35780636035083f146105ab578063653ec134146105d6578063676e5550146105fc576103c5565b80634f91440d1461056c5780635adc6dde146105745780635c42c733146105935780635c5f7dae1461059b576103c5565b806323b872dd116103675780633a09bf44116103365780633a09bf44146105305780633ba0b9a9146105385780633d94eb0514610540578063446a2ec814610564576103c5565b806323b872dd146104a05780633046c204146104d657806339509351146104fc57806339c31e9314610528576103c5565b80631bf494a7116103a35780631bf494a7146104495780631e7ff8f614610451578063232e5415146104905780632344067914610498576103c5565b8063029d3040146103ca578063095ea7b3146103ef57806318160ddd1461042f575b600080fd5b6103ed600480360360408110156103e057600080fd5b5080359060200135610a33565b005b61041b6004803603604081101561040557600080fd5b506001600160a01b038135169060200135610a43565b604080519115158252519081900360200190f35b610437610a5a565b60408051918252519081900360200190f35b610437610a61565b6104776004803603602081101561046757600080fd5b50356001600160a01b0316610aed565b6040805192835260208301919091528051918290030190f35b6103ed610b4d565b610437610b59565b61041b600480360360608110156104b657600080fd5b506001600160a01b03813581169160208101359091169060400135610b5f565b610437600480360360208110156104ec57600080fd5b50356001600160a01b0316610bb7565b61041b6004803603604081101561051257600080fd5b506001600160a01b038135169060200135610bc9565b610437610c05565b610437610c0b565b610437610c11565b610548610cce565b604080516001600160a01b039092168252519081900360200190f35b610437610cdd565b610477610ce3565b6104776004803603602081101561058a57600080fd5b50351515610cf8565b610437610ff1565b610437610ff7565b610437610ffd565b6103ed600480360360608110156105c157600080fd5b50803590602081013590604001351515611003565b610477600480360360208110156105ec57600080fd5b50356001600160a01b03166111fe565b6104376004803603602081101561061257600080fd5b50356001600160a01b0316611217565b6104376004803603604081101561063857600080fd5b508035906020013561122a565b6104376004803603606081101561065b57600080fd5b5080359060208101359060400135611238565b6103ed6004803603604081101561068457600080fd5b506001600160a01b03813516906020013561136f565b610437600480360360208110156106b057600080fd5b50356001600160a01b03166115fb565b6103ed611616565b610548611677565b610477600480360360408110156106e657600080fd5b506001600160a01b038135169060200135611686565b6103ed6004803603602081101561071257600080fd5b503515156116aa565b6103ed6004803603602081101561073157600080fd5b50356116ce565b6105486116dc565b6104376116eb565b6104376116f1565b6103ed6116f7565b610548611701565b61041b611715565b61047761172b565b610437611738565b6103ed6004803603604081101561078e57600080fd5b506001600160a01b03813516906020013561173e565b61041b600480360360408110156107ba57600080fd5b506001600160a01b03813516906020013561176c565b6103ed6117a8565b61041b600480360360408110156107ee57600080fd5b506001600160a01b0381351690602001356117c1565b6103ed6004803603606081101561081a57600080fd5b506001600160a01b038135811691602081013590911690604001356117cf565b6103ed6004803603606081101561085057600080fd5b508035906001600160a01b03602082013581169160400135166118f6565b61041b6004803603604081101561088457600080fd5b506001600160a01b0381351690602001356119be565b6105486119cc565b6103ed600480360360408110156108b857600080fd5b50803590602001356119db565b6104376119e7565b6103ed611a2e565b6103ed600480360360408110156108eb57600080fd5b5080359060200135611a38565b61041b611a44565b6104376004803603604081101561091657600080fd5b506001600160a01b0381358116916020013516611a4d565b61041b611a78565b6103ed611a81565b6104376004803603604081101561095457600080fd5b5080359060200135611a8b565b6104376004803603602081101561097757600080fd5b50356001600160a01b0316611a99565b6103ed6004803603604081101561099d57600080fd5b5080359060200135611aab565b6103ed600480360360208110156109c057600080fd5b5035611ab7565b610437600480360360c08110156109dd57600080fd5b5080359060208101359060408101359060ff6060820135169060808101359060a00135611ac2565b6103ed60048036036020811015610a1b57600080fd5b50356001600160a01b0316611cab565b6103ed611cc5565b610a3f82826000611cde565b5050565b6000610a50338484611e8e565b5060015b92915050565b6002545b90565b6005546006546040805163072c21ef60e31b8152600481019290925251600092610ae8926001600160a01b03909116916339610f7891602480820192602092909190829003018186803b158015610ab757600080fd5b505afa158015610acb573d6000803e3d6000fd5b505050506040513d6020811015610ae157600080fd5b5051611ec6565b905090565b6000806000610afb846115fb565b90506000610b07610c11565b905081610b1b57600093509150610b489050565b610b42610b26611f1d565b610b36838563ffffffff611f4416565b9063ffffffff611f6b16565b93509150505b915091565b610b576001611f8d565b565b60095481565b6000610b6c84848461205a565b6001600160a01b038416600090815260016020908152604080832033808552925290912054610bac918691610ba7908663ffffffff61212516565b611e8e565b5060015b9392505050565b60146020526000908152604090205481565b3360008181526001602090815260408083206001600160a01b03871684529091528120549091610a50918590610ba7908663ffffffff61213a16565b60075481565b600d5481565b600080610c1c610a5a565b90506000610c28611f1d565b90508115610cc55760055460065460408051637f4b432360e01b8152600481019290925251610cc0928592610b369286926001600160a01b031691637f4b4323916024808301926020929190829003018186803b158015610c8857600080fd5b505afa158015610c9c573d6000803e3d6000fd5b505050506040513d6020811015610cb257600080fd5b50519063ffffffff611f4416565b610cc7565b805b9250505090565b6004546001600160a01b031681565b600c5481565b600080610cf06000610cf8565b915091509091565b6000803381610d068261214c565b90506000600a54821015610d61576040805162461bcd60e51b815260206004820152601c60248201527f546f6f20736d616c6c207265776172647320746f2072657374616b6500000000604482015290519081900360640190fd5b8115610b4257610d73826000856121fa565b905080821115610f615785610e14576005546006546040805163bc8756a960e01b8152600481019290925283850360248301526001600160a01b038681166044840152905192169163bc8756a9916064808201926020929091908290030181600087803b158015610de357600080fd5b505af1158015610df7573d6000803e3d6000fd5b505050506040513d6020811015610e0d57600080fd5b5051610ea2565b6005546006546040805163c7f067cb60e01b8152600481019290925283850360248301526001600160a01b038681166044840152905192169163c7f067cb916064808201926020929091908290030181600087803b158015610e7557600080fd5b505af1158015610e89573d6000803e3d6000fd5b505050506040513d6020811015610e9f57600080fd5b50515b610ee9576040805162461bcd60e51b8152602060048201526013602482015272496e737566666963656e74207265776172647360681b604482015290519081900360640190fd5b600480546006546040805163b7721d2d60e01b8152938401919091526001600160a01b0386811660248501528486036044850152905191169163b7721d2d91606480830192600092919082900301818387803b158015610f4857600080fd5b505af1158015610f5c573d6000803e3d6000fd5b505050505b6000610f6c84610aed565b506004805460065460408051637f88a95760e01b8152938401919091526001600160a01b0388811660248501526044840185905290519394501691637f88a9579160648082019260009290919082900301818387803b158015610fce57600080fd5b505af1158015610fe2573d6000803e3d6000fd5b50505050509350915050915091565b600f5481565b60065481565b600b5481565b6000806110118585856124b9565b336000908152601460205260408120549294509092509061103990600163ffffffff61213a16565b9050611043613447565b6040518060400160405280848152602001600560009054906101000a90046001600160a01b03166001600160a01b031663900cf0cf6040518163ffffffff1660e01b815260040160206040518083038186803b1580156110a257600080fd5b505afa1580156110b6573d6000803e3d6000fd5b505050506040513d60208110156110cc57600080fd5b50519052336000818152601560209081526040808320878452825280832085518155858301516001909101559282526014905220839055905061110d612685565b60065460408051632a9b5b4160e11b81526004810192909252336024830152604482018a90526064820187905260848201859052516001600160a01b039290921691635536b6829160a48082019260009290919082900301818387803b15801561117657600080fd5b505af115801561118a573d6000803e3d6000fd5b5050600480546006546040805163532e19a960e01b815293840191909152516001600160a01b03909116935063532e19a99250602480830192600092919082900301818387803b1580156111dd57600080fd5b505af11580156111f1573d6000803e3d6000fd5b5050505050505050505050565b6012602052600090815260409020805460019091015482565b6000610a5482611225610a61565b6127c2565b6000610bb083836000612843565b6000611242611715565b61124b57600080fd5b600f546000611260858363ffffffff61213a16565b90508061127257600092505050610bb0565b6000611297611287888463ffffffff61213a16565b610b36848863ffffffff611f4416565b905060006112af83610b36868563ffffffff611f4416565b905060006112c3838363ffffffff61212516565b6005546006546040805163858a7c0360e01b8152600481019290925260248201849052519293506001600160a01b039091169163858a7c039160448082019260009290919082900301818387803b15801561131d57600080fd5b505af1158015611331573d6000803e3d6000fd5b5050600d54611349925090508263ffffffff61212516565b600d55600f5461135f908363ffffffff61212516565b600f555090979650505050505050565b611377611715565b61138057600080fd5b61138b8260016129bd565b5060008061139884610aed565b91509150828210156113e6576040805162461bcd60e51b815260206004820152601260248201527109ad2cee4c2e8d2dcce40e8dede40daeac6d60731b604482015290519081900360640190fd5b60006113f0611f1d565b9050600061140883610b36878563ffffffff611f4416565b90506114148682612bb9565b60055460065460408051629ff11560e81b815260048101929092526000888103602484015290516001600160a01b0390931692639ff1150092604480820193929182900301818387803b15801561146a57600080fd5b505af115801561147e573d6000803e3d6000fd5b5050600d54611496925090508663ffffffff61212516565b600d55600480546006546040805163f1382b5360e01b8152938401919091526001600160a01b0389811660248501526044840189905260648401859052905191169163f1382b5391608480830192600092919082900301818387803b1580156114fe57600080fd5b505af1158015611512573d6000803e3d6000fd5b5050600480546006546040805163532e19a960e01b815293840191909152516001600160a01b03909116935063532e19a99250602480830192600092919082900301818387803b15801561156557600080fd5b505af1158015611579573d6000803e3d6000fd5b5050600480546006546040805163302df4df60e11b8152938401919091526001600160a01b038b81166024850152604484018b905290519116935063605be9be9250606480830192600092919082900301818387803b1580156115db57600080fd5b505af11580156115ef573d6000803e3d6000fd5b50505050505050505050565b6001600160a01b031660009081526020819052604090205490565b61161e611715565b61162757600080fd5b60035460405160009161010090046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a360038054610100600160a81b0319169055565b6005546001600160a01b031681565b60156020908152600092835260408084209091529082529020805460019091015482565b6116b2611715565b6116bb57600080fd5b600e805460ff1916911515919091179055565b6116d9816001612c60565b50565b6016546001600160a01b031681565b60085481565b60105481565b610b576000611f8d565b60035461010090046001600160a01b031690565b60035461010090046001600160a01b0316331490565b600080610cf06001610cf8565b600a5481565b611746611715565b61174f57600080fd5b61175a8260016129bd565b50611767816000846121fa565b505050565b3360008181526001602090815260408083206001600160a01b03871684529091528120549091610a50918590610ba7908663ffffffff61212516565b6117b0611715565b6117b957600080fd5b610b57612d50565b6000610a5083836000612d5c565b6117d7611715565b6117e057600080fd5b6001600160a01b03831661182a576040516001600160a01b0383169082156108fc029083906000818181858888f19350505050158015611824573d6000803e3d6000fd5b50611767565b826001600160a01b031663a9059cbb83836040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561188a57600080fd5b505af115801561189e573d6000803e3d6000fd5b505050506040513d60208110156118b457600080fd5b5051611767576040805162461bcd60e51b815260206004820152600c60248201526b111c985a5b8819985a5b195960a21b604482015290519081900360640190fd5b600354600160a81b900460ff1615611946576040805162461bcd60e51b815260206004820152600e60248201526d185b1c9958591e481a5b9a5d195960921b604482015290519081900360640190fd5b6003805460ff60a81b1916600160a81b1790556006839055600480546001600160a01b038085166001600160a01b031992831617909255600580549284169290911691909117905561199781612dea565b61199f612685565b5050670de0b6b3a7640000600a555050600e805460ff19166001179055565b6000610a5083836001612d5c565b6017546001600160a01b031681565b610a3f82826001611cde565b6000806119f2611f1d565b905060086006541015611a06579050610a5e565b6010548015611a2857610cc081610b3684600f54611f4490919063ffffffff16565b50919050565b610b576000612e64565b610a3f82826000611003565b60035460ff1681565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b600e5460ff1681565b610b576001612e64565b6000610bb083836001612843565b60136020526000908152604090205481565b610a3f82826001611003565b6116d9816000612c60565b600080611acd612ec9565b60408051623f675f60e91b815233600482015290519192506000916001600160a01b03841691637ecebe00916024808301926020929190829003018186803b158015611b1857600080fd5b505afa158015611b2c573d6000803e3d6000fd5b505050506040513d6020811015611b4257600080fd5b50516005546040805163d505accf60e01b81523360048201526001600160a01b039283166024820152604481018d9052606481018b905260ff8a16608482015260a4810189905260c4810188905290519293509084169163d505accf9160e48082019260009290919082900301818387803b158015611bc057600080fd5b505af1158015611bd4573d6000803e3d6000fd5b505060408051623f675f60e91b815233600482015290516001850193506001600160a01b0386169250637ecebe0091602480820192602092909190829003018186803b158015611c2357600080fd5b505afa158015611c37573d6000803e3d6000fd5b505050506040513d6020811015611c4d57600080fd5b505114611c92576040805162461bcd60e51b815260206004820152600e60248201526d125b9d985b1a59081c195c9b5a5d60921b604482015290519081900360640190fd5b611c9e89896001612843565b9998505050505050505050565b611cb3611715565b611cbc57600080fd5b6116d981612dea565b611ccd611715565b611cd657600080fd5b610b57613043565b600080611cec8585856124b9565b91509150611cf8613447565b50336000908152601260209081526040918290208251808401909352805480845260019091015491830191909152611d36908363ffffffff61213a16565b81526005546040805163900cf0cf60e01b815290516001600160a01b039092169163900cf0cf91600480820192602092909190829003018186803b158015611d7d57600080fd5b505afa158015611d91573d6000803e3d6000fd5b505050506040513d6020811015611da757600080fd5b505160208281019182523360008181526012909252604080832085518155935160019094019390935560048054600654855163f1382b5360e01b8152928301526024820192909252604481018a90526064810187905292516001600160a01b0390911692839263f1382b539260848084019382900301818387803b158015611e2e57600080fd5b505af1158015611e42573d6000803e3d6000fd5b50505050806001600160a01b031663532e19a96006546040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156111dd57600080fd5b6040805162461bcd60e51b8152602060048201526008602482015267191a5cd8589b195960c21b604482015290519081900360640190fd5b600c546000908215610a54576000611edc610a5a565b90508015611f1657611f13611f0682610b36876a084595161401484a00000063ffffffff611f4416565b839063ffffffff61213a16565b91505b5092915050565b600060086006541015611f3257506064610a5e565b506c01431e0fae6d7217caa000000090565b600082611f5357506000610a54565b82820282848281611f6057fe5b0414610bb057600080fd5b6000808211611f7957600080fd5b6000828481611f8457fe5b04949350505050565b611f95613447565b50336000908152601260209081526040808320815180830190925280548252600101549181019190915290611fca8284613052565b3360008181526012602052604080822082815560010182905560048054600654835163302df4df60e11b81529283015260248201949094526044810185905290519394506001600160a01b039092169263605be9be92606480820193929182900301818387803b15801561203d57600080fd5b505af1158015612051573d6000803e3d6000fd5b50505050505050565b6001600160a01b03821661206d57600080fd5b6001600160a01b038316600090815260208190526040902054612096908263ffffffff61212516565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546120cb908263ffffffff61213a16565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b60008282111561213457600080fd5b50900390565b600082820183811015610bb057600080fd5b6000806121c3600560009054906101000a90046001600160a01b03166001600160a01b0316637ed4b27c6006546040518263ffffffff1660e01b815260040180828152602001915050602060405180830381600087803b1580156121af57600080fd5b505af1158015610acb573d6000803e3d6000fd5b905060006121d184836127c2565b600c8390556001600160a01b038516600090815260136020526040902092909255509050919050565b600061220461335e565b600e5460ff16612254576040805162461bcd60e51b815260206004820152601660248201527511195b1959d85d1a5bdb881a5cc8191a5cd8589b195960521b604482015290519081900360640190fd5b600061225e610c11565b9050600061226a611f1d565b9050600061228283610b36898563ffffffff611f4416565b9050858110156122cd576040805162461bcd60e51b8152602060048201526011602482015270546f6f206d75636820736c69707061676560781b604482015290519081900360640190fd5b6001600160a01b03851660009081526012602052604090205415612327576040805162461bcd60e51b815260206004820152600c60248201526b13db99dbda5b99c8195e1a5d60a21b604482015290519081900360640190fd5b612331858261339f565b61234582610b36858463ffffffff611f4416565b60055460065460408051629ff11560e81b8152600481019290925260248201849052519299506001600160a01b0390911691639ff115009160448082019260009290919082900301818387803b15801561239e57600080fd5b505af11580156123b2573d6000803e3d6000fd5b5050600d546123ca925090508863ffffffff61213a16565b600d55600480546006546040805163c69d057360e01b8152938401919091526001600160a01b038881166024850152604484018b9052606484018590529051911691829163c69d05739160848082019260009290919082900301818387803b15801561243557600080fd5b505af1158015612449573d6000803e3d6000fd5b50505050806001600160a01b031663532e19a96006546040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561249557600080fd5b505af11580156124a9573d6000803e3d6000fd5b50999a9950505050505050505050565b6000806000806124c833610aed565b91509150816000141580156124dd5750868210155b612523576040805162461bcd60e51b8152602060048201526012602482015271151bdbc81b5d58da081c995c5d595cdd195960721b604482015290519081900360640190fd5b600061252d611f1d565b9050600061254583610b368b8563ffffffff611f4416565b905087811115612590576040805162461bcd60e51b8152602060048201526011602482015270746f6f206d75636820736c69707061676560781b604482015290519081900360640190fd5b61259a33886129bd565b506125a53382612bb9565b60055460065460408051629ff11560e81b8152600481019290925260008c8103602484015290516001600160a01b0390931692639ff1150092604480820193929182900301818387803b1580156125fb57600080fd5b505af115801561260f573d6000803e3d6000fd5b5050600d54612627925090508a63ffffffff61212516565b600d5560006126476126376119e7565b610b368c8663ffffffff611f4416565b600f5490915061265d908b63ffffffff61213a16565b600f55601054612673908263ffffffff61213a16565b60105590999098509650505050505050565b6016546000906001600160a01b031680610ae857600560009054906101000a90046001600160a01b03166001600160a01b0316635ab1bd536040518163ffffffff1660e01b815260040160206040518083038186803b1580156126e757600080fd5b505afa1580156126fb573d6000803e3d6000fd5b505050506040513d602081101561271157600080fd5b5051604080516832bb32b73a39a43ab160b91b8152815190819003600901812063cac39a0560e01b8252600482015290516001600160a01b039092169163cac39a0591602480820192602092909190829003018186803b15801561277457600080fd5b505afa158015612788573d6000803e3d6000fd5b505050506040513d602081101561279e57600080fd5b5051601680546001600160a01b0319166001600160a01b0383161790559050905090565b6000806127ce846115fb565b9050806127df576000915050610a54565b6001600160a01b0384166000908152601360205260409020548381141561280b57600092505050610a54565b61283a6a084595161401484a000000610b368461282e888663ffffffff61212516565b9063ffffffff611f4416565b95945050505050565b600061284f33836129bd565b5061285b8484336121fa565b9050816128f15760055460065460408051636901b25360e01b8152600481019290925260248201849052336044830152516001600160a01b0390921691636901b253916064808201926020929091908290030181600087803b1580156128c057600080fd5b505af11580156128d4573d6000803e3d6000fd5b505050506040513d60208110156128ea57600080fd5b505161297b565b60055460065460408051624c025560e81b8152600481019290925260248201849052336044830152516001600160a01b0390921691634c025500916064808201926020929091908290030181600087803b15801561294e57600080fd5b505af1158015612962573d6000803e3d6000fd5b505050506040513d602081101561297857600080fd5b50515b610bb0576040805162461bcd60e51b815260206004820152600e60248201526d19195c1bdcda5d0819985a5b195960921b604482015290519081900360640190fd5b6000806129c98461214c565b90508015610bb05782612a67576005546006546040805163bc8756a960e01b81526004810192909252602482018490526001600160a01b038781166044840152905192169163bc8756a9916064808201926020929091908290030181600087803b158015612a3657600080fd5b505af1158015612a4a573d6000803e3d6000fd5b505050506040513d6020811015612a6057600080fd5b5051612af4565b6005546006546040805163c7f067cb60e01b81526004810192909252602482018490526001600160a01b038781166044840152905192169163c7f067cb916064808201926020929091908290030181600087803b158015612ac757600080fd5b505af1158015612adb573d6000803e3d6000fd5b505050506040513d6020811015612af157600080fd5b50515b612b3b576040805162461bcd60e51b8152602060048201526013602482015272496e737566666963656e74207265776172647360681b604482015290519081900360640190fd5b600480546006546040805163b7721d2d60e01b8152938401919091526001600160a01b03878116602485015260448401859052905191169163b7721d2d91606480830192600092919082900301818387803b158015612b9957600080fd5b505af1158015612bad573d6000803e3d6000fd5b50505050905092915050565b6001600160a01b038216612bcc57600080fd5b600254612bdf908263ffffffff61212516565b6002556001600160a01b038216600090815260208190526040902054612c0b908263ffffffff61212516565b6001600160a01b038316600081815260208181526040808320949094558351858152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35050565b612c68613447565b503360009081526015602090815260408083208584528252808320815180830190925280548252600101549181019190915290612ca58284613052565b3360009081526015602090815260408083208884529091528120818155600101559050612cd0612685565b60065460408051636e699d8760e01b815260048101929092523360248301526044820184905260648201879052516001600160a01b039290921691636e699d879160848082019260009290919082900301818387803b158015612d3257600080fd5b505af1158015612d46573d6000803e3d6000fd5b5050505050505050565b6003805460ff19169055565b33612d6784836129bd565b50612d7281836129bd565b50612d7e81858561205a565b612d86612685565b6006546040805163c08b3f9d60e01b815260048101929092526001600160a01b038481166024840152878116604484015260648301879052905192169163c08b3f9d9160848082019260009290919082900301818387803b158015612d3257600080fd5b6001600160a01b038116612dfd57600080fd5b6003546040516001600160a01b0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600380546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b6000612e7033836129bd565b9050600a54811015610a3f576040805162461bcd60e51b815260206004820152601860248201527f546f6f20736d616c6c207265776172647320616d6f756e740000000000000000604482015290519081900360640190fd5b6017546000906001600160a01b031680610ae857600560009054906101000a90046001600160a01b03166001600160a01b0316635ab1bd536040518163ffffffff1660e01b815260040160206040518083038186803b158015612f2b57600080fd5b505afa158015612f3f573d6000803e3d6000fd5b505050506040513d6020811015612f5557600080fd5b505160408051621c1bdb60ea1b8152815190819003600301812063cac39a0560e01b8252600482015290516001600160a01b039092169163cac39a0591602480820192602092909190829003018186803b158015612fb257600080fd5b505afa158015612fc6573d6000803e3d6000fd5b505050506040513d6020811015612fdc57600080fd5b505190506001600160a01b038116613023576040805162461bcd60e51b81526020600482015260056024820152641d5b9cd95d60da1b604482015290519081900360640190fd5b601780546001600160a01b0319166001600160a01b038316179055919050565b6003805460ff19166001179055565b81516005546040805163900cf0cf60e01b81529051600093926001600160a01b03169163900cf0cf916004808301926020929190829003018186803b15801561309a57600080fd5b505afa1580156130ae573d6000803e3d6000fd5b505050506040513d60208110156130c457600080fd5b50516005546040805163a7ab696160e01b81529051613149926001600160a01b03169163a7ab6961916004808301926020929190829003018186803b15801561310c57600080fd5b505afa158015613120573d6000803e3d6000fd5b505050506040513d602081101561313657600080fd5b505160208701519063ffffffff61213a16565b111580156131575750600081115b6131a8576040805162461bcd60e51b815260206004820152601c60248201527f496e636f6d706c657465207769746864726177616c20706572696f6400000000604482015290519081900360640190fd5b60006131c16131b5611f1d565b610b368461282e6119e7565b6010549091506131d7908363ffffffff61212516565b601055600f546131ed908263ffffffff61212516565b600f5583613284576005546006546040805163bc8756a960e01b8152600481019290925260248201849052336044830152516001600160a01b039092169163bc8756a9916064808201926020929091908290030181600087803b15801561325357600080fd5b505af1158015613267573d6000803e3d6000fd5b505050506040513d602081101561327d57600080fd5b505161330f565b6005546006546040805163c7f067cb60e01b8152600481019290925260248201849052336044830152516001600160a01b039092169163c7f067cb916064808201926020929091908290030181600087803b1580156132e257600080fd5b505af11580156132f6573d6000803e3d6000fd5b505050506040513d602081101561330c57600080fd5b50515b613356576040805162461bcd60e51b8152602060048201526013602482015272496e737566666963656e74207265776172647360681b604482015290519081900360640190fd5b949350505050565b60035460ff1615610b57576040805162461bcd60e51b81526020600482015260066024820152651b1bd8dad95960d21b604482015290519081900360640190fd5b6001600160a01b0382166133b257600080fd5b6002546133c5908263ffffffff61213a16565b6002556001600160a01b0382166000908152602081905260409020546133f1908263ffffffff61213a16565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b60405180604001604052806000815260200160008152509056fea265627a7a723158204218c2c8b2e87f177283c78647790865bea3a76c3c8e35d83898fc32476d052564736f6c63430005110032", - "nonce": "0x8d", - "chainId": "0xaa36a7" - }, - "additionalContracts": [], - "isFixedGasLimit": false - } - ], - "receipts": [ - { - "status": "0x1", - "cumulativeGasUsed": "0xcf4a40", - "logs": [ - { - "address": "0x777badc2c75bd4ee5303bf6e90009bd31d8fd3d1", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000724d72eb61e508d81ca701881f2248f092953bf" - ], - "data": "0x", - "blockHash": "0x80bb5b7121caad8c640dafc4e50623df1bc4757fbe8f5cd035bd702d975119ec", - "blockNumber": "0x605f17", - "transactionHash": "0x4499d0ecf70c3a39927d5245cac653c02f0f0c33dc82be6a9ce5d37d4615c70a", - "transactionIndex": "0x40", - "logIndex": "0x73", - "removed": false - } - ], - "logsBloom": "0x00000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000002000001000000000000004000000000000000000000000000000000000001000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000020000010000000000000000000000000000000000000000000000000000000000000", - "type": "0x2", - "transactionHash": "0x4499d0ecf70c3a39927d5245cac653c02f0f0c33dc82be6a9ce5d37d4615c70a", - "transactionIndex": "0x40", - "blockHash": "0x80bb5b7121caad8c640dafc4e50623df1bc4757fbe8f5cd035bd702d975119ec", - "blockNumber": "0x605f17", - "gasUsed": "0x526898", - "effectiveGasPrice": "0x3be653915", - "from": "0x0724d72eb61e508d81ca701881f2248f092953bf", - "to": null, - "contractAddress": "0x777badc2c75bd4ee5303bf6e90009bd31d8fd3d1" - }, - { - "status": "0x1", - "cumulativeGasUsed": "0xfcdd6b", - "logs": [ - { - "address": "0x19b0b3256b22116096a2ef8cafc6e832ba18a947", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000724d72eb61e508d81ca701881f2248f092953bf" - ], - "data": "0x", - "blockHash": "0x80bb5b7121caad8c640dafc4e50623df1bc4757fbe8f5cd035bd702d975119ec", - "blockNumber": "0x605f17", - "transactionHash": "0xae07c932b4a5459bd683767dde161e9fa7ad1cc9b0ac83a39f9c291bcb22b79f", - "transactionIndex": "0x41", - "logIndex": "0x74", - "removed": false - } - ], - "logsBloom": "0x00000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000001000000000000000000000000000000000000020000000000000000000800000000000000000000000000100100400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000020000010000000000000000000000000000000000000000000000000000000000000", - "type": "0x2", - "transactionHash": "0xae07c932b4a5459bd683767dde161e9fa7ad1cc9b0ac83a39f9c291bcb22b79f", - "transactionIndex": "0x41", - "blockHash": "0x80bb5b7121caad8c640dafc4e50623df1bc4757fbe8f5cd035bd702d975119ec", - "blockNumber": "0x605f17", - "gasUsed": "0x2d932b", - "effectiveGasPrice": "0x3be653915", - "from": "0x0724d72eb61e508d81ca701881f2248f092953bf", - "to": null, - "contractAddress": "0x19b0b3256b22116096a2ef8cafc6e832ba18a947" - } - ], - "libraries": [], - "pending": [], - "returns": {}, - "timestamp": 1721057742, - "chain": 11155111, - "commit": "a5fd7d69" -} \ No newline at end of file diff --git a/broadcast/UpgradeStake_DepositManager_Mainnet.s.sol/1/run-1724288447.json b/broadcast/UpgradeStake_DepositManager_Mainnet.s.sol/1/run-1724288447.json deleted file mode 100644 index ae8cdc27..00000000 --- a/broadcast/UpgradeStake_DepositManager_Mainnet.s.sol/1/run-1724288447.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "transactions": [ - { - "hash": null, - "transactionType": "CREATE", - "contractName": null, - "contractAddress": "0x97a3500083348A147F419b8a65717909762c389f", - "function": null, - "arguments": null, - "transaction": { - "from": "0x32bdc6a4e8c654df65503cbb0edc82b4ce9158e6", - "gas": "0x6b33cc", - "value": "0x0", - "input": "0x60806040526023805460ff191690553480156200001b57600080fd5b5060008054610100600160a81b0319168155600180546001600160a01b0319163317908190556040516001600160a01b039190911691907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a36200008a6001600160e01b036200009016565b6200009f565b6023805460ff19166001179055565b615fe180620000af6000396000f3fe608060405234801561001057600080fd5b50600436106107175760003560e01c80637d669752116103a8578063b1d23f02116101f4578063e8afa8e81161011a578063f5e95acb116100b8578063fb1ef52c11610087578063fb1ef52c14611826578063fba58f341461184f578063fc0c546a14611857578063ff3db8e31461185f57610717565b8063f5e95acb1461178f578063f771fc87146117f9578063f83d08ba14611816578063f8a3176c1461181e57610717565b8063f24ccbfe116100f4578063f24ccbfe14611697578063f28699fa1461169f578063f2fde38b146116be578063f41a9642146116e457610717565b8063e8afa8e81461164c578063eceec1d314611672578063f1674fdf1461168f57610717565b8063cf30901211610192578063dcd962b211610161578063dcd962b2146115fc578063e568959a1461161f578063e59ee0c614611627578063e6692f491461162f57610717565b8063cf3090121461159b578063d6de07d0146115a3578063d7f5549d146115c2578063d86d53e7146115df57610717565b8063c710e922116101ce578063c710e92214611518578063c7f067cb14611544578063cbf383d514611576578063cd6b83881461159357610717565b8063b1d23f02146114a6578063b65de35e146114c9578063bc8756a9146114e657610717565b80639342c8f4116102d95780639ff1150011610277578063a69df4b511610246578063a69df4b514611462578063a7ab69611461146a578063a8dc889b14611472578063b184be811461147a57610717565b80639ff1150014611397578063a440ab1e146113ba578063a4769071146113d7578063a6854877146113df57610717565b806399d18f6f116102b357806399d18f6f1461132c5780639a8a62431461134f5780639b33f434146113575780639ddbbf851461137457610717565b80639342c8f4146112dc57806396a93224146112f9578063987ab9db1461132457610717565b806386a22666116103465780638f32d59b116103205780638f32d59b146112a7578063900cf0cf146112af57806391460149146112b757806391f1a3a5146112d457610717565b806386a226661461127a578063883b455f146112975780638da5cb5b1461129f57610717565b80637f952d95116103825780637f952d951461118057806381254e1214611188578063817b1cd21461124f578063858a7c031461125757610717565b80637d6697521461113e5780637ed4b27c146111465780637f4b43231461116357610717565b806341b3d185116105675780635ab1bd53116104985780637060054d116104365780637854f354116104055780637854f354146110eb57806378f84a44146111085780637b1039991461112e5780637c7eaf1a1461113657610717565b80637060054d146110cb578063715018a6146110d357806376671808146110db57806377939d10146110e357610717565b80636352211e116104725780636352211e14610fa05780636365679814610fbd57806368cb812a14610fe95780636901b2531461109957610717565b80635ab1bd5314610f015780635e47655f14610f0957806360c8d12214610f7757610717565b80634fdd20f11161050557806354b8c601116104df57806354b8c60114610ecc5780635508d8e114610ed457806356342d8c14610edc5780635aa6e67514610ef957610717565b80634fdd20f114610ca657806352b8115d14610d6d5780635325e14414610e0557610717565b80634b341aed116105415780634b341aed14610c3e5780634c02550014610c645780634e3c83f114610c965780634fd101d714610c9e57610717565b806341b3d18514610bf2578063451b598514610bfa57806348ab8b2a14610c0257610717565b80632079fb9a1161064c5780632fa9d18b116105ea57806335aa2e44116105b957806335aa2e4414610ac85780633862da0b14610b8157806339610f7814610ba75780633c34355614610bc457610717565b80632fa9d18b14610a0c57806330cbe57114610a9b57806331c2273b14610ab85780633427458614610ac057610717565b80632649263a116106265780632649263a146108f257806328cc4e41146109235780632cf44a431461094e5780632e17de78146109ef57610717565b80632079fb9a1461089757806325316411146108b457806325726df2146108bc57610717565b8063174e6832116106b95780631ae4818f116106935780631ae4818f1461082f5780631c404cec146108375780631dd6b9b1146108545780631e9b12ef1461087157610717565b8063174e6832146107e4578063178c2c831461080a57806317c2b9101461082757610717565b80630e15561a116106f55780630e15561a146107935780630ebb172a1461079b57806316827b1b146107a35780631705a3bd146107c057610717565b806306cfb1041461071c578063078a13b11461073b5780630cccfc5814610779575b600080fd5b6107396004803603602081101561073257600080fd5b503561187c565b005b6107396004803603608081101561075157600080fd5b506001600160a01b038135811691602081013582169160408201358116916060013516611889565b610781611901565b60408051918252519081900360200190f35b610781611907565b61078161190d565b610739600480360360208110156107b957600080fd5b5035611913565b6107c861199c565b604080516001600160a01b039092168252519081900360200190f35b610781600480360360208110156107fa57600080fd5b50356001600160a01b03166119ab565b6107396004803603602081101561082057600080fd5b5035611a35565b610781611cc2565b6107c8611cc8565b6107396004803603602081101561084d57600080fd5b5035611cd7565b6107396004803603602081101561086a57600080fd5b5035611cf0565b6107396004803603602081101561088757600080fd5b50356001600160a01b0316611cfd565b6107c8600480360360208110156108ad57600080fd5b5035611d3a565b610781611d61565b6108d9600480360360208110156108d257600080fd5b5035611d67565b6040805192835260208301919091528051918290030190f35b61090f6004803603602081101561090857600080fd5b5035611d80565b604080519115158252519081900360200190f35b6107396004803603606081101561093957600080fd5b50803590602081013590604001351515611dbb565b6107396004803603602081101561096457600080fd5b810190602081018135600160201b81111561097e57600080fd5b82018360208201111561099057600080fd5b803590602001918460208302840111600160201b831117156109b157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611de0945050505050565b61073960048036036020811015610a0557600080fd5b5035611e04565b610781600480360360a0811015610a2257600080fd5b8135916020810135916040820135916001600160a01b036060820135169181019060a081016080820135600160201b811115610a5d57600080fd5b820183602082011115610a6f57600080fd5b803590602001918460608302840111600160201b83111715610a9057600080fd5b509092509050611e19565b61073960048036036020811015610ab157600080fd5b503561212a565b6107c861213f565b61078161214e565b610ae560048036036020811015610ade57600080fd5b5035612154565b604051808e81526020018d81526020018c81526020018b81526020018a8152602001896001600160a01b03166001600160a01b03168152602001886001600160a01b03166001600160a01b03168152602001876003811115610b4357fe5b60ff1681526020018681526020018581526020018481526020018381526020018281526020019d505050505050505050505050505060405180910390f35b61078160048036036020811015610b9757600080fd5b50356001600160a01b03166121c5565b61078160048036036020811015610bbd57600080fd5b50356121d7565b61073960048036036040811015610bda57600080fd5b506001600160a01b0381358116916020013516612238565b6107816122f1565b6107816122f7565b61073960048036036080811015610c1857600080fd5b508035906001600160a01b036020820135811691604081013590911690606001356122fd565b61078160048036036020811015610c5457600080fd5b50356001600160a01b03166123a3565b61090f60048036036060811015610c7a57600080fd5b50803590602081013590604001356001600160a01b03166124da565b6107816124fb565b610781612501565b610739600480360360a0811015610cbc57600080fd5b6001600160a01b0382351691602081013591604082013591606081013515159181019060a081016080820135600160201b811115610cf957600080fd5b820183602082011115610d0b57600080fd5b803590602001918460018302840111600160201b83111715610d2c57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550612507945050505050565b610739600480360360c0811015610d8357600080fd5b6001600160a01b038235169160208101359160408201359160608101359160808201351515919081019060c0810160a0820135600160201b811115610dc757600080fd5b820183602082011115610dd957600080fd5b803590602001918460018302840111600160201b83111715610dfa57600080fd5b509092509050612525565b610e2260048036036020811015610e1b57600080fd5b5035612648565b60405180868152602001858152602001846001600160a01b03166001600160a01b031681526020018315151515815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610e8d578181015183820152602001610e75565b50505050905090810190601f168015610eba5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390f35b61090f61270e565b610781612717565b6107c860048036036020811015610ef257600080fd5b503561271d565b6107c861273b565b6107c861274f565b61078160048036036020811015610f1f57600080fd5b810190602081018135600160201b811115610f3957600080fd5b820183602082011115610f4b57600080fd5b803590602001918460018302840111600160201b83111715610f6c57600080fd5b50909250905061275f565b61073960048036036060811015610f8d57600080fd5b5080359060208101359060400135612766565b6107c860048036036020811015610fb657600080fd5b50356127cf565b61073960048036036040811015610fd357600080fd5b506001600160a01b03813516906020013561281b565b61073960048036036060811015610fff57600080fd5b813591602081013591810190606081016040820135600160201b81111561102557600080fd5b82018360208201111561103757600080fd5b803590602001918460018302840111600160201b8311171561105857600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550612832945050505050565b61090f600480360360608110156110af57600080fd5b50803590602081013590604001356001600160a01b0316612978565b610781612990565b610739612996565b6107816129f1565b6107816129f7565b6107396004803603602081101561110157600080fd5b50356129fd565b6107816004803603602081101561111e57600080fd5b50356001600160a01b0316612a16565b6107c8612a28565b610781612a37565b610781612a3d565b6107816004803603602081101561115c57600080fd5b5035612a43565b6107816004803603602081101561117957600080fd5b5035612a9a565b610781612aaf565b610739600480360360a081101561119e57600080fd5b6001600160a01b0382351691602081013591604082013591606081013515159181019060a081016080820135600160201b8111156111db57600080fd5b8201836020820111156111ed57600080fd5b803590602001918460018302840111600160201b8311171561120e57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550612ab5945050505050565b610781612acc565b6107396004803603604081101561126d57600080fd5b5080359060200135612ad2565b6107396004803603602081101561129057600080fd5b5035612b18565b6107c8612b29565b6107c8612b3d565b61090f612b4c565b610781612b8f565b610739600480360360208110156112cd57600080fd5b5035612b95565b610781612bab565b610739600480360360208110156112f257600080fd5b5035612bb1565b6107396004803603606081101561130f57600080fd5b50803590602081013590604001351515612bc6565b6107c8612be5565b6107396004803603604081101561134257600080fd5b5080359060200135612bf4565b610781612c5a565b6107396004803603602081101561136d57600080fd5b5035612c60565b6107396004803603604081101561138a57600080fd5b5080359060200135612d1c565b610739600480360360408110156113ad57600080fd5b5080359060200135612d82565b610739600480360360208110156113d057600080fd5b5035612e75565b610781612e8c565b610739600480360360808110156113f557600080fd5b813591602081013591604082013515159190810190608081016060820135600160201b81111561142457600080fd5b82018360208201111561143657600080fd5b803590602001918460018302840111600160201b8311171561145757600080fd5b509092509050612e92565b610739612f43565b610781612f55565b610781612f5b565b6107396004803603604081101561149057600080fd5b506001600160a01b038135169060200135612f61565b610739600480360360408110156114bc57600080fd5b5080359060200135612f75565b610781600480360360208110156114df57600080fd5b5035612f88565b61090f600480360360608110156114fc57600080fd5b50803590602081013590604001356001600160a01b0316612fd6565b6107396004803603604081101561152e57600080fd5b50803590602001356001600160a01b0316612fed565b61090f6004803603606081101561155a57600080fd5b50803590602081013590604001356001600160a01b03166130a8565b6107396004803603602081101561158c57600080fd5b50356130b7565b610781613140565b61090f613146565b610739600480360360208110156115b957600080fd5b5035151561314f565b610781600480360360208110156115d857600080fd5b50356132a1565b610739600480360360208110156115f557600080fd5b50356132b3565b6107396004803603604081101561161257600080fd5b50803590602001356132c8565b610781613330565b6108d9613336565b6107396004803603602081101561164557600080fd5b503561333f565b6107396004803603602081101561166257600080fd5b50356001600160a01b03166133fb565b6107816004803603602081101561168857600080fd5b503561347b565b6107c861348d565b6107c861349c565b610739600480360360208110156116b557600080fd5b503515156134ab565b610739600480360360208110156116d457600080fd5b50356001600160a01b03166134c6565b610739600480360360408110156116fa57600080fd5b81359190810190604081016020820135600160201b81111561171b57600080fd5b82018360208201111561172d57600080fd5b803590602001918460018302840111600160201b8311171561174e57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506134e0945050505050565b61073960048036036101208110156117a657600080fd5b506001600160a01b038135811691602081013582169160408201358116916060810135821691608082013581169160a081013582169160c082013581169160e081013582169161010090910135166136e5565b6107396004803603602081101561180f57600080fd5b5035613888565b6107396138a3565b6107c86138b3565b6107396004803603606081101561183c57600080fd5b50803590602081013590604001356138c2565b6107816139dd565b6107c86139e3565b6107396004803603602081101561187557600080fd5b50356139f2565b611884613a07565b600f55565b611891613a07565b61189a81613a55565b6118a357600080fd5b60238054610100600160a81b0319169055602580546001600160a01b03199081166001600160a01b03938416179091556006805482169583169590951790945560058054851693821693909317909255600780549093169116179055565b60155481565b60135481565b60085481565b61191b613a07565b8061192557600080fd5b60055460105460408051630f1980a560e41b8152600481018590526024810192909252516001600160a01b039092169163f1980a509160448082019260009290919082900301818387803b15801561197c57600080fd5b505af1158015611990573d6000803e3d6000fd5b50505060109190915550565b602c546001600160a01b031681565b60065460408051632f745c5960e01b81526001600160a01b038481166004830152600060248301819052925192931691632f745c5991604480820192602092909190829003018186803b158015611a0157600080fd5b505afa158015611a15573d6000803e3d6000fd5b505050506040513d6020811015611a2b57600080fd5b505190505b919050565b80611a3f81613a74565b60026000838152601a6020526040902060060154600160a01b900460ff166003811115611a6857fe5b14611aa7576040805162461bcd60e51b815260206004820152600a602482015269139bdd081a985a5b195960b21b604482015290519081900360640190fd5b6000828152601a602052604090206003015415611aff576040805162461bcd60e51b8152602060048201526011602482015270416c726561647920756e7374616b696e6760781b604482015290519081900360640190fd5b6009546000838152601a6020526040902060040154811015611b61576040805162461bcd60e51b8152602060048201526016602482015275125b98dbdb5c1b195d19481a985a5b081c195c9a5bd960521b604482015290519081900360640190fd5b6000838152601a6020526040902054600c54811015611b7f57600080fd5b6000848152601a60205260409020600601546001600160a01b03168015611bf457806001600160a01b031663a69df4b56040518163ffffffff1660e01b8152600401600060405180830381600087803b158015611bdb57600080fd5b505af1158015611bef573d6000803e3d6000fd5b505050505b6000858152601a60205260409020600a0154611c2490611c1b90849063ffffffff613afe16565b60016000613b10565b6000858152601a602052604080822060068101805460ff60a01b1916600160a01b1790556005908101549054825163f92ec5af60e01b8152600481018a90526001600160a01b039283166024820181905293519394929091169263f92ec5af9260448084019391929182900301818387803b158015611ca257600080fd5b505af1158015611cb6573d6000803e3d6000fd5b50505050505050505050565b60175481565b6007546001600160a01b031681565b80611ce181613a74565b611cec826001613bcc565b5050565b611cf8613a07565b600955565b611d05613a07565b6001600160a01b038116611d1857600080fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b60268181548110611d4757fe5b6000918252602090912001546001600160a01b0316905081565b600e5481565b601e602052600090815260409020805460019091015482565b6000818152601a6020526040812060068101548154600390920154600954611db593600160a01b90930460ff16929190613be0565b92915050565b611dc3613c17565b82611dcd81613a74565b611dda8484846000613c58565b50505050565b611de8612b4c565b611df157600080fd5b8051611cec906026906020840190615e55565b80611e0e81613a74565b611cec826000613e32565b6002546000906001600160a01b03163314611e3357600080fd5b600954601d546000908190611e46615eba565b6026546040805191840180835260208082028401019091528015611e74578160200160208202803883390190505b5060408083019190915260268054825160208083028201810190945281815292830182828015611ecd57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611eaf575b50505050506060820152600060208201526026546080820152611eee615ee9565b6026546040805191850180835260208082028401019091528015611f1c578160200160208202803883390190505b50602082015260005b888110156120eb576000611f738e8c8c85818110611f3f57fe5b9050606002016003806020026040519081016040528092919082600360200280828437600092019190915250613ee5915050565b9050856001600160a01b0316816001600160a01b03161415611f9557506120e3565b856001600160a01b0316816001600160a01b03161015611fb557506120eb565b6001600160a01b0381166000908152601b6020908152604080832054808452601a909252909120805460068201546003909201548087529091600160a01b900460ff169061200790829084908e613be0565b15612092576000838152601a60205260409020600a0154939850889361204690839061203a908d9063ffffffff613afe16565b9063ffffffff613afe16565b8651909a50156120805782866020015187604001518151811061206557fe5b6020908102919091010152604086018051600101905261208d565b61208a8785613fe8565b96505b6120de565b60028160038111156120a057fe5b14156120de578287604001518860000151815181106120bb57fe5b602090810291909101810191909152875160019081018952908801805190910190525b505050505b600101611f25565b506120f7826000613fe8565b91506121198d8b878e86604001518760000151876020015188604001516140c5565b9d9c50505050505050505050505050565b8061213481613a74565b611cec826001613e32565b6006546001600160a01b031681565b60165481565b601a60205260009081526040902080546001820154600283015460038401546004850154600586015460068701546007880154600889015460098a0154600a8b0154600b909b0154999a98999798969795966001600160a01b039586169695851695600160a01b90950460ff16948d565b601b6020526000908152604090205481565b6000818152601a602052604081206003015481906121fc576121f88361422d565b9150505b6000838152601a602052604090206009015461223190600190612225908463ffffffff613afe16565b9063ffffffff6142a916565b9392505050565b612240613a07565b60038054602b80546001600160a01b038084166001600160a01b0319928316179283905592811686841617909355602c805490931684831617909255604080516370a0823160e01b81523060048201529051611cec93909216916370a0823191602480820192602092909190829003018186803b1580156122c057600080fd5b505afa1580156122d4573d6000803e3d6000fd5b505050506040513d60208110156122ea57600080fd5b50516142be565b600c5481565b60295481565b612305613a07565b6000848152601a60205260409020600601546001600160a01b03168061232a57600080fd5b6040805163abf59fc960e01b81526001600160a01b03868116600483015285811660248301526044820185905291519183169163abf59fc99160648082019260009290919082900301818387803b15801561238457600080fd5b505af1158015612398573d6000803e3d6000fd5b505050505050505050565b60006001600160a01b03821615806124315750600654604080516370a0823160e01b81526001600160a01b038581166004830152915191909216916370a08231916024808301926020929190829003018186803b15801561240357600080fd5b505afa158015612417573d6000803e3d6000fd5b505050506040513d602081101561242d57600080fd5b5051155b1561243e57506000611a30565b60065460408051632f745c5960e01b81526001600160a01b0385811660048301526000602483018190529251601a949190911691632f745c59916044808301926020929190829003018186803b15801561249757600080fd5b505afa1580156124ab573d6000803e3d6000fd5b505050506040513d60208110156124c157600080fd5b5051815260208101919091526040016000205492915050565b6000836124e68161445d565b6124f2848460016144cb565b95945050505050565b600f5481565b60105481565b61250f613c17565b61251e85858585856000614571565b5050505050565b333014612567576040805162461bcd60e51b815260206004820152600b60248201526a1b9bdd08185b1b1bddd95960aa1b604482015290519081900360640190fd5b61257687888860006001614623565b6125848560095460016146f0565b60006125c888868686868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061487092505050565b6005546040805163e12ab1af60e01b815260048101849052602481018a90526044810189905290519293506001600160a01b039091169163e12ab1af9160648082019260009290919082900301818387803b15801561262657600080fd5b505af115801561263a573d6000803e3d6000fd5b505050505050505050505050565b60208080526000918252604091829020805460018083015460028085015460038601805489516101009682161596909602600019011692909204601f8101889004880285018801909852878452939691956001600160a01b03851695600160a01b90950460ff16949392908301828280156127045780601f106126d957610100808354040283529160200191612704565b820191906000526020600020905b8154815290600101906020018083116126e757829003601f168201915b5050505050905085565b60195460ff1681565b60125481565b6000908152601a60205260409020600601546001600160a01b031690565b60005461010090046001600160a01b031681565b6004546001600160a01b03165b90565b6000806000fd5b61276e613a07565b60255460408051602481018690526044810185905260648082018590528251808303909101815260849091019091526020810180516001600160e01b0316633064689160e11b1790526127ca916001600160a01b031690614c7d565b505050565b600654604080516331a9108f60e11b81526004810184905290516000926001600160a01b031691636352211e916024808301926020929190829003018186803b158015611a0157600080fd5b612823613c17565b611cec82338360006001614623565b6017546040805133602080830191909152818301879052825180830384018152606090920190925280519101206128719184908463ffffffff614ca516565b6128b4576040805162461bcd60e51b815260206004820152600f60248201526e2bb937b7339030b1b190383937b7b360891b604482015290519081900360640190fd5b336000908152601f60205260408120546128d590859063ffffffff6142a916565b6022549091506128eb908263ffffffff6142a916565b6022556005546040805163122b648160e01b81523360048201526024810184905290516001600160a01b039092169163122b64819160448082019260009290919082900301818387803b15801561294157600080fd5b505af1158015612955573d6000803e3d6000fd5b5050336000818152601f60205260409020879055611dda92509050826001614dfb565b6000836129848161445d565b6124f2848460006144cb565b600a5481565b61299e612b4c565b6129a757600080fd5b6001546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600180546001600160a01b0319169055565b60095481565b60185481565b612a05613a07565b612a138160095460016146f0565b50565b601f6020526000908152604090205481565b6004546001600160a01b031681565b602a5481565b600b5481565b600081612a4f8161445d565b612a5883614ee5565b6000838152601a6020526040812060090154612a7b90600163ffffffff6142a916565b6000858152601a60205260409020600160099091015592505050919050565b6000908152601a60205260409020600a015490565b601d5490565b612abd613c17565b61251e85858585856001614571565b60115481565b81612adc8161445d565b6000838152601a60205260409020600a0154612afe908363ffffffff6142a916565b6000938452601a6020526040909320600a01929092555050565b612b20613a07565b612a13816142be565b60235461010090046001600160a01b031681565b6001546001600160a01b031690565b604080517f6d617469632e6e6574776f726b2e70726f78792e6f776e6572000000000000008152905190819003601901902054336001600160a01b039091161490565b60095490565b612b9d613a07565b612a138160095460006146f0565b60275481565b80612bbb81613a74565b611cec826000613bcc565b612bce613c17565b82612bd881613a74565b611dda8484846001613c58565b6002546001600160a01b031681565b612bfc613c17565b602554604080516024810185905260448101849052306064808301919091528251808303909101815260849091019091526020810180516001600160e01b031663561ad5c960e11b179052611cec916001600160a01b031690614c7d565b60225481565b612c68613a07565b6005546016546040805163a3b1d8cb60e01b8152600481018590526024810192909252516001600160a01b039092169163a3b1d8cb9160448082019260009290919082900301818387803b158015612cbf57600080fd5b505af1158015612cd3573d6000803e3d6000fd5b505050506064811115612d17576040805162461bcd60e51b8152602060048201526007602482015266746f6f2062696760c81b604482015290519081900360640190fd5b601655565b612d24612b4c565b612d2d57600080fd5b602554604080516024810185905260448082018590528251808303909101815260649091019091526020810180516001600160e01b0316639ddbbf8560e01b179052611cec916001600160a01b031690614c7d565b81612d8c8161445d565b6000821315612de55760195460ff16612de5576040805162461bcd60e51b815260206004820152601660248201527511195b1959d85d1a5bdb881a5cc8191a5cd8589b195960521b604482015290519081900360640190fd5b6000838152601a602052604090206003015480612e0d57612e0883600080613b10565b612e50565b600954811115612e50576040805162461bcd60e51b8152602060048201526009602482015268756e7374616b696e6760b81b604482015290519081900360640190fd5b60008312612e6757612e628484614ef4565b611dda565b611dda848460001902612ad2565b612e7d613a07565b80612e8757600080fd5b600e55565b601c5490565b612e9a613c17565b6025546040516024810187815260448201879052851515606483015260806084830190815260a4830185905261251e936001600160a01b03169263a685487760e01b928a928a928a928a928a9260c40184848082843760008184015260408051601f19601f9093018316909401848103909201845252506020810180516001600160e01b03199a909a166001600160e01b03909a169990991790985250614c7d95505050505050565b612f4b613a07565b612f53614f2f565b565b60085490565b60245481565b612f69613a07565b611cec82826001614dfb565b612f7d613a07565b600c91909155600d55565b6000818152601a60205260408120600301548190612fad57612fa98361422d565b5090505b6000838152601a602052604090206001908101546122319190612225908463ffffffff613afe16565b6000612fe58484846000614f3b565b949350505050565b612ff5613a07565b306001600160a01b0316816001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561303857600080fd5b505afa15801561304c573d6000803e3d6000fd5b505050506040513d602081101561306257600080fd5b50516001600160a01b03161461307757600080fd5b6000918252601a602052604090912060060180546001600160a01b0319166001600160a01b03909216919091179055565b6000612fe58484846001614f3b565b6130bf613a07565b806130c957600080fd5b600554600b5460408051632dbe9d3160e21b8152600481018590526024810192909252516001600160a01b039092169163b6fa74c49160448082019260009290919082900301818387803b15801561312057600080fd5b505af1158015613134573d6000803e3d6000fd5b505050600b9190915550565b60145481565b60005460ff1681565b336000908152601b6020908152604080832054808452601a9092529091206006810154815460039092015460095461319493600160a01b90930460ff16929190613be0565b6131d5576040805162461bcd60e51b815260206004820152600d60248201526c3737ba103b30b634b230ba37b960991b604482015290519081900360640190fd5b6000818152601a60205260409020600601546001600160a01b03168061323b576040805162461bcd60e51b815260206004820152601660248201527511195b1959d85d1a5bdb881a5cc8191a5cd8589b195960521b604482015290519081900360640190fd5b604080516303dd464160e51b8152841515600482015290516001600160a01b03831691637ba8c82091602480830192600092919082900301818387803b15801561328457600080fd5b505af1158015613298573d6000803e3d6000fd5b50505050505050565b60216020526000908152604090205481565b806132bd81613a74565b611cec8260006150ca565b816132d281613a74565b6132db83614ee5565b602554604080516024810186905260448082018690528251808303909101815260649091019091526020810180516001600160e01b0316636e6cb15960e11b1790526127ca916001600160a01b031690614c7d565b60285481565b601c54601d5482565b613347613a07565b6000811161335457600080fd5b600554600a5460408051635071805360e11b8152600481018590526024810192909252516001600160a01b039092169163a0e300a69160448082019260009290919082900301818387803b1580156133ab57600080fd5b505af11580156133bf573d6000803e3d6000fd5b505050600a8290555060088190556133de81600463ffffffff6152a816565b60158190556009546133f59163ffffffff613afe16565b60185550565b613403612b4c565b61340c57600080fd5b6001600160a01b03811661341f57600080fd5b6002546040516001600160a01b038084169216907f211c9015fc81c0dbd45bd99f0f29fc1c143bfd53442d5ffd722bbbef7a887fe990600090a3600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000908152601a602052604090205490565b602b546001600160a01b031681565b6005546001600160a01b031681565b6134b3613a07565b6019805460ff1916911515919091179055565b6134ce612b4c565b6134d757600080fd5b612a13816152ca565b816134ea81613a74565b60006134f583615339565b600954600f54600087815260216020526040902054929350909161351e9163ffffffff613afe16565b811015613560576040805162461bcd60e51b815260206004820152600b60248201526a139bdd08185b1b1bddd95960aa1b604482015290519081900360640190fd5b6000858152601a602090815260408083206005908101549054915163b80fbce560e01b8152600481018a81526001600160a01b039283166024830181905288841660448401526080606484019081528b5160848501528b519197949095169563b80fbce5958d9589958c958f95909460a490920192918601918190849084905b838110156135f85781810151838201526020016135e0565b50505050905090810190601f1680156136255780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561364757600080fd5b505af115801561365b573d6000803e3d6000fd5b5050506000878152601a60205260409020600301541515905061368a57613681816153f2565b61368a836154fc565b6001600160a01b039081166000908152601b60209081526040808320600019905594909216808252848220889055968152601a825283812060050180546001600160a01b031916909717909655602190529320929092555050565b60235460ff161561372e576040805162461bcd60e51b815260206004820152600e60248201526d185b1c9958591e481a5b9a5d195960921b604482015290519081900360640190fd5b6023805460ff1916600117905561374481613a55565b61378e576040805162461bcd60e51b8152602060048201526016602482015275185d58dd1a5bdb881a5b5c1b081a5b98dbdc9c9958dd60521b604482015290519081900360640190fd5b602580546001600160a01b03199081166001600160a01b038481169190911790925560008054610100600160a81b031916610100878516021790556004805482168c84161790556002805482168b84161790556003805482168a84161790556006805482168984161790556005805482168884161790556007805490911691861691909117905561381e826152ca565b5050612000600855505060016009819055610376600a90815569044664c7bf6451f00000600b55670de0b6b3a7640000600c819055600d55610400600e556064600f55600760105560128290556108006015556016556019805460ff191690911790555050505050565b613890613a07565b6009546133f5908263ffffffff613afe16565b6138ab613a07565b612f53615616565b6025546001600160a01b031681565b6007821161390b576040805162461bcd60e51b815260206004820152601160248201527024b73b30b634b21036b4b3b930ba34b7b760791b604482015290519081900360640190fd5b6000838152601a6020526040808220600601548151636e7ce59160e01b81523360048201526024810185905291516001600160a01b0390911692636e7ce591926044808201939182900301818387803b15801561396757600080fd5b505af115801561397b573d6000803e3d6000fd5b5050506000838152601a6020526040808220600601548151632830728d60e21b81523360048201526024810186905291516001600160a01b03909116935063a0c1ca349260448084019391929182900301818387803b15801561328457600080fd5b600d5481565b6003546001600160a01b031681565b806139fc81613a74565b611cec8260016150ca565b60005461010090046001600160a01b03163314612f535760405162461bcd60e51b8152600401808060200182810382526026815260200180615f876026913960400191505060405180910390fd5b60006001600160a01b038216613a6d57506000611a30565b503b151590565b600654604080516331a9108f60e11b815260048101849052905133926001600160a01b031691636352211e916024808301926020929190829003018186803b158015613abf57600080fd5b505afa158015613ad3573d6000803e3d6000fd5b505050506040513d6020811015613ae957600080fd5b50516001600160a01b031614612a1357600080fd5b60008282018381101561223157600080fd5b80613baa576000831315613b3957601c54613b31908463ffffffff613afe16565b601c55613b5d565b6000831215613b5d57601c54613b5990600085900363ffffffff6142a916565b601c555b6000821315613b8157601d54613b79908363ffffffff613afe16565b601d55613ba5565b6000821215613ba557601d54613ba190600084900363ffffffff6142a916565b601d555b6127ca565b6000818152601e60205260409020805484018155600101805483019055505050565b613bd582614ee5565b611cec823383615625565b60008084118015613bf85750821580613bf857508183115b80156124f257506001856003811115613c0d57fe5b1495945050505050565b60005460ff1615612f53576040805162461bcd60e51b81526020600482015260066024820152651b1bd8dad95960d21b604482015290519081900360640190fd5b6000848152601a602052604090206003015415613cab576040805162461bcd60e51b815260206004820152600c60248201526b4e6f2072657374616b696e6760a01b604482015290519081900360640190fd5b8215613cbd57613cbd333085846156fc565b613cc684614ee5565b8115613d0d576000848152601a60205260409020600190810154613cf6919061222590869063ffffffff613afe16565b6000858152601a6020526040902060019081015592505b601154600090613d23908563ffffffff613afe16565b60118190556000868152601a6020526040902054909150613d4a908563ffffffff613afe16565b6000868152601a6020526040812091909155613d6890859080613b10565b6005546040805163532e19a960e01b81526004810188905290516001600160a01b039092169163532e19a99160248082019260009290919082900301818387803b158015613db557600080fd5b505af1158015613dc9573d6000803e3d6000fd5b50506005546000888152601a6020526040808220548151631585a9f360e21b8152600481018c905260248101919091526044810187905290516001600160a01b039093169450635616a7cc93506064808201939182900301818387803b15801561238457600080fd5b600082815260208052604090205415613e4a57600080fd5b6000828152601a602052604090206006810154600290910154600160a01b90910460ff169015801590613e8c57506000838152601a6020526040902060030154155b8015613eb857506001816003811115613ea157fe5b1480613eb857506002816003811115613eb657fe5b145b613ec157600080fd5b600954600090613ed890600163ffffffff613afe16565b9050611dda8482856146f0565b805160208201516040830151600092919060ff167f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0821115613f2d5760009350505050611db5565b601b8160ff161015613f3d57601b015b8060ff16601b14158015613f5557508060ff16601c14155b15613f665760009350505050611db5565b60408051600080825260208083018085528a905260ff85168385015260608301879052608083018690529251909260019260a080820193601f1981019281900390910190855afa158015613fbe573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116613fde57600080fd5b9695505050505050565b613ff0615eba565b826080015183602001511080156140345750816001600160a01b0316836060015184602001518151811061402057fe5b60200260200101516001600160a01b031614155b156140b557601b6000846060015185602001518151811061405157fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002054836040015184600001518151811061408e57fe5b60209081029190910181019190915283516001908101855290840180519091019052613ff0565b5050602081018051600101905290565b601c546000906140f2600161203a60036140e685600263ffffffff6157fd16565b9063ffffffff6152a816565b88101561413c576040805162461bcd60e51b8152602060048201526013602482015272322f332b31206e6f6e2d6d616a6f726974792160681b604482015290519081900360640190fd5b60006141498b8a84615824565b9050600061416760646140e6601654856157fd90919063ffffffff16565b6001600160a01b038c166000908152601b6020908152604080832054808452601a909252909120600181015492935090916141a8908463ffffffff613afe16565b600182015560178b905560006141f56141e68e6140e66a084595161401484a0000006141da8a8a63ffffffff6142a916565b9063ffffffff6157fd16565b6024549063ffffffff613afe16565b90506142028b8b83615978565b6024819055614212898983615978565b61421a6159ac565b50929d9c50505050505050505050505050565b6000818152601a602052604081208054600a90910154829190829061425990839063ffffffff613afe16565b6000868152601a60205260409020600b0154602454919250900361429d86846142976a084595161401484a0000006140e6868863ffffffff6157fd16565b85615a21565b94509450505050915091565b6000828211156142b857600080fd5b50900390565b602b54604080516370a0823160e01b8152306004820152905183926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561430857600080fd5b505afa15801561431c573d6000803e3d6000fd5b505050506040513d602081101561433257600080fd5b50511015614377576040805162461bcd60e51b815260206004820152600d60248201526c4c61636b696e67204d4154494360981b604482015290519081900360640190fd5b602b54602c546040805163095ea7b360e01b81526001600160a01b039283166004820152602481018590529051919092169163095ea7b39160448083019260209291908290030181600087803b1580156143d057600080fd5b505af11580156143e4573d6000803e3d6000fd5b505050506040513d60208110156143fa57600080fd5b5050602c54604080516308a960c160e31b81526004810184905290516001600160a01b039092169163454b06089160248082019260009290919082900301818387803b15801561444957600080fd5b505af115801561251e573d6000803e3d6000fd5b6000818152601a60205260409020600601546001600160a01b03163314612a13576040805162461bcd60e51b815260206004820152601860248201527f496e76616c696420636f6e747261637420616464726573730000000000000000604482015290519081900360640190fd5b6000806144d783615ab5565b604080516323b872dd60e01b81526001600160a01b038781166004830152306024830152604482018990529151929350600092918416916323b872dd9160648082019260209290919082900301818787803b15801561453557600080fd5b505af1158015614549573d6000803e3d6000fd5b505050506040513d602081101561455f57600080fd5b50519050836124f2576124f2866142be565b60105461457c612aaf565b106145be576040805162461bcd60e51b815260206004820152600d60248201526c6e6f206d6f726520736c6f747360981b604482015290519081900360640190fd5b600c5485101561460a576040805162461bcd60e51b81526020600482015260126024820152711b9bdd08195b9bdd59da0819195c1bdcda5d60721b604482015290519081900360640190fd5b6146178633868885614623565b61329886868585614870565b600d5483101561466a576040805162461bcd60e51b815260206004820152600d60248201526c199959481d1bdbc81cdb585b1b609a1b604482015290519081900360640190fd5b614685843061467f868663ffffffff613afe16565b846156fc565b602254614698908463ffffffff613afe16565b6022556005546040805163a449d79560e01b81526001600160a01b038881166004830152602482018790529151919092169163a449d79591604480830192600092919082900301818387803b15801561238457600080fd5b6000838152601a60205260409020600301541561470c57600080fd5b61471583614ee5565b6000838152601a60205260408120549061472e856127cf565b6000868152601a6020526040902060038101869055600a810154600690910154919250906001600160a01b031680156147b557806001600160a01b031663f83d08ba6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561479c57600080fd5b505af11580156147b0573d6000803e3d6000fd5b505050505b6000878152601a60205260409020600501546147d9906001600160a01b03166153f2565b6147e4878487615625565b60006009548711156147f657866147f9565b60005b905061480d83860160000360001983613b10565b60055460408051635e04d48360e01b81526001600160a01b038781166004830152602482018c9052604482018b90526064820189905291519190921691635e04d48391608480830192600092919082900301818387803b15801561262657600080fd5b60008061487c83615339565b600954601254600554601154939450919290916001600160a01b0316906000906148ac908a63ffffffff613afe16565b905080601181905550604051806101a001604052808a8152602001600181526020018581526020016000815260200160008152602001866001600160a01b03168152602001896148fd576000614989565b600754600480546040805163d4ad267360e01b81529283018990526001600160a01b03888116602485015291821660448401525192169163d4ad2673916064808201926020929091908290030181600087803b15801561495c57600080fd5b505af1158015614970573d6000803e3d6000fd5b505050506040513d602081101561498657600080fd5b50515b6001600160a01b031681526020016001815260006020808301829052604080840183905260016060808601829052608080870186905260245460a0978801528a8652601a855294839020875181559387015191840191909155908501516002830155840151600380830191909155918401516004820155918301516005830180546001600160a01b039283166001600160a01b03199182161790915560c08501516006850180549190931691161780825560e08501519260ff60a01b1990911690600160a01b908490811115614a5b57fe5b0217905550610100820151600782015561012082015160088201556101408201516009820155610160820151600a82015561018090910151600b9091015560008381526021602052604080822086905560065481516340c10f1960e01b81526001600160a01b038e8116600483015260248201889052925192909116926340c10f199260448084019382900301818387803b158015614af957600080fd5b505af1158015614b0d573d6000803e3d6000fd5b5050506001600160a01b0386166000908152601b60205260408120859055614b3a91508a90600190613b10565b836020600085815260200190815260200160002060010181905550816001600160a01b03166333a8383c868986888e876040518763ffffffff1660e01b815260040180876001600160a01b03166001600160a01b0316815260200180602001868152602001858152602001848152602001838152602001828103825287818151815260200191508051906020019080838360005b83811015614be6578181015183820152602001614bce565b50505050905090810190601f168015614c135780820380516001836020036101000a031916815260200191505b50975050505050505050600060405180830381600087803b158015614c3757600080fd5b505af1158015614c4b573d6000803e3d6000fd5b50505050614c63600184613afe90919063ffffffff16565b601255614c6f856154fc565b509098975050505050505050565b600080825160208401856127105a03f43d604051816000823e828015614ca1578282f35b8282fd5b60006020825181614cb257fe5b0615614cfc576040805162461bcd60e51b8152602060048201526014602482015273092dcecc2d8d2c840e0e4dedecc40d8cadccee8d60631b604482015290519081900360640190fd5b60006020835181614d0957fe5b0490508060020a8510614d5b576040805162461bcd60e51b81526020600482015260156024820152744c65616620696e64657820697320746f6f2062696760581b604482015290519081900360640190fd5b60008660205b85518111614ded5785810151925060028806614dad5781836040516020018083815260200182815260200192505050604051602081830303815290604052805190602001209150614ddf565b828260405160200180838152602001828152602001925050506040516020818303038152906040528051906020012091505b600288049750602001614d61565b509094149695505050505050565b80614e0957614e0982615ade565b6000614e1482615ab5565b9050806001600160a01b031663a9059cbb85856040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015614e7657600080fd5b505af1158015614e8a573d6000803e3d6000fd5b505050506040513d6020811015614ea057600080fd5b5051611dda576040805162461bcd60e51b815260206004820152600f60248201526e1d1c985b9cd9995c8819985a5b1959608a1b604482015290519081900360640190fd5b612a1381602454602454615c67565b6000828152601a60205260409020600a0154614f16908263ffffffff613afe16565b6000928352601a6020526040909220600a019190915550565b6000805460ff19169055565b6000848152601a60205260408120600601546001600160a01b0316331480614fda57506004805460408051631ab0168360e31b8152905133936001600160a01b039093169263d580b41892808201926020929091829003018186803b158015614fa357600080fd5b505afa158015614fb7573d6000803e3d6000fd5b505050506040513d6020811015614fcd57600080fd5b50516001600160a01b0316145b615019576040805162461bcd60e51b815260206004820152600b60248201526a1b9bdd08185b1b1bddd95960aa1b604482015290519081900360640190fd5b816150275761502784615ade565b600061503283615ab5565b9050806001600160a01b031663a9059cbb85876040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561509457600080fd5b505af11580156150a8573d6000803e3d6000fd5b505050506040513d60208110156150be57600080fd5b50519695505050505050565b6000828152601a6020526040902060030154801580159061510057506009546008546150fd90839063ffffffff613afe16565b11155b8015615133575060036000848152601a6020526040902060060154600160a01b900460ff16600381111561513057fe5b14155b61513c57600080fd5b6000838152601a6020526040812054601154909190615161908363ffffffff6142a916565b60118190559050615173853386615625565b60065460408051630852cd8d60e31b81526004810188905290516001600160a01b03909216916342966c689160248082019260009290919082900301818387803b1580156151c057600080fd5b505af11580156151d4573d6000803e3d6000fd5b5050506000868152601a6020526040812081815560048101919091556005810180546001600160a01b03191690556000197f584f46c60af19681376031579adb04a2416e54ee5505351c2a8435e3766026ea55600601805460ff60a01b1916600360a01b17905550615247338386614dfb565b6005546040805163ae2e26b160e01b815233600482015260248101889052604481018590526064810184905290516001600160a01b039092169163ae2e26b19160848082019260009290919082900301818387803b15801561238457600080fd5b60008082116152b657600080fd5b60008284816152c157fe5b04949350505050565b6001600160a01b0381166152dd57600080fd5b6001546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000815160401461537b576040805162461bcd60e51b81526020600482015260076024820152663737ba10383ab160c91b604482015290519081900360640190fd5b815160208301206001600160a01b038116158015906153b057506001600160a01b0381166000908152601b6020526040902054155b611db5576040805162461bcd60e51b815260206004820152600e60248201526d24b73b30b634b21039b4b3b732b960911b604482015290519081900360640190fd5b6026805490600090600019830183811061540857fe5b600091825260209091200154602680546001600160a01b03909216925090600019840190811061543457fe5b600091825260209091200180546001600160a01b031916905560001982015b80156154eb57836001600160a01b0316826001600160a01b03161415615478576154eb565b6026600182038154811061548857fe5b9060005260206000200160009054906101000a90046001600160a01b031682602660018403815481106154b757fe5b600091825260209091200180546001600160a01b0319166001600160a01b0392909216919091179055915060001901615453565b506000198201611dda602682615f0a565b6026805460018101825560008290527f744a2cf8fd7008e3d53b67916e73460df9fa5214e3ef23dd4259ca09493a35940180546001600160a01b0319166001600160a01b0384161790555460001901805b80156155ce5760006026600183038154811061556557fe5b6000918252602090912001546001600160a01b039081169150841681101561558d57506155ce565b806026838154811061559b57fe5b600091825260209091200180546001600160a01b0319166001600160a01b0392909216919091179055506000190161554d565b8181146127ca5782602682815481106155e357fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550505050565b6000805460ff19166001179055565b6000838152601a602052604081206001908101546156489163ffffffff6142a916565b60145490915061565e908263ffffffff613afe16565b6014556000848152601a60205260409020600190810155615680838284614dfb565b60055460145460408051635b42d93560e11b815260048101889052602481018590526044810192909252516001600160a01b039092169163b685b26a9160648082019260009290919082900301818387803b1580156156de57600080fd5b505af11580156156f2573d6000803e3d6000fd5b5050505050505050565b600061570782615ab5565b604080516323b872dd60e01b81526001600160a01b0388811660048301528781166024830152604482018790529151929350908316916323b872dd916064808201926020929091908290030181600087803b15801561576557600080fd5b505af1158015615779573d6000803e3d6000fd5b505050506040513d602081101561578f57600080fd5b50516157d9576040805162461bcd60e51b81526020600482015260146024820152731d1c985b9cd9995c88199c9bdb4819985a5b195960621b604482015290519081900360640190fd5b811580156157ef57506001600160a01b03841630145b1561251e5761251e836142be565b60008261580c57506000611db5565b8282028284828161581957fe5b041461223157600080fd5b600e54600b54600091908261584483888161583b57fe5b04602954615d37565b905060008111801561585857506027548114155b1561589957602754156158935760006064602a5484028161587557fe5b04905081602754111561588b5791820191615891565b80830392505b505b60278190555b600083881115615932576028546158e16158d160646140e66158c460026000198901890204866157fd565b889063ffffffff6157fd16565b612225868663ffffffff6157fd16565b91506159036158f6848763ffffffff6157fd16565b8a9063ffffffff6142a916565b985061592e61592160646140e6846141da898963ffffffff6157fd16565b859063ffffffff6142a916565b9350505b615956615949856140e68b8763ffffffff6157fd16565b829063ffffffff613afe16565b905061596c866140e6838a63ffffffff6157fd16565b98975050505050505050565b60245460005b8381101561251e576159a485828151811061599557fe5b60200260200101518385615c67565b60010161597e565b60095460006159c282600163ffffffff613afe16565b90506159cc615f2e565b506000818152601e60209081526040808320815180830190925280548083526001909101549282018390529092615a039290613b10565b506000918252601e6020526040822082815560010191909155600955565b60008082615a3457506000905080615aac565b6000615a4a846140e6888863ffffffff6157fd16565b6000888152601a60205260409020600701549091508015615a9157615a8e615a8160646140e6846141da8b8863ffffffff6142a916565b839063ffffffff613afe16565b91505b6000615aa3878463ffffffff6142a916565b92945091925050505b94509492505050565b600081615acd57602b546001600160a01b0316611db5565b50506003546001600160a01b031690565b600354604080516370a0823160e01b8152306004820152905183926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015615b2857600080fd5b505afa158015615b3c573d6000803e3d6000fd5b505050506040513d6020811015615b5257600080fd5b50511015615b95576040805162461bcd60e51b815260206004820152600b60248201526a131858dada5b99c81413d360aa1b604482015290519081900360640190fd5b600354602c546040805163095ea7b360e01b81526001600160a01b039283166004820152602481018590529051919092169163095ea7b39160448083019260209291908290030181600087803b158015615bee57600080fd5b505af1158015615c02573d6000803e3d6000fd5b505050506040513d6020811015615c1857600080fd5b5050602c546040805163efeff0c160e01b81526004810184905290516001600160a01b039092169163efeff0c19160248082019260009290919082900301818387803b15801561444957600080fd5b6000838152601a60205260409020600301548015801590615c8a57508060095410155b15615c9557506127ca565b6000848152601a60205260409020600b015483811015615d14576000858152601a602052604090208054600a909101548015615cfc576000615cdd838363ffffffff613afe16565b9050615cf6888484615cf18c868d8b615d4d565b615d71565b50615d11565b615d1187615d0c89858a88615d4d565b615e17565b50505b8083111561251e576000858152601a60205260409020600b018390555050505050565b6000818310615d465781612231565b5090919050565b6000818303613fde6a084595161401484a0000006140e6838863ffffffff6157fd16565b6000615d83838563ffffffff613afe16565b9050600080615d9487878686615a21565b90925090508015615dd4576000878152601a6020526040902060090154615dc1908263ffffffff613afe16565b6000888152601a60205260409020600901555b8115613298576000878152601a6020526040902060010154615dfc908363ffffffff613afe16565b6000888152601a602052604090206001015550505050505050565b8015611cec576000828152601a6020526040902060010154615e3f908263ffffffff613afe16565b6000838152601a60205260409020600101555050565b828054828255906000526020600020908101928215615eaa579160200282015b82811115615eaa57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190615e75565b50615eb6929150615f48565b5090565b6040518060a0016040528060008152602001600081526020016060815260200160608152602001600081525090565b60405180606001604052806000815260200160608152602001600081525090565b8154818355818111156127ca576000838152602090206127ca918101908301615f6c565b604051806040016040528060008152602001600081525090565b61275c91905b80821115615eb65780546001600160a01b0319168155600101615f4e565b61275c91905b80821115615eb65760008155600101615f7256fe4f6e6c7920676f7665726e616e636520636f6e747261637420697320617574686f72697a6564a265627a7a7231582086111c87fcb92b182e00f7d639045350b57ef095d045842d78e5da7c1ca3156d64736f6c63430005110032", - "nonce": "0x8", - "chainId": "0x1" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": null, - "transactionType": "CREATE", - "contractName": null, - "contractAddress": "0x053FA9b934b83E1E0ffc7e98a41aAdc3640bB462", - "function": null, - "arguments": null, - "transaction": { - "from": "0x32bdc6a4e8c654df65503cbb0edc82b4ce9158e6", - "gas": "0x3a48c9", - "value": "0x0", - "input": "0x60806040526003805460ff60a81b191690553480156200001e57600080fd5b5060038054610100338102610100600160a81b0319909216919091179182905560405191046001600160a01b0316906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3620000886001600160e01b036200008e16565b620000a3565b6003805460ff60a81b1916600160a81b179055565b6133b980620000b36000396000f3fe608060405234801561001057600080fd5b50600436106103c55760003560e01c80638759c234116101ff578063b6658d071161011a578063e0db556b116100ad578063e97fddc21161007c578063e97fddc2146109aa578063eaf43bb5146109c7578063f2fde38b14610a05578063f83d08ba14610a2b576103c5565b8063e0db556b14610936578063e4457a8a1461093e578063e4cd1aec14610961578063e570b78b14610987576103c5565b8063c83ec04d116100e9578063c83ec04d146108d5578063cf309012146108f8578063dd62ed3e14610900578063df5cf7231461092e576103c5565b8063b6658d071461089a578063b89b63c1146108a2578063bfb18f29146108c5578063c7b8981c146108cd576103c5565b80639b2cb5d811610192578063a9059cbb11610161578063a9059cbb146107d8578063abf59fc914610804578063b4988fd01461083a578063b60c76fa1461086e576103c5565b80639b2cb5d814610770578063a0c1ca3414610778578063a457c2d7146107a4578063a69df4b5146107d0576103c5565b80638d16a14a116101ce5780638d16a14a146107505780638da5cb5b146107585780638f32d59b146107605780639ad5f5a414610768576103c5565b80638759c2341461071b578063883b455f146107385780638ccdd289146107405780638d086da414610748576103c5565b80634f91440d116102ef5780636ab1507111610282578063715018a611610251578063715018a6146106c05780637542ff95146106c8578063795be587146106d05780637ba8c820146106fc576103c5565b80636ab15071146106225780636cbb6050146106455780636e7ce5911461066e57806370a082311461069a576103c5565b80635f0c80cc116102be5780635f0c80cc146105a35780636035083f146105ab578063653ec134146105d6578063676e5550146105fc576103c5565b80634f91440d1461056c5780635adc6dde146105745780635c42c733146105935780635c5f7dae1461059b576103c5565b806323b872dd116103675780633a09bf44116103365780633a09bf44146105305780633ba0b9a9146105385780633d94eb0514610540578063446a2ec814610564576103c5565b806323b872dd146104a05780633046c204146104d657806339509351146104fc57806339c31e9314610528576103c5565b80631bf494a7116103a35780631bf494a7146104495780631e7ff8f614610451578063232e5415146104905780632344067914610498576103c5565b8063029d3040146103ca578063095ea7b3146103ef57806318160ddd1461042f575b600080fd5b6103ed600480360360408110156103e057600080fd5b5080359060200135610a33565b005b61041b6004803603604081101561040557600080fd5b506001600160a01b038135169060200135610a43565b604080519115158252519081900360200190f35b610437610a5a565b60408051918252519081900360200190f35b610437610a61565b6104776004803603602081101561046757600080fd5b50356001600160a01b0316610aed565b6040805192835260208301919091528051918290030190f35b6103ed610b4d565b610437610b59565b61041b600480360360608110156104b657600080fd5b506001600160a01b03813581169160208101359091169060400135610b5f565b610437600480360360208110156104ec57600080fd5b50356001600160a01b0316610bb6565b61041b6004803603604081101561051257600080fd5b506001600160a01b038135169060200135610bc8565b610437610c04565b610437610c0a565b610437610c10565b610548610ccd565b604080516001600160a01b039092168252519081900360200190f35b610437610cdc565b610477610ce2565b6104776004803603602081101561058a57600080fd5b50351515610cf7565b610437610ff0565b610437610ff6565b610437610ffc565b6103ed600480360360608110156105c157600080fd5b50803590602081013590604001351515611002565b610477600480360360208110156105ec57600080fd5b50356001600160a01b03166111fd565b6104376004803603602081101561061257600080fd5b50356001600160a01b0316611216565b6104376004803603604081101561063857600080fd5b5080359060200135611229565b6104376004803603606081101561065b57600080fd5b508035906020810135906040013561123e565b6103ed6004803603604081101561068457600080fd5b506001600160a01b038135169060200135611292565b610437600480360360208110156106b057600080fd5b50356001600160a01b031661151e565b6103ed611539565b61054861159a565b610477600480360360408110156106e657600080fd5b506001600160a01b0381351690602001356115a9565b6103ed6004803603602081101561071257600080fd5b503515156115cd565b6103ed6004803603602081101561073157600080fd5b50356115f1565b6105486115ff565b61043761160e565b610437611614565b6103ed61161a565b610548611624565b61041b611638565b61047761164e565b61043761165b565b6103ed6004803603604081101561078e57600080fd5b506001600160a01b038135169060200135611661565b61041b600480360360408110156107ba57600080fd5b506001600160a01b03813516906020013561168f565b6103ed6116cb565b61041b600480360360408110156107ee57600080fd5b506001600160a01b0381351690602001356116e4565b6103ed6004803603606081101561081a57600080fd5b506001600160a01b038135811691602081013590911690604001356116f2565b6103ed6004803603606081101561085057600080fd5b508035906001600160a01b0360208201358116916040013516611819565b61041b6004803603604081101561088457600080fd5b506001600160a01b0381351690602001356118e1565b6105486118ef565b6103ed600480360360408110156108b857600080fd5b50803590602001356118fe565b61043761190a565b6103ed611951565b6103ed600480360360408110156108eb57600080fd5b508035906020013561195b565b61041b611967565b6104376004803603604081101561091657600080fd5b506001600160a01b0381358116916020013516611970565b61041b61199b565b6103ed6119a4565b6104376004803603604081101561095457600080fd5b50803590602001356119ae565b6104376004803603602081101561097757600080fd5b50356001600160a01b03166119bc565b6103ed6004803603604081101561099d57600080fd5b50803590602001356119ce565b6103ed600480360360208110156109c057600080fd5b50356119da565b610437600480360360c08110156109dd57600080fd5b5080359060208101359060408101359060ff6060820135169060808101359060a001356119e5565b6103ed60048036036020811015610a1b57600080fd5b50356001600160a01b0316611bce565b6103ed611be8565b610a3f82826000611c01565b5050565b6000610a50338484611db1565b5060015b92915050565b6002545b90565b6005546006546040805163072c21ef60e31b8152600481019290925251600092610ae8926001600160a01b03909116916339610f7891602480820192602092909190829003018186803b158015610ab757600080fd5b505afa158015610acb573d6000803e3d6000fd5b505050506040513d6020811015610ae157600080fd5b5051611de9565b905090565b6000806000610afb8461151e565b90506000610b07610c10565b905081610b1b57600093509150610b489050565b610b42610b26611e40565b610b36838563ffffffff611e6716565b9063ffffffff611e8e16565b93509150505b915091565b610b576001611eb0565b565b60095481565b6000610b6c848484611f7d565b6001600160a01b038416600090815260016020908152604080832033808552925290912054610bac918691610ba7908663ffffffff61204816565b611db1565b5060019392505050565b60146020526000908152604090205481565b3360008181526001602090815260408083206001600160a01b03871684529091528120549091610a50918590610ba7908663ffffffff61205d16565b60075481565b600d5481565b600080610c1b610a5a565b90506000610c27611e40565b90508115610cc45760055460065460408051637f4b432360e01b8152600481019290925251610cbf928592610b369286926001600160a01b031691637f4b4323916024808301926020929190829003018186803b158015610c8757600080fd5b505afa158015610c9b573d6000803e3d6000fd5b505050506040513d6020811015610cb157600080fd5b50519063ffffffff611e6716565b610cc6565b805b9250505090565b6004546001600160a01b031681565b600c5481565b600080610cef6000610cf7565b915091509091565b6000803381610d058261206f565b90506000600a54821015610d60576040805162461bcd60e51b815260206004820152601c60248201527f546f6f20736d616c6c207265776172647320746f2072657374616b6500000000604482015290519081900360640190fd5b8115610b4257610d728260008561211d565b905080821115610f605785610e13576005546006546040805163bc8756a960e01b8152600481019290925283850360248301526001600160a01b038681166044840152905192169163bc8756a9916064808201926020929091908290030181600087803b158015610de257600080fd5b505af1158015610df6573d6000803e3d6000fd5b505050506040513d6020811015610e0c57600080fd5b5051610ea1565b6005546006546040805163c7f067cb60e01b8152600481019290925283850360248301526001600160a01b038681166044840152905192169163c7f067cb916064808201926020929091908290030181600087803b158015610e7457600080fd5b505af1158015610e88573d6000803e3d6000fd5b505050506040513d6020811015610e9e57600080fd5b50515b610ee8576040805162461bcd60e51b8152602060048201526013602482015272496e737566666963656e74207265776172647360681b604482015290519081900360640190fd5b600480546006546040805163b7721d2d60e01b8152938401919091526001600160a01b0386811660248501528486036044850152905191169163b7721d2d91606480830192600092919082900301818387803b158015610f4757600080fd5b505af1158015610f5b573d6000803e3d6000fd5b505050505b6000610f6b84610aed565b506004805460065460408051637f88a95760e01b8152938401919091526001600160a01b0388811660248501526044840185905290519394501691637f88a9579160648082019260009290919082900301818387803b158015610fcd57600080fd5b505af1158015610fe1573d6000803e3d6000fd5b50505050509350915050915091565b600f5481565b60065481565b600b5481565b6000806110108585856123dc565b336000908152601460205260408120549294509092509061103890600163ffffffff61205d16565b905061104261336a565b6040518060400160405280848152602001600560009054906101000a90046001600160a01b03166001600160a01b031663900cf0cf6040518163ffffffff1660e01b815260040160206040518083038186803b1580156110a157600080fd5b505afa1580156110b5573d6000803e3d6000fd5b505050506040513d60208110156110cb57600080fd5b50519052336000818152601560209081526040808320878452825280832085518155858301516001909101559282526014905220839055905061110c6125a8565b60065460408051632a9b5b4160e11b81526004810192909252336024830152604482018a90526064820187905260848201859052516001600160a01b039290921691635536b6829160a48082019260009290919082900301818387803b15801561117557600080fd5b505af1158015611189573d6000803e3d6000fd5b5050600480546006546040805163532e19a960e01b815293840191909152516001600160a01b03909116935063532e19a99250602480830192600092919082900301818387803b1580156111dc57600080fd5b505af11580156111f0573d6000803e3d6000fd5b5050505050505050505050565b6012602052600090815260409020805460019091015482565b6000610a5482611224610a61565b6126e5565b600061123783836000612766565b9392505050565b6000611248611638565b61125157600080fd5b6040805162461bcd60e51b815260206004820152601160248201527014db185cda1a5b99c8191a5cd8589b1959607a1b604482015290519081900360640190fd5b61129a611638565b6112a357600080fd5b6112ae8260016128e0565b506000806112bb84610aed565b9150915082821015611309576040805162461bcd60e51b815260206004820152601260248201527109ad2cee4c2e8d2dcce40e8dede40daeac6d60731b604482015290519081900360640190fd5b6000611313611e40565b9050600061132b83610b36878563ffffffff611e6716565b90506113378682612adc565b60055460065460408051629ff11560e81b815260048101929092526000888103602484015290516001600160a01b0390931692639ff1150092604480820193929182900301818387803b15801561138d57600080fd5b505af11580156113a1573d6000803e3d6000fd5b5050600d546113b9925090508663ffffffff61204816565b600d55600480546006546040805163f1382b5360e01b8152938401919091526001600160a01b0389811660248501526044840189905260648401859052905191169163f1382b5391608480830192600092919082900301818387803b15801561142157600080fd5b505af1158015611435573d6000803e3d6000fd5b5050600480546006546040805163532e19a960e01b815293840191909152516001600160a01b03909116935063532e19a99250602480830192600092919082900301818387803b15801561148857600080fd5b505af115801561149c573d6000803e3d6000fd5b5050600480546006546040805163302df4df60e11b8152938401919091526001600160a01b038b81166024850152604484018b905290519116935063605be9be9250606480830192600092919082900301818387803b1580156114fe57600080fd5b505af1158015611512573d6000803e3d6000fd5b50505050505050505050565b6001600160a01b031660009081526020819052604090205490565b611541611638565b61154a57600080fd5b60035460405160009161010090046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a360038054610100600160a81b0319169055565b6005546001600160a01b031681565b60156020908152600092835260408084209091529082529020805460019091015482565b6115d5611638565b6115de57600080fd5b600e805460ff1916911515919091179055565b6115fc816001612b83565b50565b6016546001600160a01b031681565b60085481565b60105481565b610b576000611eb0565b60035461010090046001600160a01b031690565b60035461010090046001600160a01b0316331490565b600080610cef6001610cf7565b600a5481565b611669611638565b61167257600080fd5b61167d8260016128e0565b5061168a8160008461211d565b505050565b3360008181526001602090815260408083206001600160a01b03871684529091528120549091610a50918590610ba7908663ffffffff61204816565b6116d3611638565b6116dc57600080fd5b610b57612c73565b6000610a5083836000612c7f565b6116fa611638565b61170357600080fd5b6001600160a01b03831661174d576040516001600160a01b0383169082156108fc029083906000818181858888f19350505050158015611747573d6000803e3d6000fd5b5061168a565b826001600160a01b031663a9059cbb83836040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b1580156117ad57600080fd5b505af11580156117c1573d6000803e3d6000fd5b505050506040513d60208110156117d757600080fd5b505161168a576040805162461bcd60e51b815260206004820152600c60248201526b111c985a5b8819985a5b195960a21b604482015290519081900360640190fd5b600354600160a81b900460ff1615611869576040805162461bcd60e51b815260206004820152600e60248201526d185b1c9958591e481a5b9a5d195960921b604482015290519081900360640190fd5b6003805460ff60a81b1916600160a81b1790556006839055600480546001600160a01b038085166001600160a01b03199283161790925560058054928416929091169190911790556118ba81612d0d565b6118c26125a8565b5050670de0b6b3a7640000600a555050600e805460ff19166001179055565b6000610a5083836001612c7f565b6017546001600160a01b031681565b610a3f82826001611c01565b600080611915611e40565b905060086006541015611929579050610a5e565b601054801561194b57610cbf81610b3684600f54611e6790919063ffffffff16565b50919050565b610b576000612d87565b610a3f82826000611002565b60035460ff1681565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b600e5460ff1681565b610b576001612d87565b600061123783836001612766565b60136020526000908152604090205481565b610a3f82826001611002565b6115fc816000612b83565b6000806119f0612dec565b60408051623f675f60e91b815233600482015290519192506000916001600160a01b03841691637ecebe00916024808301926020929190829003018186803b158015611a3b57600080fd5b505afa158015611a4f573d6000803e3d6000fd5b505050506040513d6020811015611a6557600080fd5b50516005546040805163d505accf60e01b81523360048201526001600160a01b039283166024820152604481018d9052606481018b905260ff8a16608482015260a4810189905260c4810188905290519293509084169163d505accf9160e48082019260009290919082900301818387803b158015611ae357600080fd5b505af1158015611af7573d6000803e3d6000fd5b505060408051623f675f60e91b815233600482015290516001850193506001600160a01b0386169250637ecebe0091602480820192602092909190829003018186803b158015611b4657600080fd5b505afa158015611b5a573d6000803e3d6000fd5b505050506040513d6020811015611b7057600080fd5b505114611bb5576040805162461bcd60e51b815260206004820152600e60248201526d125b9d985b1a59081c195c9b5a5d60921b604482015290519081900360640190fd5b611bc189896001612766565b9998505050505050505050565b611bd6611638565b611bdf57600080fd5b6115fc81612d0d565b611bf0611638565b611bf957600080fd5b610b57612f66565b600080611c0f8585856123dc565b91509150611c1b61336a565b50336000908152601260209081526040918290208251808401909352805480845260019091015491830191909152611c59908363ffffffff61205d16565b81526005546040805163900cf0cf60e01b815290516001600160a01b039092169163900cf0cf91600480820192602092909190829003018186803b158015611ca057600080fd5b505afa158015611cb4573d6000803e3d6000fd5b505050506040513d6020811015611cca57600080fd5b505160208281019182523360008181526012909252604080832085518155935160019094019390935560048054600654855163f1382b5360e01b8152928301526024820192909252604481018a90526064810187905292516001600160a01b0390911692839263f1382b539260848084019382900301818387803b158015611d5157600080fd5b505af1158015611d65573d6000803e3d6000fd5b50505050806001600160a01b031663532e19a96006546040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156111dc57600080fd5b6040805162461bcd60e51b8152602060048201526008602482015267191a5cd8589b195960c21b604482015290519081900360640190fd5b600c546000908215610a54576000611dff610a5a565b90508015611e3957611e36611e2982610b36876a084595161401484a00000063ffffffff611e6716565b839063ffffffff61205d16565b91505b5092915050565b600060086006541015611e5557506064610a5e565b506c01431e0fae6d7217caa000000090565b600082611e7657506000610a54565b82820282848281611e8357fe5b041461123757600080fd5b6000808211611e9c57600080fd5b6000828481611ea757fe5b04949350505050565b611eb861336a565b50336000908152601260209081526040808320815180830190925280548252600101549181019190915290611eed8284612f75565b3360008181526012602052604080822082815560010182905560048054600654835163302df4df60e11b81529283015260248201949094526044810185905290519394506001600160a01b039092169263605be9be92606480820193929182900301818387803b158015611f6057600080fd5b505af1158015611f74573d6000803e3d6000fd5b50505050505050565b6001600160a01b038216611f9057600080fd5b6001600160a01b038316600090815260208190526040902054611fb9908263ffffffff61204816565b6001600160a01b038085166000908152602081905260408082209390935590841681522054611fee908263ffffffff61205d16565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b60008282111561205757600080fd5b50900390565b60008282018381101561123757600080fd5b6000806120e6600560009054906101000a90046001600160a01b03166001600160a01b0316637ed4b27c6006546040518263ffffffff1660e01b815260040180828152602001915050602060405180830381600087803b1580156120d257600080fd5b505af1158015610acb573d6000803e3d6000fd5b905060006120f484836126e5565b600c8390556001600160a01b038516600090815260136020526040902092909255509050919050565b6000612127613281565b600e5460ff16612177576040805162461bcd60e51b815260206004820152601660248201527511195b1959d85d1a5bdb881a5cc8191a5cd8589b195960521b604482015290519081900360640190fd5b6000612181610c10565b9050600061218d611e40565b905060006121a583610b36898563ffffffff611e6716565b9050858110156121f0576040805162461bcd60e51b8152602060048201526011602482015270546f6f206d75636820736c69707061676560781b604482015290519081900360640190fd5b6001600160a01b0385166000908152601260205260409020541561224a576040805162461bcd60e51b815260206004820152600c60248201526b13db99dbda5b99c8195e1a5d60a21b604482015290519081900360640190fd5b61225485826132c2565b61226882610b36858463ffffffff611e6716565b60055460065460408051629ff11560e81b8152600481019290925260248201849052519299506001600160a01b0390911691639ff115009160448082019260009290919082900301818387803b1580156122c157600080fd5b505af11580156122d5573d6000803e3d6000fd5b5050600d546122ed925090508863ffffffff61205d16565b600d55600480546006546040805163c69d057360e01b8152938401919091526001600160a01b038881166024850152604484018b9052606484018590529051911691829163c69d05739160848082019260009290919082900301818387803b15801561235857600080fd5b505af115801561236c573d6000803e3d6000fd5b50505050806001600160a01b031663532e19a96006546040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156123b857600080fd5b505af11580156123cc573d6000803e3d6000fd5b50999a9950505050505050505050565b6000806000806123eb33610aed565b91509150816000141580156124005750868210155b612446576040805162461bcd60e51b8152602060048201526012602482015271151bdbc81b5d58da081c995c5d595cdd195960721b604482015290519081900360640190fd5b6000612450611e40565b9050600061246883610b368b8563ffffffff611e6716565b9050878111156124b3576040805162461bcd60e51b8152602060048201526011602482015270746f6f206d75636820736c69707061676560781b604482015290519081900360640190fd5b6124bd33886128e0565b506124c83382612adc565b60055460065460408051629ff11560e81b8152600481019290925260008c8103602484015290516001600160a01b0390931692639ff1150092604480820193929182900301818387803b15801561251e57600080fd5b505af1158015612532573d6000803e3d6000fd5b5050600d5461254a925090508a63ffffffff61204816565b600d55600061256a61255a61190a565b610b368c8663ffffffff611e6716565b600f54909150612580908b63ffffffff61205d16565b600f55601054612596908263ffffffff61205d16565b60105590999098509650505050505050565b6016546000906001600160a01b031680610ae857600560009054906101000a90046001600160a01b03166001600160a01b0316635ab1bd536040518163ffffffff1660e01b815260040160206040518083038186803b15801561260a57600080fd5b505afa15801561261e573d6000803e3d6000fd5b505050506040513d602081101561263457600080fd5b5051604080516832bb32b73a39a43ab160b91b8152815190819003600901812063cac39a0560e01b8252600482015290516001600160a01b039092169163cac39a0591602480820192602092909190829003018186803b15801561269757600080fd5b505afa1580156126ab573d6000803e3d6000fd5b505050506040513d60208110156126c157600080fd5b5051601680546001600160a01b0319166001600160a01b0383161790559050905090565b6000806126f18461151e565b905080612702576000915050610a54565b6001600160a01b0384166000908152601360205260409020548381141561272e57600092505050610a54565b61275d6a084595161401484a000000610b3684612751888663ffffffff61204816565b9063ffffffff611e6716565b95945050505050565b600061277233836128e0565b5061277e84843361211d565b9050816128145760055460065460408051636901b25360e01b8152600481019290925260248201849052336044830152516001600160a01b0390921691636901b253916064808201926020929091908290030181600087803b1580156127e357600080fd5b505af11580156127f7573d6000803e3d6000fd5b505050506040513d602081101561280d57600080fd5b505161289e565b60055460065460408051624c025560e81b8152600481019290925260248201849052336044830152516001600160a01b0390921691634c025500916064808201926020929091908290030181600087803b15801561287157600080fd5b505af1158015612885573d6000803e3d6000fd5b505050506040513d602081101561289b57600080fd5b50515b611237576040805162461bcd60e51b815260206004820152600e60248201526d19195c1bdcda5d0819985a5b195960921b604482015290519081900360640190fd5b6000806128ec8461206f565b90508015611237578261298a576005546006546040805163bc8756a960e01b81526004810192909252602482018490526001600160a01b038781166044840152905192169163bc8756a9916064808201926020929091908290030181600087803b15801561295957600080fd5b505af115801561296d573d6000803e3d6000fd5b505050506040513d602081101561298357600080fd5b5051612a17565b6005546006546040805163c7f067cb60e01b81526004810192909252602482018490526001600160a01b038781166044840152905192169163c7f067cb916064808201926020929091908290030181600087803b1580156129ea57600080fd5b505af11580156129fe573d6000803e3d6000fd5b505050506040513d6020811015612a1457600080fd5b50515b612a5e576040805162461bcd60e51b8152602060048201526013602482015272496e737566666963656e74207265776172647360681b604482015290519081900360640190fd5b600480546006546040805163b7721d2d60e01b8152938401919091526001600160a01b03878116602485015260448401859052905191169163b7721d2d91606480830192600092919082900301818387803b158015612abc57600080fd5b505af1158015612ad0573d6000803e3d6000fd5b50505050905092915050565b6001600160a01b038216612aef57600080fd5b600254612b02908263ffffffff61204816565b6002556001600160a01b038216600090815260208190526040902054612b2e908263ffffffff61204816565b6001600160a01b038316600081815260208181526040808320949094558351858152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35050565b612b8b61336a565b503360009081526015602090815260408083208584528252808320815180830190925280548252600101549181019190915290612bc88284612f75565b3360009081526015602090815260408083208884529091528120818155600101559050612bf36125a8565b60065460408051636e699d8760e01b815260048101929092523360248301526044820184905260648201879052516001600160a01b039290921691636e699d879160848082019260009290919082900301818387803b158015612c5557600080fd5b505af1158015612c69573d6000803e3d6000fd5b5050505050505050565b6003805460ff19169055565b33612c8a84836128e0565b50612c9581836128e0565b50612ca1818585611f7d565b612ca96125a8565b6006546040805163c08b3f9d60e01b815260048101929092526001600160a01b038481166024840152878116604484015260648301879052905192169163c08b3f9d9160848082019260009290919082900301818387803b158015612c5557600080fd5b6001600160a01b038116612d2057600080fd5b6003546040516001600160a01b0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600380546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b6000612d9333836128e0565b9050600a54811015610a3f576040805162461bcd60e51b815260206004820152601860248201527f546f6f20736d616c6c207265776172647320616d6f756e740000000000000000604482015290519081900360640190fd5b6017546000906001600160a01b031680610ae857600560009054906101000a90046001600160a01b03166001600160a01b0316635ab1bd536040518163ffffffff1660e01b815260040160206040518083038186803b158015612e4e57600080fd5b505afa158015612e62573d6000803e3d6000fd5b505050506040513d6020811015612e7857600080fd5b505160408051621c1bdb60ea1b8152815190819003600301812063cac39a0560e01b8252600482015290516001600160a01b039092169163cac39a0591602480820192602092909190829003018186803b158015612ed557600080fd5b505afa158015612ee9573d6000803e3d6000fd5b505050506040513d6020811015612eff57600080fd5b505190506001600160a01b038116612f46576040805162461bcd60e51b81526020600482015260056024820152641d5b9cd95d60da1b604482015290519081900360640190fd5b601780546001600160a01b0319166001600160a01b038316179055919050565b6003805460ff19166001179055565b81516005546040805163900cf0cf60e01b81529051600093926001600160a01b03169163900cf0cf916004808301926020929190829003018186803b158015612fbd57600080fd5b505afa158015612fd1573d6000803e3d6000fd5b505050506040513d6020811015612fe757600080fd5b50516005546040805163a7ab696160e01b8152905161306c926001600160a01b03169163a7ab6961916004808301926020929190829003018186803b15801561302f57600080fd5b505afa158015613043573d6000803e3d6000fd5b505050506040513d602081101561305957600080fd5b505160208701519063ffffffff61205d16565b1115801561307a5750600081115b6130cb576040805162461bcd60e51b815260206004820152601c60248201527f496e636f6d706c657465207769746864726177616c20706572696f6400000000604482015290519081900360640190fd5b60006130e46130d8611e40565b610b368461275161190a565b6010549091506130fa908363ffffffff61204816565b601055600f54613110908263ffffffff61204816565b600f55836131a7576005546006546040805163bc8756a960e01b8152600481019290925260248201849052336044830152516001600160a01b039092169163bc8756a9916064808201926020929091908290030181600087803b15801561317657600080fd5b505af115801561318a573d6000803e3d6000fd5b505050506040513d60208110156131a057600080fd5b5051613232565b6005546006546040805163c7f067cb60e01b8152600481019290925260248201849052336044830152516001600160a01b039092169163c7f067cb916064808201926020929091908290030181600087803b15801561320557600080fd5b505af1158015613219573d6000803e3d6000fd5b505050506040513d602081101561322f57600080fd5b50515b613279576040805162461bcd60e51b8152602060048201526013602482015272496e737566666963656e74207265776172647360681b604482015290519081900360640190fd5b949350505050565b60035460ff1615610b57576040805162461bcd60e51b81526020600482015260066024820152651b1bd8dad95960d21b604482015290519081900360640190fd5b6001600160a01b0382166132d557600080fd5b6002546132e8908263ffffffff61205d16565b6002556001600160a01b038216600090815260208190526040902054613314908263ffffffff61205d16565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b60405180604001604052806000815260200160008152509056fea265627a7a723158208122f8592b166b315f73cfeac7cc501401e3db4492be76d3fbc0a9e2244132df64736f6c63430005110032", - "nonce": "0x9", - "chainId": "0x1" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": null, - "transactionType": "CREATE", - "contractName": null, - "contractAddress": "0xb00aa68b87256E2F22058fB2Ba3246EEc54A44fc", - "function": null, - "arguments": null, - "transaction": { - "from": "0x32bdc6a4e8c654df65503cbb0edc82b4ce9158e6", - "gas": "0x24e04e", - "value": "0x0", - "input": "0x608060405268056bc75e2d6310000060085534801561001d57600080fd5b50600080546001600160a01b031916331780825560405182916001600160a01b03169082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3600280546001600160a01b0319166001600160a01b039290921691909117905550611fc5806100976000396000f3fe6080604052600436106101815760003560e01c80638f32d59b116100d1578063cb10f94c1161008a578063e7af7ba111610064578063e7af7ba114610627578063f22037111461064e578063f2fde38b14610681578063f83d08ba146106b457610181565b8063cb10f94c146105c4578063cf309012146105d9578063d29a4bf6146105ee57610181565b80638f32d59b146104f557806397feb9261461051e578063987ab9db1461055757806398ea5fca14610181578063a69df4b51461056c578063b02c43d01461058157610181565b80635aa6e6751161013e5780637b1f7117116101185780637b1f7117146103b0578063889a0538146104885780638b9e4f931461049d5780638da5cb5b146104e057610181565b80635aa6e67514610371578063715018a6146103865780637b1039991461039b57610181565b8063072b15351461018b578063150b7a02146101ce57806342be8379146102be57806342fc47fb146102d357806349f4cc17146103045780634b56c07114610347575b6101896106c9565b005b34801561019757600080fd5b50610189600480360360608110156101ae57600080fd5b506001600160a01b038135811691602081013590911690604001356107ab565b3480156101da57600080fd5b506102a1600480360360808110156101f157600080fd5b6001600160a01b0382358116926020810135909116916040820135919081019060808101606082013564010000000081111561022c57600080fd5b82018360208201111561023e57600080fd5b8035906020019184600183028401116401000000008311171561026057600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061087d945050505050565b604080516001600160e01b03199092168252519081900360200190f35b3480156102ca57600080fd5b5061018961088d565b3480156102df57600080fd5b506102e861099e565b604080516001600160a01b039092168252519081900360200190f35b34801561031057600080fd5b506101896004803603606081101561032757600080fd5b506001600160a01b038135811691602081013590911690604001356109ad565b34801561035357600080fd5b506101896004803603602081101561036a57600080fd5b5035610f2d565b34801561037d57600080fd5b506102e8610f73565b34801561039257600080fd5b50610189610f82565b3480156103a757600080fd5b506102e8610fdd565b3480156103bc57600080fd5b50610189600480360360608110156103d357600080fd5b8101906020810181356401000000008111156103ee57600080fd5b82018360208201111561040057600080fd5b8035906020019184602083028401116401000000008311171561042257600080fd5b91939092909160208101903564010000000081111561044057600080fd5b82018360208201111561045257600080fd5b8035906020019184602083028401116401000000008311171561047457600080fd5b9193509150356001600160a01b0316610fec565b34801561049457600080fd5b50610189611256565b3480156104a957600080fd5b50610189600480360360608110156104c057600080fd5b506001600160a01b0381358116916020810135909116906040013561136b565b3480156104ec57600080fd5b506102e86113dd565b34801561050157600080fd5b5061050a6113ec565b604080519115158252519081900360200190f35b34801561052a57600080fd5b506101896004803603604081101561054157600080fd5b506001600160a01b0381351690602001356113fd565b34801561056357600080fd5b506102e8611408565b34801561057857600080fd5b50610189611417565b34801561058d57600080fd5b506105ab600480360360208110156105a457600080fd5b5035611429565b6040805192835260208301919091528051918290030190f35b3480156105d057600080fd5b506102e8611442565b3480156105e557600080fd5b5061050a611451565b3480156105fa57600080fd5b506101896004803603604081101561061157600080fd5b506001600160a01b038135169060200135611461565b34801561063357600080fd5b5061063c61146c565b60408051918252519081900360200190f35b34801561065a57600080fd5b506101896004803603602081101561067157600080fd5b50356001600160a01b0316611472565b34801561068d57600080fd5b50610189600480360360208110156106a457600080fd5b50356001600160a01b03166114a5565b3480156106c057600080fd5b506101896114bf565b60035460408051638b9c948960e01b815290516000926001600160a01b031691638b9c9489916004808301926020929190829003018186803b15801561070e57600080fd5b505afa158015610722573d6000803e3d6000fd5b505050506040513d602081101561073857600080fd5b505160408051630d0e30db60e41b8152905191925082916001600160a01b0383169163d0e30db091349160048082019260009290919082900301818588803b15801561078357600080fd5b505af1158015610797573d6000803e3d6000fd5b50505050506107a73383346114cf565b5050565b600354604080516301f07db560e01b81526001600160a01b038681166004830152915191909216916301f07db5916024808301926020929190829003018186803b1580156107f857600080fd5b505afa15801561080c573d6000803e3d6000fd5b505050506040513d602081101561082257600080fd5b5051610862576040805162461bcd60e51b815260206004820152600a6024820152696e6f742065726337323160b01b604482015290519081900360640190fd5b61086d33848361162d565b6108788284836114cf565b505050565b630a85bd0160e11b949350505050565b60035460408051630c91702f60e31b8152815160009384936001600160a01b039091169263648b81789260048083019392829003018186803b1580156108d257600080fd5b505afa1580156108e6573d6000803e3d6000fd5b505050506040513d60408110156108fc57600080fd5b50805160209091015160055491935091506001600160a01b03808316911614158061093557506007546001600160a01b03838116911614155b6109705760405162461bcd60e51b815260040180806020018281038252603e815260200180611f2d603e913960400191505060405180910390fd5b600780546001600160a01b039384166001600160a01b03199182161790915560058054929093169116179055565b6007546001600160a01b031681565b600354604080516337b1d58560e01b815233600482015290516001600160a01b03909216916337b1d58591602480820192602092909190829003018186803b1580156109f857600080fd5b505afa158015610a0c573d6000803e3d6000fd5b505050506040513d6020811015610a2257600080fd5b50516003811115610a2f57fe5b60ff16610a7b576040805162461bcd60e51b81526020600482015260156024820152744e6f7420612076616c69642070726564696361746560581b604482015290519081900360640190fd5b60035460408051638b9c948960e01b815290516000926001600160a01b031691638b9c9489916004808301926020929190829003018186803b158015610ac057600080fd5b505afa158015610ad4573d6000803e3d6000fd5b505050506040513d6020811015610aea57600080fd5b5051600354604080516336a8279560e21b81526001600160a01b038881166004830152915193945091169163daa09e5491602480820192602092909190829003018186803b158015610b3b57600080fd5b505afa158015610b4f573d6000803e3d6000fd5b505050506040513d6020811015610b6557600080fd5b505115610be157604080516323b872dd60e01b81523060048201526001600160a01b038581166024830152604482018590529151918616916323b872dd9160648082019260009290919082900301818387803b158015610bc457600080fd5b505af1158015610bd8573d6000803e3d6000fd5b50505050610f27565b806001600160a01b0316846001600160a01b03161415610c695760408051627b8a6760e11b8152600481018490526001600160a01b0385811660248301529151869283169162f714ce91604480830192600092919082900301818387803b158015610c4b57600080fd5b505af1158015610c5f573d6000803e3d6000fd5b5050505050610f27565b60035460408051646d6174696360d81b8152815190819003600501812063cac39a0560e01b8252600482015290516001600160a01b039092169163cac39a0591602480820192602092909190829003018186803b158015610cc957600080fd5b505afa158015610cdd573d6000803e3d6000fd5b505050506040513d6020811015610cf357600080fd5b50516001600160a01b0385811691161415610e58576003805460408051621c1bdb60ea1b8152815190819003909301832063cac39a0560e01b84526004840152516001600160a01b039091169163cac39a05916024808301926020929190829003018186803b158015610d6557600080fd5b505afa158015610d79573d6000803e3d6000fd5b505050506040513d6020811015610d8f57600080fd5b50516040805163a9059cbb60e01b81526001600160a01b038681166004830152602482018690529151919092169163a9059cbb9160448083019260209291908290030181600087803b158015610de457600080fd5b505af1158015610df8573d6000803e3d6000fd5b505050506040513d6020811015610e0e57600080fd5b5051610e53576040805162461bcd60e51b815260206004820152600f60248201526e1514905394d1915497d19052531151608a1b604482015290519081900360640190fd5b610f27565b836001600160a01b031663a9059cbb84846040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610eb857600080fd5b505af1158015610ecc573d6000803e3d6000fd5b505050506040513d6020811015610ee257600080fd5b5051610f27576040805162461bcd60e51b815260206004820152600f60248201526e1514905394d1915497d19052531151608a1b604482015290519081900360640190fd5b50505050565b610f356116a2565b80610f3f57600080fd5b6008546040518291907f010c0265813c273963aa5e8683cf5c45a3b744ba6369c22af0958ec5fcf16b2090600090a3600855565b6002546001600160a01b031681565b610f8a6113ec565b610f9357600080fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6003546001600160a01b031681565b610ff46116eb565b838214611038576040805162461bcd60e51b815260206004820152600d60248201526c125b9d985b1a5908125b9c1d5d609a1b604482015290519081900360640190fd5b6004805460408051635391f48360e01b8152928301879052516000926001600160a01b0390921691635391f48391602480830192602092919082900301818787803b15801561108657600080fd5b505af115801561109a573d6000803e3d6000fd5b505050506040513d60208110156110b057600080fd5b50516003549091506001600160a01b031660005b8681101561124c57816001600160a01b03166301f07db58989848181106110e757fe5b905060200201356001600160a01b03166040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b15801561113d57600080fd5b505afa158015611151573d6000803e3d6000fd5b505050506040513d602081101561116757600080fd5b5051156111ab576111a63389898481811061117e57fe5b905060200201356001600160a01b031688888581811061119a57fe5b9050602002013561162d565b6111f8565b6111f833308888858181106111bc57fe5b905060200201358b8b868181106111cf57fe5b905060200201356001600160a01b03166001600160a01b0316611733909392919063ffffffff16565b6112318489898481811061120857fe5b905060200201356001600160a01b031688888581811061122457fe5b905060200201358661178d565b61124283600163ffffffff611aa816565b92506001016110c4565b5050505050505050565b61125e6116a2565b60035460408051646d6174696360d81b8152815190819003600501812063cac39a0560e01b8252600482015290516000926001600160a01b03169163cac39a05916024808301926020929190829003018186803b1580156112be57600080fd5b505afa1580156112d2573d6000803e3d6000fd5b505050506040513d60208110156112e857600080fd5b5051604080516370a0823160e01b81523060048201529051919250611368916001600160a01b038416916370a08231916024808301926020929190829003018186803b15801561133757600080fd5b505afa15801561134b573d6000803e3d6000fd5b505050506040513d602081101561136157600080fd5b5051611ac1565b50565b6008548111156113c2576040805162461bcd60e51b815260206004820152601d60248201527f657863656564206d6178696d756d206465706f73697420616d6f756e74000000604482015290519081900360640190fd5b61086d6001600160a01b03841633308463ffffffff61173316565b6000546001600160a01b031690565b6000546001600160a01b0316331490565b6107a782338361136b565b6004546001600160a01b031681565b61141f6116a2565b611427611d72565b565b6006602052600090815260409020805460019091015482565b6005546001600160a01b031681565b600154600160a01b900460ff1681565b6107a78233836107ab565b60085481565b61147a6113ec565b61148357600080fd5b600480546001600160a01b0319166001600160a01b0392909216919091179055565b6114ad6113ec565b6114b657600080fd5b61136881611d81565b6114c76116a2565b611427611def565b6114d76116eb565b60035460408051636416c18360e01b81526001600160a01b038086166004830152915185939290921691636416c18391602480820192602092909190829003018186803b15801561152757600080fd5b505afa15801561153b573d6000803e3d6000fd5b505050506040513d602081101561155157600080fd5b505161159a576040805162461bcd60e51b81526020600482015260136024820152721513d2d15397d393d517d4d5541413d4951151606a1b604482015290519081900360640190fd5b610f27848484600460009054906101000a90046001600160a01b03166001600160a01b0316635391f48360016040518263ffffffff1660e01b815260040180828152602001915050602060405180830381600087803b1580156115fc57600080fd5b505af1158015611610573d6000803e3d6000fd5b505050506040513d602081101561162657600080fd5b505161178d565b60408051632142170760e11b81526001600160a01b038581166004830152306024830152604482018490529151918416916342842e0e9160648082019260009290919082900301818387803b15801561168557600080fd5b505af1158015611699573d6000803e3d6000fd5b50505050505050565b6002546001600160a01b031633146114275760405162461bcd60e51b8152600401808060200182810382526026815260200180611f6b6026913960400191505060405180910390fd5b600154600160a01b900460ff1615611427576040805162461bcd60e51b81526020600482015260066024820152651b1bd8dad95960d21b604482015290519081900360640190fd5b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052610f27908590611e04565b60035460408051646d6174696360d81b8152815190819003600501812063cac39a0560e01b8252600482015290516000926001600160a01b03169163cac39a05916024808301926020929190829003018186803b1580156117ed57600080fd5b505afa158015611801573d6000803e3d6000fd5b505050506040513d602081101561181757600080fd5b505190506001600160a01b03848116908216141561183d5761183883611ac1565b6118dd565b6003805460408051621c1bdb60ea1b8152815190819003909301832063cac39a0560e01b84526004840152516001600160a01b039091169163cac39a05916024808301926020929190829003018186803b15801561189a57600080fd5b505afa1580156118ae573d6000803e3d6000fd5b505050506040513d60208110156118c457600080fd5b50516001600160a01b03858116911614156118dd578093505b604080518082018252606087811b6bffffffffffffffffffffffff199081168284015287821b16607483015260888083018790528351808403909101815260a883018452805160209182012083524281840190815260008781526006835285812094518555905160019094019390935560055460075485516001600160a01b03808d1682860152808c16828901529481018a905260808082018a90528751808303909101815260a082018089526316f1983160e01b905291851660a4820181815260c48301988952835160e4840152835196909416976316f198319791969395909361010490930192908601918190849084905b838110156119e95781810151838201526020016119d1565b50505050905090810190601f168015611a165780820380516001836020036101000a031916815260200191505b509350505050600060405180830381600087803b158015611a3657600080fd5b505af1158015611a4a573d6000803e3d6000fd5b50505050836001600160a01b0316856001600160a01b03167f1dadc8d0683c6f9824e885935c1bec6f76816730dcec148dda8cf25a7b9f797b8585604051808381526020018281526020019250505060405180910390a35050505050565b600082820183811015611aba57600080fd5b9392505050565b60035460408051646d6174696360d81b8152815190819003600501812063cac39a0560e01b8252600482015290516000926001600160a01b03169163cac39a05916024808301926020929190829003018186803b158015611b2157600080fd5b505afa158015611b35573d6000803e3d6000fd5b505050506040513d6020811015611b4b57600080fd5b5051600354604080516f3837b63cb3b7b726b4b3b930ba34b7b760811b8152815190819003601001812063cac39a0560e01b8252600482015290519293506000926001600160a01b039092169163cac39a0591602480820192602092909190829003018186803b158015611bbe57600080fd5b505afa158015611bd2573d6000803e3d6000fd5b505050506040513d6020811015611be857600080fd5b5051604080516370a0823160e01b8152306004820152905191925084916001600160a01b038516916370a08231916024808301926020929190829003018186803b158015611c3557600080fd5b505afa158015611c49573d6000803e3d6000fd5b505050506040513d6020811015611c5f57600080fd5b50511015611c9e5760405162461bcd60e51b815260040180806020018281038252602c815260200180611f01602c913960400191505060405180910390fd5b816001600160a01b031663095ea7b382856040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015611cfe57600080fd5b505af1158015611d12573d6000803e3d6000fd5b505050506040513d6020811015611d2857600080fd5b5050604080516308a960c160e31b81526004810185905290516001600160a01b0383169163454b060891602480830192600092919082900301818387803b15801561168557600080fd5b6001805460ff60a01b19169055565b6001600160a01b038116611d9457600080fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001805460ff60a01b1916600160a01b179055565b611e16826001600160a01b0316611efa565b611e1f57600080fd5b60006060836001600160a01b0316836040518082805190602001908083835b60208310611e5d5780518252601f199092019160209182019101611e3e565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611ebf576040519150601f19603f3d011682016040523d82523d6000602084013e611ec4565b606091505b509150915081611ed357600080fd5b805115610f2757808060200190516020811015611eef57600080fd5b5051610f2757600080fd5b3b15159056fe616d6f756e742065786365656473207468697320636f6e74726163742773204d415449432062616c616e636541746c65617374206f6e65206f6620737461746553656e646572206f72206368696c64436861696e20616464726573732073686f756c64206368616e67654f6e6c7920676f7665726e616e636520636f6e747261637420697320617574686f72697a6564a265627a7a72315820c1dbd9f6fea99031eca29e23c9ebb67c5314bf5383a338b9419970be48a5842664736f6c63430005110032", - "nonce": "0xa", - "chainId": "0x1" - }, - "additionalContracts": [], - "isFixedGasLimit": false - } - ], - "receipts": [], - "libraries": [], - "pending": [], - "returns": {}, - "timestamp": 1724288447, - "chain": 1, - "commit": "4857f3f1" -} \ No newline at end of file diff --git a/contracts/child/BaseERC20.sol b/contracts/child/BaseERC20.sol index 583008a4..31fb2e95 100644 --- a/contracts/child/BaseERC20.sol +++ b/contracts/child/BaseERC20.sol @@ -1,6 +1,6 @@ pragma solidity ^0.5.2; -import "./ChildToken.sol"; +import {ChildToken} from "./ChildToken.sol"; contract BaseERC20 is ChildToken { event Deposit( diff --git a/contracts/child/BaseERC20NoSig.sol b/contracts/child/BaseERC20NoSig.sol index 7a1bfb86..b3f9c3cc 100644 --- a/contracts/child/BaseERC20NoSig.sol +++ b/contracts/child/BaseERC20NoSig.sol @@ -1,6 +1,6 @@ pragma solidity ^0.5.2; -import "./ChildToken.sol"; +import {ChildToken} from "./ChildToken.sol"; contract BaseERC20NoSig is ChildToken { event Deposit( diff --git a/contracts/child/ChildChain.sol b/contracts/child/ChildChain.sol index 721a532c..5fa27f2e 100644 --- a/contracts/child/ChildChain.sol +++ b/contracts/child/ChildChain.sol @@ -1,13 +1,13 @@ pragma solidity ^0.5.2; -import {Ownable} from "openzeppelin-solidity/contracts/ownership/Ownable.sol"; +import {Ownable} from "../common/oz/ownership/Ownable.sol"; import {StateSyncerVerifier} from "./bor/StateSyncerVerifier.sol"; import {StateReceiver} from "./bor/StateReceiver.sol"; -import "./ChildToken.sol"; -import "./ChildERC20.sol"; -import "./ChildERC721.sol"; +import {ChildToken} from "./ChildToken.sol"; +import {ChildERC20} from "./ChildERC20.sol"; +import {ChildERC721} from "./ChildERC721.sol"; contract ChildChain is Ownable, StateSyncerVerifier, StateReceiver { // mapping for (root token => child token) diff --git a/contracts/child/ChildERC20.sol b/contracts/child/ChildERC20.sol index 5d7ce11a..75cf405f 100644 --- a/contracts/child/ChildERC20.sol +++ b/contracts/child/ChildERC20.sol @@ -1,12 +1,12 @@ pragma solidity ^0.5.2; import {ERC20Detailed} from "./ERC20Detailed.sol"; -import {ERC20} from "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol"; +import {ERC20} from "../common/oz/token/ERC20/ERC20.sol"; import {StateSyncerVerifier} from "./bor/StateSyncerVerifier.sol"; import {StateReceiver} from "./bor/StateReceiver.sol"; -import "./BaseERC20.sol"; -import "./misc/IParentToken.sol"; +import {BaseERC20} from "./BaseERC20.sol"; +import {IParentToken} from "./misc/IParentToken.sol"; contract ChildERC20 is BaseERC20, ERC20, ERC20Detailed, StateSyncerVerifier, StateReceiver { constructor( diff --git a/contracts/child/ChildERC721.sol b/contracts/child/ChildERC721.sol index 8305b561..37c7a21d 100644 --- a/contracts/child/ChildERC721.sol +++ b/contracts/child/ChildERC721.sol @@ -1,9 +1,9 @@ pragma solidity ^0.5.2; -import {ERC721Full} from "openzeppelin-solidity/contracts/token/ERC721/ERC721Full.sol"; +import {ERC721Full} from "../common/oz/token/ERC721/ERC721Full.sol"; -import "./ChildToken.sol"; -import "./misc/IParentToken.sol"; +import {ChildToken} from "./ChildToken.sol"; +import {IParentToken} from "./misc/IParentToken.sol"; import {StateSyncerVerifier} from "./bor/StateSyncerVerifier.sol"; import {StateReceiver} from "./bor/StateReceiver.sol"; diff --git a/contracts/child/ChildERC721Mintable.sol b/contracts/child/ChildERC721Mintable.sol index d74eb283..20ac465e 100644 --- a/contracts/child/ChildERC721Mintable.sol +++ b/contracts/child/ChildERC721Mintable.sol @@ -1,7 +1,7 @@ pragma solidity ^0.5.2; -import "openzeppelin-solidity/contracts/token/ERC721/ERC721Mintable.sol"; -import "openzeppelin-solidity/contracts/token/ERC721/ERC721MetadataMintable.sol"; +import {ERC721Mintable} from "../common/oz/token/ERC721/ERC721Mintable.sol"; +import {ERC721MetadataMintable} from "../common/oz/token/ERC721/ERC721MetadataMintable.sol"; import {ChildERC721} from "./ChildERC721.sol"; diff --git a/contracts/child/ChildToken.sol b/contracts/child/ChildToken.sol index 1c5f6285..b3cfa907 100644 --- a/contracts/child/ChildToken.sol +++ b/contracts/child/ChildToken.sol @@ -1,9 +1,9 @@ pragma solidity ^0.5.2; -import "openzeppelin-solidity/contracts/math/SafeMath.sol"; -import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; +import {SafeMath} from "../common/oz/math/SafeMath.sol"; +import {Ownable} from "../common/oz/ownership/Ownable.sol"; -import "./misc/LibTokenTransferOrder.sol"; +import {LibTokenTransferOrder} from "./misc/LibTokenTransferOrder.sol"; contract ChildToken is Ownable, LibTokenTransferOrder { using SafeMath for uint256; diff --git a/contracts/child/MRC20.sol b/contracts/child/MRC20.sol index e944e534..c17af259 100644 --- a/contracts/child/MRC20.sol +++ b/contracts/child/MRC20.sol @@ -1,6 +1,6 @@ pragma solidity 0.5.17; -import "./BaseERC20NoSig.sol"; +import {BaseERC20NoSig} from "./BaseERC20NoSig.sol"; /** * @title Polygon Ecosystem Token contract diff --git a/contracts/child/bor/StateSyncerVerifier.sol b/contracts/child/bor/StateSyncerVerifier.sol index afab33d2..75f3f807 100644 --- a/contracts/child/bor/StateSyncerVerifier.sol +++ b/contracts/child/bor/StateSyncerVerifier.sol @@ -1,6 +1,6 @@ pragma solidity ^0.5.2; -import {Ownable} from "openzeppelin-solidity/contracts/ownership/Ownable.sol"; +import {Ownable} from "../../common/oz/ownership/Ownable.sol"; contract StateSyncerVerifier is Ownable { address public stateSyncer; diff --git a/contracts/child/proxifiedChildToken/ChildERC20Proxified.sol b/contracts/child/proxifiedChildToken/ChildERC20Proxified.sol index ce0b8d8a..b03fa186 100644 --- a/contracts/child/proxifiedChildToken/ChildERC20Proxified.sol +++ b/contracts/child/proxifiedChildToken/ChildERC20Proxified.sol @@ -1,7 +1,7 @@ pragma solidity ^0.5.2; import {Initializable} from "../../common/mixin/Initializable.sol"; -import "../ChildERC20.sol"; +import {ChildERC20} from "../ChildERC20.sol"; contract ChildERC20Proxified is ChildERC20, Initializable { constructor() public ChildERC20(address(0x1), address(0x1), "", "", 18) {} diff --git a/contracts/child/proxifiedChildToken/ChildERC721Proxified.sol b/contracts/child/proxifiedChildToken/ChildERC721Proxified.sol index c8da03f6..41cfe519 100644 --- a/contracts/child/proxifiedChildToken/ChildERC721Proxified.sol +++ b/contracts/child/proxifiedChildToken/ChildERC721Proxified.sol @@ -1,7 +1,7 @@ pragma solidity ^0.5.2; import {Initializable} from "../../common/mixin/Initializable.sol"; -import "../ChildERC721.sol"; +import {ChildERC721} from "../ChildERC721.sol"; contract ChildERC721Proxified is ChildERC721, Initializable { string public name; diff --git a/contracts/common/lib/BytesLib.sol b/contracts/common/lib/BytesLib.sol index 5f811815..4720b9df 100644 --- a/contracts/common/lib/BytesLib.sol +++ b/contracts/common/lib/BytesLib.sol @@ -1,6 +1,6 @@ pragma solidity ^0.5.2; -import "openzeppelin-solidity/contracts/math/SafeMath.sol"; +import {SafeMath} from "../oz/math/SafeMath.sol"; library BytesLib { function concat(bytes memory _preBytes, bytes memory _postBytes) diff --git a/contracts/common/lib/Common.sol b/contracts/common/lib/Common.sol index deb1b1b2..caf9f803 100644 --- a/contracts/common/lib/Common.sol +++ b/contracts/common/lib/Common.sol @@ -1,6 +1,6 @@ pragma solidity ^0.5.2; -import "./BytesLib.sol"; +import {BytesLib} from "./BytesLib.sol"; library Common { function getV(bytes memory v, uint16 chainId) public pure returns (uint8) { diff --git a/contracts/common/lib/ExitPayloadReader.sol b/contracts/common/lib/ExitPayloadReader.sol index 90ab9030..e502f37b 100644 --- a/contracts/common/lib/ExitPayloadReader.sol +++ b/contracts/common/lib/ExitPayloadReader.sol @@ -1,7 +1,6 @@ pragma solidity 0.5.17; import {RLPReader} from "./RLPReader.sol"; -import {BytesLib} from "./BytesLib.sol"; library ExitPayloadReader { using RLPReader for bytes; diff --git a/contracts/common/lib/PriorityQueue.sol b/contracts/common/lib/PriorityQueue.sol index 515c103d..c769fd68 100644 --- a/contracts/common/lib/PriorityQueue.sol +++ b/contracts/common/lib/PriorityQueue.sol @@ -1,7 +1,7 @@ pragma solidity ^0.5.2; -import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; -import {SafeMath} from "openzeppelin-solidity/contracts/math/SafeMath.sol"; +import {Ownable} from "../oz/ownership/Ownable.sol"; +import {SafeMath} from "../oz/math/SafeMath.sol"; /** * @title PriorityQueue diff --git a/contracts/common/lib/RLPEncode.sol b/contracts/common/lib/RLPEncode.sol index 66800930..8c61768d 100644 --- a/contracts/common/lib/RLPEncode.sol +++ b/contracts/common/lib/RLPEncode.sol @@ -3,7 +3,7 @@ // [Very] modified version of Sam Mayo's library. pragma solidity ^0.5.2; -import "./BytesLib.sol"; +import {BytesLib} from "./BytesLib.sol"; library RLPEncode { // Encode an item (bytes memory) diff --git a/contracts/common/misc/ContractReceiver.sol b/contracts/common/misc/ContractReceiver.sol deleted file mode 100644 index 453acef5..00000000 --- a/contracts/common/misc/ContractReceiver.sol +++ /dev/null @@ -1,15 +0,0 @@ -pragma solidity ^0.5.2; - -/* - * Contract that is working with ERC223 tokens - */ - -/// @title ContractReceiver - Standard contract implementation for compatibility with ERC 223 tokens. -contract ContractReceiver { - /// @dev Function that is called when a user or another contract wants to transfer funds. - /// @param _from Transaction initiator, analogue of msg.sender - /// @param _value Number of tokens to transfer. - /// @param _data Data containig a function signature and/or parameters - function tokenFallback(address _from, uint256 _value, bytes memory _data) - public; -} diff --git a/contracts/common/misc/DrainStakeManager.sol b/contracts/common/misc/DrainStakeManager.sol index bca53f3d..fc0b8ebc 100644 --- a/contracts/common/misc/DrainStakeManager.sol +++ b/contracts/common/misc/DrainStakeManager.sol @@ -1,28 +1,17 @@ pragma solidity ^0.5.2; import { StakeManagerStorage } from "../../staking/stakeManager/StakeManagerStorage.sol"; +import { StakeManagerStorageExtension } from "../../staking/stakeManager/StakeManagerStorageExtension.sol"; import { GovernanceLockable } from "../mixin/GovernanceLockable.sol"; -import {IValidatorShare} from "../../staking/validatorShare/IValidatorShare.sol"; import {Initializable} from "../../common/mixin/Initializable.sol"; // Inheriting from Initializable as well to keep the storage layout same -contract DrainStakeManager is StakeManagerStorage, Initializable { +contract DrainStakeManager is StakeManagerStorage, Initializable, StakeManagerStorageExtension { constructor() public GovernanceLockable(address(0x0)) {} - function drain(address destination, uint amount) external onlyOwner { - require(token.transfer(destination, amount), "Drain failed"); - } - - function drainValidatorShares( - uint256 validatorId, - address _token, - address payable destination, - uint256 amount - ) external onlyOwner { - address contractAddr = validators[validatorId].contractAddress; - require(contractAddr != address(0x0), "unknown validator or no delegation enabled"); - IValidatorShare validatorShare = IValidatorShare(contractAddr); - validatorShare.drain(_token, destination, amount); + function drain(address destination) external onlyOwner { + require(token.transfer(destination, token.balanceOf(address(this))), "Drain failed"); + require(tokenMatic.transfer(destination, tokenMatic.balanceOf(address(this))), "Drain failed"); } // Overriding isOwner from Ownable.sol because owner() and transferOwnership() have been overridden by UpgradableProxy diff --git a/contracts/common/misc/Drainable.sol b/contracts/common/misc/Drainable.sol index 5daba52c..88c9bdd4 100644 --- a/contracts/common/misc/Drainable.sol +++ b/contracts/common/misc/Drainable.sol @@ -2,8 +2,8 @@ pragma solidity ^0.5.2; import { DepositManagerStorage } from "../../root/depositManager/DepositManagerStorage.sol"; import { GovernanceLockable } from "../mixin/GovernanceLockable.sol"; -import { IERC20 } from "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol"; -import { IERC721 } from "openzeppelin-solidity/contracts/token/ERC721/IERC721.sol"; +import { IERC20 } from "../oz/token/ERC20/IERC20.sol"; +import { IERC721 } from "../oz/token/ERC721/IERC721.sol"; import { WETH } from "../tokens/WETH.sol"; diff --git a/contracts/common/misc/PolygonMigration.sol b/contracts/common/misc/PolygonMigration.sol index d7e78419..89d80ad5 100644 --- a/contracts/common/misc/PolygonMigration.sol +++ b/contracts/common/misc/PolygonMigration.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity 0.5.17; -import {IERC20} from "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol"; -import {SafeERC20} from "openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol"; +import {IERC20} from "../oz/token/ERC20/IERC20.sol"; +import {SafeERC20} from "../oz/token/ERC20/SafeERC20.sol"; import {IPolygonMigration} from "./IPolygonMigration.sol"; /// @title Polygon Migration diff --git a/contracts/common/misc/ProxyStorage.sol b/contracts/common/misc/ProxyStorage.sol index 2dcf41b3..d83f30bd 100644 --- a/contracts/common/misc/ProxyStorage.sol +++ b/contracts/common/misc/ProxyStorage.sol @@ -1,5 +1,5 @@ pragma solidity ^0.5.2; -import {Ownable} from "openzeppelin-solidity/contracts/ownership/Ownable.sol"; +import {Ownable} from "../oz/ownership/Ownable.sol"; contract ProxyStorage is Ownable { address internal proxyTo; diff --git a/contracts/common/mixin/Initializable.sol b/contracts/common/mixin/Initializable.sol index 2775f03b..98cc6873 100644 --- a/contracts/common/mixin/Initializable.sol +++ b/contracts/common/mixin/Initializable.sol @@ -1,7 +1,7 @@ pragma solidity ^0.5.2; contract Initializable { - bool inited = false; + bool internal inited = false; modifier initializer() { require(!inited, "already inited"); diff --git a/contracts/common/mixin/OwnableLockable.sol b/contracts/common/mixin/OwnableLockable.sol index acfddbe7..01ddb8ae 100644 --- a/contracts/common/mixin/OwnableLockable.sol +++ b/contracts/common/mixin/OwnableLockable.sol @@ -1,6 +1,6 @@ pragma solidity ^0.5.2; import { Lockable } from "./Lockable.sol"; -import { Ownable } from "openzeppelin-solidity/contracts/ownership/Ownable.sol"; +import { Ownable } from "../oz/ownership/Ownable.sol"; contract OwnableLockable is Lockable, Ownable { function lock() public onlyOwner { diff --git a/contracts/common/mixin/RootChainable.sol b/contracts/common/mixin/RootChainable.sol index 1332122f..631494b5 100644 --- a/contracts/common/mixin/RootChainable.sol +++ b/contracts/common/mixin/RootChainable.sol @@ -1,6 +1,6 @@ pragma solidity ^0.5.2; -import {Ownable} from "openzeppelin-solidity/contracts/ownership/Ownable.sol"; +import {Ownable} from "../oz/ownership/Ownable.sol"; /** * @title RootChainable diff --git a/contracts/common/oz/LICENSE b/contracts/common/oz/LICENSE new file mode 100644 index 00000000..98dd89cd --- /dev/null +++ b/contracts/common/oz/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2016 Smart Contract Solutions, Inc. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/contracts/common/oz/access/Roles.sol b/contracts/common/oz/access/Roles.sol new file mode 100644 index 00000000..1c97678c --- /dev/null +++ b/contracts/common/oz/access/Roles.sol @@ -0,0 +1,40 @@ +pragma solidity ^0.5.2; + +/** + * @title Roles + * @dev Library for managing addresses assigned to a Role. + */ +library Roles { + struct Role { + mapping (address => bool) bearer; + } + + /** + * @dev give an account access to this role + */ + function add(Role storage role, address account) internal { + require(account != address(0)); + require(!has(role, account)); + + role.bearer[account] = true; + } + + /** + * @dev remove an account's access to this role + */ + function remove(Role storage role, address account) internal { + require(account != address(0)); + require(has(role, account)); + + role.bearer[account] = false; + } + + /** + * @dev check if an account has this role + * @return bool + */ + function has(Role storage role, address account) internal view returns (bool) { + require(account != address(0)); + return role.bearer[account]; + } +} diff --git a/contracts/common/oz/access/roles/CapperRole.sol b/contracts/common/oz/access/roles/CapperRole.sol new file mode 100644 index 00000000..a6d9da06 --- /dev/null +++ b/contracts/common/oz/access/roles/CapperRole.sol @@ -0,0 +1,43 @@ +pragma solidity ^0.5.2; + +import "../Roles.sol"; + +contract CapperRole { + using Roles for Roles.Role; + + event CapperAdded(address indexed account); + event CapperRemoved(address indexed account); + + Roles.Role private _cappers; + + constructor () internal { + _addCapper(msg.sender); + } + + modifier onlyCapper() { + require(isCapper(msg.sender)); + _; + } + + function isCapper(address account) public view returns (bool) { + return _cappers.has(account); + } + + function addCapper(address account) public onlyCapper { + _addCapper(account); + } + + function renounceCapper() public { + _removeCapper(msg.sender); + } + + function _addCapper(address account) internal { + _cappers.add(account); + emit CapperAdded(account); + } + + function _removeCapper(address account) internal { + _cappers.remove(account); + emit CapperRemoved(account); + } +} diff --git a/contracts/common/oz/access/roles/MinterRole.sol b/contracts/common/oz/access/roles/MinterRole.sol new file mode 100644 index 00000000..23d16c04 --- /dev/null +++ b/contracts/common/oz/access/roles/MinterRole.sol @@ -0,0 +1,43 @@ +pragma solidity ^0.5.2; + +import "../Roles.sol"; + +contract MinterRole { + using Roles for Roles.Role; + + event MinterAdded(address indexed account); + event MinterRemoved(address indexed account); + + Roles.Role private _minters; + + constructor () internal { + _addMinter(msg.sender); + } + + modifier onlyMinter() { + require(isMinter(msg.sender)); + _; + } + + function isMinter(address account) public view returns (bool) { + return _minters.has(account); + } + + function addMinter(address account) public onlyMinter { + _addMinter(account); + } + + function renounceMinter() public { + _removeMinter(msg.sender); + } + + function _addMinter(address account) internal { + _minters.add(account); + emit MinterAdded(account); + } + + function _removeMinter(address account) internal { + _minters.remove(account); + emit MinterRemoved(account); + } +} diff --git a/contracts/common/oz/access/roles/PauserRole.sol b/contracts/common/oz/access/roles/PauserRole.sol new file mode 100644 index 00000000..073a08e4 --- /dev/null +++ b/contracts/common/oz/access/roles/PauserRole.sol @@ -0,0 +1,43 @@ +pragma solidity ^0.5.2; + +import "../Roles.sol"; + +contract PauserRole { + using Roles for Roles.Role; + + event PauserAdded(address indexed account); + event PauserRemoved(address indexed account); + + Roles.Role private _pausers; + + constructor () internal { + _addPauser(msg.sender); + } + + modifier onlyPauser() { + require(isPauser(msg.sender)); + _; + } + + function isPauser(address account) public view returns (bool) { + return _pausers.has(account); + } + + function addPauser(address account) public onlyPauser { + _addPauser(account); + } + + function renouncePauser() public { + _removePauser(msg.sender); + } + + function _addPauser(address account) internal { + _pausers.add(account); + emit PauserAdded(account); + } + + function _removePauser(address account) internal { + _pausers.remove(account); + emit PauserRemoved(account); + } +} diff --git a/contracts/common/oz/access/roles/SignerRole.sol b/contracts/common/oz/access/roles/SignerRole.sol new file mode 100644 index 00000000..91bb59c2 --- /dev/null +++ b/contracts/common/oz/access/roles/SignerRole.sol @@ -0,0 +1,43 @@ +pragma solidity ^0.5.2; + +import "../Roles.sol"; + +contract SignerRole { + using Roles for Roles.Role; + + event SignerAdded(address indexed account); + event SignerRemoved(address indexed account); + + Roles.Role private _signers; + + constructor () internal { + _addSigner(msg.sender); + } + + modifier onlySigner() { + require(isSigner(msg.sender)); + _; + } + + function isSigner(address account) public view returns (bool) { + return _signers.has(account); + } + + function addSigner(address account) public onlySigner { + _addSigner(account); + } + + function renounceSigner() public { + _removeSigner(msg.sender); + } + + function _addSigner(address account) internal { + _signers.add(account); + emit SignerAdded(account); + } + + function _removeSigner(address account) internal { + _signers.remove(account); + emit SignerRemoved(account); + } +} diff --git a/contracts/common/oz/access/roles/WhitelistAdminRole.sol b/contracts/common/oz/access/roles/WhitelistAdminRole.sol new file mode 100644 index 00000000..e5f0883d --- /dev/null +++ b/contracts/common/oz/access/roles/WhitelistAdminRole.sol @@ -0,0 +1,47 @@ +pragma solidity ^0.5.2; + +import "../Roles.sol"; + +/** + * @title WhitelistAdminRole + * @dev WhitelistAdmins are responsible for assigning and removing Whitelisted accounts. + */ +contract WhitelistAdminRole { + using Roles for Roles.Role; + + event WhitelistAdminAdded(address indexed account); + event WhitelistAdminRemoved(address indexed account); + + Roles.Role private _whitelistAdmins; + + constructor () internal { + _addWhitelistAdmin(msg.sender); + } + + modifier onlyWhitelistAdmin() { + require(isWhitelistAdmin(msg.sender)); + _; + } + + function isWhitelistAdmin(address account) public view returns (bool) { + return _whitelistAdmins.has(account); + } + + function addWhitelistAdmin(address account) public onlyWhitelistAdmin { + _addWhitelistAdmin(account); + } + + function renounceWhitelistAdmin() public { + _removeWhitelistAdmin(msg.sender); + } + + function _addWhitelistAdmin(address account) internal { + _whitelistAdmins.add(account); + emit WhitelistAdminAdded(account); + } + + function _removeWhitelistAdmin(address account) internal { + _whitelistAdmins.remove(account); + emit WhitelistAdminRemoved(account); + } +} diff --git a/contracts/common/oz/access/roles/WhitelistedRole.sol b/contracts/common/oz/access/roles/WhitelistedRole.sol new file mode 100644 index 00000000..89cf357f --- /dev/null +++ b/contracts/common/oz/access/roles/WhitelistedRole.sol @@ -0,0 +1,50 @@ +pragma solidity ^0.5.2; + +import "../Roles.sol"; +import "./WhitelistAdminRole.sol"; + +/** + * @title WhitelistedRole + * @dev Whitelisted accounts have been approved by a WhitelistAdmin to perform certain actions (e.g. participate in a + * crowdsale). This role is special in that the only accounts that can add it are WhitelistAdmins (who can also remove + * it), and not Whitelisteds themselves. + */ +contract WhitelistedRole is WhitelistAdminRole { + using Roles for Roles.Role; + + event WhitelistedAdded(address indexed account); + event WhitelistedRemoved(address indexed account); + + Roles.Role private _whitelisteds; + + modifier onlyWhitelisted() { + require(isWhitelisted(msg.sender)); + _; + } + + function isWhitelisted(address account) public view returns (bool) { + return _whitelisteds.has(account); + } + + function addWhitelisted(address account) public onlyWhitelistAdmin { + _addWhitelisted(account); + } + + function removeWhitelisted(address account) public onlyWhitelistAdmin { + _removeWhitelisted(account); + } + + function renounceWhitelisted() public { + _removeWhitelisted(msg.sender); + } + + function _addWhitelisted(address account) internal { + _whitelisteds.add(account); + emit WhitelistedAdded(account); + } + + function _removeWhitelisted(address account) internal { + _whitelisteds.remove(account); + emit WhitelistedRemoved(account); + } +} diff --git a/contracts/common/oz/drafts/Counters.sol b/contracts/common/oz/drafts/Counters.sol new file mode 100644 index 00000000..5af417f1 --- /dev/null +++ b/contracts/common/oz/drafts/Counters.sol @@ -0,0 +1,37 @@ +pragma solidity ^0.5.2; + +import "../math/SafeMath.sol"; + +/** + * @title Counters + * @author Matt Condon (@shrugs) + * @dev Provides counters that can only be incremented or decremented by one. This can be used e.g. to track the number + * of elements in a mapping, issuing ERC721 ids, or counting request ids + * + * Include with `using Counters for Counters.Counter;` + * Since it is not possible to overflow a 256 bit integer with increments of one, `increment` can skip the SafeMath + * overflow check, thereby saving gas. This does assume however correct usage, in that the underlying `_value` is never + * directly accessed. + */ +library Counters { + using SafeMath for uint256; + + struct Counter { + // This variable should never be directly accessed by users of the library: interactions must be restricted to + // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add + // this feature: see https://github.com/ethereum/solidity/issues/4637 + uint256 _value; // default: 0 + } + + function current(Counter storage counter) internal view returns (uint256) { + return counter._value; + } + + function increment(Counter storage counter) internal { + counter._value += 1; + } + + function decrement(Counter storage counter) internal { + counter._value = counter._value.sub(1); + } +} diff --git a/contracts/common/oz/introspection/ERC165.sol b/contracts/common/oz/introspection/ERC165.sol new file mode 100644 index 00000000..3bc0f2db --- /dev/null +++ b/contracts/common/oz/introspection/ERC165.sol @@ -0,0 +1,44 @@ +pragma solidity ^0.5.2; + +import "./IERC165.sol"; + +/** + * @title ERC165 + * @author Matt Condon (@shrugs) + * @dev Implements ERC165 using a lookup table. + */ +contract ERC165 is IERC165 { + bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7; + /* + * 0x01ffc9a7 === + * bytes4(keccak256('supportsInterface(bytes4)')) + */ + + /** + * @dev a mapping of interface id to whether or not it's supported + */ + mapping(bytes4 => bool) private _supportedInterfaces; + + /** + * @dev A contract implementing SupportsInterfaceWithLookup + * implement ERC165 itself + */ + constructor () internal { + _registerInterface(_INTERFACE_ID_ERC165); + } + + /** + * @dev implement supportsInterface(bytes4) using a lookup table + */ + function supportsInterface(bytes4 interfaceId) external view returns (bool) { + return _supportedInterfaces[interfaceId]; + } + + /** + * @dev internal method for registering an interface + */ + function _registerInterface(bytes4 interfaceId) internal { + require(interfaceId != 0xffffffff); + _supportedInterfaces[interfaceId] = true; + } +} diff --git a/contracts/common/oz/introspection/IERC165.sol b/contracts/common/oz/introspection/IERC165.sol new file mode 100644 index 00000000..03e59605 --- /dev/null +++ b/contracts/common/oz/introspection/IERC165.sol @@ -0,0 +1,15 @@ +pragma solidity ^0.5.2; + +/** + * @title IERC165 + * @dev https://eips.ethereum.org/EIPS/eip-165 + */ +interface IERC165 { + /** + * @notice Query if a contract implements an interface + * @param interfaceId The interface identifier, as specified in ERC-165 + * @dev Interface identification is specified in ERC-165. This function + * uses less than 30,000 gas. + */ + function supportsInterface(bytes4 interfaceId) external view returns (bool); +} diff --git a/contracts/common/oz/lifecycle/Pausable.sol b/contracts/common/oz/lifecycle/Pausable.sol new file mode 100644 index 00000000..a1a715f5 --- /dev/null +++ b/contracts/common/oz/lifecycle/Pausable.sol @@ -0,0 +1,57 @@ +pragma solidity ^0.5.2; + +import "../access/roles/PauserRole.sol"; + +/** + * @title Pausable + * @dev Base contract which allows children to implement an emergency stop mechanism. + */ +contract Pausable is PauserRole { + event Paused(address account); + event Unpaused(address account); + + bool private _paused; + + constructor () internal { + _paused = false; + } + + /** + * @return true if the contract is paused, false otherwise. + */ + function paused() public view returns (bool) { + return _paused; + } + + /** + * @dev Modifier to make a function callable only when the contract is not paused. + */ + modifier whenNotPaused() { + require(!_paused); + _; + } + + /** + * @dev Modifier to make a function callable only when the contract is paused. + */ + modifier whenPaused() { + require(_paused); + _; + } + + /** + * @dev called by the owner to pause, triggers stopped state + */ + function pause() public onlyPauser whenNotPaused { + _paused = true; + emit Paused(msg.sender); + } + + /** + * @dev called by the owner to unpause, returns to normal state + */ + function unpause() public onlyPauser whenPaused { + _paused = false; + emit Unpaused(msg.sender); + } +} diff --git a/contracts/common/oz/math/Math.sol b/contracts/common/oz/math/Math.sol new file mode 100644 index 00000000..d12fa39c --- /dev/null +++ b/contracts/common/oz/math/Math.sol @@ -0,0 +1,31 @@ +pragma solidity ^0.5.2; + +/** + * @title Math + * @dev Assorted math operations + */ +library Math { + /** + * @dev Returns the largest of two numbers. + */ + function max(uint256 a, uint256 b) internal pure returns (uint256) { + return a >= b ? a : b; + } + + /** + * @dev Returns the smallest of two numbers. + */ + function min(uint256 a, uint256 b) internal pure returns (uint256) { + return a < b ? a : b; + } + + /** + * @dev Calculates the average of two numbers. Since these are integers, + * averages of an even and odd number cannot be represented, and will be + * rounded down. + */ + function average(uint256 a, uint256 b) internal pure returns (uint256) { + // (a + b) / 2 can overflow, so we distribute + return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2); + } +} diff --git a/contracts/common/oz/math/SafeMath.sol b/contracts/common/oz/math/SafeMath.sol new file mode 100644 index 00000000..5dd4bb90 --- /dev/null +++ b/contracts/common/oz/math/SafeMath.sol @@ -0,0 +1,65 @@ +pragma solidity ^0.5.2; + +/** + * @title SafeMath + * @dev Unsigned math operations with safety checks that revert on error + */ +library SafeMath { + /** + * @dev Multiplies two unsigned integers, reverts on overflow. + */ + function mul(uint256 a, uint256 b) internal pure returns (uint256) { + // Gas optimization: this is cheaper than requiring 'a' not being zero, but the + // benefit is lost if 'b' is also tested. + // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 + if (a == 0) { + return 0; + } + + uint256 c = a * b; + require(c / a == b); + + return c; + } + + /** + * @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero. + */ + function div(uint256 a, uint256 b) internal pure returns (uint256) { + // Solidity only automatically asserts when dividing by 0 + require(b > 0); + uint256 c = a / b; + // assert(a == b * c + a % b); // There is no case in which this doesn't hold + + return c; + } + + /** + * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend). + */ + function sub(uint256 a, uint256 b) internal pure returns (uint256) { + require(b <= a); + uint256 c = a - b; + + return c; + } + + /** + * @dev Adds two unsigned integers, reverts on overflow. + */ + function add(uint256 a, uint256 b) internal pure returns (uint256) { + uint256 c = a + b; + require(c >= a); + + return c; + } + + /** + * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo), + * reverts when dividing by zero. + */ + function mod(uint256 a, uint256 b) internal pure returns (uint256) { + require(b != 0); + return a % b; + } +} diff --git a/contracts/common/oz/ownership/Ownable.sol b/contracts/common/oz/ownership/Ownable.sol new file mode 100644 index 00000000..9780c07f --- /dev/null +++ b/contracts/common/oz/ownership/Ownable.sol @@ -0,0 +1,73 @@ +pragma solidity ^0.5.2; + +/** + * @title Ownable + * @dev The Ownable contract has an owner address, and provides basic authorization control + * functions, this simplifies the implementation of "user permissions". + */ +contract Ownable { + address private _owner; + + event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); + + /** + * @dev The Ownable constructor sets the original `owner` of the contract to the sender + * account. + */ + constructor () internal { + _owner = msg.sender; + emit OwnershipTransferred(address(0), _owner); + } + + /** + * @return the address of the owner. + */ + function owner() public view returns (address) { + return _owner; + } + + /** + * @dev Throws if called by any account other than the owner. + */ + modifier onlyOwner() { + require(isOwner()); + _; + } + + /** + * @return true if `msg.sender` is the owner of the contract. + */ + function isOwner() public view returns (bool) { + return msg.sender == _owner; + } + + /** + * @dev Allows the current owner to relinquish control of the contract. + * It will not be possible to call the functions with the `onlyOwner` + * modifier anymore. + * @notice Renouncing ownership will leave the contract without an owner, + * thereby removing any functionality that is only available to the owner. + */ + function renounceOwnership() public onlyOwner { + emit OwnershipTransferred(_owner, address(0)); + _owner = address(0); + } + + /** + * @dev Allows the current owner to transfer control of the contract to a newOwner. + * @param newOwner The address to transfer ownership to. + */ + function transferOwnership(address newOwner) public onlyOwner { + _transferOwnership(newOwner); + } + + /** + * @dev Transfers control of the contract to a newOwner. + * @param newOwner The address to transfer ownership to. + */ + function _transferOwnership(address newOwner) internal { + require(newOwner != address(0)); + emit OwnershipTransferred(_owner, newOwner); + _owner = newOwner; + } +} diff --git a/contracts/common/oz/token/ERC20/ERC20.sol b/contracts/common/oz/token/ERC20/ERC20.sol new file mode 100644 index 00000000..cedfad31 --- /dev/null +++ b/contracts/common/oz/token/ERC20/ERC20.sol @@ -0,0 +1,190 @@ +pragma solidity ^0.5.2; + +import "./IERC20.sol"; +import "../../math/SafeMath.sol"; + +/** + * @title Standard ERC20 token + * + * @dev Implementation of the basic standard token. + * https://eips.ethereum.org/EIPS/eip-20 + * Originally based on code by FirstBlood: + * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol + * + * This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for + * all accounts just by listening to said events. Note that this isn't required by the specification, and other + * compliant implementations may not do it. + */ +contract ERC20 is IERC20 { + using SafeMath for uint256; + + mapping (address => uint256) private _balances; + + mapping (address => mapping (address => uint256)) private _allowed; + + uint256 private _totalSupply; + + /** + * @dev Total number of tokens in existence + */ + function totalSupply() public view returns (uint256) { + return _totalSupply; + } + + /** + * @dev Gets the balance of the specified address. + * @param owner The address to query the balance of. + * @return A uint256 representing the amount owned by the passed address. + */ + function balanceOf(address owner) public view returns (uint256) { + return _balances[owner]; + } + + /** + * @dev Function to check the amount of tokens that an owner allowed to a spender. + * @param owner address The address which owns the funds. + * @param spender address The address which will spend the funds. + * @return A uint256 specifying the amount of tokens still available for the spender. + */ + function allowance(address owner, address spender) public view returns (uint256) { + return _allowed[owner][spender]; + } + + /** + * @dev Transfer token to a specified address + * @param to The address to transfer to. + * @param value The amount to be transferred. + */ + function transfer(address to, uint256 value) public returns (bool) { + _transfer(msg.sender, to, value); + return true; + } + + /** + * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. + * Beware that changing an allowance with this method brings the risk that someone may use both the old + * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this + * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: + * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 + * @param spender The address which will spend the funds. + * @param value The amount of tokens to be spent. + */ + function approve(address spender, uint256 value) public returns (bool) { + _approve(msg.sender, spender, value); + + return true; + } + + /** + * @dev Transfer tokens from one address to another. + * Note that while this function emits an Approval event, this is not required as per the specification, + * and other compliant implementations may not emit the event. + * @param from address The address which you want to send tokens from + * @param to address The address which you want to transfer to + * @param value uint256 the amount of tokens to be transferred + */ + function transferFrom(address from, address to, uint256 value) public returns (bool) { + _transfer(from, to, value); + _approve(from, msg.sender, _allowed[from][msg.sender].sub(value)); + return true; + } + + /** + * @dev Increase the amount of tokens that an owner allowed to a spender. + * approve should be called when _allowed[msg.sender][spender] == 0. To increment + * allowed value is better to use this function to avoid 2 calls (and wait until + * the first transaction is mined) + * From MonolithDAO Token.sol + * Emits an Approval event. + * @param spender The address which will spend the funds. + * @param addedValue The amount of tokens to increase the allowance by. + */ + function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { + _approve(msg.sender, spender, _allowed[msg.sender][spender].add(addedValue)); + return true; + } + + /** + * @dev Decrease the amount of tokens that an owner allowed to a spender. + * approve should be called when _allowed[msg.sender][spender] == 0. To decrement + * allowed value is better to use this function to avoid 2 calls (and wait until + * the first transaction is mined) + * From MonolithDAO Token.sol + * Emits an Approval event. + * @param spender The address which will spend the funds. + * @param subtractedValue The amount of tokens to decrease the allowance by. + */ + function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { + _approve(msg.sender, spender, _allowed[msg.sender][spender].sub(subtractedValue)); + return true; + } + + /** + * @dev Transfer token for a specified addresses + * @param from The address to transfer from. + * @param to The address to transfer to. + * @param value The amount to be transferred. + */ + function _transfer(address from, address to, uint256 value) internal { + require(to != address(0)); + + _balances[from] = _balances[from].sub(value); + _balances[to] = _balances[to].add(value); + emit Transfer(from, to, value); + } + + /** + * @dev Internal function that mints an amount of the token and assigns it to + * an account. This encapsulates the modification of balances such that the + * proper events are emitted. + * @param account The account that will receive the created tokens. + * @param value The amount that will be created. + */ + function _mint(address account, uint256 value) internal { + require(account != address(0)); + + _totalSupply = _totalSupply.add(value); + _balances[account] = _balances[account].add(value); + emit Transfer(address(0), account, value); + } + + /** + * @dev Internal function that burns an amount of the token of a given + * account. + * @param account The account whose tokens will be burnt. + * @param value The amount that will be burnt. + */ + function _burn(address account, uint256 value) internal { + require(account != address(0)); + + _totalSupply = _totalSupply.sub(value); + _balances[account] = _balances[account].sub(value); + emit Transfer(account, address(0), value); + } + + /** + * @dev Approve an address to spend another addresses' tokens. + * @param owner The address that owns the tokens. + * @param spender The address that will spend the tokens. + * @param value The number of tokens that can be spent. + */ + function _approve(address owner, address spender, uint256 value) internal { + require(spender != address(0)); + require(owner != address(0)); + _allowed[owner][spender] = value; + emit Approval(owner, spender, value); + } + + /** + * @dev Internal function that burns an amount of the token of a given + * account, deducting from the sender's allowance for said account. Uses the + * internal burn function. + * Emits an Approval event (reflecting the reduced allowance). + * @param account The account whose tokens will be burnt. + * @param value The amount that will be burnt. + */ + function _burnFrom(address account, uint256 value) internal { + _burn(account, value); + _approve(account, msg.sender, _allowed[account][msg.sender].sub(value)); + } +} diff --git a/contracts/common/oz/token/ERC20/ERC20Detailed.sol b/contracts/common/oz/token/ERC20/ERC20Detailed.sol new file mode 100644 index 00000000..c7face24 --- /dev/null +++ b/contracts/common/oz/token/ERC20/ERC20Detailed.sol @@ -0,0 +1,42 @@ +pragma solidity ^0.5.2; + +import "./IERC20.sol"; + +/** + * @title ERC20Detailed token + * @dev The decimals are only for visualization purposes. + * All the operations are done using the smallest and indivisible token unit, + * just as on Ethereum all the operations are done in wei. + */ +contract ERC20Detailed is IERC20 { + string private _name; + string private _symbol; + uint8 private _decimals; + + constructor (string memory name, string memory symbol, uint8 decimals) public { + _name = name; + _symbol = symbol; + _decimals = decimals; + } + + /** + * @return the name of the token. + */ + function name() public view returns (string memory) { + return _name; + } + + /** + * @return the symbol of the token. + */ + function symbol() public view returns (string memory) { + return _symbol; + } + + /** + * @return the number of decimals of the token. + */ + function decimals() public view returns (uint8) { + return _decimals; + } +} diff --git a/contracts/common/oz/token/ERC20/ERC20Mintable.sol b/contracts/common/oz/token/ERC20/ERC20Mintable.sol new file mode 100644 index 00000000..9a1d8cfe --- /dev/null +++ b/contracts/common/oz/token/ERC20/ERC20Mintable.sol @@ -0,0 +1,21 @@ +pragma solidity ^0.5.2; + +import "./ERC20.sol"; +import "../../access/roles/MinterRole.sol"; + +/** + * @title ERC20Mintable + * @dev ERC20 minting logic + */ +contract ERC20Mintable is ERC20, MinterRole { + /** + * @dev Function to mint tokens + * @param to The address that will receive the minted tokens. + * @param value The amount of tokens to mint. + * @return A boolean that indicates if the operation was successful. + */ + function mint(address to, uint256 value) public onlyMinter returns (bool) { + _mint(to, value); + return true; + } +} diff --git a/contracts/common/oz/token/ERC20/IERC20.sol b/contracts/common/oz/token/ERC20/IERC20.sol new file mode 100644 index 00000000..06c32714 --- /dev/null +++ b/contracts/common/oz/token/ERC20/IERC20.sol @@ -0,0 +1,23 @@ +pragma solidity ^0.5.2; + +/** + * @title ERC20 interface + * @dev see https://eips.ethereum.org/EIPS/eip-20 + */ +interface IERC20 { + function transfer(address to, uint256 value) external returns (bool); + + function approve(address spender, uint256 value) external returns (bool); + + function transferFrom(address from, address to, uint256 value) external returns (bool); + + function totalSupply() external view returns (uint256); + + function balanceOf(address who) external view returns (uint256); + + function allowance(address owner, address spender) external view returns (uint256); + + event Transfer(address indexed from, address indexed to, uint256 value); + + event Approval(address indexed owner, address indexed spender, uint256 value); +} diff --git a/contracts/common/oz/token/ERC20/SafeERC20.sol b/contracts/common/oz/token/ERC20/SafeERC20.sol new file mode 100644 index 00000000..e632c27f --- /dev/null +++ b/contracts/common/oz/token/ERC20/SafeERC20.sol @@ -0,0 +1,71 @@ +pragma solidity ^0.5.2; + +import "./IERC20.sol"; +import "../../math/SafeMath.sol"; +import "../../utils/Address.sol"; + +/** + * @title SafeERC20 + * @dev Wrappers around ERC20 operations that throw on failure (when the token + * contract returns false). Tokens that return no value (and instead revert or + * throw on failure) are also supported, non-reverting calls are assumed to be + * successful. + * To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract, + * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. + */ +library SafeERC20 { + using SafeMath for uint256; + using Address for address; + + function safeTransfer(IERC20 token, address to, uint256 value) internal { + callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); + } + + function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { + callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); + } + + function safeApprove(IERC20 token, address spender, uint256 value) internal { + // safeApprove should only be called when setting an initial allowance, + // or when resetting it to zero. To increase and decrease it, use + // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' + require((value == 0) || (token.allowance(address(this), spender) == 0)); + callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); + } + + function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { + uint256 newAllowance = token.allowance(address(this), spender).add(value); + callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); + } + + function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { + uint256 newAllowance = token.allowance(address(this), spender).sub(value); + callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); + } + + /** + * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement + * on the return value: the return value is optional (but if data is returned, it must equal true). + * @param token The token targeted by the call. + * @param data The call data (encoded using abi.encode or one of its variants). + */ + function callOptionalReturn(IERC20 token, bytes memory data) private { + // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since + // we're implementing it ourselves. + + // A Solidity high level call has three parts: + // 1. The target address is checked to verify it contains contract code + // 2. The call itself is made, and success asserted + // 3. The return value is decoded, which in turn checks the size of the returned data. + + require(address(token).isContract()); + + // solhint-disable-next-line avoid-low-level-calls + (bool success, bytes memory returndata) = address(token).call(data); + require(success); + + if (returndata.length > 0) { // Return data is optional + require(abi.decode(returndata, (bool))); + } + } +} diff --git a/contracts/common/oz/token/ERC721/ERC721.sol b/contracts/common/oz/token/ERC721/ERC721.sol new file mode 100644 index 00000000..64db06e4 --- /dev/null +++ b/contracts/common/oz/token/ERC721/ERC721.sol @@ -0,0 +1,286 @@ +pragma solidity ^0.5.2; + +import "./IERC721.sol"; +import "./IERC721Receiver.sol"; +import "../../math/SafeMath.sol"; +import "../../utils/Address.sol"; +import "../../drafts/Counters.sol"; +import "../../introspection/ERC165.sol"; + +/** + * @title ERC721 Non-Fungible Token Standard basic implementation + * @dev see https://eips.ethereum.org/EIPS/eip-721 + */ +contract ERC721 is ERC165, IERC721 { + using SafeMath for uint256; + using Address for address; + using Counters for Counters.Counter; + + // Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))` + // which can be also obtained as `IERC721Receiver(0).onERC721Received.selector` + bytes4 private constant _ERC721_RECEIVED = 0x150b7a02; + + // Mapping from token ID to owner + mapping (uint256 => address) private _tokenOwner; + + // Mapping from token ID to approved address + mapping (uint256 => address) private _tokenApprovals; + + // Mapping from owner to number of owned token + mapping (address => Counters.Counter) private _ownedTokensCount; + + // Mapping from owner to operator approvals + mapping (address => mapping (address => bool)) private _operatorApprovals; + + bytes4 private constant _INTERFACE_ID_ERC721 = 0x80ac58cd; + /* + * 0x80ac58cd === + * bytes4(keccak256('balanceOf(address)')) ^ + * bytes4(keccak256('ownerOf(uint256)')) ^ + * bytes4(keccak256('approve(address,uint256)')) ^ + * bytes4(keccak256('getApproved(uint256)')) ^ + * bytes4(keccak256('setApprovalForAll(address,bool)')) ^ + * bytes4(keccak256('isApprovedForAll(address,address)')) ^ + * bytes4(keccak256('transferFrom(address,address,uint256)')) ^ + * bytes4(keccak256('safeTransferFrom(address,address,uint256)')) ^ + * bytes4(keccak256('safeTransferFrom(address,address,uint256,bytes)')) + */ + + constructor () public { + // register the supported interfaces to conform to ERC721 via ERC165 + _registerInterface(_INTERFACE_ID_ERC721); + } + + /** + * @dev Gets the balance of the specified address + * @param owner address to query the balance of + * @return uint256 representing the amount owned by the passed address + */ + function balanceOf(address owner) public view returns (uint256) { + require(owner != address(0)); + return _ownedTokensCount[owner].current(); + } + + /** + * @dev Gets the owner of the specified token ID + * @param tokenId uint256 ID of the token to query the owner of + * @return address currently marked as the owner of the given token ID + */ + function ownerOf(uint256 tokenId) public view returns (address) { + address owner = _tokenOwner[tokenId]; + require(owner != address(0)); + return owner; + } + + /** + * @dev Approves another address to transfer the given token ID + * The zero address indicates there is no approved address. + * There can only be one approved address per token at a given time. + * Can only be called by the token owner or an approved operator. + * @param to address to be approved for the given token ID + * @param tokenId uint256 ID of the token to be approved + */ + function approve(address to, uint256 tokenId) public { + address owner = ownerOf(tokenId); + require(to != owner); + require(msg.sender == owner || isApprovedForAll(owner, msg.sender)); + + _tokenApprovals[tokenId] = to; + emit Approval(owner, to, tokenId); + } + + /** + * @dev Gets the approved address for a token ID, or zero if no address set + * Reverts if the token ID does not exist. + * @param tokenId uint256 ID of the token to query the approval of + * @return address currently approved for the given token ID + */ + function getApproved(uint256 tokenId) public view returns (address) { + require(_exists(tokenId)); + return _tokenApprovals[tokenId]; + } + + /** + * @dev Sets or unsets the approval of a given operator + * An operator is allowed to transfer all tokens of the sender on their behalf + * @param to operator address to set the approval + * @param approved representing the status of the approval to be set + */ + function setApprovalForAll(address to, bool approved) public { + require(to != msg.sender); + _operatorApprovals[msg.sender][to] = approved; + emit ApprovalForAll(msg.sender, to, approved); + } + + /** + * @dev Tells whether an operator is approved by a given owner + * @param owner owner address which you want to query the approval of + * @param operator operator address which you want to query the approval of + * @return bool whether the given operator is approved by the given owner + */ + function isApprovedForAll(address owner, address operator) public view returns (bool) { + return _operatorApprovals[owner][operator]; + } + + /** + * @dev Transfers the ownership of a given token ID to another address + * Usage of this method is discouraged, use `safeTransferFrom` whenever possible + * Requires the msg.sender to be the owner, approved, or operator + * @param from current owner of the token + * @param to address to receive the ownership of the given token ID + * @param tokenId uint256 ID of the token to be transferred + */ + function transferFrom(address from, address to, uint256 tokenId) public { + require(_isApprovedOrOwner(msg.sender, tokenId)); + + _transferFrom(from, to, tokenId); + } + + /** + * @dev Safely transfers the ownership of a given token ID to another address + * If the target address is a contract, it must implement `onERC721Received`, + * which is called upon a safe transfer, and return the magic value + * `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise, + * the transfer is reverted. + * Requires the msg.sender to be the owner, approved, or operator + * @param from current owner of the token + * @param to address to receive the ownership of the given token ID + * @param tokenId uint256 ID of the token to be transferred + */ + function safeTransferFrom(address from, address to, uint256 tokenId) public { + safeTransferFrom(from, to, tokenId, ""); + } + + /** + * @dev Safely transfers the ownership of a given token ID to another address + * If the target address is a contract, it must implement `onERC721Received`, + * which is called upon a safe transfer, and return the magic value + * `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise, + * the transfer is reverted. + * Requires the msg.sender to be the owner, approved, or operator + * @param from current owner of the token + * @param to address to receive the ownership of the given token ID + * @param tokenId uint256 ID of the token to be transferred + * @param _data bytes data to send along with a safe transfer check + */ + function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public { + transferFrom(from, to, tokenId); + require(_checkOnERC721Received(from, to, tokenId, _data)); + } + + /** + * @dev Returns whether the specified token exists + * @param tokenId uint256 ID of the token to query the existence of + * @return bool whether the token exists + */ + function _exists(uint256 tokenId) internal view returns (bool) { + address owner = _tokenOwner[tokenId]; + return owner != address(0); + } + + /** + * @dev Returns whether the given spender can transfer a given token ID + * @param spender address of the spender to query + * @param tokenId uint256 ID of the token to be transferred + * @return bool whether the msg.sender is approved for the given token ID, + * is an operator of the owner, or is the owner of the token + */ + function _isApprovedOrOwner(address spender, uint256 tokenId) internal view returns (bool) { + address owner = ownerOf(tokenId); + return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender)); + } + + /** + * @dev Internal function to mint a new token + * Reverts if the given token ID already exists + * @param to The address that will own the minted token + * @param tokenId uint256 ID of the token to be minted + */ + function _mint(address to, uint256 tokenId) internal { + require(to != address(0)); + require(!_exists(tokenId)); + + _tokenOwner[tokenId] = to; + _ownedTokensCount[to].increment(); + + emit Transfer(address(0), to, tokenId); + } + + /** + * @dev Internal function to burn a specific token + * Reverts if the token does not exist + * Deprecated, use _burn(uint256) instead. + * @param owner owner of the token to burn + * @param tokenId uint256 ID of the token being burned + */ + function _burn(address owner, uint256 tokenId) internal { + require(ownerOf(tokenId) == owner); + + _clearApproval(tokenId); + + _ownedTokensCount[owner].decrement(); + _tokenOwner[tokenId] = address(0); + + emit Transfer(owner, address(0), tokenId); + } + + /** + * @dev Internal function to burn a specific token + * Reverts if the token does not exist + * @param tokenId uint256 ID of the token being burned + */ + function _burn(uint256 tokenId) internal { + _burn(ownerOf(tokenId), tokenId); + } + + /** + * @dev Internal function to transfer ownership of a given token ID to another address. + * As opposed to transferFrom, this imposes no restrictions on msg.sender. + * @param from current owner of the token + * @param to address to receive the ownership of the given token ID + * @param tokenId uint256 ID of the token to be transferred + */ + function _transferFrom(address from, address to, uint256 tokenId) internal { + require(ownerOf(tokenId) == from); + require(to != address(0)); + + _clearApproval(tokenId); + + _ownedTokensCount[from].decrement(); + _ownedTokensCount[to].increment(); + + _tokenOwner[tokenId] = to; + + emit Transfer(from, to, tokenId); + } + + /** + * @dev Internal function to invoke `onERC721Received` on a target address + * The call is not executed if the target address is not a contract + * @param from address representing the previous owner of the given token ID + * @param to target address that will receive the tokens + * @param tokenId uint256 ID of the token to be transferred + * @param _data bytes optional data to send along with the call + * @return bool whether the call correctly returned the expected magic value + */ + function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data) + internal returns (bool) + { + if (!to.isContract()) { + return true; + } + + bytes4 retval = IERC721Receiver(to).onERC721Received(msg.sender, from, tokenId, _data); + return (retval == _ERC721_RECEIVED); + } + + /** + * @dev Private function to clear current approval of a given token ID + * @param tokenId uint256 ID of the token to be transferred + */ + function _clearApproval(uint256 tokenId) private { + if (_tokenApprovals[tokenId] != address(0)) { + _tokenApprovals[tokenId] = address(0); + } + } +} diff --git a/contracts/common/oz/token/ERC721/ERC721Enumerable.sol b/contracts/common/oz/token/ERC721/ERC721Enumerable.sol new file mode 100644 index 00000000..0b5fd9c0 --- /dev/null +++ b/contracts/common/oz/token/ERC721/ERC721Enumerable.sol @@ -0,0 +1,198 @@ +pragma solidity ^0.5.2; + +import "./IERC721Enumerable.sol"; +import "./ERC721.sol"; +import "../../introspection/ERC165.sol"; + +/** + * @title ERC-721 Non-Fungible Token with optional enumeration extension logic + * @dev See https://eips.ethereum.org/EIPS/eip-721 + */ +contract ERC721Enumerable is ERC165, ERC721, IERC721Enumerable { + // Mapping from owner to list of owned token IDs + mapping(address => uint256[]) private _ownedTokens; + + // Mapping from token ID to index of the owner tokens list + mapping(uint256 => uint256) private _ownedTokensIndex; + + // Array with all token ids, used for enumeration + uint256[] private _allTokens; + + // Mapping from token id to position in the allTokens array + mapping(uint256 => uint256) private _allTokensIndex; + + bytes4 private constant _INTERFACE_ID_ERC721_ENUMERABLE = 0x780e9d63; + /* + * 0x780e9d63 === + * bytes4(keccak256('totalSupply()')) ^ + * bytes4(keccak256('tokenOfOwnerByIndex(address,uint256)')) ^ + * bytes4(keccak256('tokenByIndex(uint256)')) + */ + + /** + * @dev Constructor function + */ + constructor () public { + // register the supported interface to conform to ERC721Enumerable via ERC165 + _registerInterface(_INTERFACE_ID_ERC721_ENUMERABLE); + } + + /** + * @dev Gets the token ID at a given index of the tokens list of the requested owner + * @param owner address owning the tokens list to be accessed + * @param index uint256 representing the index to be accessed of the requested tokens list + * @return uint256 token ID at the given index of the tokens list owned by the requested address + */ + function tokenOfOwnerByIndex(address owner, uint256 index) public view returns (uint256) { + require(index < balanceOf(owner)); + return _ownedTokens[owner][index]; + } + + /** + * @dev Gets the total amount of tokens stored by the contract + * @return uint256 representing the total amount of tokens + */ + function totalSupply() public view returns (uint256) { + return _allTokens.length; + } + + /** + * @dev Gets the token ID at a given index of all the tokens in this contract + * Reverts if the index is greater or equal to the total number of tokens + * @param index uint256 representing the index to be accessed of the tokens list + * @return uint256 token ID at the given index of the tokens list + */ + function tokenByIndex(uint256 index) public view returns (uint256) { + require(index < totalSupply()); + return _allTokens[index]; + } + + /** + * @dev Internal function to transfer ownership of a given token ID to another address. + * As opposed to transferFrom, this imposes no restrictions on msg.sender. + * @param from current owner of the token + * @param to address to receive the ownership of the given token ID + * @param tokenId uint256 ID of the token to be transferred + */ + function _transferFrom(address from, address to, uint256 tokenId) internal { + super._transferFrom(from, to, tokenId); + + _removeTokenFromOwnerEnumeration(from, tokenId); + + _addTokenToOwnerEnumeration(to, tokenId); + } + + /** + * @dev Internal function to mint a new token + * Reverts if the given token ID already exists + * @param to address the beneficiary that will own the minted token + * @param tokenId uint256 ID of the token to be minted + */ + function _mint(address to, uint256 tokenId) internal { + super._mint(to, tokenId); + + _addTokenToOwnerEnumeration(to, tokenId); + + _addTokenToAllTokensEnumeration(tokenId); + } + + /** + * @dev Internal function to burn a specific token + * Reverts if the token does not exist + * Deprecated, use _burn(uint256) instead + * @param owner owner of the token to burn + * @param tokenId uint256 ID of the token being burned + */ + function _burn(address owner, uint256 tokenId) internal { + super._burn(owner, tokenId); + + _removeTokenFromOwnerEnumeration(owner, tokenId); + // Since tokenId will be deleted, we can clear its slot in _ownedTokensIndex to trigger a gas refund + _ownedTokensIndex[tokenId] = 0; + + _removeTokenFromAllTokensEnumeration(tokenId); + } + + /** + * @dev Gets the list of token IDs of the requested owner + * @param owner address owning the tokens + * @return uint256[] List of token IDs owned by the requested address + */ + function _tokensOfOwner(address owner) internal view returns (uint256[] storage) { + return _ownedTokens[owner]; + } + + /** + * @dev Private function to add a token to this extension's ownership-tracking data structures. + * @param to address representing the new owner of the given token ID + * @param tokenId uint256 ID of the token to be added to the tokens list of the given address + */ + function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { + _ownedTokensIndex[tokenId] = _ownedTokens[to].length; + _ownedTokens[to].push(tokenId); + } + + /** + * @dev Private function to add a token to this extension's token tracking data structures. + * @param tokenId uint256 ID of the token to be added to the tokens list + */ + function _addTokenToAllTokensEnumeration(uint256 tokenId) private { + _allTokensIndex[tokenId] = _allTokens.length; + _allTokens.push(tokenId); + } + + /** + * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that + * while the token is not assigned a new owner, the _ownedTokensIndex mapping is _not_ updated: this allows for + * gas optimizations e.g. when performing a transfer operation (avoiding double writes). + * This has O(1) time complexity, but alters the order of the _ownedTokens array. + * @param from address representing the previous owner of the given token ID + * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address + */ + function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { + // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and + // then delete the last slot (swap and pop). + + uint256 lastTokenIndex = _ownedTokens[from].length.sub(1); + uint256 tokenIndex = _ownedTokensIndex[tokenId]; + + // When the token to delete is the last token, the swap operation is unnecessary + if (tokenIndex != lastTokenIndex) { + uint256 lastTokenId = _ownedTokens[from][lastTokenIndex]; + + _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token + _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index + } + + // This also deletes the contents at the last position of the array + _ownedTokens[from].length--; + + // Note that _ownedTokensIndex[tokenId] hasn't been cleared: it still points to the old slot (now occupied by + // lastTokenId, or just over the end of the array if the token was the last one). + } + + /** + * @dev Private function to remove a token from this extension's token tracking data structures. + * This has O(1) time complexity, but alters the order of the _allTokens array. + * @param tokenId uint256 ID of the token to be removed from the tokens list + */ + function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { + // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and + // then delete the last slot (swap and pop). + + uint256 lastTokenIndex = _allTokens.length.sub(1); + uint256 tokenIndex = _allTokensIndex[tokenId]; + + // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so + // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding + // an 'if' statement (like in _removeTokenFromOwnerEnumeration) + uint256 lastTokenId = _allTokens[lastTokenIndex]; + + _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token + _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index + + // This also deletes the contents at the last position of the array + _allTokens.length--; + _allTokensIndex[tokenId] = 0; + } +} diff --git a/contracts/common/oz/token/ERC721/ERC721Full.sol b/contracts/common/oz/token/ERC721/ERC721Full.sol new file mode 100644 index 00000000..d76d6995 --- /dev/null +++ b/contracts/common/oz/token/ERC721/ERC721Full.sol @@ -0,0 +1,17 @@ +pragma solidity ^0.5.2; + +import "./ERC721.sol"; +import "./ERC721Enumerable.sol"; +import "./ERC721Metadata.sol"; + +/** + * @title Full ERC721 Token + * This implementation includes all the required and some optional functionality of the ERC721 standard + * Moreover, it includes approve all functionality using operator terminology + * @dev see https://eips.ethereum.org/EIPS/eip-721 + */ +contract ERC721Full is ERC721, ERC721Enumerable, ERC721Metadata { + constructor (string memory name, string memory symbol) public ERC721Metadata(name, symbol) { + // solhint-disable-previous-line no-empty-blocks + } +} diff --git a/contracts/common/oz/token/ERC721/ERC721Holder.sol b/contracts/common/oz/token/ERC721/ERC721Holder.sol new file mode 100644 index 00000000..3121ec9b --- /dev/null +++ b/contracts/common/oz/token/ERC721/ERC721Holder.sol @@ -0,0 +1,9 @@ +pragma solidity ^0.5.2; + +import "./IERC721Receiver.sol"; + +contract ERC721Holder is IERC721Receiver { + function onERC721Received(address, address, uint256, bytes memory) public returns (bytes4) { + return this.onERC721Received.selector; + } +} diff --git a/contracts/common/oz/token/ERC721/ERC721Metadata.sol b/contracts/common/oz/token/ERC721/ERC721Metadata.sol new file mode 100644 index 00000000..0da71d0b --- /dev/null +++ b/contracts/common/oz/token/ERC721/ERC721Metadata.sol @@ -0,0 +1,88 @@ +pragma solidity ^0.5.2; + +import "./ERC721.sol"; +import "./IERC721Metadata.sol"; +import "../../introspection/ERC165.sol"; + +contract ERC721Metadata is ERC165, ERC721, IERC721Metadata { + // Token name + string private _name; + + // Token symbol + string private _symbol; + + // Optional mapping for token URIs + mapping(uint256 => string) private _tokenURIs; + + bytes4 private constant _INTERFACE_ID_ERC721_METADATA = 0x5b5e139f; + /* + * 0x5b5e139f === + * bytes4(keccak256('name()')) ^ + * bytes4(keccak256('symbol()')) ^ + * bytes4(keccak256('tokenURI(uint256)')) + */ + + /** + * @dev Constructor function + */ + constructor (string memory name, string memory symbol) public { + _name = name; + _symbol = symbol; + + // register the supported interfaces to conform to ERC721 via ERC165 + _registerInterface(_INTERFACE_ID_ERC721_METADATA); + } + + /** + * @dev Gets the token name + * @return string representing the token name + */ + function name() external view returns (string memory) { + return _name; + } + + /** + * @dev Gets the token symbol + * @return string representing the token symbol + */ + function symbol() external view returns (string memory) { + return _symbol; + } + + /** + * @dev Returns an URI for a given token ID + * Throws if the token ID does not exist. May return an empty string. + * @param tokenId uint256 ID of the token to query + */ + function tokenURI(uint256 tokenId) external view returns (string memory) { + require(_exists(tokenId)); + return _tokenURIs[tokenId]; + } + + /** + * @dev Internal function to set the token URI for a given token + * Reverts if the token ID does not exist + * @param tokenId uint256 ID of the token to set its URI + * @param uri string URI to assign + */ + function _setTokenURI(uint256 tokenId, string memory uri) internal { + require(_exists(tokenId)); + _tokenURIs[tokenId] = uri; + } + + /** + * @dev Internal function to burn a specific token + * Reverts if the token does not exist + * Deprecated, use _burn(uint256) instead + * @param owner owner of the token to burn + * @param tokenId uint256 ID of the token being burned by the msg.sender + */ + function _burn(address owner, uint256 tokenId) internal { + super._burn(owner, tokenId); + + // Clear metadata (if any) + if (bytes(_tokenURIs[tokenId]).length != 0) { + delete _tokenURIs[tokenId]; + } + } +} diff --git a/contracts/common/oz/token/ERC721/ERC721MetadataMintable.sol b/contracts/common/oz/token/ERC721/ERC721MetadataMintable.sol new file mode 100644 index 00000000..b73f5631 --- /dev/null +++ b/contracts/common/oz/token/ERC721/ERC721MetadataMintable.sol @@ -0,0 +1,24 @@ +pragma solidity ^0.5.2; + +import "./ERC721Metadata.sol"; +import "../../access/roles/MinterRole.sol"; + + +/** + * @title ERC721MetadataMintable + * @dev ERC721 minting logic with metadata + */ +contract ERC721MetadataMintable is ERC721, ERC721Metadata, MinterRole { + /** + * @dev Function to mint tokens + * @param to The address that will receive the minted tokens. + * @param tokenId The token id to mint. + * @param tokenURI The token URI of the minted token. + * @return A boolean that indicates if the operation was successful. + */ + function mintWithTokenURI(address to, uint256 tokenId, string memory tokenURI) public onlyMinter returns (bool) { + _mint(to, tokenId); + _setTokenURI(tokenId, tokenURI); + return true; + } +} diff --git a/contracts/common/oz/token/ERC721/ERC721Mintable.sol b/contracts/common/oz/token/ERC721/ERC721Mintable.sol new file mode 100644 index 00000000..10a47dd4 --- /dev/null +++ b/contracts/common/oz/token/ERC721/ERC721Mintable.sol @@ -0,0 +1,21 @@ +pragma solidity ^0.5.2; + +import "./ERC721.sol"; +import "../../access/roles/MinterRole.sol"; + +/** + * @title ERC721Mintable + * @dev ERC721 minting logic + */ +contract ERC721Mintable is ERC721, MinterRole { + /** + * @dev Function to mint tokens + * @param to The address that will receive the minted tokens. + * @param tokenId The token id to mint. + * @return A boolean that indicates if the operation was successful. + */ + function mint(address to, uint256 tokenId) public onlyMinter returns (bool) { + _mint(to, tokenId); + return true; + } +} diff --git a/contracts/common/oz/token/ERC721/IERC721.sol b/contracts/common/oz/token/ERC721/IERC721.sol new file mode 100644 index 00000000..0f02852a --- /dev/null +++ b/contracts/common/oz/token/ERC721/IERC721.sol @@ -0,0 +1,27 @@ +pragma solidity ^0.5.2; + +import "../../introspection/IERC165.sol"; + +/** + * @title ERC721 Non-Fungible Token Standard basic interface + * @dev see https://eips.ethereum.org/EIPS/eip-721 + */ +contract IERC721 is IERC165 { + event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); + event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); + event ApprovalForAll(address indexed owner, address indexed operator, bool approved); + + function balanceOf(address owner) public view returns (uint256 balance); + function ownerOf(uint256 tokenId) public view returns (address owner); + + function approve(address to, uint256 tokenId) public; + function getApproved(uint256 tokenId) public view returns (address operator); + + function setApprovalForAll(address operator, bool _approved) public; + function isApprovedForAll(address owner, address operator) public view returns (bool); + + function transferFrom(address from, address to, uint256 tokenId) public; + function safeTransferFrom(address from, address to, uint256 tokenId) public; + + function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public; +} diff --git a/contracts/common/oz/token/ERC721/IERC721Enumerable.sol b/contracts/common/oz/token/ERC721/IERC721Enumerable.sol new file mode 100644 index 00000000..5d56c811 --- /dev/null +++ b/contracts/common/oz/token/ERC721/IERC721Enumerable.sol @@ -0,0 +1,14 @@ +pragma solidity ^0.5.2; + +import "./IERC721.sol"; + +/** + * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension + * @dev See https://eips.ethereum.org/EIPS/eip-721 + */ +contract IERC721Enumerable is IERC721 { + function totalSupply() public view returns (uint256); + function tokenOfOwnerByIndex(address owner, uint256 index) public view returns (uint256 tokenId); + + function tokenByIndex(uint256 index) public view returns (uint256); +} diff --git a/contracts/common/oz/token/ERC721/IERC721Full.sol b/contracts/common/oz/token/ERC721/IERC721Full.sol new file mode 100644 index 00000000..fe91109a --- /dev/null +++ b/contracts/common/oz/token/ERC721/IERC721Full.sol @@ -0,0 +1,13 @@ +pragma solidity ^0.5.2; + +import "./IERC721.sol"; +import "./IERC721Enumerable.sol"; +import "./IERC721Metadata.sol"; + +/** + * @title ERC-721 Non-Fungible Token Standard, full implementation interface + * @dev See https://eips.ethereum.org/EIPS/eip-721 + */ +contract IERC721Full is IERC721, IERC721Enumerable, IERC721Metadata { + // solhint-disable-previous-line no-empty-blocks +} diff --git a/contracts/common/oz/token/ERC721/IERC721Metadata.sol b/contracts/common/oz/token/ERC721/IERC721Metadata.sol new file mode 100644 index 00000000..a22c3dd6 --- /dev/null +++ b/contracts/common/oz/token/ERC721/IERC721Metadata.sol @@ -0,0 +1,13 @@ +pragma solidity ^0.5.2; + +import "./IERC721.sol"; + +/** + * @title ERC-721 Non-Fungible Token Standard, optional metadata extension + * @dev See https://eips.ethereum.org/EIPS/eip-721 + */ +contract IERC721Metadata is IERC721 { + function name() external view returns (string memory); + function symbol() external view returns (string memory); + function tokenURI(uint256 tokenId) external view returns (string memory); +} diff --git a/contracts/common/oz/token/ERC721/IERC721Receiver.sol b/contracts/common/oz/token/ERC721/IERC721Receiver.sol new file mode 100644 index 00000000..bd76e674 --- /dev/null +++ b/contracts/common/oz/token/ERC721/IERC721Receiver.sol @@ -0,0 +1,25 @@ +pragma solidity ^0.5.2; + +/** + * @title ERC721 token receiver interface + * @dev Interface for any contract that wants to support safeTransfers + * from ERC721 asset contracts. + */ +contract IERC721Receiver { + /** + * @notice Handle the receipt of an NFT + * @dev The ERC721 smart contract calls this function on the recipient + * after a `safeTransfer`. This function MUST return the function selector, + * otherwise the caller will revert the transaction. The selector to be + * returned can be obtained as `this.onERC721Received.selector`. This + * function MAY throw to revert and reject the transfer. + * Note: the ERC721 contract address is always the message sender. + * @param operator The address which called `safeTransferFrom` function + * @param from The address which previously owned the token + * @param tokenId The NFT identifier which is being transferred + * @param data Additional data with no specified format + * @return bytes4 `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))` + */ + function onERC721Received(address operator, address from, uint256 tokenId, bytes memory data) + public returns (bytes4); +} diff --git a/contracts/common/oz/utils/Address.sol b/contracts/common/oz/utils/Address.sol new file mode 100644 index 00000000..98c8778f --- /dev/null +++ b/contracts/common/oz/utils/Address.sol @@ -0,0 +1,26 @@ +pragma solidity ^0.5.2; + +/** + * Utility library of inline functions on addresses + */ +library Address { + /** + * Returns whether the target address is a contract + * @dev This function will return false if invoked during the constructor of a contract, + * as the code is not actually created until after the constructor finishes. + * @param account address of the account to check + * @return whether the target address is a contract + */ + function isContract(address account) internal view returns (bool) { + uint256 size; + // XXX Currently there is no better way to check if there is a contract in an address + // than to check the size of the code at that address. + // See https://ethereum.stackexchange.com/a/14016/36603 + // for more details about how this works. + // TODO Check this again before the Serenity release, because all addresses will be + // contracts then. + // solhint-disable-next-line no-inline-assembly + assembly { size := extcodesize(account) } + return size > 0; + } +} diff --git a/contracts/common/tokens/ERC20NonTradable.sol b/contracts/common/tokens/ERC20NonTradable.sol index 5258c8b5..5901cf83 100644 --- a/contracts/common/tokens/ERC20NonTradable.sol +++ b/contracts/common/tokens/ERC20NonTradable.sol @@ -1,6 +1,6 @@ pragma solidity ^0.5.2; -import {ERC20} from "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol"; +import {ERC20} from "../oz/token/ERC20/ERC20.sol"; contract ERC20NonTradable is ERC20 { function _approve( diff --git a/contracts/common/tokens/ERC20Permit.sol b/contracts/common/tokens/ERC20Permit.sol index 18a2f4a7..1d445989 100644 --- a/contracts/common/tokens/ERC20Permit.sol +++ b/contracts/common/tokens/ERC20Permit.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity 0.5.17; -import {ECDSA} from "openzeppelin-solidity/contracts/cryptography/ECDSA.sol"; +import {ECVerify} from "../lib/ECVerify.sol"; import {TestToken} from "./TestToken.sol"; import {EIP712} from "./../misc/EIP712.sol"; import {IERC20Permit} from "./../misc/IERC20Permit.sol"; @@ -41,7 +41,7 @@ contract ERC20Permit is TestToken, IERC20Permit, EIP712 { bytes32 hash = _hashTypedDataV4(structHash); - address signer = ECDSA.recover(hash, _compress(v, r, s)); + address signer = ECVerify.ecrecovery(hash, v, r, s); if (signer != owner) { revert("ERC2612InvalidSigner"); } diff --git a/contracts/common/tokens/ERC721PlasmaMintable.sol b/contracts/common/tokens/ERC721PlasmaMintable.sol index 477a92cd..47f3cb75 100644 --- a/contracts/common/tokens/ERC721PlasmaMintable.sol +++ b/contracts/common/tokens/ERC721PlasmaMintable.sol @@ -1,8 +1,8 @@ pragma solidity ^0.5.2; -import {ERC721Mintable} from "openzeppelin-solidity/contracts/token/ERC721/ERC721Mintable.sol"; -import {ERC721MetadataMintable} from "openzeppelin-solidity/contracts/token/ERC721/ERC721MetadataMintable.sol"; -import {ERC721Metadata} from "openzeppelin-solidity/contracts/token/ERC721/ERC721Metadata.sol"; +import {ERC721Mintable} from "../oz/token/ERC721/ERC721Mintable.sol"; +import {ERC721MetadataMintable} from "../oz/token/ERC721/ERC721MetadataMintable.sol"; +import {ERC721Metadata} from "../oz/token/ERC721/ERC721Metadata.sol"; contract ERC721PlasmaMintable is ERC721Mintable, ERC721MetadataMintable { constructor(string memory name, string memory symbol) diff --git a/contracts/common/tokens/RootERC721.sol b/contracts/common/tokens/RootERC721.sol index 2a4177c6..6965bd9d 100644 --- a/contracts/common/tokens/RootERC721.sol +++ b/contracts/common/tokens/RootERC721.sol @@ -1,6 +1,6 @@ pragma solidity ^0.5.2; -import {ERC721Full} from "openzeppelin-solidity/contracts/token/ERC721/ERC721Full.sol"; +import {ERC721Full} from "../oz/token/ERC721/ERC721Full.sol"; contract RootERC721 is ERC721Full { constructor(string memory name, string memory symbol) diff --git a/contracts/common/tokens/TestToken.sol b/contracts/common/tokens/TestToken.sol index 7dffc006..c725adfd 100644 --- a/contracts/common/tokens/TestToken.sol +++ b/contracts/common/tokens/TestToken.sol @@ -1,6 +1,6 @@ pragma solidity ^0.5.2; -import "openzeppelin-solidity/contracts/token/ERC20/ERC20Mintable.sol"; +import {ERC20Mintable} from "../oz/token/ERC20/ERC20Mintable.sol"; contract TestToken is ERC20Mintable { // detailed ERC20 diff --git a/contracts/common/tokens/WETH.sol b/contracts/common/tokens/WETH.sol index 339efac3..fd9e84d8 100644 --- a/contracts/common/tokens/WETH.sol +++ b/contracts/common/tokens/WETH.sol @@ -1,6 +1,6 @@ pragma solidity ^0.5.2; -import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol"; +import {ERC20} from "../oz/token/ERC20/ERC20.sol"; contract WETH is ERC20 { event Deposit(address indexed dst, uint256 wad); diff --git a/contracts/root/IRootChain.sol b/contracts/root/IRootChain.sol index 95857c96..9dea9277 100644 --- a/contracts/root/IRootChain.sol +++ b/contracts/root/IRootChain.sol @@ -2,8 +2,6 @@ pragma solidity ^0.5.2; interface IRootChain { - function slash() external; - function submitHeaderBlock(bytes calldata data, bytes calldata sigs) external; diff --git a/contracts/root/RootChain.sol b/contracts/root/RootChain.sol index c1fe93a9..9f5591ac 100644 --- a/contracts/root/RootChain.sol +++ b/contracts/root/RootChain.sol @@ -1,12 +1,11 @@ pragma solidity ^0.5.2; -import {SafeMath} from "openzeppelin-solidity/contracts/math/SafeMath.sol"; +import {SafeMath} from "../common/oz/math/SafeMath.sol"; -import {RootChainHeader, RootChainStorage} from "./RootChainStorage.sol"; +import {RootChainStorage} from "./RootChainStorage.sol"; import {IStakeManager} from "../staking/stakeManager/IStakeManager.sol"; import {IRootChain} from "./IRootChain.sol"; -import {Registry} from "../common/Registry.sol"; contract RootChain is RootChainStorage, IRootChain { @@ -65,10 +64,6 @@ contract RootChain is RootChainStorage, IRootChain { return headerBlocks[currentHeaderBlock()].end; } - function slash() external { - //TODO: future implementation - } - function currentHeaderBlock() public view returns (uint256) { return _nextHeaderBlock.sub(MAX_DEPOSITS); } diff --git a/contracts/root/depositManager/DepositManager.sol b/contracts/root/depositManager/DepositManager.sol index 22beaee9..3803dc73 100644 --- a/contracts/root/depositManager/DepositManager.sol +++ b/contracts/root/depositManager/DepositManager.sol @@ -1,10 +1,10 @@ pragma solidity ^0.5.2; -import {ERC721Holder} from "openzeppelin-solidity/contracts/token/ERC721/ERC721Holder.sol"; -import {IERC20} from "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol"; -import {IERC721} from "openzeppelin-solidity/contracts/token/ERC721/IERC721.sol"; -import {SafeMath} from "openzeppelin-solidity/contracts/math/SafeMath.sol"; -import {SafeERC20} from "openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol"; +import {ERC721Holder} from "../../common/oz/token/ERC721/ERC721Holder.sol"; +import {IERC20} from "../../common/oz/token/ERC20/IERC20.sol"; +import {IERC721} from "../../common/oz/token/ERC721/IERC721.sol"; +import {SafeMath} from "../../common/oz/math/SafeMath.sol"; +import {SafeERC20} from "../../common/oz/token/ERC20/SafeERC20.sol"; import {Registry} from "../../common/Registry.sol"; import {WETH} from "../../common/tokens/WETH.sol"; diff --git a/contracts/root/predicates/ERC20Predicate.sol b/contracts/root/predicates/ERC20Predicate.sol deleted file mode 100644 index e991d96c..00000000 --- a/contracts/root/predicates/ERC20Predicate.sol +++ /dev/null @@ -1,667 +0,0 @@ -pragma solidity ^0.5.2; - -import {BytesLib} from "../../common/lib/BytesLib.sol"; -import {Common} from "../../common/lib/Common.sol"; -import {Math} from "openzeppelin-solidity/contracts/math/Math.sol"; -import {RLPEncode} from "../../common/lib/RLPEncode.sol"; -import {RLPReader} from "../../common/lib/RLPReader.sol"; -import {SafeMath} from "openzeppelin-solidity/contracts/math/SafeMath.sol"; - -import {IErcPredicate} from "./IPredicate.sol"; -import {Registry} from "../../common/Registry.sol"; -import { - WithdrawManagerHeader -} from "../withdrawManager/WithdrawManagerStorage.sol"; - -contract ERC20Predicate is IErcPredicate { - using RLPReader for bytes; - using RLPReader for RLPReader.RLPItem; - using SafeMath for uint256; - - // keccak256('Deposit(address,address,uint256,uint256,uint256)') - bytes32 constant DEPOSIT_EVENT_SIG = 0x4e2ca0515ed1aef1395f66b5303bb5d6f1bf9d61a353fa53f73f8ac9973fa9f6; - // keccak256('Withdraw(address,address,uint256,uint256,uint256)') - bytes32 constant WITHDRAW_EVENT_SIG = 0xebff2602b3f468259e1e99f613fed6691f3a6526effe6ef3e768ba7ae7a36c4f; - // keccak256('LogTransfer(address,address,address,uint256,uint256,uint256,uint256,uint256)') - bytes32 constant LOG_TRANSFER_EVENT_SIG = 0xe6497e3ee548a3372136af2fcb0696db31fc6cf20260707645068bd3fe97f3c4; - // keccak256('LogFeeTransfer(address,address,address,uint256,uint256,uint256,uint256,uint256)') - bytes32 constant LOG_FEE_TRANSFER_EVENT_SIG = 0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63; - - // keccak256('withdraw(uint256)').slice(0, 4) - bytes4 constant WITHDRAW_FUNC_SIG = 0x2e1a7d4d; - // keccak256('transfer(address,uint256)').slice(0, 4) - bytes4 constant TRANSFER_FUNC_SIG = 0xa9059cbb; - - Registry registry; - - constructor( - address _withdrawManager, - address _depositManager, - address _registry - ) public IErcPredicate(_withdrawManager, _depositManager) { - registry = Registry(_registry); - } - - function startExitWithBurntTokens(bytes calldata data) external { - RLPReader.RLPItem[] memory referenceTxData = data.toRlpItem().toList(); - bytes memory receipt = referenceTxData[6].toBytes(); - RLPReader.RLPItem[] memory inputItems = receipt.toRlpItem().toList(); - uint256 logIndex = referenceTxData[9].toUint(); - require(logIndex < MAX_LOGS, "Supporting a max of 10 logs"); - uint256 age = withdrawManager.verifyInclusion( - data, - 0, /* offset */ - false /* verifyTxInclusion */ - ); - inputItems = inputItems[3].toList()[logIndex].toList(); // select log based on given logIndex - - // "address" (contract address that emitted the log) field in the receipt - address childToken = RLPReader.toAddress(inputItems[0]); - bytes memory logData = inputItems[2].toBytes(); - inputItems = inputItems[1].toList(); // topics - // now, inputItems[i] refers to i-th (0-based) topic in the topics array - // event Withdraw(address indexed token, address indexed from, uint256 amountOrTokenId, uint256 input1, uint256 output1) - require( - bytes32(inputItems[0].toUint()) == WITHDRAW_EVENT_SIG, - "Not a withdraw event signature" - ); - address rootToken = address(RLPReader.toUint(inputItems[1])); - require( - msg.sender == address(inputItems[2].toUint()), // from - "Withdrawer and burn exit tx do not match" - ); - uint256 exitAmount = BytesLib.toUint(logData, 0); // amountOrTokenId - withdrawManager.addExitToQueue( - msg.sender, - childToken, - rootToken, - exitAmount, - bytes32(0x0), - true, /* isRegularExit */ - age << 1 - ); - } - - /** - * @notice Start an exit by referencing the preceding (reference) transaction - * @param data RLP encoded data of the reference tx (proof-of-funds of exitor) that encodes the following fields - * headerNumber Header block number of which the reference tx was a part of - * blockProof Proof that the block header (in the child chain) is a leaf in the submitted merkle root - * blockNumber Block number of which the reference tx is a part of - * blockTime Reference tx block time - * blocktxRoot Transactions root of block - * blockReceiptsRoot Receipts root of block - * receipt Receipt of the reference transaction - * receiptProof Merkle proof of the reference receipt - * branchMask Merkle proof branchMask for the receipt - * logIndex Log Index to read from the receipt - * @param exitTx Signed exit transaction (outgoing transfer or burn) - * @return address rootToken that the exit corresponds to - * @return uint256 exitAmount - */ - function startExitForOutgoingErc20Transfer( - bytes calldata data, - bytes calldata exitTx - ) - external - payable - isBondProvided - returns ( - address, /* rootToken */ - uint256 /* exitAmount */ - ) - { - // referenceTx is a proof-of-funds of the party who signed the exit tx - // If the exitor is exiting with outgoing transfer, it will refer to their own preceding tx - // If the exitor is exiting with incoming transfer, it will refer to the counterparty's preceding tx - RLPReader.RLPItem[] memory referenceTx = data.toRlpItem().toList(); - - // Validate the exitTx - This may be an in-flight tx, so inclusion will not be checked - ExitTxData memory exitTxData = processExitTx(exitTx); - require( - exitTxData.signer == msg.sender, - "Should be an outgoing transfer" - ); - - // Process the receipt of the referenced tx - ReferenceTxData memory referenceTxData = processReferenceTx( - referenceTx[6].toBytes(), // receipt - referenceTx[9].toUint(), // logIndex - msg.sender, // participant whose proof-of-funds are to be checked in the reference tx - false /* isChallenge */ - ); - require( - exitTxData.childToken == referenceTxData.childToken, - "Reference and exit tx do not correspond to the same child token" - ); - // exitTxData.amountOrToken represents the total exit amount based on the in-flight exit type - // re-using the variable here to avoid stack overflow - exitTxData.amountOrToken = validateSequential( - exitTxData, - referenceTxData - ); - - // Checking the inclusion of the receipt of the preceding tx is enough - // It is inconclusive to check the inclusion of the signed tx, hence verifyTxInclusion = false - // age is a measure of the position of the tx in the side chain - referenceTxData.age = withdrawManager - .verifyInclusion( - data, - 0, /* offset */ - false /* verifyTxInclusion */ - ) - .add(referenceTxData.age); // Add the logIndex and oIndex from the receipt - - sendBond(); // send BOND_AMOUNT to withdrawManager - - // last bit is to differentiate whether the sender or receiver of the in-flight tx is starting an exit - uint256 exitId = referenceTxData.age << 1; - exitId |= 1; // since msg.sender == exitTxData.signer - withdrawManager.addExitToQueue( - msg.sender, - referenceTxData.childToken, - referenceTxData.rootToken, - exitTxData.amountOrToken, - exitTxData.txHash, - false, /* isRegularExit */ - exitId - ); - withdrawManager.addInput( - exitId, - referenceTxData.age, - msg.sender, - referenceTxData.rootToken - ); - return (referenceTxData.rootToken, exitTxData.amountOrToken); - } - - /** - * @notice Start an exit by referencing the preceding (reference) transaction - * @param data RLP encoded data of the reference tx(s) that encodes the following fields for each tx - * headerNumber Header block number of which the reference tx was a part of - * blockProof Proof that the block header (in the child chain) is a leaf in the submitted merkle root - * blockNumber Block number of which the reference tx is a part of - * blockTime Reference tx block time - * blocktxRoot Transactions root of block - * blockReceiptsRoot Receipts root of block - * receipt Receipt of the reference transaction - * receiptProof Merkle proof of the reference receipt - * branchMask Merkle proof branchMask for the receipt - * logIndex Log Index to read from the receipt - * @param exitTx Signed exit transaction (incoming transfer) - * @return address rootToken that the exit corresponds to - * @return uint256 exitAmount - */ - function startExitForIncomingErc20Transfer( - bytes calldata data, - bytes calldata exitTx - ) - external - payable - isBondProvided - returns ( - address, /* rootToken */ - uint256 /* exitAmount */ - ) - { - // referenceTx is a proof-of-funds of the party who signed the exit tx - // If the exitor is exiting with outgoing transfer, it will refer to their own preceding tx - // If the exitor is exiting with incoming transfer, it will refer to the counterparty's preceding tx - RLPReader.RLPItem[] memory referenceTx = data.toRlpItem().toList(); - - // Validate the exitTx - This may be an in-flight tx, so inclusion will not be checked - ExitTxData memory exitTxData = processExitTx(exitTx); - require( - exitTxData.signer != msg.sender, - "Should be an incoming transfer" - ); - // Process the receipt (i.e. proof-of-funds of the counterparty) of the referenced tx - ReferenceTxData memory referenceTxData = processReferenceTx( - referenceTx[6].toBytes(), // receipt - referenceTx[9].toUint(), // logIndex - exitTxData.signer, - false /* isChallenge */ - ); - require( - exitTxData.childToken == referenceTxData.childToken, - "Reference and exit tx do not correspond to the same child token" - ); - exitTxData.amountOrToken = validateSequential( - exitTxData, - referenceTxData - ); - - // Checking the inclusion of the receipt of the preceding tx is enough - // It is inconclusive to check the inclusion of the signed tx, hence verifyTxInclusion = false - // age is a measure of the position of the tx in the side chain - referenceTxData.age = withdrawManager - .verifyInclusion( - data, - 0, /* offset */ - false /* verifyTxInclusion */ - ) - .add(referenceTxData.age); // Add the logIndex and oIndex from the receipt - - ReferenceTxData memory _referenceTxData; - // referenceTx.length > 10 means the exitor sent along another input UTXO to the exit tx - // This will be used to exit with the pre-existing balance on the chain along with the couterparty signed exit tx - if (referenceTx.length > 10) { - _referenceTxData = processReferenceTx( - referenceTx[16].toBytes(), // receipt - referenceTx[19].toUint(), // logIndex - msg.sender, // participant - false /* isChallenge */ - ); - require( - _referenceTxData.childToken == referenceTxData.childToken, - "child tokens in the referenced txs do not match" - ); - require( - _referenceTxData.rootToken == referenceTxData.rootToken, - "root tokens in the referenced txs do not match" - ); - _referenceTxData.age = withdrawManager - .verifyInclusion( - data, - 10, /* offset */ - false /* verifyTxInclusion */ - ) - .add(_referenceTxData.age); - } - - sendBond(); // send BOND_AMOUNT to withdrawManager - - // last bit is to differentiate whether the sender or receiver of the in-flight tx is starting an exit - uint256 exitId = Math.max(referenceTxData.age, _referenceTxData.age) << - 1; - withdrawManager.addExitToQueue( - msg.sender, - referenceTxData.childToken, - referenceTxData.rootToken, - exitTxData.amountOrToken.add(_referenceTxData.closingBalance), - exitTxData.txHash, - false, /* isRegularExit */ - exitId - ); - withdrawManager.addInput( - exitId, - referenceTxData.age, - exitTxData.signer, - referenceTxData.rootToken - ); - // If exitor did not have pre-exiting balance on the chain => _referenceTxData has default values; - // In that case, the following input acts as a "dummy" input UTXO to challenge token spends by the exitor - withdrawManager.addInput( - exitId, - _referenceTxData.age, - msg.sender, - referenceTxData.rootToken - ); - return ( - referenceTxData.rootToken, - exitTxData.amountOrToken.add(_referenceTxData.closingBalance) - ); - } - - /** - * @notice Verify the deprecation of a state update - * @param exit ABI encoded PlasmaExit data - * @param inputUtxo ABI encoded Input UTXO data - * @param challengeData RLP encoded data of the challenge reference tx that encodes the following fields - * headerNumber Header block number of which the reference tx was a part of - * blockProof Proof that the block header (in the child chain) is a leaf in the submitted merkle root - * blockNumber Block number of which the reference tx is a part of - * blockTime Reference tx block time - * blocktxRoot Transactions root of block - * blockReceiptsRoot Receipts root of block - * receipt Receipt of the reference transaction - * receiptProof Merkle proof of the reference receipt - * branchMask Merkle proof branchMask for the receipt - * logIndex Log Index to read from the receipt - * tx Challenge transaction - * txProof Merkle proof of the challenge tx - * @return Whether or not the state is deprecated - */ - function verifyDeprecation( - bytes calldata exit, - bytes calldata inputUtxo, - bytes calldata challengeData - ) external returns (bool) { - PlasmaExit memory _exit = decodeExit(exit); - (uint256 age, address signer, , address childToken) = decodeInputUtxo( - inputUtxo - ); - RLPReader.RLPItem[] memory _challengeData = challengeData - .toRlpItem() - .toList(); - ExitTxData memory challengeTxData = processChallengeTx( - _challengeData[10].toBytes() - ); - require( - challengeTxData.signer == signer, - "Challenge tx not signed by the party who signed the input UTXO to the exit" - ); - - // receipt alone is not enough for a challenge. It is required to check that the challenge tx was included as well - ReferenceTxData memory referenceTxData = processReferenceTx( - _challengeData[6].toBytes(), // receipt - _challengeData[9].toUint(), // logIndex - challengeTxData.signer, - true /* isChallenge */ - ); - referenceTxData.age = withdrawManager - .verifyInclusion( - challengeData, - 0, - true /* verifyTxInclusion */ - ) - .add(referenceTxData.age); - require( - referenceTxData.childToken == childToken && - challengeTxData.childToken == childToken, - "LogTransferReceipt, challengeTx token and challenged utxo token do not match" - ); - if (referenceTxData.age < age) { - // this block shows that the exitor used an older, already checkpointed tx as in-flight to start an exit; - // only in that case, we can allow the challenge age to be < exit age - require( - _exit.txHash == challengeTxData.txHash, - "Cannot challenge with the exit tx" - ); - } else { - require( - _exit.txHash != challengeTxData.txHash, - "Cannot challenge with the exit tx" - ); - } - return true; - } - - /** - * @notice Parse a ERC20 LogTransfer event in the receipt - * @param state abi encoded (data, participant, verifyInclusion) - * data is RLP encoded reference tx receipt that encodes the following fields - * headerNumber Header block number of which the reference tx was a part of - * blockProof Proof that the block header (in the child chain) is a leaf in the submitted merkle root - * blockNumber Block number of which the reference tx is a part of - * blockTime Reference tx block time - * blocktxRoot Transactions root of block - * blockReceiptsRoot Receipts root of block - * receipt Receipt of the reference transaction - * receiptProof Merkle proof of the reference receipt - * branchMask Merkle proof branchMask for the receipt - * logIndex Log Index to read from the receipt - * tx Challenge transaction - * txProof Merkle proof of the challenge tx - * @return abi encoded (closingBalance, ageOfUtxo, childToken, rootToken) - */ - function interpretStateUpdate(bytes calldata state) - external - view - returns (bytes memory) - { - // isChallenge - Is the state being parsed for a challenge - (bytes memory _data, address participant, bool verifyInclusion, bool isChallenge) = abi - .decode(state, (bytes, address, bool, bool)); - RLPReader.RLPItem[] memory referenceTx = _data.toRlpItem().toList(); - bytes memory receipt = referenceTx[6].toBytes(); - uint256 logIndex = referenceTx[9].toUint(); - require(logIndex < MAX_LOGS, "Supporting a max of 10 logs"); - RLPReader.RLPItem[] memory inputItems = receipt.toRlpItem().toList(); - inputItems = inputItems[3].toList()[logIndex].toList(); // select log based on given logIndex - ReferenceTxData memory data; - data.childToken = RLPReader.toAddress(inputItems[0]); // "address" (contract address that emitted the log) field in the receipt - bytes memory logData = inputItems[2].toBytes(); - inputItems = inputItems[1].toList(); // topics - data.rootToken = address(RLPReader.toUint(inputItems[1])); - if (isChallenge) { - processChallenge(inputItems, participant); - } else { - (data.closingBalance, data.age) = processStateUpdate( - inputItems, - logData, - participant - ); - } - data.age = data.age.add(logIndex.mul(MAX_LOGS)); - if (verifyInclusion) { - data.age = data.age.add( - withdrawManager.verifyInclusion( - _data, - 0, - false /* verifyTxInclusion */ - ) - ); - } - return - abi.encode( - data.closingBalance, - data.age, - data.childToken, - data.rootToken - ); - } - - /** - * @dev Process the reference tx to start a MoreVP style exit - * @param receipt Receipt of the reference transaction - * @param logIndex Log Index to read from the receipt - * @param participant Either of exitor or a counterparty depending on the type of exit - * @param isChallenge Whether it is a challenge or start exit operation - * @return ReferenceTxData Parsed reference tx data - */ - function processReferenceTx( - bytes memory receipt, - uint256 logIndex, - address participant, - bool isChallenge - ) internal view returns (ReferenceTxData memory data) { - require(logIndex < MAX_LOGS, "Supporting a max of 10 logs"); - RLPReader.RLPItem[] memory inputItems = receipt.toRlpItem().toList(); - inputItems = inputItems[3].toList()[logIndex].toList(); // select log based on given logIndex - data.childToken = RLPReader.toAddress(inputItems[0]); // "address" (contract address that emitted the log) field in the receipt - bytes memory logData = inputItems[2].toBytes(); - inputItems = inputItems[1].toList(); // topics - // now, inputItems[i] refers to i-th (0-based) topic in the topics array - bytes32 eventSignature = bytes32(inputItems[0].toUint()); // inputItems[0] is the event signature - data.rootToken = address(RLPReader.toUint(inputItems[1])); - - // When child chain is started, since child matic is a genenis contract at 0x1010, - // the root token corresponding to matic is not known, hence child token address is emitted in LogFeeTransfer events. - // Fix that anomaly here - if (eventSignature == LOG_FEE_TRANSFER_EVENT_SIG) { - data.rootToken = registry.childToRootToken(data.rootToken); - } - - if (isChallenge) { - processChallenge(inputItems, participant); - } else { - (data.closingBalance, data.age) = processStateUpdate( - inputItems, - logData, - participant - ); - } - // In our construction, we give an incrementing age to every log in a receipt - data.age = data.age.add(logIndex.mul(MAX_LOGS)); - } - - function validateSequential( - ExitTxData memory exitTxData, - ReferenceTxData memory referenceTxData - ) internal pure returns (uint256 exitAmount) { - // The closing balance of the referenced tx should be >= exit amount in exitTx - require( - referenceTxData.closingBalance >= exitTxData.amountOrToken, - "Exiting with more tokens than referenced" - ); - // If exit tx has is an outgoing transfer from exitor's perspective, exit with closingBalance minus sent amount - if (exitTxData.exitType == ExitType.OutgoingTransfer) { - return referenceTxData.closingBalance.sub(exitTxData.amountOrToken); - } - // If exit tx was burnt tx, exit with the entire referenced balance not just that was burnt, since user only gets one chance to exit MoreVP style - if (exitTxData.exitType == ExitType.Burnt) { - return referenceTxData.closingBalance; - } - // If exit tx has is an incoming transfer from exitor's perspective, exit with exitAmount - return exitTxData.amountOrToken; - } - - function processChallenge( - RLPReader.RLPItem[] memory inputItems, - address participant - ) internal pure { - bytes32 eventSignature = bytes32(inputItems[0].toUint()); - // event Withdraw(address indexed token, address indexed from, uint256 amountOrTokenId, uint256 input1, uint256 output1) - // event Log(Fee)Transfer( - // address indexed token, address indexed from, address indexed to, - // uint256 amountOrTokenId, uint256 input1, uint256 input2, uint256 output1, uint256 output2) - require( - eventSignature == WITHDRAW_EVENT_SIG || - eventSignature == LOG_TRANSFER_EVENT_SIG || - eventSignature == LOG_FEE_TRANSFER_EVENT_SIG, - "Log signature doesnt qualify as a valid spend" - ); - require( - participant == address(inputItems[2].toUint()), // from - "participant and referenced tx do not match" - ); - // oIndex is always 0 for the 2 scenarios above, hence not returning it - } - - /** - * @notice Parse the state update and check if this predicate recognizes it - * @param inputItems inputItems[i] refers to i-th (0-based) topic in the topics array in the log - * @param logData Data field (unindexed params) in the log - */ - function processStateUpdate( - RLPReader.RLPItem[] memory inputItems, - bytes memory logData, - address participant - ) internal pure returns (uint256 closingBalance, uint256 oIndex) { - bytes32 eventSignature = bytes32(inputItems[0].toUint()); - if ( - eventSignature == DEPOSIT_EVENT_SIG || - eventSignature == WITHDRAW_EVENT_SIG - ) { - // event Deposit(address indexed token, address indexed from, uint256 amountOrTokenId, uint256 input1, uint256 output1) - // event Withdraw(address indexed token, address indexed from, uint256 amountOrTokenId, uint256 input1, uint256 output1) - require( - participant == address(inputItems[2].toUint()), // from - "Withdrawer and referenced tx do not match" - ); - closingBalance = BytesLib.toUint(logData, 64); // output1 - } else if ( - eventSignature == LOG_TRANSFER_EVENT_SIG || - eventSignature == LOG_FEE_TRANSFER_EVENT_SIG - ) { - // event Log(Fee)Transfer( - // address indexed token, address indexed from, address indexed to, - // uint256 amountOrTokenId, uint256 input1, uint256 input2, uint256 output1, uint256 output2) - if (participant == address(inputItems[2].toUint())) { - // A. Participant transferred tokens - closingBalance = BytesLib.toUint(logData, 96); // output1 - } else if (participant == address(inputItems[3].toUint())) { - // B. Participant received tokens - closingBalance = BytesLib.toUint(logData, 128); // output2 - oIndex = 1; - } else { - revert("tx / log doesnt concern the participant"); - } - } else { - revert("Exit type not supported"); - } - } - - /** - * @notice Process the transaction to start a MoreVP style exit from - * @param exitTx Signed exit transaction - */ - function processExitTx(bytes memory exitTx) - internal - view - returns (ExitTxData memory txData) - { - RLPReader.RLPItem[] memory txList = exitTx.toRlpItem().toList(); - require(txList.length == 9, "MALFORMED_WITHDRAW_TX"); - txData.childToken = RLPReader.toAddress(txList[3]); // corresponds to "to" field in tx - (txData.signer, txData.txHash) = getAddressFromTx(txList); - if (txData.signer == msg.sender) { - // exit tx is signed by exitor - (txData.amountOrToken, txData.exitType) = processExitTxSender( - RLPReader.toBytes(txList[5]) - ); - } else { - // exitor is a counterparty in the provided tx - txData.amountOrToken = processExitTxCounterparty( - RLPReader.toBytes(txList[5]) - ); - txData.exitType = ExitType.IncomingTransfer; - } - } - - /** - * @notice Process the challenge transaction - * @param exitTx Challenge transaction - * @return ExitTxData Parsed challenge transaction data - */ - function processChallengeTx(bytes memory exitTx) - internal - pure - returns (ExitTxData memory txData) - { - RLPReader.RLPItem[] memory txList = exitTx.toRlpItem().toList(); - require(txList.length == 9, "MALFORMED_WITHDRAW_TX"); - txData.childToken = RLPReader.toAddress(txList[3]); // corresponds to "to" field in tx - (txData.signer, txData.txHash) = getAddressFromTx(txList); - // during a challenge, the tx signer must be the first party - (txData.amountOrToken, ) = processExitTxSender( - RLPReader.toBytes(txList[5]) - ); - } - - /** - * @dev Processes transaction from the "signer / sender" perspective - * @param txData Transaction input data - * @return exitAmount Number of tokens burnt or sent - * @return burnt Whether the tokens were burnt - */ - function processExitTxSender(bytes memory txData) - internal - pure - returns (uint256 amount, ExitType exitType) - { - bytes4 funcSig = BytesLib.toBytes4(BytesLib.slice(txData, 0, 4)); - if (funcSig == WITHDRAW_FUNC_SIG) { - amount = BytesLib.toUint(txData, 4); - exitType = ExitType.Burnt; - } else if (funcSig == TRANSFER_FUNC_SIG) { - amount = BytesLib.toUint(txData, 36); - exitType = ExitType.OutgoingTransfer; - } else { - revert("Exit tx type not supported"); - } - } - - /** - * @dev Processes transaction from the "receiver" perspective - * @param txData Transaction input data - * @return exitAmount Number of tokens received - */ - function processExitTxCounterparty(bytes memory txData) - internal - view - returns (uint256 exitAmount) - { - bytes4 funcSig = BytesLib.toBytes4(BytesLib.slice(txData, 0, 4)); - require( - funcSig == TRANSFER_FUNC_SIG, - "Only supports exiting from transfer txs" - ); - require( - msg.sender == address(BytesLib.toUint(txData, 4)), // to - "Exitor should be the receiver in the exit tx" - ); - exitAmount = BytesLib.toUint(txData, 36); // value - } -} diff --git a/contracts/root/predicates/ERC20PredicateBurnOnly.sol b/contracts/root/predicates/ERC20PredicateBurnOnly.sol index 074d435e..4c8814ca 100644 --- a/contracts/root/predicates/ERC20PredicateBurnOnly.sol +++ b/contracts/root/predicates/ERC20PredicateBurnOnly.sol @@ -1,19 +1,11 @@ pragma solidity ^0.5.2; import {BytesLib} from "../../common/lib/BytesLib.sol"; -import {Common} from "../../common/lib/Common.sol"; -import {Math} from "openzeppelin-solidity/contracts/math/Math.sol"; -import {RLPEncode} from "../../common/lib/RLPEncode.sol"; -import {RLPReader} from "../../common/lib/RLPReader.sol"; -import {SafeMath} from "openzeppelin-solidity/contracts/math/SafeMath.sol"; +import {SafeMath} from "../../common/oz/math/SafeMath.sol"; import {ExitPayloadReader} from "../../common/lib/ExitPayloadReader.sol"; import {IErcPredicate} from "./IPredicate.sol"; -import {Registry} from "../../common/Registry.sol"; -import {WithdrawManagerHeader} from "../withdrawManager/WithdrawManagerStorage.sol"; contract ERC20PredicateBurnOnly is IErcPredicate { - using RLPReader for bytes; - using RLPReader for RLPReader.RLPItem; using SafeMath for uint256; using ExitPayloadReader for bytes; @@ -23,7 +15,7 @@ contract ERC20PredicateBurnOnly is IErcPredicate { using ExitPayloadReader for ExitPayloadReader.LogTopics; // keccak256('Withdraw(address,address,uint256,uint256,uint256)') - bytes32 constant WITHDRAW_EVENT_SIG = 0xebff2602b3f468259e1e99f613fed6691f3a6526effe6ef3e768ba7ae7a36c4f; + bytes32 internal constant WITHDRAW_EVENT_SIG = 0xebff2602b3f468259e1e99f613fed6691f3a6526effe6ef3e768ba7ae7a36c4f; constructor( address _withdrawManager, diff --git a/contracts/root/predicates/ERC721Predicate.sol b/contracts/root/predicates/ERC721Predicate.sol deleted file mode 100644 index 8db5912e..00000000 --- a/contracts/root/predicates/ERC721Predicate.sol +++ /dev/null @@ -1,450 +0,0 @@ -pragma solidity ^0.5.2; - -import {RLPReader} from "../../common/lib/RLPReader.sol"; -import {SafeMath} from "openzeppelin-solidity/contracts/math/SafeMath.sol"; - -import {BytesLib} from "../../common/lib/BytesLib.sol"; -import {Common} from "../../common/lib/Common.sol"; -import {RLPEncode} from "../../common/lib/RLPEncode.sol"; - -import {IErcPredicate} from "./IPredicate.sol"; - -contract ERC721Predicate is IErcPredicate { - using RLPReader for bytes; - using RLPReader for RLPReader.RLPItem; - using SafeMath for uint256; - - // keccak256('Deposit(address,address,uint256)') - bytes32 constant DEPOSIT_EVENT_SIG = 0x5548c837ab068cf56a2c2479df0882a4922fd203edb7517321831d95078c5f62; - // keccak256('Withdraw(address,address,uint256)') - bytes32 constant WITHDRAW_EVENT_SIG = 0x9b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8eb; - // keccak256('LogTransfer(address,address,address,uint256)') - bytes32 constant E721_LOG_TRANSFER_EVENT_SIG = 0x6eabe333476233fd382224f233210cb808a7bc4c4de64f9d76628bf63c677b1a; - // keccak256('withdraw(uint256)').slice(0, 4) - bytes4 constant WITHDRAW_FUNC_SIG = 0x2e1a7d4d; - // keccak256('transferFrom(address,address,uint256)').slice(0, 4) - bytes4 constant TRANSFER_FROM_FUNC_SIG = 0x23b872dd; - - constructor(address _withdrawManager, address _depositManager) - public - IErcPredicate(_withdrawManager, _depositManager) - {} - - /** - * @notice Verify the deprecation of a state update - * @param exit ABI encoded PlasmaExit data - * @param inputUtxo ABI encoded Input UTXO data - * @param challengeData RLP encoded data of the challenge reference tx that encodes the following fields - * headerNumber Header block number of which the reference tx was a part of - * blockProof Proof that the block header (in the child chain) is a leaf in the submitted merkle root - * blockNumber Block number of which the reference tx is a part of - * blockTime Reference tx block time - * blocktxRoot Transactions root of block - * blockReceiptsRoot Receipts root of block - * receipt Receipt of the reference transaction - * receiptProof Merkle proof of the reference receipt - * branchMask Merkle proof branchMask for the receipt - * logIndex Log Index to read from the receipt - * tx Challenge transaction - * txProof Merkle proof of the challenge tx - * @return Whether or not the state is deprecated - */ - function verifyDeprecation( - bytes calldata exit, - bytes calldata inputUtxo, - bytes calldata challengeData - ) external returns (bool) { - PlasmaExit memory _exit = decodeExit(exit); - (uint256 age, address signer, , ) = decodeInputUtxo(inputUtxo); - RLPReader.RLPItem[] memory referenceTxData = challengeData - .toRlpItem() - .toList(); - - ExitTxData memory challengeTxData = processChallengeTx( - referenceTxData[10].toBytes() - ); - require( - challengeTxData.signer == signer, - "Challenge tx not signed by the party who signed the input UTXO to the exit" - ); - require( - _exit.token == challengeTxData.childToken, - "Challenge tx token doesnt match with exit token" - ); - require( - _exit.txHash != challengeTxData.txHash, - "Cannot challenge with the exit tx" - ); - require( - _exit.receiptAmountOrNFTId == challengeTxData.amountOrToken, - "tokenId doesn't match" - ); - uint256 ageOfChallengeTx = withdrawManager.verifyInclusion( - challengeData, - 0, - true /* verifyTxInclusion */ - ); - processReferenceTx( - referenceTxData[6].toBytes(), // receipt - referenceTxData[9].toUint(), // logIndex - challengeTxData.signer, - challengeTxData.childToken, - challengeTxData.amountOrToken, - true // isChallenge - ); - return ageOfChallengeTx > age; - } - - function interpretStateUpdate(bytes calldata state) - external - view - returns (bytes memory b) - { - (bytes memory _data, address participant, bool verifyInclusion, bool isChallenge) = abi - .decode(state, (bytes, address, bool, bool)); - RLPReader.RLPItem[] memory referenceTx = _data.toRlpItem().toList(); - bytes memory receipt = referenceTx[6].toBytes(); - uint256 logIndex = referenceTx[9].toUint(); - require(logIndex < MAX_LOGS, "Supporting a max of 10 logs"); - RLPReader.RLPItem[] memory inputItems = receipt.toRlpItem().toList(); - inputItems = inputItems[3].toList()[logIndex].toList(); // select log based on given logIndex - ReferenceTxData memory data; - data.childToken = RLPReader.toAddress(inputItems[0]); // "address" (contract address that emitted the log) field in the receipt - bytes memory logData = inputItems[2].toBytes(); - inputItems = inputItems[1].toList(); // topics - data.rootToken = address(RLPReader.toUint(inputItems[1])); - // event LogTransfer(address indexed token, address indexed from, address indexed to, uint256 tokenId); - data.closingBalance = BytesLib.toUint(logData, 0); // first un-indexed param in LogTransfer - if (isChallenge) { - processChallenge(inputItems, participant); - } else { - data.age = processStateUpdate(inputItems, participant); - } - data.age = data.age.add(logIndex.mul(MAX_LOGS)); - if (verifyInclusion) { - data.age = withdrawManager - .verifyInclusion( - _data, - 0, - false /* verifyTxInclusion */ - ) - .add(data.age); - } - return - abi.encode( - data.closingBalance, - data.age, - data.childToken, - data.rootToken - ); - } - - function startExitWithBurntTokens(bytes memory data) - public - returns (bytes memory) - { - RLPReader.RLPItem[] memory referenceTxData = data.toRlpItem().toList(); - bytes memory receipt = referenceTxData[6].toBytes(); - RLPReader.RLPItem[] memory inputItems = receipt.toRlpItem().toList(); - uint256 age = withdrawManager.verifyInclusion( - data, - 0, /* offset */ - false /* verifyTxInclusion */ - ); - uint256 logIndex = referenceTxData[9].toUint(); - require(logIndex < MAX_LOGS, "Supporting a max of 10 logs"); - inputItems = inputItems[3].toList()[logIndex].toList(); // select log based on given logIndex - - // "address" (contract address that emitted the log) field in the receipt - address childToken = RLPReader.toAddress(inputItems[0]); - bytes memory logData = inputItems[2].toBytes(); - inputItems = inputItems[1].toList(); // topics - // now, inputItems[i] refers to i-th (0-based) topic in the topics array - // event Withdraw(address indexed token, address indexed from, uint256 amountOrTokenId, uint256 input1, uint256 output1) - require( - bytes32(inputItems[0].toUint()) == WITHDRAW_EVENT_SIG, - "Not a withdraw event signature" - ); - address rootToken = address(RLPReader.toUint(inputItems[1])); - require( - msg.sender == address(inputItems[2].toUint()), // from - "Withdrawer and burn exit tx do not match" - ); - uint256 tokenId = BytesLib.toUint(logData, 0); - uint256 exitId = age << 1; // last bit is reserved for housekeeping in erc20Predicate - withdrawManager.addExitToQueue( - msg.sender, - childToken, - rootToken, - tokenId, - bytes32(0x0), /* txHash */ - true, /* isRegularExit */ - exitId - ); - return abi.encode(rootToken, tokenId, childToken, exitId); - } - - /** - * @notice Start an exit by referencing the preceding (reference) transaction - * @param data RLP encoded data of the reference tx(s) that encodes the following fields for each tx - * headerNumber Header block number of which the reference tx was a part of - * blockProof Proof that the block header (in the child chain) is a leaf in the submitted merkle root - * blockNumber Block number of which the reference tx is a part of - * blockTime Reference tx block time - * blocktxRoot Transactions root of block - * blockReceiptsRoot Receipts root of block - * receipt Receipt of the reference transaction - * receiptProof Merkle proof of the reference receipt - * branchMask Merkle proof branchMask for the receipt - * logIndex Log Index to read from the receipt - * @param exitTx Signed exit transaction - * @return abi encoded bytes array that encodes the following fields - * address rootToken: Token that the exit corresponds to - * uint256 tokenId: TokenId being exited - * address childToken: Child token that the exit corresponds to - * uint256 exitId - */ - function startExit(bytes memory data, bytes memory exitTx) - public - payable - isBondProvided - returns (bytes memory) - { - // referenceTx is a proof-of-funds of the party who signed the exit tx - RLPReader.RLPItem[] memory referenceTxData = data.toRlpItem().toList(); - - // Validate the exitTx - This may be an in-flight tx, so inclusion will not be checked - ExitTxData memory exitTxData = processExitTx(exitTx); - - // process the receipt of the referenced tx - (address rootToken, uint256 oIndex) = processReferenceTx( - referenceTxData[6].toBytes(), // receipt - referenceTxData[9].toUint(), // logIndex - exitTxData.signer, - exitTxData.childToken, - exitTxData.amountOrToken, - false // isChallenge - ); - - sendBond(); // send BOND_AMOUNT to withdrawManager - - // verifyInclusion returns the position of the receipt in child chain - uint256 ageOfUtxo = withdrawManager - .verifyInclusion( - data, - 0, /* offset */ - false /* verifyTxInclusion */ - ) - .add(referenceTxData[9].toUint().mul(MAX_LOGS)) // logIndex * MAX_LOGS - .add(oIndex); // whether exitTxData.signer is a sender or receiver in the referenced receipt - uint256 exitId = ageOfUtxo << 1; // last bit is reserved for housekeeping in erc20Predicate - withdrawManager.addExitToQueue( - msg.sender, - exitTxData.childToken, - rootToken, - exitTxData.amountOrToken, - exitTxData.txHash, - false, /* isRegularExit */ - exitId - ); - - withdrawManager.addInput( - exitId, - ageOfUtxo, - exitTxData.signer, - rootToken - ); - // Adding a dummy input, owner being the exitor to challenge spends that the exitor made after the transaction being exited from - withdrawManager.addInput( - exitId, - ageOfUtxo.sub(1), - msg.sender, - rootToken - ); - return - abi.encode( - rootToken, - exitTxData.amountOrToken, - exitTxData.childToken, - exitId - ); - } - - /** - * @notice Process the reference tx to start a MoreVP style exit - * @param receipt Receipt of the reference transaction - * @param logIndex Log Index to read from the receipt - * @param participant Either of exitor or a counterparty depending on the type of exit - */ - function processReferenceTx( - bytes memory receipt, - uint256 logIndex, - address participant, - address childToken, - uint256 tokenId, - bool isChallenge - ) internal pure returns (address rootToken, uint256 oIndex) { - require(logIndex < 10, "Supporting a max of 10 logs"); - RLPReader.RLPItem[] memory inputItems = receipt.toRlpItem().toList(); - inputItems = inputItems[3].toList()[logIndex].toList(); // select log based on given logIndex - require( - childToken == RLPReader.toAddress(inputItems[0]), // "address" (contract address that emitted the log) field in the receipt - "Reference and exit tx do not correspond to the same token" - ); - bytes memory logData = inputItems[2].toBytes(); - inputItems = inputItems[1].toList(); // topics - // now, inputItems[i] refers to i-th (0-based) topic in the topics array - // inputItems[0] is the event signature - rootToken = address(RLPReader.toUint(inputItems[1])); - if (isChallenge) { - processChallenge(inputItems, participant); - } else { - oIndex = processStateUpdate(inputItems, participant); - } - // tokenId is the first param in logData in all 3 of Deposit, Withdraw and LogTransfer - require( - tokenId == BytesLib.toUint(logData, 0), - "TokenId in the tx and logData do not match" - ); - } - - /** - * @notice Parse the state update and check if this predicate recognizes it - * @param inputItems inputItems[i] refers to i-th (0-based) topic in the topics array in the log - */ - function processStateUpdate( - RLPReader.RLPItem[] memory inputItems, - address participant - ) internal pure returns (uint256 oIndex) { - bytes32 eventSignature = bytes32(inputItems[0].toUint()); - address _participant; - if (eventSignature == DEPOSIT_EVENT_SIG) { - // event Deposit(address indexed token, address indexed from, uint256 amountOrTokenId, uint256 input1, uint256 output1) - _participant = address(inputItems[2].toUint()); // from - } else if (eventSignature == E721_LOG_TRANSFER_EVENT_SIG) { - // event LogTransfer( - // address indexed token, address indexed from, address indexed to, - // uint256 amountOrTokenId); - // Only makes sense to reference an incoming transfer, unlike erc20 where outgoing transfer also makes sense - _participant = address(inputItems[3].toUint()); // to - oIndex = 1; - } else { - revert("Exit type not supported"); - } - require( - participant == _participant, - "tx / log doesnt concern the participant" - ); - } - - /** - * @notice Parse the state update and check if this predicate recognizes it - * @param inputItems inputItems[i] refers to i-th (0-based) topic in the topics array in the log - */ - function processChallenge( - RLPReader.RLPItem[] memory inputItems, - address participant - ) internal pure { - bytes32 eventSignature = bytes32(inputItems[0].toUint()); - // event Withdraw(address indexed token, address indexed from, uint256 amountOrTokenId, uint256 input1, uint256 output1) - // event LogTransfer( - // address indexed token, address indexed from, address indexed to, - // uint256 amountOrTokenId, uint256 input1, uint256 input2, uint256 output1, uint256 output2) - require( - eventSignature == WITHDRAW_EVENT_SIG || - eventSignature == E721_LOG_TRANSFER_EVENT_SIG, - "Log signature doesnt qualify as a valid spend" - ); - require( - participant == address(inputItems[2].toUint()), // from - "participant and referenced tx do not match" - ); - // oIndex is always 0 for the 2 scenarios above, hence not returning it - } - - /** - * @notice Process the transaction to start a MoreVP style exit from - * @param exitTx Signed exit transaction - */ - function processExitTx(bytes memory exitTx) - internal - view - returns (ExitTxData memory txData) - { - RLPReader.RLPItem[] memory txList = exitTx.toRlpItem().toList(); - require(txList.length == 9, "MALFORMED_WITHDRAW_TX"); - txData.childToken = RLPReader.toAddress(txList[3]); // corresponds to "to" field in tx - (txData.signer, txData.txHash) = getAddressFromTx(txList); - if (txData.signer == msg.sender) { - // exit tx is signed by exitor himself - (txData.amountOrToken, txData.exitType) = processExitTxSender( - RLPReader.toBytes(txList[5]) - ); - } else { - // exitor is a counterparty in the provided tx - txData.amountOrToken = processExitTxCounterparty( - RLPReader.toBytes(txList[5]) - ); - txData.exitType = ExitType.IncomingTransfer; - } - } - - /** - * @notice Process the challenge transaction - * @param challengeTx Challenge transaction - * @return ExitTxData Parsed challenge transaction data - */ - function processChallengeTx(bytes memory challengeTx) - internal - pure - returns (ExitTxData memory txData) - { - RLPReader.RLPItem[] memory txList = challengeTx.toRlpItem().toList(); - require(txList.length == 9, "MALFORMED_WITHDRAW_TX"); - txData.childToken = RLPReader.toAddress(txList[3]); // corresponds to "to" field in tx - (txData.signer, txData.txHash) = getAddressFromTx(txList); - // during a challenge, the tx signer must be the first party - (txData.amountOrToken, ) = processExitTxSender( - RLPReader.toBytes(txList[5]) - ); - } - - function processExitTxSender(bytes memory txData) - internal - pure - returns (uint256 tokenId, ExitType exitType) - { - bytes4 funcSig = BytesLib.toBytes4(BytesLib.slice(txData, 0, 4)); - if (funcSig == WITHDRAW_FUNC_SIG) { - // function withdraw(uint256 tokenId) - require(txData.length == 36, "Invalid tx"); // 4 bytes for funcSig and a single bytes32 parameter - tokenId = BytesLib.toUint(txData, 4); - exitType = ExitType.Burnt; - } else if (funcSig == TRANSFER_FROM_FUNC_SIG) { - // function transferFrom(address from, address to, uint256 tokenId) - require(txData.length == 100, "Invalid tx"); // 4 bytes for funcSig and a 3 bytes32 parameters (from, to, tokenId) - tokenId = BytesLib.toUint(txData, 68); - exitType = ExitType.OutgoingTransfer; - } else { - revert("Exit tx type not supported"); - } - } - - function processExitTxCounterparty(bytes memory txData) - internal - view - returns (uint256 tokenId) - { - require(txData.length == 100, "Invalid tx"); // 4 bytes for funcSig and a 2 bytes32 parameters (to, value) - bytes4 funcSig = BytesLib.toBytes4(BytesLib.slice(txData, 0, 4)); - require( - funcSig == TRANSFER_FROM_FUNC_SIG, - "Only supports exiting from transfer txs" - ); - require( - msg.sender == address(BytesLib.toUint(txData, 36)), // to - "Exit tx doesnt concern the exitor" - ); - tokenId = BytesLib.toUint(txData, 68); // NFT ID - } -} diff --git a/contracts/root/predicates/ERC721PredicateBurnOnly.sol b/contracts/root/predicates/ERC721PredicateBurnOnly.sol index 84ff6b99..0ab95a3a 100644 --- a/contracts/root/predicates/ERC721PredicateBurnOnly.sol +++ b/contracts/root/predicates/ERC721PredicateBurnOnly.sol @@ -1,17 +1,12 @@ pragma solidity ^0.5.2; -import {RLPReader} from "../../common/lib/RLPReader.sol"; -import {SafeMath} from "openzeppelin-solidity/contracts/math/SafeMath.sol"; +import {SafeMath} from "../../common/oz/math/SafeMath.sol"; import {BytesLib} from "../../common/lib/BytesLib.sol"; -import {Common} from "../../common/lib/Common.sol"; -import {RLPEncode} from "../../common/lib/RLPEncode.sol"; import {ExitPayloadReader} from "../../common/lib/ExitPayloadReader.sol"; import {IErcPredicate} from "./IPredicate.sol"; contract ERC721PredicateBurnOnly is IErcPredicate { - using RLPReader for bytes; - using RLPReader for RLPReader.RLPItem; using SafeMath for uint256; using ExitPayloadReader for bytes; @@ -21,7 +16,7 @@ contract ERC721PredicateBurnOnly is IErcPredicate { using ExitPayloadReader for ExitPayloadReader.LogTopics; // keccak256('Withdraw(address,address,uint256)') - bytes32 constant WITHDRAW_EVENT_SIG = 0x9b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8eb; + bytes32 internal constant WITHDRAW_EVENT_SIG = 0x9b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8eb; constructor(address _withdrawManager, address _depositManager) public diff --git a/contracts/root/predicates/MintableERC721Predicate.sol b/contracts/root/predicates/MintableERC721Predicate.sol deleted file mode 100644 index 77c2ce38..00000000 --- a/contracts/root/predicates/MintableERC721Predicate.sol +++ /dev/null @@ -1,227 +0,0 @@ -pragma solidity ^0.5.2; - -import {RLPReader} from "../../common/lib/RLPReader.sol"; -import {SafeMath} from "openzeppelin-solidity/contracts/math/SafeMath.sol"; - -import {BytesLib} from "../../common/lib/BytesLib.sol"; -import {Common} from "../../common/lib/Common.sol"; -import {RLPEncode} from "../../common/lib/RLPEncode.sol"; - -import {ERC721Predicate} from "./ERC721Predicate.sol"; -import { - ERC721PlasmaMintable -} from "../../common/tokens/ERC721PlasmaMintable.sol"; - -contract MintableERC721Predicate is ERC721Predicate { - struct MintableTokenInfo { - string uri; - address minter; - bool isVanillaMint; - } - - mapping(uint256 => MintableTokenInfo) public exitToMintableTokenInfo; - - constructor(address _withdrawManager, address _depositManager) - public - ERC721Predicate(_withdrawManager, _depositManager) - {} - - /** - * @notice Start an exit for a token that was minted and burnt on the side chain - * @param data RLP encoded data of the burn tx - * @param mintTx Signed mint transaction - */ - function startExitForMintableBurntToken( - bytes calldata data, - bytes calldata mintTx - ) external { - (address rootToken, uint256 tokenId, address childToken, uint256 exitId) = abi - .decode( - startExitWithBurntTokens(data), - (address, uint256, address, uint256) - ); - processMint(mintTx, rootToken, tokenId, childToken, exitId); - } - - /** - * @notice Start a MoreVP style exit for a token that was minted on the side chain - * @param data RLP encoded data of the burn tx - * @param mintTx Signed mint transaction - */ - function startExitForMintableToken( - bytes calldata data, - bytes calldata mintTx, - bytes calldata exitTx - ) external payable { - (address rootToken, uint256 tokenId, address childToken, uint256 exitId) = abi - .decode( - startExit(data, exitTx), - (address, uint256, address, uint256) - ); - processMint(mintTx, rootToken, tokenId, childToken, exitId); - } - - /** - * @notice Start an exit for a token with metadata that was minted and burnt on the side chain - * @param data RLP encoded data of the burn tx - * @param mintTx Signed mint transaction - */ - function startExitForMetadataMintableBurntToken( - bytes calldata data, - bytes calldata mintTx - ) external { - (address rootToken, uint256 tokenId, address childToken, uint256 exitId) = abi - .decode( - startExitWithBurntTokens(data), - (address, uint256, address, uint256) - ); - processMintWithTokenURI(mintTx, rootToken, tokenId, childToken, exitId); - } - - /** - * @notice Start a MoreVP style exit for a token with metadata that was minted on the side chain - * @param data RLP encoded data of the burn tx - * @param mintTx Signed mint transaction - * @param exitTx Signed exit transaction - */ - function startExitForMetadataMintableToken( - bytes calldata data, - bytes calldata mintTx, - bytes calldata exitTx - ) external payable { - (address rootToken, uint256 tokenId, address childToken, uint256 exitId) = abi - .decode( - startExit(data, exitTx), - (address, uint256, address, uint256) - ); - processMintWithTokenURI(mintTx, rootToken, tokenId, childToken, exitId); - } - - function onFinalizeExit(bytes calldata data) external onlyWithdrawManager { - (uint256 exitId, address token, address exitor, uint256 tokenId) = decodeExitForProcessExit( - data - ); - MintableTokenInfo storage info = exitToMintableTokenInfo[exitId]; - - // check that the signer of the mint tx is a valid minter in the root contract - require( - ERC721PlasmaMintable(token).isMinter(info.minter), - "MintableERC721Predicate.processMintWithTokenURI: Not authorized to mint" - ); - - // this predicate contract should have been added to the root token minter role - if (info.isVanillaMint) { - ERC721PlasmaMintable _token = ERC721PlasmaMintable(token); - require(_token.mint(exitor, tokenId), "TOKEN_MINT_FAILED"); - } else { - ERC721PlasmaMintable _token = ERC721PlasmaMintable(token); - require( - _token.mintWithTokenURI(exitor, tokenId, info.uri), - "MintableERC721Predicate.onFinalizeExit: TOKEN_MINT_FAILED" - ); - } - } - - function processMint( - bytes memory mintTx, - address rootToken, - uint256 tokenId, - address childToken, - uint256 exitId - ) internal { - RLPReader.RLPItem[] memory txList = mintTx.toRlpItem().toList(); - _processRawMint(RLPReader.toBytes(txList[5]), tokenId); - ERC721PlasmaMintable token = ERC721PlasmaMintable(rootToken); - require( - !token.exists(tokenId), - "MintableERC721Predicate.processMint: Token being exited already exists" - ); - - // Will lazily (at the time of processExits) check that the signer of the mint tx is a valid minter in the root contract - (address minter, ) = getAddressFromTx(txList); - exitToMintableTokenInfo[exitId] = MintableTokenInfo( - "", - /* uri */ - minter, - true /* isVanillaMint */ - ); - address _childToken = RLPReader.toAddress(txList[3]); // corresponds to "to" field in tx - require( - childToken == _childToken, - "MintableERC721Predicate.processMint; Token in reference and mint tx are not same" - ); - } - - function _processRawMint(bytes memory txData, uint256 tokenId) - internal - pure - { - bytes4 funcSig = BytesLib.toBytes4(BytesLib.slice(txData, 0, 4)); - require( - funcSig == 0x40c10f19, // keccak256('mint(address,uint256)').slice(0, 4) - "MintableERC721Predicate._processRawMint: funcSig does not match with mint" - ); - uint256 _tokenId; - (, _tokenId) = abi.decode( - BytesLib.slice(txData, 4, txData.length - 4), - (address, uint256) - ); - require( - _tokenId == tokenId, - "MintableERC721Predicate._processRawMint: TokenIds in exit and mint tx do not match" - ); - } - - function processMintWithTokenURI( - bytes memory mintTx, - address rootToken, - uint256 tokenId, - address childToken, - uint256 exitId - ) internal { - ERC721PlasmaMintable token = ERC721PlasmaMintable(rootToken); - require( - !token.exists(tokenId), - "MintableERC721Predicate.processMintWithTokenURI: Token being exited already exists" - ); - - RLPReader.RLPItem[] memory txList = mintTx.toRlpItem().toList(); - string memory uri = _processRawMintWithTokenURI( - RLPReader.toBytes(txList[5]), - tokenId - ); - // Will lazily (at the time of processExits) check that the signer of the mint tx is a valid minter in the root contract - (address minter, ) = getAddressFromTx(txList); - exitToMintableTokenInfo[exitId] = MintableTokenInfo( - uri, - minter, - false /* isVanillaMint */ - ); - address _childToken = RLPReader.toAddress(txList[3]); // corresponds to "to" field in tx - require( - childToken == _childToken, - "MintableERC721Predicate.processMintWithTokenURI; Token in reference and mint tx are not same" - ); - } - - function _processRawMintWithTokenURI(bytes memory txData, uint256 tokenId) - internal - pure - returns (string memory uri) - { - bytes4 funcSig = BytesLib.toBytes4(BytesLib.slice(txData, 0, 4)); - require( - funcSig == 0x50bb4e7f, // keccak256('mintWithTokenURI(address,uint256,string)').slice(0, 4) - "MintableERC721Predicate._processRawMintWithTokenURI: funcSig does not match mintWithTokenURI" - ); - uint256 _tokenId; - (, _tokenId, uri) = abi.decode( - BytesLib.slice(txData, 4, txData.length - 4), - (address, uint256, string) - ); - require( - _tokenId == tokenId, - "MintableERC721Predicate._processRawMintWithTokenURI: TokenIds in exit and mint tx do not match" - ); - } -} diff --git a/contracts/root/stateSyncer/StateSender.sol b/contracts/root/stateSyncer/StateSender.sol index 0525dc40..8dd092d0 100644 --- a/contracts/root/stateSyncer/StateSender.sol +++ b/contracts/root/stateSyncer/StateSender.sol @@ -1,7 +1,7 @@ pragma solidity ^0.5.2; -import {Ownable} from "openzeppelin-solidity/contracts/ownership/Ownable.sol"; -import {SafeMath} from "openzeppelin-solidity/contracts/math/SafeMath.sol"; +import {Ownable} from "../../common/oz/ownership/Ownable.sol"; +import {SafeMath} from "../../common/oz/math/SafeMath.sol"; contract StateSender is Ownable { using SafeMath for uint256; diff --git a/contracts/root/withdrawManager/ExitNFT.sol b/contracts/root/withdrawManager/ExitNFT.sol index ad50f060..82dbbbc3 100644 --- a/contracts/root/withdrawManager/ExitNFT.sol +++ b/contracts/root/withdrawManager/ExitNFT.sol @@ -1,6 +1,6 @@ pragma solidity ^0.5.2; -import {ERC721} from "openzeppelin-solidity/contracts/token/ERC721/ERC721.sol"; +import {ERC721} from "../../common/oz/token/ERC721/ERC721.sol"; import {Registry} from "../../common/Registry.sol"; contract ExitNFT is ERC721 { diff --git a/contracts/root/withdrawManager/WithdrawManager.sol b/contracts/root/withdrawManager/WithdrawManager.sol index 7ae504ec..6466c9cf 100644 --- a/contracts/root/withdrawManager/WithdrawManager.sol +++ b/contracts/root/withdrawManager/WithdrawManager.sol @@ -1,8 +1,6 @@ pragma solidity ^0.5.2; -import {ERC20} from "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol"; -import {ERC721} from "openzeppelin-solidity/contracts/token/ERC721/ERC721.sol"; -import {Math} from "openzeppelin-solidity/contracts/math/Math.sol"; +import {Math} from "../../common/oz/math/Math.sol"; import {Merkle} from "../../common/lib/Merkle.sol"; import {MerklePatriciaProof} from "../../common/lib/MerklePatriciaProof.sol"; @@ -13,7 +11,6 @@ import {ExitNFT} from "./ExitNFT.sol"; import {DepositManager} from "../depositManager/DepositManager.sol"; import {IPredicate} from "../predicates/IPredicate.sol"; import {IWithdrawManager} from "./IWithdrawManager.sol"; -import {RootChainHeader} from "../RootChainStorage.sol"; import {Registry} from "../../common/Registry.sol"; import {WithdrawManagerStorage} from "./WithdrawManagerStorage.sol"; diff --git a/contracts/staking/StakingInfo.sol b/contracts/staking/StakingInfo.sol index 0f12ba44..2a96d41f 100644 --- a/contracts/staking/StakingInfo.sol +++ b/contracts/staking/StakingInfo.sol @@ -1,8 +1,8 @@ pragma solidity ^0.5.2; import {Registry} from "../common/Registry.sol"; -import {SafeMath} from "openzeppelin-solidity/contracts/math/SafeMath.sol"; -import {Ownable} from "openzeppelin-solidity/contracts/ownership/Ownable.sol"; +import {SafeMath} from "../common/oz/math/SafeMath.sol"; +import {Ownable} from "../common/oz/ownership/Ownable.sol"; // dummy interface to avoid cyclic dependency diff --git a/contracts/staking/slashing/ISlashingManager.sol b/contracts/staking/slashing/ISlashingManager.sol deleted file mode 100644 index f788e316..00000000 --- a/contracts/staking/slashing/ISlashingManager.sol +++ /dev/null @@ -1,15 +0,0 @@ -pragma solidity ^0.5.2; -import {StakingInfo} from "../StakingInfo.sol"; -import {Registry} from "../../common/Registry.sol"; - - -contract ISlashingManager { - bytes32 public heimdallId; - uint8 public constant VOTE_TYPE = 2; - uint256 public reportRate = 5; // dummy default value - uint256 public proposerRate = 50; // dummy default value - uint256 public jailCheckpoints = 5; // checkpoints - uint256 public slashingNonce; - Registry public registry; - StakingInfo public logger; -} diff --git a/contracts/staking/slashing/SlashingManager.sol b/contracts/staking/slashing/SlashingManager.sol deleted file mode 100644 index 6b52e774..00000000 --- a/contracts/staking/slashing/SlashingManager.sol +++ /dev/null @@ -1,138 +0,0 @@ -pragma solidity ^0.5.2; - -import {Ownable} from "openzeppelin-solidity/contracts/ownership/Ownable.sol"; -import {SafeMath} from "openzeppelin-solidity/contracts/math/SafeMath.sol"; -import {IERC20} from "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol"; - -import {BytesLib} from "../../common/lib/BytesLib.sol"; -import {ECVerify} from "../../common/lib/ECVerify.sol"; - -import {StakeManager} from "../stakeManager/StakeManager.sol"; -import {IValidatorShare} from "../validatorShare/IValidatorShare.sol"; -import {Registry} from "../../common/Registry.sol"; -import {StakingInfo} from "../StakingInfo.sol"; -import "./ISlashingManager.sol"; - - -contract SlashingManager is ISlashingManager, Ownable { - using SafeMath for uint256; - using ECVerify for bytes32; - - modifier onlyStakeManager() { - require(registry.getStakeManagerAddress() == msg.sender); - _; - } - - constructor( - address _registry, - address _logger, - string memory _heimdallId - ) public { - registry = Registry(_registry); - logger = StakingInfo(_logger); - heimdallId = keccak256(abi.encodePacked(_heimdallId)); - } - - function updateSlashedAmounts(bytes memory data, bytes memory sigs) public { - (uint256 _slashingNonce, address proposer, bytes memory _slashingInfoList) = abi.decode( - data, - (uint256, address, bytes) - ); - - slashingNonce = slashingNonce.add(1); - require(slashingNonce == _slashingNonce, "Invalid slashing nonce"); - StakeManager stakeManager = StakeManager(registry.getStakeManagerAddress()); - - uint256 stakePower; - uint256 activeTwoByThree; - require(verifyConsensus(keccak256(abi.encodePacked(bytes(hex"01"), data)), sigs), "2/3+1 Power required"); - //slashingInfoList[]=[[valiD,am,isJailed]] - uint256 slashedAmount = stakeManager.slash(_slashingInfoList); - logger.logSlashed(_slashingNonce, slashedAmount); - - uint256 bounty = (slashedAmount.mul(reportRate)).div(100); - slashedAmount = slashedAmount.sub(bounty); - - require( - stakeManager.transferFunds( - 0, //placeholder - slashedAmount, - address(this) - ), - "Transfer failed" - ); - // Transfer bounty to slashing reporter - if (msg.sender != proposer) { - // bounty - uint256 _bounty = (bounty.mul(proposerRate)).div(100); - require( - stakeManager.transferFunds( - 0, //placeholder - _bounty, - proposer - ), - "Bounty transfer failed" - ); - bounty = bounty.sub(_bounty); - } - require( - stakeManager.transferFunds( - 0, //placeholder - bounty, - msg.sender - ), - "Bounty transfer failed" - ); - } - - function verifyConsensus(bytes32 voteHash, bytes memory sigs) public view returns (bool) { - StakeManager stakeManager = StakeManager(registry.getStakeManagerAddress()); - // total voting power - uint256 _stakePower; - address lastAdd; // cannot have address(0x0) as an owner - for (uint64 i = 0; i < sigs.length; i += 65) { - bytes memory sigElement = BytesLib.slice(sigs, i, 65); - address signer = voteHash.ecrecovery(sigElement); - - uint256 validatorId = stakeManager.signerToValidator(signer); - // check if signer is staker and not proposer - if (signer == lastAdd) { - break; - } else if (stakeManager.isValidator(validatorId) && signer > lastAdd) { - lastAdd = signer; - uint256 amount; - uint256 delegatedAmount; - (amount,,,,,,,,,,,delegatedAmount,) = stakeManager.validators(validatorId); - - // add delegation power - amount = amount.add(delegatedAmount); - _stakePower = _stakePower.add(amount); - } - } - return (_stakePower >= stakeManager.currentValidatorSetTotalStake().mul(2).div(3).add(1)); - } - - function updateReportRate(uint256 newReportRate) public onlyOwner { - require(newReportRate > 0); - reportRate = newReportRate; - } - - function updateProposerRate(uint256 newProposerRate) public onlyOwner { - require(newProposerRate > 0); - proposerRate = newProposerRate; - } - - // Housekeeping function. @todo remove later - function setHeimdallId(string memory _heimdallId) public onlyOwner { - heimdallId = keccak256(abi.encodePacked(_heimdallId)); - } - - // Housekeeping function. @todo remove later - function drainTokens( - uint256 value, - address token, - address destination - ) external onlyOwner { - require(IERC20(token).transfer(destination, value), "Transfer failed"); - } -} diff --git a/contracts/staking/stakeManager/IStakeManager.sol b/contracts/staking/stakeManager/IStakeManager.sol index ccf3f7b2..a4a7df65 100644 --- a/contracts/staking/stakeManager/IStakeManager.sol +++ b/contracts/staking/stakeManager/IStakeManager.sol @@ -1,16 +1,6 @@ pragma solidity 0.5.17; contract IStakeManager { - // validator replacement - function startAuction( - uint256 validatorId, - uint256 amount, - bool acceptDelegation, - bytes calldata signerPubkey - ) external; - - function confirmAuctionBid(uint256 validatorId, uint256 heimdallFee) external; - function transferFunds( uint256 validatorId, uint256 amount, @@ -69,8 +59,6 @@ contract IStakeManager { function ownerOf(uint256 tokenId) public view returns (address); - function slash(bytes calldata slashingInfoList) external returns (uint256); - function validatorStake(uint256 validatorId) public view returns (uint256); function epoch() public view returns (uint256); @@ -86,13 +74,4 @@ contract IStakeManager { function withdrawDelegatorsReward(uint256 validatorId) public returns(uint256); function delegatorsReward(uint256 validatorId) public view returns(uint256); - - function dethroneAndStake( - address auctionUser, - uint256 heimdallFee, - uint256 validatorId, - uint256 auctionAmount, - bool acceptDelegation, - bytes calldata signerPubkey - ) external; } diff --git a/contracts/staking/stakeManager/StakeManager.sol b/contracts/staking/stakeManager/StakeManager.sol index 2d5e2c97..bf185f5f 100644 --- a/contracts/staking/stakeManager/StakeManager.sol +++ b/contracts/staking/stakeManager/StakeManager.sol @@ -1,17 +1,15 @@ pragma solidity 0.5.17; -import {IERC20} from "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol"; -import {Math} from "openzeppelin-solidity/contracts/math/Math.sol"; -import {SafeMath} from "openzeppelin-solidity/contracts/math/SafeMath.sol"; +import {IERC20} from "../../common/oz/token/ERC20/IERC20.sol"; +import {Math} from "../../common/oz/math/Math.sol"; +import {SafeMath} from "../../common/oz/math/SafeMath.sol"; import {ECVerify} from "../../common/lib/ECVerify.sol"; import {Merkle} from "../../common/lib/Merkle.sol"; import {GovernanceLockable} from "../../common/mixin/GovernanceLockable.sol"; import {DelegateProxyForwarder} from "../../common/misc/DelegateProxyForwarder.sol"; -import {Registry} from "../../common/Registry.sol"; import {IStakeManager} from "./IStakeManager.sol"; import {IValidatorShare} from "../validatorShare/IValidatorShare.sol"; -import {ValidatorShare} from "../validatorShare/ValidatorShare.sol"; import {StakingInfo} from "../StakingInfo.sol"; import {StakingNFT} from "./StakingNFT.sol"; import {ValidatorShareFactory} from "../validatorShare/ValidatorShareFactory.sol"; @@ -71,20 +69,24 @@ contract StakeManager is function initialize( address _registry, address _rootchain, - address _token, + address _tokenLegacy, address _NFTContract, address _stakingLogger, address _validatorShareFactory, address _governance, address _owner, - address _extensionCode + address _extensionCode, + address _token, + address _migration ) external initializer { - require(isContract(_extensionCode), "auction impl incorrect"); + require(isContract(_extensionCode), "extension impl incorrect"); extensionCode = _extensionCode; governance = IGovernance(_governance); registry = _registry; rootChain = _rootchain; token = IERC20(_token); + tokenMatic = IERC20(_tokenLegacy); + migration = IPolygonMigration(_migration); NFTContract = StakingNFT(_NFTContract); logger = StakingInfo(_stakingLogger); validatorShareFactory = ValidatorShareFactory(_validatorShareFactory); @@ -101,35 +103,10 @@ contract StakeManager is validatorThreshold = 7; //128 NFTCounter = 1; - auctionPeriod = (2**13) / 4; // 1 week in epochs proposerBonus = 10; // 10 % of total rewards delegationEnabled = true; } - function reinitialize( - address _NFTContract, - address _stakingLogger, - address _validatorShareFactory, - address _extensionCode - ) external onlyGovernance { - require(isContract(_extensionCode)); - eventsHub = address(0x0); - extensionCode = _extensionCode; - NFTContract = StakingNFT(_NFTContract); - logger = StakingInfo(_stakingLogger); - validatorShareFactory = ValidatorShareFactory(_validatorShareFactory); - } - - function initializePOL( - address _tokenNew, - address _migration - ) external onlyGovernance { - tokenMatic = IERC20(token); - token = IERC20(_tokenNew); - migration = IPolygonMigration(_migration); - _convertMaticToPOL(tokenMatic.balanceOf(address(this))); - } - function isOwner() public view returns (bool) { address _owner; bytes32 position = keccak256("matic.network.proxy.owner"); @@ -233,11 +210,6 @@ contract StakeManager is currentEpoch = _currentEpoch; } - function setStakingToken(address _token) public onlyGovernance { - require(_token != address(0x0)); - token = IERC20(_token); - } - /** * @dev Change the number of validators required to allow a passed header root */ @@ -304,13 +276,6 @@ contract StakeManager is logger.logDynastyValueChange(newDynasty, dynasty); dynasty = newDynasty; WITHDRAWAL_DELAY = newDynasty; - auctionPeriod = newDynasty.div(4); - replacementCoolDown = currentEpoch.add(auctionPeriod); - } - - // Housekeeping function. @todo remove later - function stopAuctions(uint256 forNCheckpoints) public onlyGovernance { - replacementCoolDown = currentEpoch.add(forNCheckpoints); } function updateProposerBonus(uint256 newProposerBonus) public onlyGovernance { @@ -351,56 +316,6 @@ contract StakeManager is return validators[NFTContract.tokenOfOwnerByIndex(user, 0)].amount; } - function startAuction( - uint256 validatorId, - uint256 amount, - bool _acceptDelegation, - bytes calldata _signerPubkey - ) external onlyWhenUnlocked { - delegatedFwd( - extensionCode, - abi.encodeWithSelector( - StakeManagerExtension(extensionCode).startAuction.selector, - validatorId, - amount, - _acceptDelegation, - _signerPubkey - ) - ); - } - - function confirmAuctionBid( - uint256 validatorId, - uint256 heimdallFee /** for new validator */ - ) external onlyWhenUnlocked { - delegatedFwd( - extensionCode, - abi.encodeWithSelector( - StakeManagerExtension(extensionCode).confirmAuctionBid.selector, - validatorId, - heimdallFee, - address(this) - ) - ); - } - - function dethroneAndStake( - address auctionUser, - uint256 heimdallFee, - uint256 validatorId, - uint256 auctionAmount, - bool acceptDelegation, - bytes calldata signerPubkey - ) external { - require(msg.sender == address(this), "not allowed"); - // dethrone - _transferAndTopUp(auctionUser, auctionUser, heimdallFee, 0, true); - _unstake(validatorId, currentEpoch, true); - - uint256 newValidatorId = _stakeFor(auctionUser, auctionAmount, acceptDelegation, signerPubkey); - logger.logConfirmAuction(newValidatorId, validatorId, auctionAmount); - } - function unstake(uint256 validatorId) external onlyStaker(validatorId) { _unstakeValidator(validatorId, false); } @@ -410,8 +325,6 @@ contract StakeManager is } function _unstakeValidator(uint256 validatorId, bool pol) internal { - require(validatorAuction[validatorId].amount == 0); - Status status = validators[validatorId].status; require( validators[validatorId].activationEpoch > 0 && @@ -432,7 +345,7 @@ contract StakeManager is } function _transferFunds(uint256 validatorId, uint256 amount, address delegator, bool pol) internal returns (bool) { - require(validators[validatorId].contractAddress == msg.sender || Registry(registry).getSlashingManagerAddress() == msg.sender, "not allowed"); + require(validators[validatorId].contractAddress == msg.sender, "not allowed"); if (!pol) _convertPOLToMatic(amount); IERC20 token_ = _getToken(pol); return token_.transfer(delegator, amount); @@ -711,34 +624,6 @@ contract StakeManager is return totalReward; } - function slash(bytes calldata _slashingInfoList) external returns (uint256) { - revert(); - } - - function unjail(uint256 validatorId) public onlyStaker(validatorId) { - require(validators[validatorId].status == Status.Locked, "Not jailed"); - require(validators[validatorId].deactivationEpoch == 0, "Already unstaking"); - - uint256 _currentEpoch = currentEpoch; - require(validators[validatorId].jailTime <= _currentEpoch, "Incomplete jail period"); - - uint256 amount = validators[validatorId].amount; - require(amount >= minDeposit); - - address delegationContract = validators[validatorId].contractAddress; - if (delegationContract != address(0x0)) { - IValidatorShare(delegationContract).unlock(); - } - - // undo timeline so that validator is normal validator - updateTimeline(int256(amount.add(validators[validatorId].delegatedAmount)), 1, 0); - - validators[validatorId].status = Status.Active; - - address signer = validators[validatorId].signer; - logger.logUnjailed(validatorId, signer); - } - function updateTimeline( int256 amount, int256 stakerCount, @@ -935,15 +820,14 @@ contract StakeManager is // attempt to save gas in case if rewards were updated previously if (initialRewardPerStake < currentRewardPerStake) { uint256 validatorsStake = validators[validatorId].amount; - uint256 delegatedAmount = validators[validatorId].delegatedAmount; - if (delegatedAmount > 0) { - uint256 combinedStakePower = validatorsStake.add(delegatedAmount); + uint256 valDelegatedAmount = validators[validatorId].delegatedAmount; + if (valDelegatedAmount > 0) { + uint256 combinedStakePower = validatorsStake.add(valDelegatedAmount); _increaseValidatorRewardWithDelegation( validatorId, validatorsStake, - delegatedAmount, + valDelegatedAmount, _getEligibleValidatorReward( - validatorId, combinedStakePower, currentRewardPerStake, initialRewardPerStake @@ -953,7 +837,6 @@ contract StakeManager is _increaseValidatorReward( validatorId, _getEligibleValidatorReward( - validatorId, validatorsStake, currentRewardPerStake, initialRewardPerStake @@ -972,7 +855,6 @@ contract StakeManager is } function _getEligibleValidatorReward( - uint256 validatorId, uint256 validatorStakePower, uint256 currentRewardPerStake, uint256 initialRewardPerStake @@ -990,19 +872,19 @@ contract StakeManager is function _increaseValidatorRewardWithDelegation( uint256 validatorId, uint256 validatorsStake, - uint256 delegatedAmount, + uint256 valDelegatedAmount, uint256 reward ) private { - uint256 combinedStakePower = delegatedAmount.add(validatorsStake); - (uint256 validatorReward, uint256 delegatorsReward) = + uint256 combinedStakePower = valDelegatedAmount.add(validatorsStake); + (uint256 valReward, uint256 delReward) = _getValidatorAndDelegationReward(validatorId, validatorsStake, reward, combinedStakePower); - if (delegatorsReward > 0) { - validators[validatorId].delegatorsReward = validators[validatorId].delegatorsReward.add(delegatorsReward); + if (delReward > 0) { + validators[validatorId].delegatorsReward = validators[validatorId].delegatorsReward.add(delReward); } - if (validatorReward > 0) { - validators[validatorId].reward = validators[validatorId].reward.add(validatorReward); + if (valReward > 0) { + validators[validatorId].reward = validators[validatorId].reward.add(valReward); } } @@ -1016,24 +898,24 @@ contract StakeManager is return (0, 0); } - uint256 validatorReward = validatorsStake.mul(reward).div(combinedStakePower); + uint256 valReward = validatorsStake.mul(reward).div(combinedStakePower); // add validator commission from delegation reward uint256 commissionRate = validators[validatorId].commissionRate; if (commissionRate > 0) { - validatorReward = validatorReward.add( - reward.sub(validatorReward).mul(commissionRate).div(MAX_COMMISION_RATE) + valReward = valReward.add( + reward.sub(valReward).mul(commissionRate).div(MAX_COMMISION_RATE) ); } - uint256 delegatorsReward = reward.sub(validatorReward); - return (validatorReward, delegatorsReward); + uint256 delReward = reward.sub(valReward); + return (valReward, delReward); } function _evaluateValidatorAndDelegationReward(uint256 validatorId) private view - returns (uint256 validatorReward, uint256 delegatorsReward) + returns (uint256 valReward, uint256 delReward) { uint256 validatorsStake = validators[validatorId].amount; uint256 combinedStakePower = validatorsStake.add(validators[validatorId].delegatedAmount); @@ -1084,8 +966,6 @@ contract StakeManager is signerToValidator[signer] = validatorId; updateTimeline(int256(amount), 1, 0); - // no Auctions for 1 dynasty - validatorAuction[validatorId].startEpoch = _currentEpoch; _logger.logStaked(signer, signerPubkey, validatorId, _currentEpoch, amount, newTotalStaked); NFTCounter = validatorId.add(1); diff --git a/contracts/staking/stakeManager/StakeManagerExtension.sol b/contracts/staking/stakeManager/StakeManagerExtension.sol index c74dbcca..88500d19 100644 --- a/contracts/staking/stakeManager/StakeManagerExtension.sol +++ b/contracts/staking/stakeManager/StakeManagerExtension.sol @@ -1,13 +1,10 @@ pragma solidity 0.5.17; -import {IERC20} from "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol"; -import {SafeMath} from "openzeppelin-solidity/contracts/math/SafeMath.sol"; +import {SafeMath} from "../../common/oz/math/SafeMath.sol"; import {Registry} from "../../common/Registry.sol"; import {GovernanceLockable} from "../../common/mixin/GovernanceLockable.sol"; -import {IStakeManager} from "./IStakeManager.sol"; import {StakeManagerStorage} from "./StakeManagerStorage.sol"; import {StakeManagerStorageExtension} from "./StakeManagerStorageExtension.sol"; -import {Math} from "openzeppelin-solidity/contracts/math/Math.sol"; import {Initializable} from "../../common/mixin/Initializable.sol"; import {EventsHub} from "../EventsHub.sol"; import {ValidatorShare} from "../validatorShare/ValidatorShare.sol"; @@ -17,114 +14,6 @@ contract StakeManagerExtension is StakeManagerStorage, Initializable, StakeManag constructor() public GovernanceLockable(address(0x0)) {} - function startAuction( - uint256 validatorId, - uint256 amount, - bool _acceptDelegation, - bytes calldata _signerPubkey - ) external { - uint256 currentValidatorAmount = validators[validatorId].amount; - - require( - validators[validatorId].deactivationEpoch == 0 && currentValidatorAmount != 0, - "Invalid validator for an auction" - ); - uint256 senderValidatorId = signerToValidator[msg.sender]; - // make sure that signer wasn't used already - require( - NFTContract.balanceOf(msg.sender) == 0 && // existing validators can't bid - senderValidatorId != INCORRECT_VALIDATOR_ID, - "Already used address" - ); - - uint256 _currentEpoch = currentEpoch; - uint256 _replacementCoolDown = replacementCoolDown; - // when dynasty period is updated validators are in cooldown period - require(_replacementCoolDown == 0 || _replacementCoolDown <= _currentEpoch, "Cooldown period"); - // (auctionPeriod--dynasty)--(auctionPeriod--dynasty)--(auctionPeriod--dynasty) - // if it's auctionPeriod then will get residue smaller then auctionPeriod - // from (CurrentPeriod of validator )%(auctionPeriod--dynasty) - // make sure that its `auctionPeriod` window - // dynasty = 30, auctionPeriod = 7, activationEpoch = 1, currentEpoch = 39 - // residue 1 = (39-1)% (7+30), if residue <= auctionPeriod it's `auctionPeriod` - - require( - (_currentEpoch.sub(validators[validatorId].activationEpoch) % dynasty.add(auctionPeriod)) < auctionPeriod, - "Invalid auction period" - ); - - uint256 perceivedStake = currentValidatorAmount; - perceivedStake = perceivedStake.add(validators[validatorId].delegatedAmount); - - Auction storage auction = validatorAuction[validatorId]; - uint256 currentAuctionAmount = auction.amount; - - perceivedStake = Math.max(perceivedStake, currentAuctionAmount); - - require(perceivedStake < amount, "Must bid higher"); - require(token.transferFrom(msg.sender, address(this), amount), "Transfer failed"); - - //replace prev auction - if (currentAuctionAmount != 0) { - require(token.transfer(auction.user, currentAuctionAmount), "Bid return failed"); - } - - // create new auction - auction.amount = amount; - auction.user = msg.sender; - auction.acceptDelegation = _acceptDelegation; - auction.signerPubkey = _signerPubkey; - - logger.logStartAuction(validatorId, currentValidatorAmount, amount); - } - - function confirmAuctionBid( - uint256 validatorId, - uint256 heimdallFee, /** for new validator */ - IStakeManager stakeManager - ) external { - Auction storage auction = validatorAuction[validatorId]; - address auctionUser = auction.user; - - require( - msg.sender == auctionUser || NFTContract.tokenOfOwnerByIndex(msg.sender, 0) == validatorId, - "Only bidder can confirm" - ); - - uint256 _currentEpoch = currentEpoch; - require( - _currentEpoch.sub(auction.startEpoch) % auctionPeriod.add(dynasty) >= auctionPeriod, - "Not allowed before auctionPeriod" - ); - require(auction.user != address(0x0), "Invalid auction"); - - uint256 validatorAmount = validators[validatorId].amount; - uint256 perceivedStake = validatorAmount; - uint256 auctionAmount = auction.amount; - - perceivedStake = perceivedStake.add(validators[validatorId].delegatedAmount); - - // validator is last auctioner - if (perceivedStake >= auctionAmount && validators[validatorId].deactivationEpoch == 0) { - require(token.transfer(auctionUser, auctionAmount), "Bid return failed"); - //cleanup auction data - auction.startEpoch = _currentEpoch; - logger.logConfirmAuction(validatorId, validatorId, validatorAmount); - } else { - stakeManager.dethroneAndStake( - auctionUser, - heimdallFee, - validatorId, - auctionAmount, - auction.acceptDelegation, - auction.signerPubkey - ); - } - uint256 startEpoch = auction.startEpoch; - delete validatorAuction[validatorId]; - validatorAuction[validatorId].startEpoch = startEpoch; - } - function migrateValidatorsData(uint256 validatorIdFrom, uint256 validatorIdTo) external { for (uint256 i = validatorIdFrom; i < validatorIdTo; ++i) { ValidatorShare contractAddress = ValidatorShare(validators[i].contractAddress); diff --git a/contracts/staking/stakeManager/StakeManagerStorage.sol b/contracts/staking/stakeManager/StakeManagerStorage.sol index 6b448a83..5b081eb5 100644 --- a/contracts/staking/stakeManager/StakeManagerStorage.sol +++ b/contracts/staking/stakeManager/StakeManagerStorage.sol @@ -1,8 +1,7 @@ pragma solidity 0.5.17; -import {IERC20} from "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol"; +import {IERC20} from "../../common/oz/token/ERC20/IERC20.sol"; -import {Registry} from "../../common/Registry.sol"; import {GovernanceLockable} from "../../common/mixin/GovernanceLockable.sol"; import {RootChainable} from "../../common/mixin/RootChainable.sol"; import {StakingInfo} from "../StakingInfo.sol"; @@ -46,9 +45,9 @@ contract StakeManagerStorage is GovernanceLockable, RootChainable { uint256 initialRewardPerStake; } - uint256 constant MAX_COMMISION_RATE = 100; - uint256 constant MAX_PROPOSER_BONUS = 100; - uint256 constant REWARD_PRECISION = 10**25; + uint256 internal constant MAX_COMMISION_RATE = 100; + uint256 internal constant MAX_PROPOSER_BONUS = 100; + uint256 internal constant REWARD_PRECISION = 10**25; uint256 internal constant INCORRECT_VALIDATOR_ID = 2**256 - 1; uint256 internal constant INITIALIZED_AMOUNT = 1; @@ -73,11 +72,11 @@ contract StakeManagerStorage is GovernanceLockable, RootChainable { uint256 public NFTCounter; uint256 public totalRewards; uint256 public totalRewardsLiquidated; - uint256 public auctionPeriod; // 1 week in epochs + uint256 public auctionPeriod; // 1 week in epochs // deprecated uint256 public proposerBonus; // 10 % of total rewards bytes32 public accountStateRoot; // Stop validator auction for some time when updating dynasty value - uint256 public replacementCoolDown; + uint256 public replacementCoolDown; // deprecated bool public delegationEnabled; mapping(uint256 => Validator) public validators; @@ -88,7 +87,7 @@ contract StakeManagerStorage is GovernanceLockable, RootChainable { mapping(address => uint256) public userFeeExit; //Ongoing auctions for validatorId - mapping(uint256 => Auction) public validatorAuction; + mapping(uint256 => Auction) public validatorAuction; // deprecated // validatorId to last signer update epoch mapping(uint256 => uint256) public latestSignerUpdateEpoch; diff --git a/contracts/staking/stakeManager/StakeManagerStorageExtension.sol b/contracts/staking/stakeManager/StakeManagerStorageExtension.sol index adf715f8..0fd4b2fc 100644 --- a/contracts/staking/stakeManager/StakeManagerStorageExtension.sol +++ b/contracts/staking/stakeManager/StakeManagerStorageExtension.sol @@ -1,7 +1,7 @@ pragma solidity 0.5.17; import {IPolygonMigration} from "../../common/misc/IPolygonMigration.sol"; -import {IERC20} from "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol"; +import {IERC20} from "../../common/oz/token/ERC20/IERC20.sol"; contract StakeManagerStorageExtension { address public eventsHub; @@ -9,7 +9,7 @@ contract StakeManagerStorageExtension { address public extensionCode; address[] public signers; - uint256 constant CHK_REWARD_PRECISION = 100; + uint256 internal constant CHK_REWARD_PRECISION = 100; uint256 public prevBlockInterval; // how much less reward per skipped checkpoint, 0 - 100% uint256 public rewardDecreasePerCheckpoint; diff --git a/contracts/staking/stakeManager/StakingNFT.sol b/contracts/staking/stakeManager/StakingNFT.sol index 31255a68..40c8ec9c 100644 --- a/contracts/staking/stakeManager/StakingNFT.sol +++ b/contracts/staking/stakeManager/StakingNFT.sol @@ -1,7 +1,7 @@ pragma solidity ^0.5.2; -import "openzeppelin-solidity/contracts/token/ERC721/ERC721Full.sol"; -import {Ownable} from "openzeppelin-solidity/contracts/ownership/Ownable.sol"; +import {ERC721Full} from "../../common/oz/token/ERC721/ERC721Full.sol"; +import {Ownable} from "../../common/oz//ownership/Ownable.sol"; contract StakingNFT is ERC721Full, Ownable { diff --git a/contracts/staking/validatorShare/IValidatorShare.sol b/contracts/staking/validatorShare/IValidatorShare.sol index 5881c70c..74d9450c 100644 --- a/contracts/staking/validatorShare/IValidatorShare.sol +++ b/contracts/staking/validatorShare/IValidatorShare.sol @@ -16,14 +16,6 @@ contract IValidatorShare { function lock() external; - function drain( - address token, - address payable destination, - uint256 amount - ) external; - - function slash(uint256 valPow, uint256 delegatedAmount, uint256 totalAmountToSlash) external returns (uint256); - function updateDelegation(bool delegation) external; function migrateOut(address user, uint256 amount) external; diff --git a/contracts/staking/validatorShare/ValidatorShare.sol b/contracts/staking/validatorShare/ValidatorShare.sol index 0f8ba7ff..950b8d81 100644 --- a/contracts/staking/validatorShare/ValidatorShare.sol +++ b/contracts/staking/validatorShare/ValidatorShare.sol @@ -2,7 +2,6 @@ pragma solidity 0.5.17; import {Registry} from "../../common/Registry.sol"; import {ERC20NonTradable} from "../../common/tokens/ERC20NonTradable.sol"; -import {ERC20} from "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol"; import {StakingInfo} from "./../StakingInfo.sol"; import {EventsHub} from "./../EventsHub.sol"; import {OwnableLockable} from "../../common/mixin/OwnableLockable.sol"; @@ -26,12 +25,12 @@ contract ValidatorShare is IValidatorShare, ERC20NonTradable, OwnableLockable, I StakingInfo public stakingLogger; IStakeManager public stakeManager; uint256 public validatorId; - uint256 public validatorRewards_deprecated; - uint256 public commissionRate_deprecated; - uint256 public lastCommissionUpdate_deprecated; + uint256 public validatorRewards_deprecated; // Now in StakeManager + uint256 public commissionRate_deprecated; // Now in StakeManager + uint256 private lastCommissionUpdate_deprecated; // Now in StakeManager uint256 public minAmount; - uint256 public totalStake_deprecated; + uint256 private totalStake_deprecated; // Now in StakeManager uint256 public rewardPerShare; uint256 public activeAmount; @@ -66,6 +65,7 @@ contract ValidatorShare is IValidatorShare, ERC20NonTradable, OwnableLockable, I stakeManager = IStakeManager(_stakeManager); _transferOwnership(_stakeManager); _getOrCacheEventsHub(); + _getOrCachePOLToken(); minAmount = 10**18; delegation = true; @@ -262,26 +262,10 @@ contract ValidatorShare is IValidatorShare, ERC20NonTradable, OwnableLockable, I stakingLogger.logDelegatorUnstaked(validatorId, msg.sender, amount); } - function slash( - uint256 validatorStake, - uint256 delegatedAmount, - uint256 totalAmountToSlash - ) external onlyOwner returns (uint256) { - revert("Slashing disabled"); - } - function updateDelegation(bool _delegation) external onlyOwner { delegation = _delegation; } - function drain( - address token, - address payable destination, - uint256 amount - ) external onlyOwner { - revert("No draining."); - } - /** New shares exit API */ diff --git a/contracts/test/ContractActor.sol b/contracts/test/ContractActor.sol index 8f35ab0f..379b7552 100644 --- a/contracts/test/ContractActor.sol +++ b/contracts/test/ContractActor.sol @@ -1,8 +1,8 @@ pragma solidity ^0.5.2; -import {IERC20} from "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol"; -import "../root/depositManager/IDepositManager.sol"; -import "../root/withdrawManager/WithdrawManager.sol"; +import {IERC20} from "../common/oz/token/ERC20/IERC20.sol"; +import {IDepositManager} from "../root/depositManager/IDepositManager.sol"; +import {WithdrawManager} from "../root/withdrawManager/WithdrawManager.sol"; contract ContractWithFallback { function deposit(address depositManager, address token, uint256 amount) public { diff --git a/contracts/test/PolygonMigrationTest.sol b/contracts/test/PolygonMigrationTest.sol index 6089be8c..d26b130e 100644 --- a/contracts/test/PolygonMigrationTest.sol +++ b/contracts/test/PolygonMigrationTest.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.5.2; -import {IERC20} from "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol"; -import {SafeERC20} from "openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol"; +import {IERC20} from "../common/oz/token/ERC20/IERC20.sol"; +import {SafeERC20} from "../common/oz/token/ERC20/SafeERC20.sol"; // this impl was shortened for testing purposes // full impl at https://github.com/0xPolygon/indicia/blob/main/src/PolygonMigration.sol diff --git a/contracts/test/StakeManagerTest.sol b/contracts/test/StakeManagerTest.sol index cd6a4f1f..ab4d15b1 100644 --- a/contracts/test/StakeManagerTest.sol +++ b/contracts/test/StakeManagerTest.sol @@ -11,6 +11,11 @@ contract StakeManagerTest is StakeManager { address proposer, uint[3][] calldata sigs ) external onlyRootChain returns (uint256) { + blockInterval; + voteHash; + stateRoot; + proposer; + sigs; return CHECKPOINT_REWARD; // for dummy tests return full reward } } diff --git a/docs/autogen/.gitignore b/docs/autogen/.gitignore deleted file mode 100644 index 4e42a1bc..00000000 --- a/docs/autogen/.gitignore +++ /dev/null @@ -1 +0,0 @@ -book/ \ No newline at end of file diff --git a/docs/autogen/book.css b/docs/autogen/book.css deleted file mode 100644 index b5ce903f..00000000 --- a/docs/autogen/book.css +++ /dev/null @@ -1,13 +0,0 @@ -table { - margin: 0 auto; - border-collapse: collapse; - width: 100%; -} - -table td:first-child { - width: 15%; -} - -table td:nth-child(2) { - width: 25%; -} \ No newline at end of file diff --git a/docs/autogen/book.toml b/docs/autogen/book.toml deleted file mode 100644 index f63044be..00000000 --- a/docs/autogen/book.toml +++ /dev/null @@ -1,12 +0,0 @@ -[book] -src = "src" -title = "" - -[output.html] -no-section-label = true -additional-js = ["solidity.min.js"] -additional-css = ["book.css"] -git-repository-url = "https://github.com/maticnetwork/contracts" - -[output.html.fold] -enable = true diff --git a/docs/autogen/solidity.min.js b/docs/autogen/solidity.min.js deleted file mode 100644 index 19249329..00000000 --- a/docs/autogen/solidity.min.js +++ /dev/null @@ -1,74 +0,0 @@ -hljs.registerLanguage("solidity",(()=>{"use strict";function e(){try{return!0 -}catch(e){return!1}} -var a=/-?(\b0[xX]([a-fA-F0-9]_?)*[a-fA-F0-9]|(\b[1-9](_?\d)*(\.((\d_?)*\d)?)?|\.\d(_?\d)*)([eE][-+]?\d(_?\d)*)?|\b0)(?!\w|\$)/ -;e()&&(a=a.source.replace(/\\b/g,"(?{ -var a=r(e),o=l(e),c=/[A-Za-z_$][A-Za-z_$0-9.]*/,d=e.inherit(e.TITLE_MODE,{ -begin:/[A-Za-z$_][0-9A-Za-z$_]*/,lexemes:c,keywords:n}),u={className:"params", -begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,lexemes:c,keywords:n, -contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,a,o,s]},_={ -className:"operator",begin:/:=|->/};return{keywords:n,lexemes:c, -contains:[a,o,i,t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,s,_,{ -className:"function",lexemes:c,beginKeywords:"function",end:"{",excludeEnd:!0, -contains:[d,u,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,_]}]}}, -solAposStringMode:r,solQuoteStringMode:l,HEX_APOS_STRING_MODE:i, -HEX_QUOTE_STRING_MODE:t,SOL_NUMBER:s,isNegativeLookbehindAvailable:e} -;const{baseAssembly:c,solAposStringMode:d,solQuoteStringMode:u,HEX_APOS_STRING_MODE:_,HEX_QUOTE_STRING_MODE:m,SOL_NUMBER:b,isNegativeLookbehindAvailable:E}=o -;return e=>{for(var a=d(e),s=u(e),n=[],i=0;i<32;i++)n[i]=i+1 -;var t=n.map((e=>8*e)),r=[];for(i=0;i<=80;i++)r[i]=i -;var l=n.map((e=>"bytes"+e)).join(" ")+" ",o=t.map((e=>"uint"+e)).join(" ")+" ",g=t.map((e=>"int"+e)).join(" ")+" ",M=[].concat.apply([],t.map((e=>r.map((a=>e+"x"+a))))),p={ -keyword:"var bool string int uint "+g+o+"byte bytes "+l+"fixed ufixed "+M.map((e=>"fixed"+e)).join(" ")+" "+M.map((e=>"ufixed"+e)).join(" ")+" enum struct mapping address new delete if else for while continue break return throw emit try catch revert unchecked _ function modifier event constructor fallback receive error virtual override constant immutable anonymous indexed storage memory calldata external public internal payable pure view private returns import from as using pragma contract interface library is abstract type assembly", -literal:"true false wei gwei szabo finney ether seconds minutes hours days weeks years", -built_in:"self this super selfdestruct suicide now msg block tx abi blockhash gasleft assert require Error Panic sha3 sha256 keccak256 ripemd160 ecrecover addmod mulmod log0 log1 log2 log3 log4" -},O={className:"operator",begin:/[+\-!~*\/%<>&^|=]/ -},C=/[A-Za-z_$][A-Za-z_$0-9]*/,N={className:"params",begin:/\(/,end:/\)/, -excludeBegin:!0,excludeEnd:!0,lexemes:C,keywords:p, -contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,a,s,b,"self"]},f={ -begin:/\.\s*/,end:/[^A-Za-z0-9$_\.]/,excludeBegin:!0,excludeEnd:!0,keywords:{ -built_in:"gas value selector address length push pop send transfer call callcode delegatecall staticcall balance code codehash wrap unwrap name creationCode runtimeCode interfaceId min max" -},relevance:2},y=e.inherit(e.TITLE_MODE,{begin:/[A-Za-z$_][0-9A-Za-z$_]*/, -lexemes:C,keywords:p}),w={className:"built_in", -begin:(E()?"(?`|`bool`|Returns success of function call.| - - -## Events -### Deposit - -```solidity -event Deposit(address indexed token, address indexed from, uint256 amount, uint256 input1, uint256 output1); -``` - -### Withdraw - -```solidity -event Withdraw(address indexed token, address indexed from, uint256 amount, uint256 input1, uint256 output1); -``` - -### LogTransfer - -```solidity -event LogTransfer( - address indexed token, address indexed from, address indexed to, uint256 amount, uint256 input1, uint256 input2, uint256 output1, uint256 output2 -); -``` - diff --git a/docs/autogen/src/contracts/child/BaseERC20NoSig.sol/contract.BaseERC20NoSig.md b/docs/autogen/src/contracts/child/BaseERC20NoSig.sol/contract.BaseERC20NoSig.md deleted file mode 100644 index 956e26ca..00000000 --- a/docs/autogen/src/contracts/child/BaseERC20NoSig.sol/contract.BaseERC20NoSig.md +++ /dev/null @@ -1,78 +0,0 @@ -# BaseERC20NoSig -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/child/BaseERC20NoSig.sol) - -**Inherits:** -[ChildToken](/contracts/child/ChildToken.sol/contract.ChildToken.md) - - -## Functions -### constructor - - -```solidity -constructor() public; -``` - -### transferWithSig - - -```solidity -function transferWithSig(bytes calldata sig, uint256 amount, bytes32 data, uint256 expiration, address to) external returns (address from); -``` - -### balanceOf - - -```solidity -function balanceOf(address account) external view returns (uint256); -``` - -### _transfer - - -```solidity -function _transfer(address sender, address recipient, uint256 amount) internal; -``` - -### _transferFrom - - -```solidity -function _transferFrom(address from, address to, uint256 value) internal returns (bool); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`from`|`address`|Address from where tokens are withdrawn.| -|`to`|`address`|Address to where tokens are sent.| -|`value`|`uint256`|Number of tokens to transfer.| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`bool`|Returns success of function call.| - - -## Events -### Deposit - -```solidity -event Deposit(address indexed token, address indexed from, uint256 amount, uint256 input1, uint256 output1); -``` - -### Withdraw - -```solidity -event Withdraw(address indexed token, address indexed from, uint256 amount, uint256 input1, uint256 output1); -``` - -### LogTransfer - -```solidity -event LogTransfer( - address indexed token, address indexed from, address indexed to, uint256 amount, uint256 input1, uint256 input2, uint256 output1, uint256 output2 -); -``` - diff --git a/docs/autogen/src/contracts/child/ChildChain.sol/contract.ChildChain.md b/docs/autogen/src/contracts/child/ChildChain.sol/contract.ChildChain.md deleted file mode 100644 index 732c5a6d..00000000 --- a/docs/autogen/src/contracts/child/ChildChain.sol/contract.ChildChain.md +++ /dev/null @@ -1,101 +0,0 @@ -# ChildChain -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/child/ChildChain.sol) - -**Inherits:** -Ownable, [StateSyncerVerifier](/contracts/child/bor/StateSyncerVerifier.sol/contract.StateSyncerVerifier.md), [StateReceiver](/contracts/child/bor/StateReceiver.sol/interface.StateReceiver.md) - - -## State Variables -### tokens - -```solidity -mapping(address => address) public tokens; -``` - - -### isERC721 - -```solidity -mapping(address => bool) public isERC721; -``` - - -### deposits - -```solidity -mapping(uint256 => bool) public deposits; -``` - - -### withdraws - -```solidity -mapping(uint256 => bool) public withdraws; -``` - - -## Functions -### constructor - - -```solidity -constructor() public; -``` - -### onStateReceive - - -```solidity -function onStateReceive(uint256, bytes calldata data) external onlyStateSyncer; -``` - -### addToken - - -```solidity -function addToken(address _owner, address _rootToken, string memory _name, string memory _symbol, uint8 _decimals, bool _isERC721) - public - onlyOwner - returns (address token); -``` - -### mapToken - - -```solidity -function mapToken(address rootToken, address token, bool isErc721) public onlyOwner; -``` - -### withdrawTokens - - -```solidity -function withdrawTokens(address rootToken, address user, uint256 amountOrTokenId, uint256 withdrawCount) public onlyOwner; -``` - -### depositTokens - - -```solidity -function depositTokens(address rootToken, address user, uint256 amountOrTokenId, uint256 depositId) internal; -``` - -## Events -### NewToken - -```solidity -event NewToken(address indexed rootToken, address indexed token, uint8 _decimals); -``` - -### TokenDeposited - -```solidity -event TokenDeposited(address indexed rootToken, address indexed childToken, address indexed user, uint256 amount, uint256 depositCount); -``` - -### TokenWithdrawn - -```solidity -event TokenWithdrawn(address indexed rootToken, address indexed childToken, address indexed user, uint256 amount, uint256 withrawCount); -``` - diff --git a/docs/autogen/src/contracts/child/ChildERC20.sol/contract.ChildERC20.md b/docs/autogen/src/contracts/child/ChildERC20.sol/contract.ChildERC20.md deleted file mode 100644 index bc46a7ed..00000000 --- a/docs/autogen/src/contracts/child/ChildERC20.sol/contract.ChildERC20.md +++ /dev/null @@ -1,103 +0,0 @@ -# ChildERC20 -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/child/ChildERC20.sol) - -**Inherits:** -[BaseERC20](/contracts/child/BaseERC20.sol/contract.BaseERC20.md), ERC20, [ERC20Detailed](/contracts/child/ERC20Detailed.sol/contract.ERC20Detailed.md), [StateSyncerVerifier](/contracts/child/bor/StateSyncerVerifier.sol/contract.StateSyncerVerifier.md), [StateReceiver](/contracts/child/bor/StateReceiver.sol/interface.StateReceiver.md) - - -## Functions -### constructor - - -```solidity -constructor(address, address _token, string memory _name, string memory _symbol, uint8 _decimals) public ERC20Detailed(_name, _symbol, _decimals); -``` - -### deposit - -Deposit tokens - - -```solidity -function deposit(address user, uint256 amount) public onlyChildChain; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`user`|`address`|address for address| -|`amount`|`uint256`|token balance| - - -### withdraw - -Withdraw tokens - - -```solidity -function withdraw(uint256 amount) public payable; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`amount`|`uint256`|tokens| - - -### onStateReceive - - -```solidity -function onStateReceive(uint256, bytes calldata data) external onlyStateSyncer; -``` - -### _withdraw - - -```solidity -function _withdraw(address user, uint256 amount) internal; -``` - -### transfer - -*Function that is called when a user or another contract wants to transfer funds.* - - -```solidity -function transfer(address to, uint256 value) public returns (bool); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`to`|`address`|Address of token receiver.| -|`value`|`uint256`|Number of tokens to transfer.| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`bool`|Returns success of function call.| - - -### allowance - - -```solidity -function allowance(address, address) public view returns (uint256); -``` - -### approve - - -```solidity -function approve(address, uint256) public returns (bool); -``` - -### transferFrom - - -```solidity -function transferFrom(address, address, uint256) public returns (bool); -``` - diff --git a/docs/autogen/src/contracts/child/ChildERC721.sol/contract.ChildERC721.md b/docs/autogen/src/contracts/child/ChildERC721.sol/contract.ChildERC721.md deleted file mode 100644 index afa0fac8..00000000 --- a/docs/autogen/src/contracts/child/ChildERC721.sol/contract.ChildERC721.md +++ /dev/null @@ -1,123 +0,0 @@ -# ChildERC721 -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/child/ChildERC721.sol) - -**Inherits:** -[ChildToken](/contracts/child/ChildToken.sol/contract.ChildToken.md), ERC721Full, [StateSyncerVerifier](/contracts/child/bor/StateSyncerVerifier.sol/contract.StateSyncerVerifier.md), [StateReceiver](/contracts/child/bor/StateReceiver.sol/interface.StateReceiver.md) - - -## Functions -### constructor - - -```solidity -constructor(address, address _token, string memory name, string memory symbol) public ERC721Full(name, symbol); -``` - -### transferWithSig - - -```solidity -function transferWithSig(bytes calldata sig, uint256 tokenId, bytes32 data, uint256 expiration, address to) external returns (address); -``` - -### approve - - -```solidity -function approve(address to, uint256 tokenId) public; -``` - -### getApproved - - -```solidity -function getApproved(uint256 tokenId) public view returns (address operator); -``` - -### setApprovalForAll - - -```solidity -function setApprovalForAll(address operator, bool _approved) public; -``` - -### isApprovedForAll - - -```solidity -function isApprovedForAll(address owner, address operator) public view returns (bool); -``` - -### deposit - -Deposit tokens - - -```solidity -function deposit(address user, uint256 tokenId) public onlyChildChain; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`user`|`address`|address for deposit| -|`tokenId`|`uint256`|tokenId to mint to user's account| - - -### withdraw - -Withdraw tokens - - -```solidity -function withdraw(uint256 tokenId) public payable; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`tokenId`|`uint256`|tokenId of the token to be withdrawn| - - -### onStateReceive - - -```solidity -function onStateReceive(uint256, bytes calldata data) external onlyStateSyncer; -``` - -### transferFrom - -*Overriding the inherited method so that it emits LogTransfer* - - -```solidity -function transferFrom(address from, address to, uint256 tokenId) public; -``` - -### _transferFrom - - -```solidity -function _transferFrom(address from, address to, uint256 tokenId) internal; -``` - -## Events -### Deposit - -```solidity -event Deposit(address indexed token, address indexed from, uint256 tokenId); -``` - -### Withdraw - -```solidity -event Withdraw(address indexed token, address indexed from, uint256 tokenId); -``` - -### LogTransfer - -```solidity -event LogTransfer(address indexed token, address indexed from, address indexed to, uint256 tokenId); -``` - diff --git a/docs/autogen/src/contracts/child/ChildERC721Mintable.sol/contract.ChildERC721Mintable.md b/docs/autogen/src/contracts/child/ChildERC721Mintable.sol/contract.ChildERC721Mintable.md deleted file mode 100644 index 19a2a70f..00000000 --- a/docs/autogen/src/contracts/child/ChildERC721Mintable.sol/contract.ChildERC721Mintable.md +++ /dev/null @@ -1,15 +0,0 @@ -# ChildERC721Mintable -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/child/ChildERC721Mintable.sol) - -**Inherits:** -[ChildERC721](/contracts/child/ChildERC721.sol/contract.ChildERC721.md), ERC721Mintable, ERC721MetadataMintable - - -## Functions -### constructor - - -```solidity -constructor(address rootToken, string memory name, string memory symbol) public ChildERC721(msg.sender, rootToken, name, symbol); -``` - diff --git a/docs/autogen/src/contracts/child/ChildToken.sol/contract.ChildToken.md b/docs/autogen/src/contracts/child/ChildToken.sol/contract.ChildToken.md deleted file mode 100644 index 93ca7ecb..00000000 --- a/docs/autogen/src/contracts/child/ChildToken.sol/contract.ChildToken.md +++ /dev/null @@ -1,100 +0,0 @@ -# ChildToken -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/child/ChildToken.sol) - -**Inherits:** -Ownable, [LibTokenTransferOrder](/contracts/child/misc/LibTokenTransferOrder.sol/contract.LibTokenTransferOrder.md) - - -## State Variables -### token - -```solidity -address public token; -``` - - -### childChain - -```solidity -address public childChain; -``` - - -### parent - -```solidity -address public parent; -``` - - -### disabledHashes - -```solidity -mapping(bytes32 => bool) public disabledHashes; -``` - - -## Functions -### onlyChildChain - - -```solidity -modifier onlyChildChain(); -``` - -### deposit - - -```solidity -function deposit(address user, uint256 amountOrTokenId) public; -``` - -### withdraw - - -```solidity -function withdraw(uint256 amountOrTokenId) public payable; -``` - -### ecrecovery - - -```solidity -function ecrecovery(bytes32 hash, bytes memory sig) public pure returns (address result); -``` - -### changeChildChain - - -```solidity -function changeChildChain(address newAddress) public onlyOwner; -``` - -### setParent - - -```solidity -function setParent(address newAddress) public onlyOwner; -``` - -## Events -### LogFeeTransfer - -```solidity -event LogFeeTransfer( - address indexed token, address indexed from, address indexed to, uint256 amount, uint256 input1, uint256 input2, uint256 output1, uint256 output2 -); -``` - -### ChildChainChanged - -```solidity -event ChildChainChanged(address indexed previousAddress, address indexed newAddress); -``` - -### ParentChanged - -```solidity -event ParentChanged(address indexed previousAddress, address indexed newAddress); -``` - diff --git a/docs/autogen/src/contracts/child/ERC20Detailed.sol/contract.ERC20Detailed.md b/docs/autogen/src/contracts/child/ERC20Detailed.sol/contract.ERC20Detailed.md deleted file mode 100644 index 4ac1cc46..00000000 --- a/docs/autogen/src/contracts/child/ERC20Detailed.sol/contract.ERC20Detailed.md +++ /dev/null @@ -1,77 +0,0 @@ -# ERC20Detailed -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/child/ERC20Detailed.sol) - -*The decimals are only for visualization purposes. -All the operations are done using the smallest and indivisible token unit, -just as on Ethereum all the operations are done in wei.* - - -## State Variables -### _name - -```solidity -string internal _name; -``` - - -### _symbol - -```solidity -string internal _symbol; -``` - - -### _decimals - -```solidity -uint8 internal _decimals; -``` - - -## Functions -### constructor - - -```solidity -constructor(string memory name, string memory symbol, uint8 decimals) public; -``` - -### name - - -```solidity -function name() public view returns (string memory); -``` -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`string`|the name of the token.| - - -### symbol - - -```solidity -function symbol() public view returns (string memory); -``` -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`string`|the symbol of the token.| - - -### decimals - - -```solidity -function decimals() public view returns (uint8); -``` -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`uint8`|the number of decimals of the token.| - - diff --git a/docs/autogen/src/contracts/child/MRC20.sol/contract.MRC20.md b/docs/autogen/src/contracts/child/MRC20.sol/contract.MRC20.md deleted file mode 100644 index af3f2822..00000000 --- a/docs/autogen/src/contracts/child/MRC20.sol/contract.MRC20.md +++ /dev/null @@ -1,143 +0,0 @@ -# MRC20 -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/child/MRC20.sol) - -**Inherits:** -[BaseERC20NoSig](/contracts/child/BaseERC20NoSig.sol/contract.BaseERC20NoSig.md) - -This contract is an ECR20 like wrapper over native ether (matic token) transfers on the matic chain - -*ERC20 methods have been made payable while keeping their method signature same as other ChildERC20s on Matic* - - -## State Variables -### currentSupply - -```solidity -uint256 public currentSupply = 0; -``` - - -### DECIMALS - -```solidity -uint8 private constant DECIMALS = 18; -``` - - -### isInitialized - -```solidity -bool isInitialized; -``` - - -## Functions -### constructor - - -```solidity -constructor() public; -``` - -### initialize - - -```solidity -function initialize(address _childChain, address _token) public; -``` - -### setParent - - -```solidity -function setParent(address) public; -``` - -### deposit - - -```solidity -function deposit(address user, uint256 amount) public onlyOwner; -``` - -### withdraw - - -```solidity -function withdraw(uint256 amount) public payable; -``` - -### name - - -```solidity -function name() public pure returns (string memory); -``` - -### symbol - - -```solidity -function symbol() public pure returns (string memory); -``` - -### decimals - - -```solidity -function decimals() public pure returns (uint8); -``` - -### totalSupply - - -```solidity -function totalSupply() public view returns (uint256); -``` - -### balanceOf - - -```solidity -function balanceOf(address account) public view returns (uint256); -``` - -### transfer - -*Function that is called when a user or another contract wants to transfer funds.* - - -```solidity -function transfer(address to, uint256 value) public payable returns (bool); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`to`|`address`|Address of token receiver.| -|`value`|`uint256`|Number of tokens to transfer.| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`bool`|Returns success of function call.| - - -### _transfer - -*_transfer is invoked by _transferFrom method that is inherited from BaseERC20. -This enables us to transfer MaticEth between users while keeping the interface same as that of an ERC20 Token.* - - -```solidity -function _transfer(address sender, address recipient, uint256 amount) internal; -``` - -## Events -### Transfer - -```solidity -event Transfer(address indexed from, address indexed to, uint256 value); -``` - diff --git a/docs/autogen/src/contracts/child/README.md b/docs/autogen/src/contracts/child/README.md deleted file mode 100644 index f7cb9ca5..00000000 --- a/docs/autogen/src/contracts/child/README.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# Contents -- [bor](/contracts/child/bor) -- [misc](/contracts/child/misc) -- [proxifiedChildToken](/contracts/child/proxifiedChildToken) -- [BaseERC20](BaseERC20.sol/contract.BaseERC20.md) -- [BaseERC20NoSig](BaseERC20NoSig.sol/contract.BaseERC20NoSig.md) -- [ChildChain](ChildChain.sol/contract.ChildChain.md) -- [ChildERC20](ChildERC20.sol/contract.ChildERC20.md) -- [ChildERC721](ChildERC721.sol/contract.ChildERC721.md) -- [ChildERC721Mintable](ChildERC721Mintable.sol/contract.ChildERC721Mintable.md) -- [ChildToken](ChildToken.sol/contract.ChildToken.md) -- [ERC20Detailed](ERC20Detailed.sol/contract.ERC20Detailed.md) -- [MRC20](MRC20.sol/contract.MRC20.md) diff --git a/docs/autogen/src/contracts/child/bor/README.md b/docs/autogen/src/contracts/child/bor/README.md deleted file mode 100644 index 4cb245c9..00000000 --- a/docs/autogen/src/contracts/child/bor/README.md +++ /dev/null @@ -1,5 +0,0 @@ - - -# Contents -- [StateReceiver](StateReceiver.sol/interface.StateReceiver.md) -- [StateSyncerVerifier](StateSyncerVerifier.sol/contract.StateSyncerVerifier.md) diff --git a/docs/autogen/src/contracts/child/bor/StateReceiver.sol/interface.StateReceiver.md b/docs/autogen/src/contracts/child/bor/StateReceiver.sol/interface.StateReceiver.md deleted file mode 100644 index 058d6b4a..00000000 --- a/docs/autogen/src/contracts/child/bor/StateReceiver.sol/interface.StateReceiver.md +++ /dev/null @@ -1,12 +0,0 @@ -# StateReceiver -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/child/bor/StateReceiver.sol) - - -## Functions -### onStateReceive - - -```solidity -function onStateReceive(uint256 id, bytes calldata data) external; -``` - diff --git a/docs/autogen/src/contracts/child/bor/StateSyncerVerifier.sol/contract.StateSyncerVerifier.md b/docs/autogen/src/contracts/child/bor/StateSyncerVerifier.sol/contract.StateSyncerVerifier.md deleted file mode 100644 index 85dd484e..00000000 --- a/docs/autogen/src/contracts/child/bor/StateSyncerVerifier.sol/contract.StateSyncerVerifier.md +++ /dev/null @@ -1,56 +0,0 @@ -# StateSyncerVerifier -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/child/bor/StateSyncerVerifier.sol) - -**Inherits:** -Ownable - - -## State Variables -### stateSyncer - -```solidity -address public stateSyncer; -``` - - -## Functions -### onlyStateSyncer - -*Throws if called by any account other than state syncer* - - -```solidity -modifier onlyStateSyncer(); -``` - -### constructor - - -```solidity -constructor() public; -``` - -### isOnlyStateSyncerContract - -*Returns true if the caller is the state syncer contract -TODO: replace onlyOwner ownership with 0x1000 for validator majority* - - -```solidity -function isOnlyStateSyncerContract() public view returns (bool); -``` - -### changeStateSyncerAddress - - -```solidity -function changeStateSyncerAddress(address newAddress) public onlyOwner; -``` - -## Events -### StateSyncerAddressChanged - -```solidity -event StateSyncerAddressChanged(address indexed previousAddress, address indexed newAddress); -``` - diff --git a/docs/autogen/src/contracts/child/misc/EIP712.sol/contract.LibEIP712Domain.md b/docs/autogen/src/contracts/child/misc/EIP712.sol/contract.LibEIP712Domain.md deleted file mode 100644 index 58f06933..00000000 --- a/docs/autogen/src/contracts/child/misc/EIP712.sol/contract.LibEIP712Domain.md +++ /dev/null @@ -1,79 +0,0 @@ -# LibEIP712Domain -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/child/misc/EIP712.sol) - -**Inherits:** -[ChainIdMixin](/contracts/common/mixin/ChainIdMixin.sol/contract.ChainIdMixin.md) - - -## State Variables -### EIP712_DOMAIN_SCHEMA - -```solidity -string internal constant EIP712_DOMAIN_SCHEMA = "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"; -``` - - -### EIP712_DOMAIN_SCHEMA_HASH - -```solidity -bytes32 public constant EIP712_DOMAIN_SCHEMA_HASH = keccak256(abi.encodePacked(EIP712_DOMAIN_SCHEMA)); -``` - - -### EIP712_DOMAIN_NAME - -```solidity -string internal constant EIP712_DOMAIN_NAME = "Matic Network"; -``` - - -### EIP712_DOMAIN_VERSION - -```solidity -string internal constant EIP712_DOMAIN_VERSION = "1"; -``` - - -### EIP712_DOMAIN_CHAINID - -```solidity -uint256 internal constant EIP712_DOMAIN_CHAINID = CHAINID; -``` - - -### EIP712_DOMAIN_HASH - -```solidity -bytes32 public EIP712_DOMAIN_HASH; -``` - - -## Functions -### constructor - - -```solidity -constructor() public; -``` - -### hashEIP712Message - - -```solidity -function hashEIP712Message(bytes32 hashStruct) internal view returns (bytes32 result); -``` - -### hashEIP712MessageWithAddress - - -```solidity -function hashEIP712MessageWithAddress(bytes32 hashStruct, address add) internal view returns (bytes32 result); -``` - -### _hashEIP712Message - - -```solidity -function _hashEIP712Message(bytes32 hashStruct, bytes32 domainHash) internal pure returns (bytes32 result); -``` - diff --git a/docs/autogen/src/contracts/child/misc/IParentToken.sol/interface.IParentToken.md b/docs/autogen/src/contracts/child/misc/IParentToken.sol/interface.IParentToken.md deleted file mode 100644 index ebead334..00000000 --- a/docs/autogen/src/contracts/child/misc/IParentToken.sol/interface.IParentToken.md +++ /dev/null @@ -1,12 +0,0 @@ -# IParentToken -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/child/misc/IParentToken.sol) - - -## Functions -### beforeTransfer - - -```solidity -function beforeTransfer(address sender, address to, uint256 value) external returns (bool); -``` - diff --git a/docs/autogen/src/contracts/child/misc/LibTokenTransferOrder.sol/contract.LibTokenTransferOrder.md b/docs/autogen/src/contracts/child/misc/LibTokenTransferOrder.sol/contract.LibTokenTransferOrder.md deleted file mode 100644 index 9af86b96..00000000 --- a/docs/autogen/src/contracts/child/misc/LibTokenTransferOrder.sol/contract.LibTokenTransferOrder.md +++ /dev/null @@ -1,49 +0,0 @@ -# LibTokenTransferOrder -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/child/misc/LibTokenTransferOrder.sol) - -**Inherits:** -[LibEIP712Domain](/contracts/child/misc/EIP712.sol/contract.LibEIP712Domain.md) - - -## State Variables -### EIP712_TOKEN_TRANSFER_ORDER_SCHEMA - -```solidity -string internal constant EIP712_TOKEN_TRANSFER_ORDER_SCHEMA = "TokenTransferOrder(address spender,uint256 tokenIdOrAmount,bytes32 data,uint256 expiration)"; -``` - - -### EIP712_TOKEN_TRANSFER_ORDER_SCHEMA_HASH - -```solidity -bytes32 public constant EIP712_TOKEN_TRANSFER_ORDER_SCHEMA_HASH = keccak256(abi.encodePacked(EIP712_TOKEN_TRANSFER_ORDER_SCHEMA)); -``` - - -## Functions -### getTokenTransferOrderHash - - -```solidity -function getTokenTransferOrderHash(address spender, uint256 tokenIdOrAmount, bytes32 data, uint256 expiration) public view returns (bytes32 orderHash); -``` - -### hashTokenTransferOrder - - -```solidity -function hashTokenTransferOrder(address spender, uint256 tokenIdOrAmount, bytes32 data, uint256 expiration) internal pure returns (bytes32 result); -``` - -## Structs -### TokenTransferOrder - -```solidity -struct TokenTransferOrder { - address spender; - uint256 tokenIdOrAmount; - bytes32 data; - uint256 expiration; -} -``` - diff --git a/docs/autogen/src/contracts/child/misc/Marketplace.sol/contract.Marketplace.md b/docs/autogen/src/contracts/child/misc/Marketplace.sol/contract.Marketplace.md deleted file mode 100644 index e2993e8a..00000000 --- a/docs/autogen/src/contracts/child/misc/Marketplace.sol/contract.Marketplace.md +++ /dev/null @@ -1,30 +0,0 @@ -# Marketplace -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/child/misc/Marketplace.sol) - - -## Functions -### executeOrder - - -```solidity -function executeOrder(bytes memory data1, bytes memory data2, bytes32 orderId, uint256 expiration, address taker) public; -``` - -### decode - - -```solidity -function decode(bytes memory data) internal pure returns (Order memory order); -``` - -## Structs -### Order - -```solidity -struct Order { - address token; - bytes sig; - uint256 tokenIdOrAmount; -} -``` - diff --git a/docs/autogen/src/contracts/child/misc/Marketplace.sol/interface.MarketplaceToken.md b/docs/autogen/src/contracts/child/misc/Marketplace.sol/interface.MarketplaceToken.md deleted file mode 100644 index 7b788b98..00000000 --- a/docs/autogen/src/contracts/child/misc/Marketplace.sol/interface.MarketplaceToken.md +++ /dev/null @@ -1,12 +0,0 @@ -# MarketplaceToken -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/child/misc/Marketplace.sol) - - -## Functions -### transferWithSig - - -```solidity -function transferWithSig(bytes calldata sig, uint256 tokenIdOrAmount, bytes32 data, uint256 expiration, address to) external returns (address); -``` - diff --git a/docs/autogen/src/contracts/child/misc/ParentTokenMock.sol/contract.ParentTokenMock.md b/docs/autogen/src/contracts/child/misc/ParentTokenMock.sol/contract.ParentTokenMock.md deleted file mode 100644 index ac082eb5..00000000 --- a/docs/autogen/src/contracts/child/misc/ParentTokenMock.sol/contract.ParentTokenMock.md +++ /dev/null @@ -1,30 +0,0 @@ -# ParentTokenMock -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/child/misc/ParentTokenMock.sol) - -**Inherits:** -[IParentToken](/contracts/child/misc/IParentToken.sol/interface.IParentToken.md), Ownable - - -## State Variables -### isAllowed - -```solidity -mapping(address => bool) isAllowed; -``` - - -## Functions -### beforeTransfer - - -```solidity -function beforeTransfer(address sender, address to, uint256 value) external returns (bool); -``` - -### updatePermission - - -```solidity -function updatePermission(address user) public onlyOwner; -``` - diff --git a/docs/autogen/src/contracts/child/misc/README.md b/docs/autogen/src/contracts/child/misc/README.md deleted file mode 100644 index c3422149..00000000 --- a/docs/autogen/src/contracts/child/misc/README.md +++ /dev/null @@ -1,9 +0,0 @@ - - -# Contents -- [LibEIP712Domain](EIP712.sol/contract.LibEIP712Domain.md) -- [IParentToken](IParentToken.sol/interface.IParentToken.md) -- [LibTokenTransferOrder](LibTokenTransferOrder.sol/contract.LibTokenTransferOrder.md) -- [MarketplaceToken](Marketplace.sol/interface.MarketplaceToken.md) -- [Marketplace](Marketplace.sol/contract.Marketplace.md) -- [ParentTokenMock](ParentTokenMock.sol/contract.ParentTokenMock.md) diff --git a/docs/autogen/src/contracts/child/proxifiedChildToken/ChildERC20Proxified.sol/contract.ChildERC20Proxified.md b/docs/autogen/src/contracts/child/proxifiedChildToken/ChildERC20Proxified.sol/contract.ChildERC20Proxified.md deleted file mode 100644 index af5bb5eb..00000000 --- a/docs/autogen/src/contracts/child/proxifiedChildToken/ChildERC20Proxified.sol/contract.ChildERC20Proxified.md +++ /dev/null @@ -1,29 +0,0 @@ -# ChildERC20Proxified -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/child/proxifiedChildToken/ChildERC20Proxified.sol) - -**Inherits:** -[ChildERC20](/contracts/child/ChildERC20.sol/contract.ChildERC20.md), [Initializable](/contracts/common/mixin/Initializable.sol/contract.Initializable.md) - - -## Functions -### constructor - - -```solidity -constructor() public ChildERC20(address(0x1), address(0x1), "", "", 18); -``` - -### initialize - - -```solidity -function initialize(address _token, string calldata name, string calldata symbol, uint8 decimals) external initializer; -``` - -### isOwner - - -```solidity -function isOwner() public view returns (bool); -``` - diff --git a/docs/autogen/src/contracts/child/proxifiedChildToken/ChildERC721Proxified.sol/contract.ChildERC721Proxified.md b/docs/autogen/src/contracts/child/proxifiedChildToken/ChildERC721Proxified.sol/contract.ChildERC721Proxified.md deleted file mode 100644 index ddb9d3fd..00000000 --- a/docs/autogen/src/contracts/child/proxifiedChildToken/ChildERC721Proxified.sol/contract.ChildERC721Proxified.md +++ /dev/null @@ -1,44 +0,0 @@ -# ChildERC721Proxified -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/child/proxifiedChildToken/ChildERC721Proxified.sol) - -**Inherits:** -[ChildERC721](/contracts/child/ChildERC721.sol/contract.ChildERC721.md), [Initializable](/contracts/common/mixin/Initializable.sol/contract.Initializable.md) - - -## State Variables -### name - -```solidity -string public name; -``` - - -### symbol - -```solidity -string public symbol; -``` - - -## Functions -### constructor - - -```solidity -constructor() public ChildERC721(address(0x1), address(0x1), "", ""); -``` - -### initialize - - -```solidity -function initialize(address _token, string calldata _name, string calldata _symbol) external initializer; -``` - -### isOwner - - -```solidity -function isOwner() public view returns (bool); -``` - diff --git a/docs/autogen/src/contracts/child/proxifiedChildToken/ChildTokenProxy.sol/contract.ChildTokenProxy.md b/docs/autogen/src/contracts/child/proxifiedChildToken/ChildTokenProxy.sol/contract.ChildTokenProxy.md deleted file mode 100644 index 4554a906..00000000 --- a/docs/autogen/src/contracts/child/proxifiedChildToken/ChildTokenProxy.sol/contract.ChildTokenProxy.md +++ /dev/null @@ -1,15 +0,0 @@ -# ChildTokenProxy -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/child/proxifiedChildToken/ChildTokenProxy.sol) - -**Inherits:** -[UpgradableProxy](/contracts/common/misc/UpgradableProxy.sol/contract.UpgradableProxy.md) - - -## Functions -### constructor - - -```solidity -constructor(address _proxyTo) public UpgradableProxy(_proxyTo); -``` - diff --git a/docs/autogen/src/contracts/child/proxifiedChildToken/README.md b/docs/autogen/src/contracts/child/proxifiedChildToken/README.md deleted file mode 100644 index bc029d2f..00000000 --- a/docs/autogen/src/contracts/child/proxifiedChildToken/README.md +++ /dev/null @@ -1,6 +0,0 @@ - - -# Contents -- [ChildERC20Proxified](ChildERC20Proxified.sol/contract.ChildERC20Proxified.md) -- [ChildERC721Proxified](ChildERC721Proxified.sol/contract.ChildERC721Proxified.md) -- [ChildTokenProxy](ChildTokenProxy.sol/contract.ChildTokenProxy.md) diff --git a/docs/autogen/src/contracts/common/README.md b/docs/autogen/src/contracts/common/README.md deleted file mode 100644 index 2718b510..00000000 --- a/docs/autogen/src/contracts/common/README.md +++ /dev/null @@ -1,10 +0,0 @@ - - -# Contents -- [gnosis](/contracts/common/gnosis) -- [governance](/contracts/common/governance) -- [lib](/contracts/common/lib) -- [misc](/contracts/common/misc) -- [mixin](/contracts/common/mixin) -- [tokens](/contracts/common/tokens) -- [Registry](Registry.sol/contract.Registry.md) diff --git a/docs/autogen/src/contracts/common/Registry.sol/contract.Registry.md b/docs/autogen/src/contracts/common/Registry.sol/contract.Registry.md deleted file mode 100644 index 6cd9a805..00000000 --- a/docs/autogen/src/contracts/common/Registry.sol/contract.Registry.md +++ /dev/null @@ -1,315 +0,0 @@ -# Registry -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/Registry.sol) - -**Inherits:** -[Governable](/contracts/common/governance/Governable.sol/contract.Governable.md) - - -## State Variables -### WETH_TOKEN - -```solidity -bytes32 private constant WETH_TOKEN = keccak256("wethToken"); -``` - - -### DEPOSIT_MANAGER - -```solidity -bytes32 private constant DEPOSIT_MANAGER = keccak256("depositManager"); -``` - - -### STAKE_MANAGER - -```solidity -bytes32 private constant STAKE_MANAGER = keccak256("stakeManager"); -``` - - -### VALIDATOR_SHARE - -```solidity -bytes32 private constant VALIDATOR_SHARE = keccak256("validatorShare"); -``` - - -### WITHDRAW_MANAGER - -```solidity -bytes32 private constant WITHDRAW_MANAGER = keccak256("withdrawManager"); -``` - - -### CHILD_CHAIN - -```solidity -bytes32 private constant CHILD_CHAIN = keccak256("childChain"); -``` - - -### STATE_SENDER - -```solidity -bytes32 private constant STATE_SENDER = keccak256("stateSender"); -``` - - -### SLASHING_MANAGER - -```solidity -bytes32 private constant SLASHING_MANAGER = keccak256("slashingManager"); -``` - - -### erc20Predicate - -```solidity -address public erc20Predicate; -``` - - -### erc721Predicate - -```solidity -address public erc721Predicate; -``` - - -### contractMap - -```solidity -mapping(bytes32 => address) public contractMap; -``` - - -### rootToChildToken - -```solidity -mapping(address => address) public rootToChildToken; -``` - - -### childToRootToken - -```solidity -mapping(address => address) public childToRootToken; -``` - - -### proofValidatorContracts - -```solidity -mapping(address => bool) public proofValidatorContracts; -``` - - -### isERC721 - -```solidity -mapping(address => bool) public isERC721; -``` - - -### predicates - -```solidity -mapping(address => Predicate) public predicates; -``` - - -## Functions -### constructor - - -```solidity -constructor(address _governance) public Governable(_governance); -``` - -### updateContractMap - - -```solidity -function updateContractMap(bytes32 _key, address _address) external onlyGovernance; -``` - -### mapToken - -*Map root token to child token* - - -```solidity -function mapToken(address _rootToken, address _childToken, bool _isERC721) external onlyGovernance; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`_rootToken`|`address`|Token address on the root chain| -|`_childToken`|`address`|Token address on the child chain| -|`_isERC721`|`bool`|Is the token being mapped ERC721| - - -### addErc20Predicate - - -```solidity -function addErc20Predicate(address predicate) public onlyGovernance; -``` - -### addErc721Predicate - - -```solidity -function addErc721Predicate(address predicate) public onlyGovernance; -``` - -### addPredicate - - -```solidity -function addPredicate(address predicate, Type _type) public onlyGovernance; -``` - -### removePredicate - - -```solidity -function removePredicate(address predicate) public onlyGovernance; -``` - -### getValidatorShareAddress - - -```solidity -function getValidatorShareAddress() public view returns (address); -``` - -### getWethTokenAddress - - -```solidity -function getWethTokenAddress() public view returns (address); -``` - -### getDepositManagerAddress - - -```solidity -function getDepositManagerAddress() public view returns (address); -``` - -### getStakeManagerAddress - - -```solidity -function getStakeManagerAddress() public view returns (address); -``` - -### getSlashingManagerAddress - - -```solidity -function getSlashingManagerAddress() public view returns (address); -``` - -### getWithdrawManagerAddress - - -```solidity -function getWithdrawManagerAddress() public view returns (address); -``` - -### getChildChainAndStateSender - - -```solidity -function getChildChainAndStateSender() public view returns (address, address); -``` - -### isTokenMapped - - -```solidity -function isTokenMapped(address _token) public view returns (bool); -``` - -### isTokenMappedAndIsErc721 - - -```solidity -function isTokenMappedAndIsErc721(address _token) public view returns (bool); -``` - -### isTokenMappedAndGetPredicate - - -```solidity -function isTokenMappedAndGetPredicate(address _token) public view returns (address); -``` - -### isChildTokenErc721 - - -```solidity -function isChildTokenErc721(address childToken) public view returns (bool); -``` - -## Events -### TokenMapped - -```solidity -event TokenMapped(address indexed rootToken, address indexed childToken); -``` - -### ProofValidatorAdded - -```solidity -event ProofValidatorAdded(address indexed validator, address indexed from); -``` - -### ProofValidatorRemoved - -```solidity -event ProofValidatorRemoved(address indexed validator, address indexed from); -``` - -### PredicateAdded - -```solidity -event PredicateAdded(address indexed predicate, address indexed from); -``` - -### PredicateRemoved - -```solidity -event PredicateRemoved(address indexed predicate, address indexed from); -``` - -### ContractMapUpdated - -```solidity -event ContractMapUpdated(bytes32 indexed key, address indexed previousContract, address indexed newContract); -``` - -## Structs -### Predicate - -```solidity -struct Predicate { - Type _type; -} -``` - -## Enums -### Type - -```solidity -enum Type { - Invalid, - ERC20, - ERC721, - Custom -} -``` - diff --git a/docs/autogen/src/contracts/common/gnosis/GnosisSafe.sol/contract.Enum.md b/docs/autogen/src/contracts/common/gnosis/GnosisSafe.sol/contract.Enum.md deleted file mode 100644 index 6b6a1527..00000000 --- a/docs/autogen/src/contracts/common/gnosis/GnosisSafe.sol/contract.Enum.md +++ /dev/null @@ -1,17 +0,0 @@ -# Enum -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/gnosis/GnosisSafe.sol) - -**Author:** -Richard Meissner - - - -## Enums -### Operation - -```solidity -enum Operation { - Call, - DelegateCall -} -``` - diff --git a/docs/autogen/src/contracts/common/gnosis/GnosisSafe.sol/contract.Executor.md b/docs/autogen/src/contracts/common/gnosis/GnosisSafe.sol/contract.Executor.md deleted file mode 100644 index 67df4fb9..00000000 --- a/docs/autogen/src/contracts/common/gnosis/GnosisSafe.sol/contract.Executor.md +++ /dev/null @@ -1,29 +0,0 @@ -# Executor -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/gnosis/GnosisSafe.sol) - -**Author:** -Richard Meissner - - - -## Functions -### execute - - -```solidity -function execute(address to, uint256 value, bytes memory data, Enum.Operation operation, uint256 txGas) internal returns (bool success); -``` - -### executeCall - - -```solidity -function executeCall(address to, uint256 value, bytes memory data, uint256 txGas) internal returns (bool success); -``` - -### executeDelegateCall - - -```solidity -function executeDelegateCall(address to, bytes memory data, uint256 txGas) internal returns (bool success); -``` - diff --git a/docs/autogen/src/contracts/common/gnosis/GnosisSafe.sol/contract.FallbackManager.md b/docs/autogen/src/contracts/common/gnosis/GnosisSafe.sol/contract.FallbackManager.md deleted file mode 100644 index 2739306f..00000000 --- a/docs/autogen/src/contracts/common/gnosis/GnosisSafe.sol/contract.FallbackManager.md +++ /dev/null @@ -1,50 +0,0 @@ -# FallbackManager -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/gnosis/GnosisSafe.sol) - -**Inherits:** -[SelfAuthorized](/contracts/common/gnosis/GnosisSafe.sol/contract.SelfAuthorized.md) - -**Author:** -Richard Meissner - - - -## State Variables -### FALLBACK_HANDLER_STORAGE_SLOT - -```solidity -bytes32 internal constant FALLBACK_HANDLER_STORAGE_SLOT = 0x6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d5; -``` - - -## Functions -### internalSetFallbackHandler - - -```solidity -function internalSetFallbackHandler(address handler) internal; -``` - -### setFallbackHandler - -*Allows to add a contract to handle fallback calls. -Only fallback calls without value and with data will be forwarded. -This can only be done via a Safe transaction.* - - -```solidity -function setFallbackHandler(address handler) public authorized; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`handler`|`address`|contract to handle fallbacks calls.| - - -### function - - -```solidity -function() external payable; -``` - diff --git a/docs/autogen/src/contracts/common/gnosis/GnosisSafe.sol/contract.GnosisSafe.md b/docs/autogen/src/contracts/common/gnosis/GnosisSafe.sol/contract.GnosisSafe.md deleted file mode 100644 index 852089ae..00000000 --- a/docs/autogen/src/contracts/common/gnosis/GnosisSafe.sol/contract.GnosisSafe.md +++ /dev/null @@ -1,389 +0,0 @@ -# GnosisSafe -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/gnosis/GnosisSafe.sol) - -**Inherits:** -[MasterCopy](/contracts/common/gnosis/GnosisSafe.sol/contract.MasterCopy.md), [ModuleManager](/contracts/common/gnosis/GnosisSafe.sol/contract.ModuleManager.md), [OwnerManager](/contracts/common/gnosis/GnosisSafe.sol/contract.OwnerManager.md), [SignatureDecoder](/contracts/common/gnosis/GnosisSafe.sol/contract.SignatureDecoder.md), [SecuredTokenTransfer](/contracts/common/gnosis/GnosisSafe.sol/contract.SecuredTokenTransfer.md), [ISignatureValidatorConstants](/contracts/common/gnosis/GnosisSafe.sol/contract.ISignatureValidatorConstants.md), [FallbackManager](/contracts/common/gnosis/GnosisSafe.sol/contract.FallbackManager.md) - -**Authors:** -Stefan George - , Richard Meissner - , Ricardo Guilherme Schmidt - (Status Research & Development GmbH) - Gas Token Payment - - -## State Variables -### NAME - -```solidity -string public constant NAME = "Gnosis Safe"; -``` - - -### VERSION - -```solidity -string public constant VERSION = "1.1.1"; -``` - - -### DOMAIN_SEPARATOR_TYPEHASH - -```solidity -bytes32 private constant DOMAIN_SEPARATOR_TYPEHASH = 0x035aff83d86937d35b32e04f0ddc6ff469290eef2f1b692d8a815c89404d4749; -``` - - -### SAFE_TX_TYPEHASH - -```solidity -bytes32 private constant SAFE_TX_TYPEHASH = 0xbb8310d486368db6bd6f849402fdd73ad53d316b5a4b2644ad6efe0f941286d8; -``` - - -### SAFE_MSG_TYPEHASH - -```solidity -bytes32 private constant SAFE_MSG_TYPEHASH = 0x60b3cbf8b4a223d68d641b3b6ddf9a298e7f33710cf3d3a9d1146b5a6150fbca; -``` - - -### nonce - -```solidity -uint256 public nonce; -``` - - -### domainSeparator - -```solidity -bytes32 public domainSeparator; -``` - - -### signedMessages - -```solidity -mapping(bytes32 => uint256) public signedMessages; -``` - - -### approvedHashes - -```solidity -mapping(address => mapping(bytes32 => uint256)) public approvedHashes; -``` - - -## Functions -### constructor - - -```solidity -constructor() public; -``` - -### setup - -*Setup function sets initial storage of contract.* - - -```solidity -function setup( - address[] calldata _owners, - uint256 _threshold, - address to, - bytes calldata data, - address fallbackHandler, - address paymentToken, - uint256 payment, - address payable paymentReceiver -) external; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`_owners`|`address[]`|List of Safe owners.| -|`_threshold`|`uint256`|Number of required confirmations for a Safe transaction.| -|`to`|`address`|Contract address for optional delegate call.| -|`data`|`bytes`|Data payload for optional delegate call.| -|`fallbackHandler`|`address`|Handler for fallback calls to this contract| -|`paymentToken`|`address`|Token that should be used for the payment (0 is ETH)| -|`payment`|`uint256`|Value that should be paid| -|`paymentReceiver`|`address payable`|Adddress that should receive the payment (or 0 if tx.origin)| - - -### execTransaction - -*Allows to execute a Safe transaction confirmed by required number of owners and then pays the account that submitted the transaction. -Note: The fees are always transfered, even if the user transaction fails.* - - -```solidity -function execTransaction( - address to, - uint256 value, - bytes calldata data, - Enum.Operation operation, - uint256 safeTxGas, - uint256 baseGas, - uint256 gasPrice, - address gasToken, - address payable refundReceiver, - bytes calldata signatures -) external returns (bool success); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`to`|`address`|Destination address of Safe transaction.| -|`value`|`uint256`|Ether value of Safe transaction.| -|`data`|`bytes`|Data payload of Safe transaction.| -|`operation`|`Enum.Operation`|Operation type of Safe transaction.| -|`safeTxGas`|`uint256`|Gas that should be used for the Safe transaction.| -|`baseGas`|`uint256`|Gas costs for that are indipendent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)| -|`gasPrice`|`uint256`|Gas price that should be used for the payment calculation.| -|`gasToken`|`address`|Token address (or 0 if ETH) that is used for the payment.| -|`refundReceiver`|`address payable`|Address of receiver of gas payment (or 0 if tx.origin).| -|`signatures`|`bytes`|Packed signature data ({bytes32 r}{bytes32 s}{uint8 v})| - - -### handlePayment - - -```solidity -function handlePayment(uint256 gasUsed, uint256 baseGas, uint256 gasPrice, address gasToken, address payable refundReceiver) - private - returns (uint256 payment); -``` - -### checkSignatures - -*Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.* - - -```solidity -function checkSignatures(bytes32 dataHash, bytes memory data, bytes memory signatures, bool consumeHash) internal; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`dataHash`|`bytes32`|Hash of the data (could be either a message hash or transaction hash)| -|`data`|`bytes`|That should be signed (this is passed to an external validator contract)| -|`signatures`|`bytes`|Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.| -|`consumeHash`|`bool`|Indicates that in case of an approved hash the storage can be freed to save gas| - - -### requiredTxGas - -*Allows to estimate a Safe transaction. -This method is only meant for estimation purpose, therefore two different protection mechanism against execution in a transaction have been made: -1.) The method can only be called from the safe itself -2.) The response is returned with a revert -When estimating set `from` to the address of the safe. -Since the `estimateGas` function includes refunds, call this method to get an estimated of the costs that are deducted from the safe with `execTransaction`* - - -```solidity -function requiredTxGas(address to, uint256 value, bytes calldata data, Enum.Operation operation) external authorized returns (uint256); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`to`|`address`|Destination address of Safe transaction.| -|`value`|`uint256`|Ether value of Safe transaction.| -|`data`|`bytes`|Data payload of Safe transaction.| -|`operation`|`Enum.Operation`|Operation type of Safe transaction.| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`uint256`|Estimate without refunds and overhead fees (base transaction and payload data gas costs).| - - -### approveHash - -*Marks a hash as approved. This can be used to validate a hash that is used by a signature.* - - -```solidity -function approveHash(bytes32 hashToApprove) external; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`hashToApprove`|`bytes32`|The hash that should be marked as approved for signatures that are verified by this contract.| - - -### signMessage - -*Marks a message as signed* - - -```solidity -function signMessage(bytes calldata _data) external authorized; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`_data`|`bytes`|Arbitrary length data that should be marked as signed on the behalf of address(this)| - - -### isValidSignature - -Implementation of ISignatureValidator (see `interfaces/ISignatureValidator.sol`) - -*Should return whether the signature provided is valid for the provided data. -The save does not implement the interface since `checkSignatures` is not a view method. -The method will not perform any state changes (see parameters of `checkSignatures`)* - - -```solidity -function isValidSignature(bytes calldata _data, bytes calldata _signature) external returns (bytes4); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`_data`|`bytes`|Arbitrary length data signed on the behalf of address(this)| -|`_signature`|`bytes`|Signature byte array associated with _data| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`bytes4`|a bool upon valid or invalid signature with corresponding _data| - - -### getMessageHash - -*Returns hash of a message that can be signed by owners.* - - -```solidity -function getMessageHash(bytes memory message) public view returns (bytes32); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`message`|`bytes`|Message that should be hashed| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`bytes32`|Message hash.| - - -### encodeTransactionData - -*Returns the bytes that are hashed to be signed by owners.* - - -```solidity -function encodeTransactionData( - address to, - uint256 value, - bytes memory data, - Enum.Operation operation, - uint256 safeTxGas, - uint256 baseGas, - uint256 gasPrice, - address gasToken, - address refundReceiver, - uint256 _nonce -) public view returns (bytes memory); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`to`|`address`|Destination address.| -|`value`|`uint256`|Ether value.| -|`data`|`bytes`|Data payload.| -|`operation`|`Enum.Operation`|Operation type.| -|`safeTxGas`|`uint256`|Fas that should be used for the safe transaction.| -|`baseGas`|`uint256`|Gas costs for data used to trigger the safe transaction.| -|`gasPrice`|`uint256`|Maximum gas price that should be used for this transaction.| -|`gasToken`|`address`|Token address (or 0 if ETH) that is used for the payment.| -|`refundReceiver`|`address`|Address of receiver of gas payment (or 0 if tx.origin).| -|`_nonce`|`uint256`|Transaction nonce.| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`bytes`|Transaction hash bytes.| - - -### getTransactionHash - -*Returns hash to be signed by owners.* - - -```solidity -function getTransactionHash( - address to, - uint256 value, - bytes memory data, - Enum.Operation operation, - uint256 safeTxGas, - uint256 baseGas, - uint256 gasPrice, - address gasToken, - address refundReceiver, - uint256 _nonce -) public view returns (bytes32); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`to`|`address`|Destination address.| -|`value`|`uint256`|Ether value.| -|`data`|`bytes`|Data payload.| -|`operation`|`Enum.Operation`|Operation type.| -|`safeTxGas`|`uint256`|Fas that should be used for the safe transaction.| -|`baseGas`|`uint256`|Gas costs for data used to trigger the safe transaction.| -|`gasPrice`|`uint256`|Maximum gas price that should be used for this transaction.| -|`gasToken`|`address`|Token address (or 0 if ETH) that is used for the payment.| -|`refundReceiver`|`address`|Address of receiver of gas payment (or 0 if tx.origin).| -|`_nonce`|`uint256`|Transaction nonce.| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`bytes32`|Transaction hash.| - - -## Events -### ApproveHash - -```solidity -event ApproveHash(bytes32 indexed approvedHash, address indexed owner); -``` - -### SignMsg - -```solidity -event SignMsg(bytes32 indexed msgHash); -``` - -### ExecutionFailure - -```solidity -event ExecutionFailure(bytes32 txHash, uint256 payment); -``` - -### ExecutionSuccess - -```solidity -event ExecutionSuccess(bytes32 txHash, uint256 payment); -``` - diff --git a/docs/autogen/src/contracts/common/gnosis/GnosisSafe.sol/contract.ISignatureValidator.md b/docs/autogen/src/contracts/common/gnosis/GnosisSafe.sol/contract.ISignatureValidator.md deleted file mode 100644 index a141e519..00000000 --- a/docs/autogen/src/contracts/common/gnosis/GnosisSafe.sol/contract.ISignatureValidator.md +++ /dev/null @@ -1,24 +0,0 @@ -# ISignatureValidator -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/gnosis/GnosisSafe.sol) - -**Inherits:** -[ISignatureValidatorConstants](/contracts/common/gnosis/GnosisSafe.sol/contract.ISignatureValidatorConstants.md) - - -## Functions -### isValidSignature - -*Should return whether the signature provided is valid for the provided data* - - -```solidity -function isValidSignature(bytes memory _data, bytes memory _signature) public view returns (bytes4); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`_data`|`bytes`|Arbitrary length data signed on the behalf of address(this)| -|`_signature`|`bytes`|Signature byte array associated with _data MUST return the bytes4 magic value 0x20c13b0b when function passes. MUST NOT modify state (using STATICCALL for solc < 0.5, view modifier for solc > 0.5) MUST allow external calls| - - diff --git a/docs/autogen/src/contracts/common/gnosis/GnosisSafe.sol/contract.ISignatureValidatorConstants.md b/docs/autogen/src/contracts/common/gnosis/GnosisSafe.sol/contract.ISignatureValidatorConstants.md deleted file mode 100644 index 5e2a6d68..00000000 --- a/docs/autogen/src/contracts/common/gnosis/GnosisSafe.sol/contract.ISignatureValidatorConstants.md +++ /dev/null @@ -1,12 +0,0 @@ -# ISignatureValidatorConstants -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/gnosis/GnosisSafe.sol) - - -## State Variables -### EIP1271_MAGIC_VALUE - -```solidity -bytes4 internal constant EIP1271_MAGIC_VALUE = 0x20c13b0b; -``` - - diff --git a/docs/autogen/src/contracts/common/gnosis/GnosisSafe.sol/contract.MasterCopy.md b/docs/autogen/src/contracts/common/gnosis/GnosisSafe.sol/contract.MasterCopy.md deleted file mode 100644 index 57e2230e..00000000 --- a/docs/autogen/src/contracts/common/gnosis/GnosisSafe.sol/contract.MasterCopy.md +++ /dev/null @@ -1,41 +0,0 @@ -# MasterCopy -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/gnosis/GnosisSafe.sol) - -**Inherits:** -[SelfAuthorized](/contracts/common/gnosis/GnosisSafe.sol/contract.SelfAuthorized.md) - -**Author:** -Richard Meissner - - - -## State Variables -### masterCopy - -```solidity -address private masterCopy; -``` - - -## Functions -### changeMasterCopy - -*Allows to upgrade the contract. This can only be done via a Safe transaction.* - - -```solidity -function changeMasterCopy(address _masterCopy) public authorized; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`_masterCopy`|`address`|New contract address.| - - -## Events -### ChangedMasterCopy - -```solidity -event ChangedMasterCopy(address masterCopy); -``` - diff --git a/docs/autogen/src/contracts/common/gnosis/GnosisSafe.sol/contract.Module.md b/docs/autogen/src/contracts/common/gnosis/GnosisSafe.sol/contract.Module.md deleted file mode 100644 index 4d65d7ca..00000000 --- a/docs/autogen/src/contracts/common/gnosis/GnosisSafe.sol/contract.Module.md +++ /dev/null @@ -1,33 +0,0 @@ -# Module -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/gnosis/GnosisSafe.sol) - -**Inherits:** -[MasterCopy](/contracts/common/gnosis/GnosisSafe.sol/contract.MasterCopy.md) - -**Authors:** -Stefan George - , Richard Meissner - - - -## State Variables -### manager - -```solidity -ModuleManager public manager; -``` - - -## Functions -### authorized - - -```solidity -modifier authorized(); -``` - -### setManager - - -```solidity -function setManager() internal; -``` - diff --git a/docs/autogen/src/contracts/common/gnosis/GnosisSafe.sol/contract.ModuleManager.md b/docs/autogen/src/contracts/common/gnosis/GnosisSafe.sol/contract.ModuleManager.md deleted file mode 100644 index 0e9c7579..00000000 --- a/docs/autogen/src/contracts/common/gnosis/GnosisSafe.sol/contract.ModuleManager.md +++ /dev/null @@ -1,167 +0,0 @@ -# ModuleManager -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/gnosis/GnosisSafe.sol) - -**Inherits:** -[SelfAuthorized](/contracts/common/gnosis/GnosisSafe.sol/contract.SelfAuthorized.md), [Executor](/contracts/common/gnosis/GnosisSafe.sol/contract.Executor.md) - -**Authors:** -Stefan George - , Richard Meissner - - - -## State Variables -### SENTINEL_MODULES - -```solidity -address internal constant SENTINEL_MODULES = address(0x1); -``` - - -### modules - -```solidity -mapping(address => address) internal modules; -``` - - -## Functions -### setupModules - - -```solidity -function setupModules(address to, bytes memory data) internal; -``` - -### enableModule - -*Allows to add a module to the whitelist. -This can only be done via a Safe transaction.* - - -```solidity -function enableModule(Module module) public authorized; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`module`|`Module`|Module to be whitelisted.| - - -### disableModule - -*Allows to remove a module from the whitelist. -This can only be done via a Safe transaction.* - - -```solidity -function disableModule(Module prevModule, Module module) public authorized; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`prevModule`|`Module`|Module that pointed to the module to be removed in the linked list| -|`module`|`Module`|Module to be removed.| - - -### execTransactionFromModule - -*Allows a Module to execute a Safe transaction without any further confirmations.* - - -```solidity -function execTransactionFromModule(address to, uint256 value, bytes memory data, Enum.Operation operation) public returns (bool success); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`to`|`address`|Destination address of module transaction.| -|`value`|`uint256`|Ether value of module transaction.| -|`data`|`bytes`|Data payload of module transaction.| -|`operation`|`Enum.Operation`|Operation type of module transaction.| - - -### execTransactionFromModuleReturnData - -*Allows a Module to execute a Safe transaction without any further confirmations and return data* - - -```solidity -function execTransactionFromModuleReturnData(address to, uint256 value, bytes memory data, Enum.Operation operation) - public - returns (bool success, bytes memory returnData); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`to`|`address`|Destination address of module transaction.| -|`value`|`uint256`|Ether value of module transaction.| -|`data`|`bytes`|Data payload of module transaction.| -|`operation`|`Enum.Operation`|Operation type of module transaction.| - - -### getModules - -*Returns array of first 10 modules.* - - -```solidity -function getModules() public view returns (address[] memory); -``` -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`address[]`|Array of modules.| - - -### getModulesPaginated - -*Returns array of modules.* - - -```solidity -function getModulesPaginated(address start, uint256 pageSize) public view returns (address[] memory array, address next); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`start`|`address`|Start of the page.| -|`pageSize`|`uint256`|Maximum number of modules that should be returned.| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|`array`|`address[]`|Array of modules.| -|`next`|`address`|| - - -## Events -### EnabledModule - -```solidity -event EnabledModule(Module module); -``` - -### DisabledModule - -```solidity -event DisabledModule(Module module); -``` - -### ExecutionFromModuleSuccess - -```solidity -event ExecutionFromModuleSuccess(address indexed module); -``` - -### ExecutionFromModuleFailure - -```solidity -event ExecutionFromModuleFailure(address indexed module); -``` - diff --git a/docs/autogen/src/contracts/common/gnosis/GnosisSafe.sol/contract.OwnerManager.md b/docs/autogen/src/contracts/common/gnosis/GnosisSafe.sol/contract.OwnerManager.md deleted file mode 100644 index e400ff3f..00000000 --- a/docs/autogen/src/contracts/common/gnosis/GnosisSafe.sol/contract.OwnerManager.md +++ /dev/null @@ -1,173 +0,0 @@ -# OwnerManager -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/gnosis/GnosisSafe.sol) - -**Inherits:** -[SelfAuthorized](/contracts/common/gnosis/GnosisSafe.sol/contract.SelfAuthorized.md) - -**Authors:** -Stefan George - , Richard Meissner - - - -## State Variables -### SENTINEL_OWNERS - -```solidity -address internal constant SENTINEL_OWNERS = address(0x1); -``` - - -### owners - -```solidity -mapping(address => address) internal owners; -``` - - -### ownerCount - -```solidity -uint256 ownerCount; -``` - - -### threshold - -```solidity -uint256 internal threshold; -``` - - -## Functions -### setupOwners - -*Setup function sets initial storage of contract.* - - -```solidity -function setupOwners(address[] memory _owners, uint256 _threshold) internal; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`_owners`|`address[]`|List of Safe owners.| -|`_threshold`|`uint256`|Number of required confirmations for a Safe transaction.| - - -### addOwnerWithThreshold - -*Allows to add a new owner to the Safe and update the threshold at the same time. -This can only be done via a Safe transaction.* - - -```solidity -function addOwnerWithThreshold(address owner, uint256 _threshold) public authorized; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`owner`|`address`|New owner address.| -|`_threshold`|`uint256`|New threshold.| - - -### removeOwner - -*Allows to remove an owner from the Safe and update the threshold at the same time. -This can only be done via a Safe transaction.* - - -```solidity -function removeOwner(address prevOwner, address owner, uint256 _threshold) public authorized; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`prevOwner`|`address`|Owner that pointed to the owner to be removed in the linked list| -|`owner`|`address`|Owner address to be removed.| -|`_threshold`|`uint256`|New threshold.| - - -### swapOwner - -*Allows to swap/replace an owner from the Safe with another address. -This can only be done via a Safe transaction.* - - -```solidity -function swapOwner(address prevOwner, address oldOwner, address newOwner) public authorized; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`prevOwner`|`address`|Owner that pointed to the owner to be replaced in the linked list| -|`oldOwner`|`address`|Owner address to be replaced.| -|`newOwner`|`address`|New owner address.| - - -### changeThreshold - -*Allows to update the number of required confirmations by Safe owners. -This can only be done via a Safe transaction.* - - -```solidity -function changeThreshold(uint256 _threshold) public authorized; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`_threshold`|`uint256`|New threshold.| - - -### getThreshold - - -```solidity -function getThreshold() public view returns (uint256); -``` - -### isOwner - - -```solidity -function isOwner(address owner) public view returns (bool); -``` - -### getOwners - -*Returns array of owners.* - - -```solidity -function getOwners() public view returns (address[] memory); -``` -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`address[]`|Array of Safe owners.| - - -## Events -### AddedOwner - -```solidity -event AddedOwner(address owner); -``` - -### RemovedOwner - -```solidity -event RemovedOwner(address owner); -``` - -### ChangedThreshold - -```solidity -event ChangedThreshold(uint256 threshold); -``` - diff --git a/docs/autogen/src/contracts/common/gnosis/GnosisSafe.sol/contract.SecuredTokenTransfer.md b/docs/autogen/src/contracts/common/gnosis/GnosisSafe.sol/contract.SecuredTokenTransfer.md deleted file mode 100644 index 35acc70b..00000000 --- a/docs/autogen/src/contracts/common/gnosis/GnosisSafe.sol/contract.SecuredTokenTransfer.md +++ /dev/null @@ -1,25 +0,0 @@ -# SecuredTokenTransfer -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/gnosis/GnosisSafe.sol) - -**Author:** -Richard Meissner - - - -## Functions -### transferToken - -*Transfers a token and returns if it was a success* - - -```solidity -function transferToken(address token, address receiver, uint256 amount) internal returns (bool transferred); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`token`|`address`|Token that should be transferred| -|`receiver`|`address`|Receiver to whom the token should be transferred| -|`amount`|`uint256`|The amount of tokens that should be transferred| - - diff --git a/docs/autogen/src/contracts/common/gnosis/GnosisSafe.sol/contract.SelfAuthorized.md b/docs/autogen/src/contracts/common/gnosis/GnosisSafe.sol/contract.SelfAuthorized.md deleted file mode 100644 index 211082c6..00000000 --- a/docs/autogen/src/contracts/common/gnosis/GnosisSafe.sol/contract.SelfAuthorized.md +++ /dev/null @@ -1,17 +0,0 @@ -# SelfAuthorized -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/gnosis/GnosisSafe.sol) - -**Author:** -Richard Meissner - - -Submitted for verification at Etherscan.io on 2019-12-26 - - -## Functions -### authorized - - -```solidity -modifier authorized(); -``` - diff --git a/docs/autogen/src/contracts/common/gnosis/GnosisSafe.sol/contract.SignatureDecoder.md b/docs/autogen/src/contracts/common/gnosis/GnosisSafe.sol/contract.SignatureDecoder.md deleted file mode 100644 index 9e5d3858..00000000 --- a/docs/autogen/src/contracts/common/gnosis/GnosisSafe.sol/contract.SignatureDecoder.md +++ /dev/null @@ -1,43 +0,0 @@ -# SignatureDecoder -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/gnosis/GnosisSafe.sol) - -**Authors:** -Ricardo Guilherme Schmidt (Status Research & Development GmbH), Richard Meissner - - - -## Functions -### recoverKey - -*Recovers address who signed the message* - - -```solidity -function recoverKey(bytes32 messageHash, bytes memory messageSignature, uint256 pos) internal pure returns (address); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`messageHash`|`bytes32`|operation ethereum signed message hash| -|`messageSignature`|`bytes`|message `txHash` signature| -|`pos`|`uint256`|which signature to read| - - -### signatureSplit - -Make sure to peform a bounds check for @param pos, to avoid out of bounds access on @param signatures - -*divides bytes signature into `uint8 v, bytes32 r, bytes32 s`.* - - -```solidity -function signatureSplit(bytes memory signatures, uint256 pos) internal pure returns (uint8 v, bytes32 r, bytes32 s); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`signatures`|`bytes`|concatenated rsv signatures| -|`pos`|`uint256`|which signature to read. A prior bounds check of this parameter should be performed, to avoid out of bounds access| - - diff --git a/docs/autogen/src/contracts/common/gnosis/GnosisSafe.sol/library.SafeMath.md b/docs/autogen/src/contracts/common/gnosis/GnosisSafe.sol/library.SafeMath.md deleted file mode 100644 index 7020b0ce..00000000 --- a/docs/autogen/src/contracts/common/gnosis/GnosisSafe.sol/library.SafeMath.md +++ /dev/null @@ -1,54 +0,0 @@ -# SafeMath -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/gnosis/GnosisSafe.sol) - -*Math operations with safety checks that revert on error -TODO: remove once open zeppelin update to solc 0.5.0* - - -## Functions -### mul - -*Multiplies two numbers, reverts on overflow.* - - -```solidity -function mul(uint256 a, uint256 b) internal pure returns (uint256); -``` - -### div - -*Integer division of two numbers truncating the quotient, reverts on division by zero.* - - -```solidity -function div(uint256 a, uint256 b) internal pure returns (uint256); -``` - -### sub - -*Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).* - - -```solidity -function sub(uint256 a, uint256 b) internal pure returns (uint256); -``` - -### add - -*Adds two numbers, reverts on overflow.* - - -```solidity -function add(uint256 a, uint256 b) internal pure returns (uint256); -``` - -### mod - -*Divides two numbers and returns the remainder (unsigned integer modulo), -reverts when dividing by zero.* - - -```solidity -function mod(uint256 a, uint256 b) internal pure returns (uint256); -``` - diff --git a/docs/autogen/src/contracts/common/gnosis/GnosisSafeProxy.sol/contract.GnosisSafeProxy.md b/docs/autogen/src/contracts/common/gnosis/GnosisSafeProxy.sol/contract.GnosisSafeProxy.md deleted file mode 100644 index 4e00c942..00000000 --- a/docs/autogen/src/contracts/common/gnosis/GnosisSafeProxy.sol/contract.GnosisSafeProxy.md +++ /dev/null @@ -1,42 +0,0 @@ -# GnosisSafeProxy -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/gnosis/GnosisSafeProxy.sol) - -**Authors:** -Stefan George - , Richard Meissner - - -Submitted for verification at Etherscan.io on 2020-01-13 - - -## State Variables -### masterCopy - -```solidity -address internal masterCopy; -``` - - -## Functions -### constructor - -*Constructor function sets address of master copy contract.* - - -```solidity -constructor(address _masterCopy) public; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`_masterCopy`|`address`|Master copy address.| - - -### function - -*Fallback function forwards all transactions and returns all received return data.* - - -```solidity -function() external payable; -``` - diff --git a/docs/autogen/src/contracts/common/gnosis/README.md b/docs/autogen/src/contracts/common/gnosis/README.md deleted file mode 100644 index 85c40d6e..00000000 --- a/docs/autogen/src/contracts/common/gnosis/README.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# Contents -- [SelfAuthorized](GnosisSafe.sol/contract.SelfAuthorized.md) -- [MasterCopy](GnosisSafe.sol/contract.MasterCopy.md) -- [Module](GnosisSafe.sol/contract.Module.md) -- [Enum](GnosisSafe.sol/contract.Enum.md) -- [Executor](GnosisSafe.sol/contract.Executor.md) -- [SecuredTokenTransfer](GnosisSafe.sol/contract.SecuredTokenTransfer.md) -- [ModuleManager](GnosisSafe.sol/contract.ModuleManager.md) -- [OwnerManager](GnosisSafe.sol/contract.OwnerManager.md) -- [FallbackManager](GnosisSafe.sol/contract.FallbackManager.md) -- [SignatureDecoder](GnosisSafe.sol/contract.SignatureDecoder.md) -- [ISignatureValidatorConstants](GnosisSafe.sol/contract.ISignatureValidatorConstants.md) -- [ISignatureValidator](GnosisSafe.sol/contract.ISignatureValidator.md) -- [SafeMath](GnosisSafe.sol/library.SafeMath.md) -- [GnosisSafe](GnosisSafe.sol/contract.GnosisSafe.md) -- [GnosisSafeProxy](GnosisSafeProxy.sol/contract.GnosisSafeProxy.md) diff --git a/docs/autogen/src/contracts/common/governance/Governable.sol/contract.Governable.md b/docs/autogen/src/contracts/common/governance/Governable.sol/contract.Governable.md deleted file mode 100644 index 3285bb04..00000000 --- a/docs/autogen/src/contracts/common/governance/Governable.sol/contract.Governable.md +++ /dev/null @@ -1,34 +0,0 @@ -# Governable -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/governance/Governable.sol) - - -## State Variables -### governance - -```solidity -IGovernance public governance; -``` - - -## Functions -### constructor - - -```solidity -constructor(address _governance) public; -``` - -### onlyGovernance - - -```solidity -modifier onlyGovernance(); -``` - -### _assertGovernance - - -```solidity -function _assertGovernance() private view; -``` - diff --git a/docs/autogen/src/contracts/common/governance/Governance.sol/contract.Governance.md b/docs/autogen/src/contracts/common/governance/Governance.sol/contract.Governance.md deleted file mode 100644 index a27f013f..00000000 --- a/docs/autogen/src/contracts/common/governance/Governance.sol/contract.Governance.md +++ /dev/null @@ -1,15 +0,0 @@ -# Governance -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/governance/Governance.sol) - -**Inherits:** -[ProxyStorage](/contracts/common/misc/ProxyStorage.sol/contract.ProxyStorage.md), [IGovernance](/contracts/common/governance/IGovernance.sol/interface.IGovernance.md) - - -## Functions -### update - - -```solidity -function update(address target, bytes memory data) public onlyOwner; -``` - diff --git a/docs/autogen/src/contracts/common/governance/GovernanceProxy.sol/contract.GovernanceProxy.md b/docs/autogen/src/contracts/common/governance/GovernanceProxy.sol/contract.GovernanceProxy.md deleted file mode 100644 index 8fcbc250..00000000 --- a/docs/autogen/src/contracts/common/governance/GovernanceProxy.sol/contract.GovernanceProxy.md +++ /dev/null @@ -1,15 +0,0 @@ -# GovernanceProxy -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/governance/GovernanceProxy.sol) - -**Inherits:** -[Proxy](/contracts/common/misc/Proxy.sol/contract.Proxy.md) - - -## Functions -### constructor - - -```solidity -constructor(address _proxyTo) public Proxy(_proxyTo); -``` - diff --git a/docs/autogen/src/contracts/common/governance/IGovernance.sol/interface.IGovernance.md b/docs/autogen/src/contracts/common/governance/IGovernance.sol/interface.IGovernance.md deleted file mode 100644 index a5f0d395..00000000 --- a/docs/autogen/src/contracts/common/governance/IGovernance.sol/interface.IGovernance.md +++ /dev/null @@ -1,12 +0,0 @@ -# IGovernance -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/governance/IGovernance.sol) - - -## Functions -### update - - -```solidity -function update(address target, bytes calldata data) external; -``` - diff --git a/docs/autogen/src/contracts/common/governance/README.md b/docs/autogen/src/contracts/common/governance/README.md deleted file mode 100644 index 4ef85a41..00000000 --- a/docs/autogen/src/contracts/common/governance/README.md +++ /dev/null @@ -1,7 +0,0 @@ - - -# Contents -- [Governable](Governable.sol/contract.Governable.md) -- [Governance](Governance.sol/contract.Governance.md) -- [GovernanceProxy](GovernanceProxy.sol/contract.GovernanceProxy.md) -- [IGovernance](IGovernance.sol/interface.IGovernance.md) diff --git a/docs/autogen/src/contracts/common/lib/BytesLib.sol/library.BytesLib.md b/docs/autogen/src/contracts/common/lib/BytesLib.sol/library.BytesLib.md deleted file mode 100644 index 8558a879..00000000 --- a/docs/autogen/src/contracts/common/lib/BytesLib.sol/library.BytesLib.md +++ /dev/null @@ -1,68 +0,0 @@ -# BytesLib -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/lib/BytesLib.sol) - - -## Functions -### concat - - -```solidity -function concat(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bytes memory); -``` - -### slice - - -```solidity -function slice(bytes memory _bytes, uint256 _start, uint256 _length) internal pure returns (bytes memory); -``` - -### leftPad - - -```solidity -function leftPad(bytes memory _bytes) internal pure returns (bytes memory); -``` - -### toBytes32 - - -```solidity -function toBytes32(bytes memory b) internal pure returns (bytes32); -``` - -### toBytes4 - - -```solidity -function toBytes4(bytes memory b) internal pure returns (bytes4 result); -``` - -### fromBytes32 - - -```solidity -function fromBytes32(bytes32 x) internal pure returns (bytes memory); -``` - -### fromUint - - -```solidity -function fromUint(uint256 _num) internal pure returns (bytes memory _ret); -``` - -### toUint - - -```solidity -function toUint(bytes memory _bytes, uint256 _start) internal pure returns (uint256); -``` - -### toAddress - - -```solidity -function toAddress(bytes memory _bytes, uint256 _start) internal pure returns (address); -``` - diff --git a/docs/autogen/src/contracts/common/lib/Common.sol/library.Common.md b/docs/autogen/src/contracts/common/lib/Common.sol/library.Common.md deleted file mode 100644 index 1a9ccfa6..00000000 --- a/docs/autogen/src/contracts/common/lib/Common.sol/library.Common.md +++ /dev/null @@ -1,33 +0,0 @@ -# Common -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/lib/Common.sol) - - -## Functions -### getV - - -```solidity -function getV(bytes memory v, uint16 chainId) public pure returns (uint8); -``` - -### isContract - - -```solidity -function isContract(address _addr) public view returns (bool); -``` - -### toUint8 - - -```solidity -function toUint8(bytes memory _arg) public pure returns (uint8); -``` - -### toUint16 - - -```solidity -function toUint16(bytes memory _arg) public pure returns (uint16); -``` - diff --git a/docs/autogen/src/contracts/common/lib/ECVerify.sol/library.ECVerify.md b/docs/autogen/src/contracts/common/lib/ECVerify.sol/library.ECVerify.md deleted file mode 100644 index 1286ec28..00000000 --- a/docs/autogen/src/contracts/common/lib/ECVerify.sol/library.ECVerify.md +++ /dev/null @@ -1,33 +0,0 @@ -# ECVerify -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/lib/ECVerify.sol) - - -## Functions -### ecrecovery - - -```solidity -function ecrecovery(bytes32 hash, uint256[3] memory sig) internal pure returns (address); -``` - -### ecrecovery - - -```solidity -function ecrecovery(bytes32 hash, bytes memory sig) internal pure returns (address); -``` - -### ecrecovery - - -```solidity -function ecrecovery(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address); -``` - -### ecverify - - -```solidity -function ecverify(bytes32 hash, bytes memory sig, address signer) internal pure returns (bool); -``` - diff --git a/docs/autogen/src/contracts/common/lib/ExitPayloadReader.sol/library.ExitPayloadReader.md b/docs/autogen/src/contracts/common/lib/ExitPayloadReader.sol/library.ExitPayloadReader.md deleted file mode 100644 index 5034d56a..00000000 --- a/docs/autogen/src/contracts/common/lib/ExitPayloadReader.sol/library.ExitPayloadReader.md +++ /dev/null @@ -1,203 +0,0 @@ -# ExitPayloadReader -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/lib/ExitPayloadReader.sol) - - -## State Variables -### WORD_SIZE - -```solidity -uint8 constant WORD_SIZE = 32; -``` - - -## Functions -### toExitPayload - - -```solidity -function toExitPayload(bytes memory data) internal pure returns (ExitPayload memory); -``` - -### copy - - -```solidity -function copy(uint256 src, uint256 dest, uint256 len) private pure; -``` - -### getHeaderNumber - - -```solidity -function getHeaderNumber(ExitPayload memory payload) internal pure returns (uint256); -``` - -### getBlockProof - - -```solidity -function getBlockProof(ExitPayload memory payload) internal pure returns (bytes memory); -``` - -### getBlockNumber - - -```solidity -function getBlockNumber(ExitPayload memory payload) internal pure returns (uint256); -``` - -### getBlockTime - - -```solidity -function getBlockTime(ExitPayload memory payload) internal pure returns (uint256); -``` - -### getTxRoot - - -```solidity -function getTxRoot(ExitPayload memory payload) internal pure returns (bytes32); -``` - -### getReceiptRoot - - -```solidity -function getReceiptRoot(ExitPayload memory payload) internal pure returns (bytes32); -``` - -### getReceipt - - -```solidity -function getReceipt(ExitPayload memory payload) internal pure returns (Receipt memory receipt); -``` - -### getReceiptProof - - -```solidity -function getReceiptProof(ExitPayload memory payload) internal pure returns (bytes memory); -``` - -### getBranchMaskAsBytes - - -```solidity -function getBranchMaskAsBytes(ExitPayload memory payload) internal pure returns (bytes memory); -``` - -### getBranchMaskAsUint - - -```solidity -function getBranchMaskAsUint(ExitPayload memory payload) internal pure returns (uint256); -``` - -### getReceiptLogIndex - - -```solidity -function getReceiptLogIndex(ExitPayload memory payload) internal pure returns (uint256); -``` - -### getTx - - -```solidity -function getTx(ExitPayload memory payload) internal pure returns (bytes memory); -``` - -### getTxProof - - -```solidity -function getTxProof(ExitPayload memory payload) internal pure returns (bytes memory); -``` - -### toBytes - - -```solidity -function toBytes(Receipt memory receipt) internal pure returns (bytes memory); -``` - -### getLog - - -```solidity -function getLog(Receipt memory receipt) internal pure returns (Log memory); -``` - -### getEmitter - - -```solidity -function getEmitter(Log memory log) internal pure returns (address); -``` - -### getTopics - - -```solidity -function getTopics(Log memory log) internal pure returns (LogTopics memory); -``` - -### getData - - -```solidity -function getData(Log memory log) internal pure returns (bytes memory); -``` - -### toRlpBytes - - -```solidity -function toRlpBytes(Log memory log) internal pure returns (bytes memory); -``` - -### getField - - -```solidity -function getField(LogTopics memory topics, uint256 index) internal pure returns (RLPReader.RLPItem memory); -``` - -## Structs -### ExitPayload - -```solidity -struct ExitPayload { - RLPReader.RLPItem[] data; -} -``` - -### Receipt - -```solidity -struct Receipt { - RLPReader.RLPItem[] data; - bytes raw; - uint256 logIndex; -} -``` - -### Log - -```solidity -struct Log { - RLPReader.RLPItem data; - RLPReader.RLPItem[] list; -} -``` - -### LogTopics - -```solidity -struct LogTopics { - RLPReader.RLPItem[] data; -} -``` - diff --git a/docs/autogen/src/contracts/common/lib/Merkle.sol/library.Merkle.md b/docs/autogen/src/contracts/common/lib/Merkle.sol/library.Merkle.md deleted file mode 100644 index 96c1ee4c..00000000 --- a/docs/autogen/src/contracts/common/lib/Merkle.sol/library.Merkle.md +++ /dev/null @@ -1,12 +0,0 @@ -# Merkle -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/lib/Merkle.sol) - - -## Functions -### checkMembership - - -```solidity -function checkMembership(bytes32 leaf, uint256 index, bytes32 rootHash, bytes memory proof) internal pure returns (bool); -``` - diff --git a/docs/autogen/src/contracts/common/lib/MerklePatriciaProof.sol/library.MerklePatriciaProof.md b/docs/autogen/src/contracts/common/lib/MerklePatriciaProof.sol/library.MerklePatriciaProof.md deleted file mode 100644 index 4904ef0a..00000000 --- a/docs/autogen/src/contracts/common/lib/MerklePatriciaProof.sol/library.MerklePatriciaProof.md +++ /dev/null @@ -1,33 +0,0 @@ -# MerklePatriciaProof -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/lib/MerklePatriciaProof.sol) - - -## Functions -### verify - - -```solidity -function verify(bytes memory value, bytes memory encodedPath, bytes memory rlpParentNodes, bytes32 root) internal pure returns (bool); -``` - -### _nibblesToTraverse - - -```solidity -function _nibblesToTraverse(bytes memory encodedPartialPath, bytes memory path, uint256 pathPtr) private pure returns (uint256); -``` - -### _getNibbleArray - - -```solidity -function _getNibbleArray(bytes memory b) private pure returns (bytes memory); -``` - -### _getNthNibbleOfBytes - - -```solidity -function _getNthNibbleOfBytes(uint256 n, bytes memory str) private pure returns (bytes1); -``` - diff --git a/docs/autogen/src/contracts/common/lib/PriorityQueue.sol/contract.PriorityQueue.md b/docs/autogen/src/contracts/common/lib/PriorityQueue.sol/contract.PriorityQueue.md deleted file mode 100644 index 740006ad..00000000 --- a/docs/autogen/src/contracts/common/lib/PriorityQueue.sol/contract.PriorityQueue.md +++ /dev/null @@ -1,141 +0,0 @@ -# PriorityQueue -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/lib/PriorityQueue.sol) - -**Inherits:** -Ownable - -*A priority queue implementation.* - - -## State Variables -### heapList - -```solidity -uint256[] heapList; -``` - - -### currentSize - -```solidity -uint256 public currentSize; -``` - - -## Functions -### constructor - - -```solidity -constructor() public; -``` - -### insert - -*Inserts an element into the priority queue.* - - -```solidity -function insert(uint256 _priority, uint256 _value) public onlyOwner; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`_priority`|`uint256`|Priority to insert.| -|`_value`|`uint256`|Some additional value.| - - -### getMin - -*Returns the top element of the heap.* - - -```solidity -function getMin() public view returns (uint256, uint256); -``` -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`uint256`|The smallest element in the priority queue.| -|``|`uint256`|| - - -### delMin - -*Deletes the top element of the heap and shifts everything up.* - - -```solidity -function delMin() public onlyOwner returns (uint256, uint256); -``` -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`uint256`|The smallest element in the priorty queue.| -|``|`uint256`|| - - -### _minChild - -*Determines the minimum child of a given node in the tree.* - - -```solidity -function _minChild(uint256 _index) private view returns (uint256); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`_index`|`uint256`|Index of the node in the tree.| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`uint256`|The smallest child node.| - - -### _percUp - -*Bubbles the element at some index up.* - - -```solidity -function _percUp(uint256 _index) private; -``` - -### _percDown - -*Bubbles the element at some index down.* - - -```solidity -function _percDown(uint256 _index) private; -``` - -### _splitElement - -*Split an element into its priority and value.* - - -```solidity -function _splitElement(uint256 _element) private pure returns (uint256, uint256); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`_element`|`uint256`|Element to decode.| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`uint256`|A tuple containing the priority and value.| -|``|`uint256`|| - - diff --git a/docs/autogen/src/contracts/common/lib/README.md b/docs/autogen/src/contracts/common/lib/README.md deleted file mode 100644 index 57470311..00000000 --- a/docs/autogen/src/contracts/common/lib/README.md +++ /dev/null @@ -1,11 +0,0 @@ - - -# Contents -- [BytesLib](BytesLib.sol/library.BytesLib.md) -- [Common](Common.sol/library.Common.md) -- [ECVerify](ECVerify.sol/library.ECVerify.md) -- [ExitPayloadReader](ExitPayloadReader.sol/library.ExitPayloadReader.md) -- [Merkle](Merkle.sol/library.Merkle.md) -- [MerklePatriciaProof](MerklePatriciaProof.sol/library.MerklePatriciaProof.md) -- [PriorityQueue](PriorityQueue.sol/contract.PriorityQueue.md) -- [RLPEncode](RLPEncode.sol/library.RLPEncode.md) diff --git a/docs/autogen/src/contracts/common/lib/RLPEncode.sol/library.RLPEncode.md b/docs/autogen/src/contracts/common/lib/RLPEncode.sol/library.RLPEncode.md deleted file mode 100644 index 8950ab22..00000000 --- a/docs/autogen/src/contracts/common/lib/RLPEncode.sol/library.RLPEncode.md +++ /dev/null @@ -1,33 +0,0 @@ -# RLPEncode -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/lib/RLPEncode.sol) - - -## Functions -### encodeItem - - -```solidity -function encodeItem(bytes memory self) internal pure returns (bytes memory); -``` - -### encodeList - - -```solidity -function encodeList(bytes[] memory self) internal pure returns (bytes memory); -``` - -### encodeLength - - -```solidity -function encodeLength(uint256 L, uint256 offset) internal pure returns (bytes memory); -``` - -### getLengthBytes - - -```solidity -function getLengthBytes(uint256 x) internal pure returns (bytes memory b); -``` - diff --git a/docs/autogen/src/contracts/common/misc/ContractReceiver.sol/contract.ContractReceiver.md b/docs/autogen/src/contracts/common/misc/ContractReceiver.sol/contract.ContractReceiver.md deleted file mode 100644 index 8016e784..00000000 --- a/docs/autogen/src/contracts/common/misc/ContractReceiver.sol/contract.ContractReceiver.md +++ /dev/null @@ -1,22 +0,0 @@ -# ContractReceiver -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/misc/ContractReceiver.sol) - - -## Functions -### tokenFallback - -*Function that is called when a user or another contract wants to transfer funds.* - - -```solidity -function tokenFallback(address _from, uint256 _value, bytes memory _data) public; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`_from`|`address`|Transaction initiator, analogue of msg.sender| -|`_value`|`uint256`|Number of tokens to transfer.| -|`_data`|`bytes`|Data containig a function signature and/or parameters| - - diff --git a/docs/autogen/src/contracts/common/misc/DelegateProxy.sol/contract.DelegateProxy.md b/docs/autogen/src/contracts/common/misc/DelegateProxy.sol/contract.DelegateProxy.md deleted file mode 100644 index 6044db6a..00000000 --- a/docs/autogen/src/contracts/common/misc/DelegateProxy.sol/contract.DelegateProxy.md +++ /dev/null @@ -1,22 +0,0 @@ -# DelegateProxy -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/misc/DelegateProxy.sol) - -**Inherits:** -[ERCProxy](/contracts/common/misc/ERCProxy.sol/interface.ERCProxy.md), [DelegateProxyForwarder](/contracts/common/misc/DelegateProxyForwarder.sol/contract.DelegateProxyForwarder.md) - - -## Functions -### proxyType - - -```solidity -function proxyType() external pure returns (uint256 proxyTypeId); -``` - -### implementation - - -```solidity -function implementation() external view returns (address); -``` - diff --git a/docs/autogen/src/contracts/common/misc/DelegateProxyForwarder.sol/contract.DelegateProxyForwarder.md b/docs/autogen/src/contracts/common/misc/DelegateProxyForwarder.sol/contract.DelegateProxyForwarder.md deleted file mode 100644 index 7f317b0a..00000000 --- a/docs/autogen/src/contracts/common/misc/DelegateProxyForwarder.sol/contract.DelegateProxyForwarder.md +++ /dev/null @@ -1,19 +0,0 @@ -# DelegateProxyForwarder -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/misc/DelegateProxyForwarder.sol) - - -## Functions -### delegatedFwd - - -```solidity -function delegatedFwd(address _dst, bytes memory _calldata) internal; -``` - -### isContract - - -```solidity -function isContract(address _target) internal view returns (bool); -``` - diff --git a/docs/autogen/src/contracts/common/misc/DrainStakeManager.sol/contract.DrainStakeManager.md b/docs/autogen/src/contracts/common/misc/DrainStakeManager.sol/contract.DrainStakeManager.md deleted file mode 100644 index 2113802d..00000000 --- a/docs/autogen/src/contracts/common/misc/DrainStakeManager.sol/contract.DrainStakeManager.md +++ /dev/null @@ -1,36 +0,0 @@ -# DrainStakeManager -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/misc/DrainStakeManager.sol) - -**Inherits:** -[StakeManagerStorage](/contracts/staking/stakeManager/StakeManagerStorage.sol/contract.StakeManagerStorage.md), [Initializable](/contracts/common/mixin/Initializable.sol/contract.Initializable.md) - - -## Functions -### constructor - - -```solidity -constructor() public GovernanceLockable(address(0x0)); -``` - -### drain - - -```solidity -function drain(address destination, uint256 amount) external onlyOwner; -``` - -### drainValidatorShares - - -```solidity -function drainValidatorShares(uint256 validatorId, address _token, address payable destination, uint256 amount) external onlyOwner; -``` - -### isOwner - - -```solidity -function isOwner() public view returns (bool); -``` - diff --git a/docs/autogen/src/contracts/common/misc/Drainable.sol/contract.Drainable.md b/docs/autogen/src/contracts/common/misc/Drainable.sol/contract.Drainable.md deleted file mode 100644 index 645349f3..00000000 --- a/docs/autogen/src/contracts/common/misc/Drainable.sol/contract.Drainable.md +++ /dev/null @@ -1,36 +0,0 @@ -# Drainable -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/misc/Drainable.sol) - -**Inherits:** -[DepositManagerStorage](/contracts/root/depositManager/DepositManagerStorage.sol/contract.DepositManagerStorage.md) - - -## Functions -### constructor - - -```solidity -constructor() public GovernanceLockable(address(0x0)); -``` - -### drainErc20 - - -```solidity -function drainErc20(address[] calldata tokens, uint256[] calldata values, address destination) external onlyGovernance; -``` - -### drainErc721 - - -```solidity -function drainErc721(address[] calldata tokens, uint256[] calldata values, address destination) external onlyGovernance; -``` - -### drainEther - - -```solidity -function drainEther(uint256 amount, address payable destination) external onlyGovernance; -``` - diff --git a/docs/autogen/src/contracts/common/misc/ERCProxy.sol/interface.ERCProxy.md b/docs/autogen/src/contracts/common/misc/ERCProxy.sol/interface.ERCProxy.md deleted file mode 100644 index a14b05c6..00000000 --- a/docs/autogen/src/contracts/common/misc/ERCProxy.sol/interface.ERCProxy.md +++ /dev/null @@ -1,19 +0,0 @@ -# ERCProxy -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/misc/ERCProxy.sol) - - -## Functions -### proxyType - - -```solidity -function proxyType() external pure returns (uint256 proxyTypeId); -``` - -### implementation - - -```solidity -function implementation() external view returns (address codeAddr); -``` - diff --git a/docs/autogen/src/contracts/common/misc/Proxy.sol/contract.Proxy.md b/docs/autogen/src/contracts/common/misc/Proxy.sol/contract.Proxy.md deleted file mode 100644 index aaaa6571..00000000 --- a/docs/autogen/src/contracts/common/misc/Proxy.sol/contract.Proxy.md +++ /dev/null @@ -1,56 +0,0 @@ -# Proxy -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/misc/Proxy.sol) - -**Inherits:** -[ProxyStorage](/contracts/common/misc/ProxyStorage.sol/contract.ProxyStorage.md), [DelegateProxy](/contracts/common/misc/DelegateProxy.sol/contract.DelegateProxy.md) - - -## Functions -### constructor - - -```solidity -constructor(address _proxyTo) public; -``` - -### function - - -```solidity -function() external payable; -``` - -### implementation - - -```solidity -function implementation() external view returns (address); -``` - -### updateImplementation - - -```solidity -function updateImplementation(address _newProxyTo) public onlyOwner; -``` - -### isContract - - -```solidity -function isContract(address _target) internal view returns (bool); -``` - -## Events -### ProxyUpdated - -```solidity -event ProxyUpdated(address indexed _new, address indexed _old); -``` - -### OwnerUpdate - -```solidity -event OwnerUpdate(address _prevOwner, address _newOwner); -``` - diff --git a/docs/autogen/src/contracts/common/misc/ProxyStorage.sol/contract.ProxyStorage.md b/docs/autogen/src/contracts/common/misc/ProxyStorage.sol/contract.ProxyStorage.md deleted file mode 100644 index 66dd8bc0..00000000 --- a/docs/autogen/src/contracts/common/misc/ProxyStorage.sol/contract.ProxyStorage.md +++ /dev/null @@ -1,15 +0,0 @@ -# ProxyStorage -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/misc/ProxyStorage.sol) - -**Inherits:** -Ownable - - -## State Variables -### proxyTo - -```solidity -address internal proxyTo; -``` - - diff --git a/docs/autogen/src/contracts/common/misc/README.md b/docs/autogen/src/contracts/common/misc/README.md deleted file mode 100644 index 4e0e42bc..00000000 --- a/docs/autogen/src/contracts/common/misc/README.md +++ /dev/null @@ -1,12 +0,0 @@ - - -# Contents -- [ContractReceiver](ContractReceiver.sol/contract.ContractReceiver.md) -- [DelegateProxy](DelegateProxy.sol/contract.DelegateProxy.md) -- [DelegateProxyForwarder](DelegateProxyForwarder.sol/contract.DelegateProxyForwarder.md) -- [DrainStakeManager](DrainStakeManager.sol/contract.DrainStakeManager.md) -- [Drainable](Drainable.sol/contract.Drainable.md) -- [ERCProxy](ERCProxy.sol/interface.ERCProxy.md) -- [Proxy](Proxy.sol/contract.Proxy.md) -- [ProxyStorage](ProxyStorage.sol/contract.ProxyStorage.md) -- [UpgradableProxy](UpgradableProxy.sol/contract.UpgradableProxy.md) diff --git a/docs/autogen/src/contracts/common/misc/UpgradableProxy.sol/contract.UpgradableProxy.md b/docs/autogen/src/contracts/common/misc/UpgradableProxy.sol/contract.UpgradableProxy.md deleted file mode 100644 index f90c4297..00000000 --- a/docs/autogen/src/contracts/common/misc/UpgradableProxy.sol/contract.UpgradableProxy.md +++ /dev/null @@ -1,120 +0,0 @@ -# UpgradableProxy -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/misc/UpgradableProxy.sol) - -**Inherits:** -[DelegateProxy](/contracts/common/misc/DelegateProxy.sol/contract.DelegateProxy.md) - - -## State Variables -### IMPLEMENTATION_SLOT - -```solidity -bytes32 constant IMPLEMENTATION_SLOT = keccak256("matic.network.proxy.implementation"); -``` - - -### OWNER_SLOT - -```solidity -bytes32 constant OWNER_SLOT = keccak256("matic.network.proxy.owner"); -``` - - -## Functions -### constructor - - -```solidity -constructor(address _proxyTo) public; -``` - -### function - - -```solidity -function() external payable; -``` - -### onlyProxyOwner - - -```solidity -modifier onlyProxyOwner(); -``` - -### owner - - -```solidity -function owner() external view returns (address); -``` - -### loadOwner - - -```solidity -function loadOwner() internal view returns (address); -``` - -### implementation - - -```solidity -function implementation() external view returns (address); -``` - -### loadImplementation - - -```solidity -function loadImplementation() internal view returns (address); -``` - -### transferOwnership - - -```solidity -function transferOwnership(address newOwner) public onlyProxyOwner; -``` - -### setOwner - - -```solidity -function setOwner(address newOwner) private; -``` - -### updateImplementation - - -```solidity -function updateImplementation(address _newProxyTo) public onlyProxyOwner; -``` - -### updateAndCall - - -```solidity -function updateAndCall(address _newProxyTo, bytes memory data) public payable onlyProxyOwner; -``` - -### setImplementation - - -```solidity -function setImplementation(address _newProxyTo) private; -``` - -## Events -### ProxyUpdated - -```solidity -event ProxyUpdated(address indexed _new, address indexed _old); -``` - -### OwnerUpdate - -```solidity -event OwnerUpdate(address _new, address _old); -``` - diff --git a/docs/autogen/src/contracts/common/mixin/ChainIdMixin.sol/contract.ChainIdMixin.md b/docs/autogen/src/contracts/common/mixin/ChainIdMixin.sol/contract.ChainIdMixin.md deleted file mode 100644 index da58bee9..00000000 --- a/docs/autogen/src/contracts/common/mixin/ChainIdMixin.sol/contract.ChainIdMixin.md +++ /dev/null @@ -1,19 +0,0 @@ -# ChainIdMixin -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/mixin/ChainIdMixin.sol) - - -## State Variables -### networkId - -```solidity -bytes public constant networkId = hex"3A99"; -``` - - -### CHAINID - -```solidity -uint256 public constant CHAINID = 15_001; -``` - - diff --git a/docs/autogen/src/contracts/common/mixin/GovernanceLockable.sol/contract.GovernanceLockable.md b/docs/autogen/src/contracts/common/mixin/GovernanceLockable.sol/contract.GovernanceLockable.md deleted file mode 100644 index 48f91f5f..00000000 --- a/docs/autogen/src/contracts/common/mixin/GovernanceLockable.sol/contract.GovernanceLockable.md +++ /dev/null @@ -1,29 +0,0 @@ -# GovernanceLockable -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/mixin/GovernanceLockable.sol) - -**Inherits:** -[Lockable](/contracts/common/mixin/Lockable.sol/contract.Lockable.md), [Governable](/contracts/common/governance/Governable.sol/contract.Governable.md) - - -## Functions -### constructor - - -```solidity -constructor(address governance) public Governable(governance); -``` - -### lock - - -```solidity -function lock() public onlyGovernance; -``` - -### unlock - - -```solidity -function unlock() public onlyGovernance; -``` - diff --git a/docs/autogen/src/contracts/common/mixin/Initializable.sol/contract.Initializable.md b/docs/autogen/src/contracts/common/mixin/Initializable.sol/contract.Initializable.md deleted file mode 100644 index 140e86a9..00000000 --- a/docs/autogen/src/contracts/common/mixin/Initializable.sol/contract.Initializable.md +++ /dev/null @@ -1,20 +0,0 @@ -# Initializable -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/mixin/Initializable.sol) - - -## State Variables -### inited - -```solidity -bool inited = false; -``` - - -## Functions -### initializer - - -```solidity -modifier initializer(); -``` - diff --git a/docs/autogen/src/contracts/common/mixin/Lockable.sol/contract.Lockable.md b/docs/autogen/src/contracts/common/mixin/Lockable.sol/contract.Lockable.md deleted file mode 100644 index f4c6d58d..00000000 --- a/docs/autogen/src/contracts/common/mixin/Lockable.sol/contract.Lockable.md +++ /dev/null @@ -1,41 +0,0 @@ -# Lockable -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/mixin/Lockable.sol) - - -## State Variables -### locked - -```solidity -bool public locked; -``` - - -## Functions -### onlyWhenUnlocked - - -```solidity -modifier onlyWhenUnlocked(); -``` - -### _assertUnlocked - - -```solidity -function _assertUnlocked() private view; -``` - -### lock - - -```solidity -function lock() public; -``` - -### unlock - - -```solidity -function unlock() public; -``` - diff --git a/docs/autogen/src/contracts/common/mixin/OwnableLockable.sol/contract.OwnableLockable.md b/docs/autogen/src/contracts/common/mixin/OwnableLockable.sol/contract.OwnableLockable.md deleted file mode 100644 index 29cb693d..00000000 --- a/docs/autogen/src/contracts/common/mixin/OwnableLockable.sol/contract.OwnableLockable.md +++ /dev/null @@ -1,22 +0,0 @@ -# OwnableLockable -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/mixin/OwnableLockable.sol) - -**Inherits:** -[Lockable](/contracts/common/mixin/Lockable.sol/contract.Lockable.md), Ownable - - -## Functions -### lock - - -```solidity -function lock() public onlyOwner; -``` - -### unlock - - -```solidity -function unlock() public onlyOwner; -``` - diff --git a/docs/autogen/src/contracts/common/mixin/README.md b/docs/autogen/src/contracts/common/mixin/README.md deleted file mode 100644 index 7fd484c0..00000000 --- a/docs/autogen/src/contracts/common/mixin/README.md +++ /dev/null @@ -1,9 +0,0 @@ - - -# Contents -- [ChainIdMixin](ChainIdMixin.sol/contract.ChainIdMixin.md) -- [GovernanceLockable](GovernanceLockable.sol/contract.GovernanceLockable.md) -- [Initializable](Initializable.sol/contract.Initializable.md) -- [Lockable](Lockable.sol/contract.Lockable.md) -- [OwnableLockable](OwnableLockable.sol/contract.OwnableLockable.md) -- [RootChainable](RootChainable.sol/contract.RootChainable.md) diff --git a/docs/autogen/src/contracts/common/mixin/RootChainable.sol/contract.RootChainable.md b/docs/autogen/src/contracts/common/mixin/RootChainable.sol/contract.RootChainable.md deleted file mode 100644 index 11280740..00000000 --- a/docs/autogen/src/contracts/common/mixin/RootChainable.sol/contract.RootChainable.md +++ /dev/null @@ -1,45 +0,0 @@ -# RootChainable -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/mixin/RootChainable.sol) - -**Inherits:** -Ownable - - -## State Variables -### rootChain - -```solidity -address public rootChain; -``` - - -## Functions -### onlyRootChain - - -```solidity -modifier onlyRootChain(); -``` - -### changeRootChain - -*Allows the current owner to change root chain address.* - - -```solidity -function changeRootChain(address newRootChain) public onlyOwner; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`newRootChain`|`address`|The address to new rootchain.| - - -## Events -### RootChainChanged - -```solidity -event RootChainChanged(address indexed previousRootChain, address indexed newRootChain); -``` - diff --git a/docs/autogen/src/contracts/common/tokens/ERC20NonTradable.sol/contract.ERC20NonTradable.md b/docs/autogen/src/contracts/common/tokens/ERC20NonTradable.sol/contract.ERC20NonTradable.md deleted file mode 100644 index 96a2bc0e..00000000 --- a/docs/autogen/src/contracts/common/tokens/ERC20NonTradable.sol/contract.ERC20NonTradable.md +++ /dev/null @@ -1,15 +0,0 @@ -# ERC20NonTradable -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/tokens/ERC20NonTradable.sol) - -**Inherits:** -ERC20 - - -## Functions -### _approve - - -```solidity -function _approve(address owner, address spender, uint256 value) internal; -``` - diff --git a/docs/autogen/src/contracts/common/tokens/ERC20NonTransferable.sol/contract.ERC20NonTransferable.md b/docs/autogen/src/contracts/common/tokens/ERC20NonTransferable.sol/contract.ERC20NonTransferable.md deleted file mode 100644 index 07881076..00000000 --- a/docs/autogen/src/contracts/common/tokens/ERC20NonTransferable.sol/contract.ERC20NonTransferable.md +++ /dev/null @@ -1,15 +0,0 @@ -# ERC20NonTransferable -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/tokens/ERC20NonTransferable.sol) - -**Inherits:** -ERC20 - - -## Functions -### _transfer - - -```solidity -function _transfer(address from, address to, uint256 value) internal; -``` - diff --git a/docs/autogen/src/contracts/common/tokens/ERC721PlasmaMintable.sol/contract.ERC721PlasmaMintable.md b/docs/autogen/src/contracts/common/tokens/ERC721PlasmaMintable.sol/contract.ERC721PlasmaMintable.md deleted file mode 100644 index 3d83e71b..00000000 --- a/docs/autogen/src/contracts/common/tokens/ERC721PlasmaMintable.sol/contract.ERC721PlasmaMintable.md +++ /dev/null @@ -1,36 +0,0 @@ -# ERC721PlasmaMintable -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/tokens/ERC721PlasmaMintable.sol) - -**Inherits:** -ERC721Mintable, ERC721MetadataMintable - - -## Functions -### constructor - - -```solidity -constructor(string memory name, string memory symbol) public ERC721Metadata(name, symbol); -``` - -### exists - -*Returns whether the specified token exists* - - -```solidity -function exists(uint256 tokenId) public view returns (bool); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`tokenId`|`uint256`|uint256 ID of the token to query the existence of| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`bool`|bool whether the token exists| - - diff --git a/docs/autogen/src/contracts/common/tokens/MaticWETH.sol/contract.MaticWETH.md b/docs/autogen/src/contracts/common/tokens/MaticWETH.sol/contract.MaticWETH.md deleted file mode 100644 index 1f76cdf5..00000000 --- a/docs/autogen/src/contracts/common/tokens/MaticWETH.sol/contract.MaticWETH.md +++ /dev/null @@ -1,51 +0,0 @@ -# MaticWETH -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/tokens/MaticWETH.sol) - -**Inherits:** -[WETH](/contracts/common/tokens/WETH.sol/contract.WETH.md) - - -## State Variables -### name - -```solidity -string public name = "Wrapped Ether"; -``` - - -### symbol - -```solidity -string public symbol = "WETH"; -``` - - -### decimals - -```solidity -uint8 public decimals = 18; -``` - - -## Functions -### deposit - - -```solidity -function deposit() public payable; -``` - -### withdraw - - -```solidity -function withdraw(uint256 wad) public; -``` - -### withdraw - - -```solidity -function withdraw(uint256 wad, address user) public; -``` - diff --git a/docs/autogen/src/contracts/common/tokens/POLTokenMock.sol/contract.POLTokenMock.md b/docs/autogen/src/contracts/common/tokens/POLTokenMock.sol/contract.POLTokenMock.md deleted file mode 100644 index 1bd56d60..00000000 --- a/docs/autogen/src/contracts/common/tokens/POLTokenMock.sol/contract.POLTokenMock.md +++ /dev/null @@ -1,68 +0,0 @@ -# POLTokenMock -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/tokens/POLTokenMock.sol) - -**Inherits:** -ERC20Mintable - - -## State Variables -### name - -```solidity -string public name; -``` - - -### symbol - -```solidity -string public symbol; -``` - - -### decimals - -```solidity -uint8 public decimals = 18; -``` - - -## Functions -### constructor - - -```solidity -constructor(string memory _name, string memory _symbol) public; -``` - -### safeTransfer - - -```solidity -function safeTransfer(IERC20 token, address to, uint256 value) public; -``` - -### safeTransferFrom - - -```solidity -function safeTransferFrom(IERC20 token, address from, address to, uint256 value) public; -``` - -### callOptionalReturn - -*Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement -on the return value: the return value is optional (but if data is returned, it must equal true).* - - -```solidity -function callOptionalReturn(IERC20 token, bytes memory data) private; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`token`|`IERC20`|The token targeted by the call.| -|`data`|`bytes`|The call data (encoded using abi.encode or one of its variants).| - - diff --git a/docs/autogen/src/contracts/common/tokens/README.md b/docs/autogen/src/contracts/common/tokens/README.md deleted file mode 100644 index 5c3db7ef..00000000 --- a/docs/autogen/src/contracts/common/tokens/README.md +++ /dev/null @@ -1,11 +0,0 @@ - - -# Contents -- [ERC20NonTradable](ERC20NonTradable.sol/contract.ERC20NonTradable.md) -- [ERC20NonTransferable](ERC20NonTransferable.sol/contract.ERC20NonTransferable.md) -- [ERC721PlasmaMintable](ERC721PlasmaMintable.sol/contract.ERC721PlasmaMintable.md) -- [MaticWETH](MaticWETH.sol/contract.MaticWETH.md) -- [POLTokenMock](POLTokenMock.sol/contract.POLTokenMock.md) -- [RootERC721](RootERC721.sol/contract.RootERC721.md) -- [TestToken](TestToken.sol/contract.TestToken.md) -- [WETH](WETH.sol/contract.WETH.md) diff --git a/docs/autogen/src/contracts/common/tokens/RootERC721.sol/contract.RootERC721.md b/docs/autogen/src/contracts/common/tokens/RootERC721.sol/contract.RootERC721.md deleted file mode 100644 index 31a866f3..00000000 --- a/docs/autogen/src/contracts/common/tokens/RootERC721.sol/contract.RootERC721.md +++ /dev/null @@ -1,22 +0,0 @@ -# RootERC721 -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/tokens/RootERC721.sol) - -**Inherits:** -ERC721Full - - -## Functions -### constructor - - -```solidity -constructor(string memory name, string memory symbol) public ERC721Full(name, symbol); -``` - -### mint - - -```solidity -function mint(uint256 tokenId) public; -``` - diff --git a/docs/autogen/src/contracts/common/tokens/TestToken.sol/contract.TestToken.md b/docs/autogen/src/contracts/common/tokens/TestToken.sol/contract.TestToken.md deleted file mode 100644 index 301ef5e0..00000000 --- a/docs/autogen/src/contracts/common/tokens/TestToken.sol/contract.TestToken.md +++ /dev/null @@ -1,37 +0,0 @@ -# TestToken -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/tokens/TestToken.sol) - -**Inherits:** -ERC20Mintable - - -## State Variables -### name - -```solidity -string public name; -``` - - -### symbol - -```solidity -string public symbol; -``` - - -### decimals - -```solidity -uint8 public decimals = 18; -``` - - -## Functions -### constructor - - -```solidity -constructor(string memory _name, string memory _symbol) public; -``` - diff --git a/docs/autogen/src/contracts/common/tokens/WETH.sol/contract.WETH.md b/docs/autogen/src/contracts/common/tokens/WETH.sol/contract.WETH.md deleted file mode 100644 index 9cc992d1..00000000 --- a/docs/autogen/src/contracts/common/tokens/WETH.sol/contract.WETH.md +++ /dev/null @@ -1,42 +0,0 @@ -# WETH -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/common/tokens/WETH.sol) - -**Inherits:** -ERC20 - - -## Functions -### deposit - - -```solidity -function deposit() public payable; -``` - -### withdraw - - -```solidity -function withdraw(uint256 wad) public; -``` - -### withdraw - - -```solidity -function withdraw(uint256 wad, address user) public; -``` - -## Events -### Deposit - -```solidity -event Deposit(address indexed dst, uint256 wad); -``` - -### Withdrawal - -```solidity -event Withdrawal(address indexed src, uint256 wad); -``` - diff --git a/docs/autogen/src/contracts/root/IRootChain.sol/interface.IRootChain.md b/docs/autogen/src/contracts/root/IRootChain.sol/interface.IRootChain.md deleted file mode 100644 index 34227031..00000000 --- a/docs/autogen/src/contracts/root/IRootChain.sol/interface.IRootChain.md +++ /dev/null @@ -1,40 +0,0 @@ -# IRootChain -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/root/IRootChain.sol) - - -## Functions -### slash - - -```solidity -function slash() external; -``` - -### submitHeaderBlock - - -```solidity -function submitHeaderBlock(bytes calldata data, bytes calldata sigs) external; -``` - -### submitCheckpoint - - -```solidity -function submitCheckpoint(bytes calldata data, uint256[3][] calldata sigs) external; -``` - -### getLastChildBlock - - -```solidity -function getLastChildBlock() external view returns (uint256); -``` - -### currentHeaderBlock - - -```solidity -function currentHeaderBlock() external view returns (uint256); -``` - diff --git a/docs/autogen/src/contracts/root/README.md b/docs/autogen/src/contracts/root/README.md deleted file mode 100644 index 212e4eca..00000000 --- a/docs/autogen/src/contracts/root/README.md +++ /dev/null @@ -1,12 +0,0 @@ - - -# Contents -- [depositManager](/contracts/root/depositManager) -- [predicates](/contracts/root/predicates) -- [stateSyncer](/contracts/root/stateSyncer) -- [withdrawManager](/contracts/root/withdrawManager) -- [IRootChain](IRootChain.sol/interface.IRootChain.md) -- [RootChain](RootChain.sol/contract.RootChain.md) -- [RootChainProxy](RootChainProxy.sol/contract.RootChainProxy.md) -- [RootChainHeader](RootChainStorage.sol/contract.RootChainHeader.md) -- [RootChainStorage](RootChainStorage.sol/contract.RootChainStorage.md) diff --git a/docs/autogen/src/contracts/root/RootChain.sol/contract.RootChain.md b/docs/autogen/src/contracts/root/RootChain.sol/contract.RootChain.md deleted file mode 100644 index 2d51a2ff..00000000 --- a/docs/autogen/src/contracts/root/RootChain.sol/contract.RootChain.md +++ /dev/null @@ -1,82 +0,0 @@ -# RootChain -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/root/RootChain.sol) - -**Inherits:** -[RootChainStorage](/contracts/root/RootChainStorage.sol/contract.RootChainStorage.md), [IRootChain](/contracts/root/IRootChain.sol/interface.IRootChain.md) - - -## Functions -### onlyDepositManager - - -```solidity -modifier onlyDepositManager(); -``` - -### submitHeaderBlock - - -```solidity -function submitHeaderBlock(bytes calldata data, bytes calldata sigs) external; -``` - -### submitCheckpoint - - -```solidity -function submitCheckpoint(bytes calldata data, uint256[3][] calldata sigs) external; -``` - -### updateDepositId - -prefix 01 to data -01 represents positive vote on data and 00 is negative vote -malicious validator can try to send 2/3 on negative vote so 01 is appended - - -```solidity -function updateDepositId(uint256 numDeposits) external onlyDepositManager returns (uint256 depositId); -``` - -### getLastChildBlock - - -```solidity -function getLastChildBlock() external view returns (uint256); -``` - -### slash - - -```solidity -function slash() external; -``` - -### currentHeaderBlock - - -```solidity -function currentHeaderBlock() public view returns (uint256); -``` - -### _buildHeaderBlock - - -```solidity -function _buildHeaderBlock(address proposer, uint256 start, uint256 end, bytes32 rootHash) private returns (bool); -``` - -### setNextHeaderBlock - - -```solidity -function setNextHeaderBlock(uint256 _value) public onlyOwner; -``` - -### setHeimdallId - - -```solidity -function setHeimdallId(string memory _heimdallId) public onlyOwner; -``` - diff --git a/docs/autogen/src/contracts/root/RootChainProxy.sol/contract.RootChainProxy.md b/docs/autogen/src/contracts/root/RootChainProxy.sol/contract.RootChainProxy.md deleted file mode 100644 index c94b541f..00000000 --- a/docs/autogen/src/contracts/root/RootChainProxy.sol/contract.RootChainProxy.md +++ /dev/null @@ -1,15 +0,0 @@ -# RootChainProxy -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/root/RootChainProxy.sol) - -**Inherits:** -[Proxy](/contracts/common/misc/Proxy.sol/contract.Proxy.md), [RootChainStorage](/contracts/root/RootChainStorage.sol/contract.RootChainStorage.md) - - -## Functions -### constructor - - -```solidity -constructor(address _proxyTo, address _registry, string memory _heimdallId) public Proxy(_proxyTo); -``` - diff --git a/docs/autogen/src/contracts/root/RootChainStorage.sol/contract.RootChainHeader.md b/docs/autogen/src/contracts/root/RootChainStorage.sol/contract.RootChainHeader.md deleted file mode 100644 index 7300eea8..00000000 --- a/docs/autogen/src/contracts/root/RootChainStorage.sol/contract.RootChainHeader.md +++ /dev/null @@ -1,30 +0,0 @@ -# RootChainHeader -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/root/RootChainStorage.sol) - - -## Events -### NewHeaderBlock - -```solidity -event NewHeaderBlock(address indexed proposer, uint256 indexed headerBlockId, uint256 indexed reward, uint256 start, uint256 end, bytes32 root); -``` - -### ResetHeaderBlock - -```solidity -event ResetHeaderBlock(address indexed proposer, uint256 indexed headerBlockId); -``` - -## Structs -### HeaderBlock - -```solidity -struct HeaderBlock { - bytes32 root; - uint256 start; - uint256 end; - uint256 createdAt; - address proposer; -} -``` - diff --git a/docs/autogen/src/contracts/root/RootChainStorage.sol/contract.RootChainStorage.md b/docs/autogen/src/contracts/root/RootChainStorage.sol/contract.RootChainStorage.md deleted file mode 100644 index a85e443d..00000000 --- a/docs/autogen/src/contracts/root/RootChainStorage.sol/contract.RootChainStorage.md +++ /dev/null @@ -1,57 +0,0 @@ -# RootChainStorage -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/root/RootChainStorage.sol) - -**Inherits:** -[ProxyStorage](/contracts/common/misc/ProxyStorage.sol/contract.ProxyStorage.md), [RootChainHeader](/contracts/root/RootChainStorage.sol/contract.RootChainHeader.md), [ChainIdMixin](/contracts/common/mixin/ChainIdMixin.sol/contract.ChainIdMixin.md) - - -## State Variables -### heimdallId - -```solidity -bytes32 public heimdallId; -``` - - -### VOTE_TYPE - -```solidity -uint8 public constant VOTE_TYPE = 2; -``` - - -### MAX_DEPOSITS - -```solidity -uint16 internal constant MAX_DEPOSITS = 10_000; -``` - - -### _nextHeaderBlock - -```solidity -uint256 public _nextHeaderBlock = MAX_DEPOSITS; -``` - - -### _blockDepositId - -```solidity -uint256 internal _blockDepositId = 1; -``` - - -### headerBlocks - -```solidity -mapping(uint256 => HeaderBlock) public headerBlocks; -``` - - -### registry - -```solidity -Registry internal registry; -``` - - diff --git a/docs/autogen/src/contracts/root/depositManager/DepositManager.sol/contract.DepositManager.md b/docs/autogen/src/contracts/root/depositManager/DepositManager.sol/contract.DepositManager.md deleted file mode 100644 index 1403e171..00000000 --- a/docs/autogen/src/contracts/root/depositManager/DepositManager.sol/contract.DepositManager.md +++ /dev/null @@ -1,143 +0,0 @@ -# DepositManager -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/root/depositManager/DepositManager.sol) - -**Inherits:** -[DepositManagerStorage](/contracts/root/depositManager/DepositManagerStorage.sol/contract.DepositManagerStorage.md), [IDepositManager](/contracts/root/depositManager/IDepositManager.sol/interface.IDepositManager.md), ERC721Holder - - -## Functions -### isTokenMapped - - -```solidity -modifier isTokenMapped(address _token); -``` - -### isPredicateAuthorized - - -```solidity -modifier isPredicateAuthorized(); -``` - -### constructor - - -```solidity -constructor() public GovernanceLockable(address(0x0)); -``` - -### function - - -```solidity -function() external payable; -``` - -### migrateMatic - - -```solidity -function migrateMatic(uint256 _amount) external onlyGovernance; -``` - -### _migrateMatic - - -```solidity -function _migrateMatic(uint256 _amount) private; -``` - -### updateMaxErc20Deposit - - -```solidity -function updateMaxErc20Deposit(uint256 maxDepositAmount) public onlyGovernance; -``` - -### transferAssets - - -```solidity -function transferAssets(address _token, address _user, uint256 _amountOrNFTId) external isPredicateAuthorized; -``` - -### depositERC20 - - -```solidity -function depositERC20(address _token, uint256 _amount) external; -``` - -### depositERC721 - - -```solidity -function depositERC721(address _token, uint256 _tokenId) external; -``` - -### depositBulk - - -```solidity -function depositBulk(address[] calldata _tokens, uint256[] calldata _amountOrTokens, address _user) external onlyWhenUnlocked; -``` - -### updateChildChainAndStateSender - -*Caches childChain and stateSender (frequently used variables) from registry* - - -```solidity -function updateChildChainAndStateSender() public; -``` - -### depositERC20ForUser - - -```solidity -function depositERC20ForUser(address _token, address _user, uint256 _amount) public; -``` - -### depositERC721ForUser - - -```solidity -function depositERC721ForUser(address _token, address _user, uint256 _tokenId) public; -``` - -### depositEther - - -```solidity -function depositEther() public payable; -``` - -### _safeCreateDepositBlock - - -```solidity -function _safeCreateDepositBlock(address _user, address _token, uint256 _amountOrToken) internal onlyWhenUnlocked isTokenMapped(_token); -``` - -### _createDepositBlock - - -```solidity -function _createDepositBlock(address _user, address _token, uint256 _amountOrToken, uint256 _depositId) internal; -``` - -### updateRootChain - - -```solidity -function updateRootChain(address _rootChain) public onlyOwner; -``` - -### _safeTransferERC721 - - -```solidity -function _safeTransferERC721(address _user, address _token, uint256 _tokenId) private; -``` - diff --git a/docs/autogen/src/contracts/root/depositManager/DepositManager.sol/interface.IPolygonMigration.md b/docs/autogen/src/contracts/root/depositManager/DepositManager.sol/interface.IPolygonMigration.md deleted file mode 100644 index e172965f..00000000 --- a/docs/autogen/src/contracts/root/depositManager/DepositManager.sol/interface.IPolygonMigration.md +++ /dev/null @@ -1,12 +0,0 @@ -# IPolygonMigration -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/root/depositManager/DepositManager.sol) - - -## Functions -### migrate - - -```solidity -function migrate(uint256 amount) external; -``` - diff --git a/docs/autogen/src/contracts/root/depositManager/DepositManagerProxy.sol/contract.DepositManagerProxy.md b/docs/autogen/src/contracts/root/depositManager/DepositManagerProxy.sol/contract.DepositManagerProxy.md deleted file mode 100644 index c1d09282..00000000 --- a/docs/autogen/src/contracts/root/depositManager/DepositManagerProxy.sol/contract.DepositManagerProxy.md +++ /dev/null @@ -1,15 +0,0 @@ -# DepositManagerProxy -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/root/depositManager/DepositManagerProxy.sol) - -**Inherits:** -[Proxy](/contracts/common/misc/Proxy.sol/contract.Proxy.md), [DepositManagerStorage](/contracts/root/depositManager/DepositManagerStorage.sol/contract.DepositManagerStorage.md) - - -## Functions -### constructor - - -```solidity -constructor(address _proxyTo, address _registry, address _rootChain, address _governance) public Proxy(_proxyTo) GovernanceLockable(_governance); -``` - diff --git a/docs/autogen/src/contracts/root/depositManager/DepositManagerStorage.sol/contract.DepositManagerHeader.md b/docs/autogen/src/contracts/root/depositManager/DepositManagerStorage.sol/contract.DepositManagerHeader.md deleted file mode 100644 index e64e0ee4..00000000 --- a/docs/autogen/src/contracts/root/depositManager/DepositManagerStorage.sol/contract.DepositManagerHeader.md +++ /dev/null @@ -1,27 +0,0 @@ -# DepositManagerHeader -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/root/depositManager/DepositManagerStorage.sol) - - -## Events -### NewDepositBlock - -```solidity -event NewDepositBlock(address indexed owner, address indexed token, uint256 amountOrNFTId, uint256 depositBlockId); -``` - -### MaxErc20DepositUpdate - -```solidity -event MaxErc20DepositUpdate(uint256 indexed oldLimit, uint256 indexed newLimit); -``` - -## Structs -### DepositBlock - -```solidity -struct DepositBlock { - bytes32 depositHash; - uint256 createdAt; -} -``` - diff --git a/docs/autogen/src/contracts/root/depositManager/DepositManagerStorage.sol/contract.DepositManagerStorage.md b/docs/autogen/src/contracts/root/depositManager/DepositManagerStorage.sol/contract.DepositManagerStorage.md deleted file mode 100644 index 041d9d52..00000000 --- a/docs/autogen/src/contracts/root/depositManager/DepositManagerStorage.sol/contract.DepositManagerStorage.md +++ /dev/null @@ -1,50 +0,0 @@ -# DepositManagerStorage -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/root/depositManager/DepositManagerStorage.sol) - -**Inherits:** -[ProxyStorage](/contracts/common/misc/ProxyStorage.sol/contract.ProxyStorage.md), [GovernanceLockable](/contracts/common/mixin/GovernanceLockable.sol/contract.GovernanceLockable.md), [DepositManagerHeader](/contracts/root/depositManager/DepositManagerStorage.sol/contract.DepositManagerHeader.md) - - -## State Variables -### registry - -```solidity -Registry public registry; -``` - - -### rootChain - -```solidity -RootChain public rootChain; -``` - - -### stateSender - -```solidity -StateSender public stateSender; -``` - - -### deposits - -```solidity -mapping(uint256 => DepositBlock) public deposits; -``` - - -### childChain - -```solidity -address public childChain; -``` - - -### maxErc20Deposit - -```solidity -uint256 public maxErc20Deposit = 100 * (10 ** 18); -``` - - diff --git a/docs/autogen/src/contracts/root/depositManager/IDepositManager.sol/interface.IDepositManager.md b/docs/autogen/src/contracts/root/depositManager/IDepositManager.sol/interface.IDepositManager.md deleted file mode 100644 index ba3cce56..00000000 --- a/docs/autogen/src/contracts/root/depositManager/IDepositManager.sol/interface.IDepositManager.md +++ /dev/null @@ -1,33 +0,0 @@ -# IDepositManager -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/root/depositManager/IDepositManager.sol) - - -## Functions -### depositEther - - -```solidity -function depositEther() external payable; -``` - -### transferAssets - - -```solidity -function transferAssets(address _token, address _user, uint256 _amountOrNFTId) external; -``` - -### depositERC20 - - -```solidity -function depositERC20(address _token, uint256 _amount) external; -``` - -### depositERC721 - - -```solidity -function depositERC721(address _token, uint256 _tokenId) external; -``` - diff --git a/docs/autogen/src/contracts/root/depositManager/README.md b/docs/autogen/src/contracts/root/depositManager/README.md deleted file mode 100644 index 4f2574f8..00000000 --- a/docs/autogen/src/contracts/root/depositManager/README.md +++ /dev/null @@ -1,9 +0,0 @@ - - -# Contents -- [IPolygonMigration](DepositManager.sol/interface.IPolygonMigration.md) -- [DepositManager](DepositManager.sol/contract.DepositManager.md) -- [DepositManagerProxy](DepositManagerProxy.sol/contract.DepositManagerProxy.md) -- [DepositManagerHeader](DepositManagerStorage.sol/contract.DepositManagerHeader.md) -- [DepositManagerStorage](DepositManagerStorage.sol/contract.DepositManagerStorage.md) -- [IDepositManager](IDepositManager.sol/interface.IDepositManager.md) diff --git a/docs/autogen/src/contracts/root/predicates/ERC20Predicate.sol/contract.ERC20Predicate.md b/docs/autogen/src/contracts/root/predicates/ERC20Predicate.sol/contract.ERC20Predicate.md deleted file mode 100644 index 86e1d2f6..00000000 --- a/docs/autogen/src/contracts/root/predicates/ERC20Predicate.sol/contract.ERC20Predicate.md +++ /dev/null @@ -1,302 +0,0 @@ -# ERC20Predicate -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/root/predicates/ERC20Predicate.sol) - -**Inherits:** -[IErcPredicate](/contracts/root/predicates/IPredicate.sol/contract.IErcPredicate.md) - - -## State Variables -### DEPOSIT_EVENT_SIG - -```solidity -bytes32 constant DEPOSIT_EVENT_SIG = 0x4e2ca0515ed1aef1395f66b5303bb5d6f1bf9d61a353fa53f73f8ac9973fa9f6; -``` - - -### WITHDRAW_EVENT_SIG - -```solidity -bytes32 constant WITHDRAW_EVENT_SIG = 0xebff2602b3f468259e1e99f613fed6691f3a6526effe6ef3e768ba7ae7a36c4f; -``` - - -### LOG_TRANSFER_EVENT_SIG - -```solidity -bytes32 constant LOG_TRANSFER_EVENT_SIG = 0xe6497e3ee548a3372136af2fcb0696db31fc6cf20260707645068bd3fe97f3c4; -``` - - -### LOG_FEE_TRANSFER_EVENT_SIG - -```solidity -bytes32 constant LOG_FEE_TRANSFER_EVENT_SIG = 0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63; -``` - - -### WITHDRAW_FUNC_SIG - -```solidity -bytes4 constant WITHDRAW_FUNC_SIG = 0x2e1a7d4d; -``` - - -### TRANSFER_FUNC_SIG - -```solidity -bytes4 constant TRANSFER_FUNC_SIG = 0xa9059cbb; -``` - - -### registry - -```solidity -Registry registry; -``` - - -## Functions -### constructor - - -```solidity -constructor(address _withdrawManager, address _depositManager, address _registry) public IErcPredicate(_withdrawManager, _depositManager); -``` - -### startExitWithBurntTokens - - -```solidity -function startExitWithBurntTokens(bytes calldata data) external; -``` - -### startExitForOutgoingErc20Transfer - -Start an exit by referencing the preceding (reference) transaction - - -```solidity -function startExitForOutgoingErc20Transfer(bytes calldata data, bytes calldata exitTx) external payable isBondProvided returns (address, uint256); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`data`|`bytes`|RLP encoded data of the reference tx (proof-of-funds of exitor) that encodes the following fields headerNumber Header block number of which the reference tx was a part of blockProof Proof that the block header (in the child chain) is a leaf in the submitted merkle root blockNumber Block number of which the reference tx is a part of blockTime Reference tx block time blocktxRoot Transactions root of block blockReceiptsRoot Receipts root of block receipt Receipt of the reference transaction receiptProof Merkle proof of the reference receipt branchMask Merkle proof branchMask for the receipt logIndex Log Index to read from the receipt| -|`exitTx`|`bytes`|Signed exit transaction (outgoing transfer or burn)| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`address`|address rootToken that the exit corresponds to| -|``|`uint256`|uint256 exitAmount| - - -### startExitForIncomingErc20Transfer - -Start an exit by referencing the preceding (reference) transaction - - -```solidity -function startExitForIncomingErc20Transfer(bytes calldata data, bytes calldata exitTx) external payable isBondProvided returns (address, uint256); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`data`|`bytes`|RLP encoded data of the reference tx(s) that encodes the following fields for each tx headerNumber Header block number of which the reference tx was a part of blockProof Proof that the block header (in the child chain) is a leaf in the submitted merkle root blockNumber Block number of which the reference tx is a part of blockTime Reference tx block time blocktxRoot Transactions root of block blockReceiptsRoot Receipts root of block receipt Receipt of the reference transaction receiptProof Merkle proof of the reference receipt branchMask Merkle proof branchMask for the receipt logIndex Log Index to read from the receipt| -|`exitTx`|`bytes`|Signed exit transaction (incoming transfer)| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`address`|address rootToken that the exit corresponds to| -|``|`uint256`|uint256 exitAmount| - - -### verifyDeprecation - -Verify the deprecation of a state update - - -```solidity -function verifyDeprecation(bytes calldata exit, bytes calldata inputUtxo, bytes calldata challengeData) external returns (bool); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`exit`|`bytes`|ABI encoded PlasmaExit data| -|`inputUtxo`|`bytes`|ABI encoded Input UTXO data| -|`challengeData`|`bytes`|RLP encoded data of the challenge reference tx that encodes the following fields headerNumber Header block number of which the reference tx was a part of blockProof Proof that the block header (in the child chain) is a leaf in the submitted merkle root blockNumber Block number of which the reference tx is a part of blockTime Reference tx block time blocktxRoot Transactions root of block blockReceiptsRoot Receipts root of block receipt Receipt of the reference transaction receiptProof Merkle proof of the reference receipt branchMask Merkle proof branchMask for the receipt logIndex Log Index to read from the receipt tx Challenge transaction txProof Merkle proof of the challenge tx| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`bool`|Whether or not the state is deprecated| - - -### interpretStateUpdate - -Parse a ERC20 LogTransfer event in the receipt - - -```solidity -function interpretStateUpdate(bytes calldata state) external view returns (bytes memory); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`state`|`bytes`|abi encoded (data, participant, verifyInclusion) data is RLP encoded reference tx receipt that encodes the following fields headerNumber Header block number of which the reference tx was a part of blockProof Proof that the block header (in the child chain) is a leaf in the submitted merkle root blockNumber Block number of which the reference tx is a part of blockTime Reference tx block time blocktxRoot Transactions root of block blockReceiptsRoot Receipts root of block receipt Receipt of the reference transaction receiptProof Merkle proof of the reference receipt branchMask Merkle proof branchMask for the receipt logIndex Log Index to read from the receipt tx Challenge transaction txProof Merkle proof of the challenge tx| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`bytes`|abi encoded (closingBalance, ageOfUtxo, childToken, rootToken)| - - -### processReferenceTx - -*Process the reference tx to start a MoreVP style exit* - - -```solidity -function processReferenceTx(bytes memory receipt, uint256 logIndex, address participant, bool isChallenge) - internal - view - returns (ReferenceTxData memory data); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`receipt`|`bytes`|Receipt of the reference transaction| -|`logIndex`|`uint256`|Log Index to read from the receipt| -|`participant`|`address`|Either of exitor or a counterparty depending on the type of exit| -|`isChallenge`|`bool`|Whether it is a challenge or start exit operation| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|`data`|`ReferenceTxData`|ReferenceTxData Parsed reference tx data| - - -### validateSequential - - -```solidity -function validateSequential(ExitTxData memory exitTxData, ReferenceTxData memory referenceTxData) internal pure returns (uint256 exitAmount); -``` - -### processChallenge - - -```solidity -function processChallenge(RLPReader.RLPItem[] memory inputItems, address participant) internal pure; -``` - -### processStateUpdate - -Parse the state update and check if this predicate recognizes it - - -```solidity -function processStateUpdate(RLPReader.RLPItem[] memory inputItems, bytes memory logData, address participant) - internal - pure - returns (uint256 closingBalance, uint256 oIndex); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`inputItems`|`RLPReader.RLPItem[]`|inputItems[i] refers to i-th (0-based) topic in the topics array in the log| -|`logData`|`bytes`|Data field (unindexed params) in the log| -|`participant`|`address`|| - - -### processExitTx - -Process the transaction to start a MoreVP style exit from - - -```solidity -function processExitTx(bytes memory exitTx) internal view returns (ExitTxData memory txData); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`exitTx`|`bytes`|Signed exit transaction| - - -### processChallengeTx - -Process the challenge transaction - - -```solidity -function processChallengeTx(bytes memory exitTx) internal pure returns (ExitTxData memory txData); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`exitTx`|`bytes`|Challenge transaction| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|`txData`|`ExitTxData`|ExitTxData Parsed challenge transaction data| - - -### processExitTxSender - -*Processes transaction from the "signer / sender" perspective* - - -```solidity -function processExitTxSender(bytes memory txData) internal pure returns (uint256 amount, ExitType exitType); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`txData`|`bytes`|Transaction input data| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|`amount`|`uint256`|exitAmount Number of tokens burnt or sent| -|`exitType`|`ExitType`|burnt Whether the tokens were burnt| - - -### processExitTxCounterparty - -*Processes transaction from the "receiver" perspective* - - -```solidity -function processExitTxCounterparty(bytes memory txData) internal view returns (uint256 exitAmount); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`txData`|`bytes`|Transaction input data| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|`exitAmount`|`uint256`|Number of tokens received| - - diff --git a/docs/autogen/src/contracts/root/predicates/ERC20PredicateBurnOnly.sol/contract.ERC20PredicateBurnOnly.md b/docs/autogen/src/contracts/root/predicates/ERC20PredicateBurnOnly.sol/contract.ERC20PredicateBurnOnly.md deleted file mode 100644 index 4005b926..00000000 --- a/docs/autogen/src/contracts/root/predicates/ERC20PredicateBurnOnly.sol/contract.ERC20PredicateBurnOnly.md +++ /dev/null @@ -1,44 +0,0 @@ -# ERC20PredicateBurnOnly -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/root/predicates/ERC20PredicateBurnOnly.sol) - -**Inherits:** -[IErcPredicate](/contracts/root/predicates/IPredicate.sol/contract.IErcPredicate.md) - - -## State Variables -### WITHDRAW_EVENT_SIG - -```solidity -bytes32 constant WITHDRAW_EVENT_SIG = 0xebff2602b3f468259e1e99f613fed6691f3a6526effe6ef3e768ba7ae7a36c4f; -``` - - -## Functions -### constructor - - -```solidity -constructor(address _withdrawManager, address _depositManager) public IErcPredicate(_withdrawManager, _depositManager); -``` - -### startExitWithBurntTokens - - -```solidity -function startExitWithBurntTokens(bytes calldata data) external; -``` - -### verifyDeprecation - - -```solidity -function verifyDeprecation(bytes calldata exit, bytes calldata inputUtxo, bytes calldata challengeData) external returns (bool); -``` - -### interpretStateUpdate - - -```solidity -function interpretStateUpdate(bytes calldata state) external view returns (bytes memory); -``` - diff --git a/docs/autogen/src/contracts/root/predicates/ERC721Predicate.sol/contract.ERC721Predicate.md b/docs/autogen/src/contracts/root/predicates/ERC721Predicate.sol/contract.ERC721Predicate.md deleted file mode 100644 index 73fda7d4..00000000 --- a/docs/autogen/src/contracts/root/predicates/ERC721Predicate.sol/contract.ERC721Predicate.md +++ /dev/null @@ -1,215 +0,0 @@ -# ERC721Predicate -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/root/predicates/ERC721Predicate.sol) - -**Inherits:** -[IErcPredicate](/contracts/root/predicates/IPredicate.sol/contract.IErcPredicate.md) - - -## State Variables -### DEPOSIT_EVENT_SIG - -```solidity -bytes32 constant DEPOSIT_EVENT_SIG = 0x5548c837ab068cf56a2c2479df0882a4922fd203edb7517321831d95078c5f62; -``` - - -### WITHDRAW_EVENT_SIG - -```solidity -bytes32 constant WITHDRAW_EVENT_SIG = 0x9b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8eb; -``` - - -### E721_LOG_TRANSFER_EVENT_SIG - -```solidity -bytes32 constant E721_LOG_TRANSFER_EVENT_SIG = 0x6eabe333476233fd382224f233210cb808a7bc4c4de64f9d76628bf63c677b1a; -``` - - -### WITHDRAW_FUNC_SIG - -```solidity -bytes4 constant WITHDRAW_FUNC_SIG = 0x2e1a7d4d; -``` - - -### TRANSFER_FROM_FUNC_SIG - -```solidity -bytes4 constant TRANSFER_FROM_FUNC_SIG = 0x23b872dd; -``` - - -## Functions -### constructor - - -```solidity -constructor(address _withdrawManager, address _depositManager) public IErcPredicate(_withdrawManager, _depositManager); -``` - -### verifyDeprecation - -Verify the deprecation of a state update - - -```solidity -function verifyDeprecation(bytes calldata exit, bytes calldata inputUtxo, bytes calldata challengeData) external returns (bool); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`exit`|`bytes`|ABI encoded PlasmaExit data| -|`inputUtxo`|`bytes`|ABI encoded Input UTXO data| -|`challengeData`|`bytes`|RLP encoded data of the challenge reference tx that encodes the following fields headerNumber Header block number of which the reference tx was a part of blockProof Proof that the block header (in the child chain) is a leaf in the submitted merkle root blockNumber Block number of which the reference tx is a part of blockTime Reference tx block time blocktxRoot Transactions root of block blockReceiptsRoot Receipts root of block receipt Receipt of the reference transaction receiptProof Merkle proof of the reference receipt branchMask Merkle proof branchMask for the receipt logIndex Log Index to read from the receipt tx Challenge transaction txProof Merkle proof of the challenge tx| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`bool`|Whether or not the state is deprecated| - - -### interpretStateUpdate - - -```solidity -function interpretStateUpdate(bytes calldata state) external view returns (bytes memory b); -``` - -### startExitWithBurntTokens - - -```solidity -function startExitWithBurntTokens(bytes memory data) public returns (bytes memory); -``` - -### startExit - -Start an exit by referencing the preceding (reference) transaction - - -```solidity -function startExit(bytes memory data, bytes memory exitTx) public payable isBondProvided returns (bytes memory); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`data`|`bytes`|RLP encoded data of the reference tx(s) that encodes the following fields for each tx headerNumber Header block number of which the reference tx was a part of blockProof Proof that the block header (in the child chain) is a leaf in the submitted merkle root blockNumber Block number of which the reference tx is a part of blockTime Reference tx block time blocktxRoot Transactions root of block blockReceiptsRoot Receipts root of block receipt Receipt of the reference transaction receiptProof Merkle proof of the reference receipt branchMask Merkle proof branchMask for the receipt logIndex Log Index to read from the receipt| -|`exitTx`|`bytes`|Signed exit transaction| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`bytes`|abi encoded bytes array that encodes the following fields address rootToken: Token that the exit corresponds to uint256 tokenId: TokenId being exited address childToken: Child token that the exit corresponds to uint256 exitId| - - -### processReferenceTx - -Process the reference tx to start a MoreVP style exit - - -```solidity -function processReferenceTx(bytes memory receipt, uint256 logIndex, address participant, address childToken, uint256 tokenId, bool isChallenge) - internal - pure - returns (address rootToken, uint256 oIndex); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`receipt`|`bytes`|Receipt of the reference transaction| -|`logIndex`|`uint256`|Log Index to read from the receipt| -|`participant`|`address`|Either of exitor or a counterparty depending on the type of exit| -|`childToken`|`address`|| -|`tokenId`|`uint256`|| -|`isChallenge`|`bool`|| - - -### processStateUpdate - -Parse the state update and check if this predicate recognizes it - - -```solidity -function processStateUpdate(RLPReader.RLPItem[] memory inputItems, address participant) internal pure returns (uint256 oIndex); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`inputItems`|`RLPReader.RLPItem[]`|inputItems[i] refers to i-th (0-based) topic in the topics array in the log| -|`participant`|`address`|| - - -### processChallenge - -Parse the state update and check if this predicate recognizes it - - -```solidity -function processChallenge(RLPReader.RLPItem[] memory inputItems, address participant) internal pure; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`inputItems`|`RLPReader.RLPItem[]`|inputItems[i] refers to i-th (0-based) topic in the topics array in the log| -|`participant`|`address`|| - - -### processExitTx - -Process the transaction to start a MoreVP style exit from - - -```solidity -function processExitTx(bytes memory exitTx) internal view returns (ExitTxData memory txData); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`exitTx`|`bytes`|Signed exit transaction| - - -### processChallengeTx - -Process the challenge transaction - - -```solidity -function processChallengeTx(bytes memory challengeTx) internal pure returns (ExitTxData memory txData); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`challengeTx`|`bytes`|Challenge transaction| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|`txData`|`ExitTxData`|ExitTxData Parsed challenge transaction data| - - -### processExitTxSender - - -```solidity -function processExitTxSender(bytes memory txData) internal pure returns (uint256 tokenId, ExitType exitType); -``` - -### processExitTxCounterparty - - -```solidity -function processExitTxCounterparty(bytes memory txData) internal view returns (uint256 tokenId); -``` - diff --git a/docs/autogen/src/contracts/root/predicates/ERC721PredicateBurnOnly.sol/contract.ERC721PredicateBurnOnly.md b/docs/autogen/src/contracts/root/predicates/ERC721PredicateBurnOnly.sol/contract.ERC721PredicateBurnOnly.md deleted file mode 100644 index 2057ffb6..00000000 --- a/docs/autogen/src/contracts/root/predicates/ERC721PredicateBurnOnly.sol/contract.ERC721PredicateBurnOnly.md +++ /dev/null @@ -1,44 +0,0 @@ -# ERC721PredicateBurnOnly -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/root/predicates/ERC721PredicateBurnOnly.sol) - -**Inherits:** -[IErcPredicate](/contracts/root/predicates/IPredicate.sol/contract.IErcPredicate.md) - - -## State Variables -### WITHDRAW_EVENT_SIG - -```solidity -bytes32 constant WITHDRAW_EVENT_SIG = 0x9b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8eb; -``` - - -## Functions -### constructor - - -```solidity -constructor(address _withdrawManager, address _depositManager) public IErcPredicate(_withdrawManager, _depositManager); -``` - -### verifyDeprecation - - -```solidity -function verifyDeprecation(bytes calldata exit, bytes calldata inputUtxo, bytes calldata challengeData) external returns (bool); -``` - -### interpretStateUpdate - - -```solidity -function interpretStateUpdate(bytes calldata state) external view returns (bytes memory b); -``` - -### startExitWithBurntTokens - - -```solidity -function startExitWithBurntTokens(bytes memory data) public returns (bytes memory); -``` - diff --git a/docs/autogen/src/contracts/root/predicates/IPredicate.sol/contract.IErcPredicate.md b/docs/autogen/src/contracts/root/predicates/IPredicate.sol/contract.IErcPredicate.md deleted file mode 100644 index 86a12e27..00000000 --- a/docs/autogen/src/contracts/root/predicates/IPredicate.sol/contract.IErcPredicate.md +++ /dev/null @@ -1,59 +0,0 @@ -# IErcPredicate -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/root/predicates/IPredicate.sol) - -**Inherits:** -[IPredicate](/contracts/root/predicates/IPredicate.sol/interface.IPredicate.md), [PredicateUtils](/contracts/root/predicates/IPredicate.sol/contract.PredicateUtils.md) - - -## State Variables -### MAX_LOGS - -```solidity -uint256 internal constant MAX_LOGS = 10; -``` - - -## Functions -### constructor - - -```solidity -constructor(address _withdrawManager, address _depositManager) public; -``` - -## Structs -### ExitTxData - -```solidity -struct ExitTxData { - uint256 amountOrToken; - bytes32 txHash; - address childToken; - address signer; - ExitType exitType; -} -``` - -### ReferenceTxData - -```solidity -struct ReferenceTxData { - uint256 closingBalance; - uint256 age; - address childToken; - address rootToken; -} -``` - -## Enums -### ExitType - -```solidity -enum ExitType { - Invalid, - OutgoingTransfer, - IncomingTransfer, - Burnt -} -``` - diff --git a/docs/autogen/src/contracts/root/predicates/IPredicate.sol/contract.PredicateUtils.md b/docs/autogen/src/contracts/root/predicates/IPredicate.sol/contract.PredicateUtils.md deleted file mode 100644 index ca1d8bd3..00000000 --- a/docs/autogen/src/contracts/root/predicates/IPredicate.sol/contract.PredicateUtils.md +++ /dev/null @@ -1,86 +0,0 @@ -# PredicateUtils -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/root/predicates/IPredicate.sol) - -**Inherits:** -[ExitsDataStructure](/contracts/root/withdrawManager/WithdrawManagerStorage.sol/contract.ExitsDataStructure.md), [ChainIdMixin](/contracts/common/mixin/ChainIdMixin.sol/contract.ChainIdMixin.md) - - -## State Variables -### BOND_AMOUNT - -```solidity -uint256 private constant BOND_AMOUNT = 10 ** 17; -``` - - -### withdrawManager - -```solidity -IWithdrawManager internal withdrawManager; -``` - - -### depositManager - -```solidity -IDepositManager internal depositManager; -``` - - -## Functions -### onlyWithdrawManager - - -```solidity -modifier onlyWithdrawManager(); -``` - -### isBondProvided - - -```solidity -modifier isBondProvided(); -``` - -### onFinalizeExit - - -```solidity -function onFinalizeExit(bytes calldata data) external onlyWithdrawManager; -``` - -### sendBond - - -```solidity -function sendBond() internal; -``` - -### getAddressFromTx - - -```solidity -function getAddressFromTx(RLPReader.RLPItem[] memory txList) internal pure returns (address signer, bytes32 txHash); -``` - -### decodeExit - - -```solidity -function decodeExit(bytes memory data) internal pure returns (PlasmaExit memory); -``` - -### decodeExitForProcessExit - - -```solidity -function decodeExitForProcessExit(bytes memory data) internal pure returns (uint256 exitId, address token, address exitor, uint256 tokenId); -``` - -### decodeInputUtxo - - -```solidity -function decodeInputUtxo(bytes memory data) internal pure returns (uint256 age, address signer, address predicate, address token); -``` - diff --git a/docs/autogen/src/contracts/root/predicates/IPredicate.sol/interface.IPredicate.md b/docs/autogen/src/contracts/root/predicates/IPredicate.sol/interface.IPredicate.md deleted file mode 100644 index 01c5149c..00000000 --- a/docs/autogen/src/contracts/root/predicates/IPredicate.sol/interface.IPredicate.md +++ /dev/null @@ -1,42 +0,0 @@ -# IPredicate -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/root/predicates/IPredicate.sol) - - -## Functions -### verifyDeprecation - -Verify the deprecation of a state update - - -```solidity -function verifyDeprecation(bytes calldata exit, bytes calldata inputUtxo, bytes calldata challengeData) external returns (bool); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`exit`|`bytes`|ABI encoded PlasmaExit data| -|`inputUtxo`|`bytes`|ABI encoded Input UTXO data| -|`challengeData`|`bytes`|RLP encoded data of the challenge reference tx that encodes the following fields headerNumber Header block number of which the reference tx was a part of blockProof Proof that the block header (in the child chain) is a leaf in the submitted merkle root blockNumber Block number of which the reference tx is a part of blockTime Reference tx block time blocktxRoot Transactions root of block blockReceiptsRoot Receipts root of block receipt Receipt of the reference transaction receiptProof Merkle proof of the reference receipt branchMask Merkle proof branchMask for the receipt logIndex Log Index to read from the receipt tx Challenge transaction txProof Merkle proof of the challenge tx| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`bool`|Whether or not the state is deprecated| - - -### interpretStateUpdate - - -```solidity -function interpretStateUpdate(bytes calldata state) external view returns (bytes memory); -``` - -### onFinalizeExit - - -```solidity -function onFinalizeExit(bytes calldata data) external; -``` - diff --git a/docs/autogen/src/contracts/root/predicates/MarketplacePredicate.sol/contract.MarketplacePredicate.md b/docs/autogen/src/contracts/root/predicates/MarketplacePredicate.sol/contract.MarketplacePredicate.md deleted file mode 100644 index 186130a9..00000000 --- a/docs/autogen/src/contracts/root/predicates/MarketplacePredicate.sol/contract.MarketplacePredicate.md +++ /dev/null @@ -1,179 +0,0 @@ -# MarketplacePredicate -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/root/predicates/MarketplacePredicate.sol) - -**Inherits:** -[PredicateUtils](/contracts/root/predicates/IPredicate.sol/contract.PredicateUtils.md) - - -## State Variables -### EXECUTE_ORDER_FUNC_SIG - -```solidity -bytes4 constant EXECUTE_ORDER_FUNC_SIG = 0xe660b9e4; -``` - - -### registry - -```solidity -Registry public registry; -``` - - -### rootChain - -```solidity -IRootChain public rootChain; -``` - - -## Functions -### constructor - - -```solidity -constructor(address _rootChain, address _withdrawManager, address _registry) public; -``` - -### startExit - -Start an exit from in-flight marketplace tx - - -```solidity -function startExit(bytes calldata data, bytes calldata exitTx) external payable isBondProvided; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`data`|`bytes`|RLP encoded array of input utxos data[n] ( 1 < n <= 3) is abi encoded as (predicateAddress, RLP encoded reference tx) data[n][1] is RLP encoded reference tx that encodes the following fields headerNumber Header block number of which the reference tx was a part of blockProof Proof that the block header (in the child chain) is a leaf in the submitted merkle root blockNumber Block number of which the reference tx is a part of blockTime Reference tx block time blocktxRoot Transactions root of block blockReceiptsRoot Receipts root of block receipt Receipt of the reference transaction receiptProof Merkle proof of the reference receipt branchMask Merkle proof branchMask for the receipt logIndex Log Index to read from the receipt data[2] is the child token that the user wishes to start an exit for| -|`exitTx`|`bytes`| Signed (marketplace.executeOrder) exit transaction| - - -### verifyDeprecation - -Verify the deprecation of a state update - - -```solidity -function verifyDeprecation(bytes calldata exit, bytes calldata inputUtxo, bytes calldata challengeData) external view returns (bool); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`exit`|`bytes`|ABI encoded PlasmaExit data| -|`inputUtxo`|`bytes`|ABI encoded Input UTXO data| -|`challengeData`|`bytes`|RLP encoded data of the challenge reference tx that encodes the following fields headerNumber Header block number of which the reference tx was a part of blockProof Proof that the block header (in the child chain) is a leaf in the submitted merkle root blockNumber Block number of which the reference tx is a part of blockTime Reference tx block time blocktxRoot Transactions root of block blockReceiptsRoot Receipts root of block receipt Receipt of the reference transaction receiptProof Merkle proof of the reference receipt branchMask Merkle proof branchMask for the receipt logIndex Log Index to read from the receipt tx Challenge transaction txProof Merkle proof of the challenge tx| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`bool`|Whether or not the state is deprecated| - - -### getChildBlockNumberFromAge - - -```solidity -function getChildBlockNumberFromAge(uint256 age) internal pure returns (uint256); -``` - -### validateTokenBalance - - -```solidity -function validateTokenBalance(address childToken, address _childToken, uint256 closingBalance, uint256 amount) internal view; -``` - -### processLogTransferReceipt - - -```solidity -function processLogTransferReceipt(address predicate, bytes memory preState, address participant, bool verifyInclusionInCheckpoint, bool isChallenge) - internal - view - returns (ReferenceTxData memory _referenceTx); -``` - -### processExitTx - - -```solidity -function processExitTx(bytes memory exitTx, address tradeParticipant) internal pure returns (ExitTxData memory txData); -``` - -### verifySignatures - - -```solidity -function verifySignatures(ExecuteOrderData memory executeOrder, address marketplaceContract, address tradeParticipant) - internal - pure - returns (ExitTxData memory); -``` - -### decodeExecuteOrder - - -```solidity -function decodeExecuteOrder(bytes memory orderData) internal pure returns (bytes4 funcSig, ExecuteOrderData memory order); -``` - -### decodeOrder - - -```solidity -function decodeOrder(bytes memory data) internal pure returns (Order memory order); -``` - -## Structs -### ExecuteOrderData - -```solidity -struct ExecuteOrderData { - bytes data1; - bytes data2; - bytes32 orderId; - uint256 expiration; - address taker; -} -``` - -### Order - -```solidity -struct Order { - address token; - bytes sig; - uint256 amount; -} -``` - -### ExitTxData - -```solidity -struct ExitTxData { - uint256 amount1; - uint256 amount2; - address token1; - address token2; - address counterParty; - bytes32 txHash; - uint256 expiration; -} -``` - -### ReferenceTxData - -```solidity -struct ReferenceTxData { - uint256 closingBalance; - uint256 age; - address childToken; - address rootToken; -} -``` - diff --git a/docs/autogen/src/contracts/root/predicates/MintableERC721Predicate.sol/contract.MintableERC721Predicate.md b/docs/autogen/src/contracts/root/predicates/MintableERC721Predicate.sol/contract.MintableERC721Predicate.md deleted file mode 100644 index 99a70287..00000000 --- a/docs/autogen/src/contracts/root/predicates/MintableERC721Predicate.sol/contract.MintableERC721Predicate.md +++ /dev/null @@ -1,135 +0,0 @@ -# MintableERC721Predicate -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/root/predicates/MintableERC721Predicate.sol) - -**Inherits:** -[ERC721Predicate](/contracts/root/predicates/ERC721Predicate.sol/contract.ERC721Predicate.md) - - -## State Variables -### exitToMintableTokenInfo - -```solidity -mapping(uint256 => MintableTokenInfo) public exitToMintableTokenInfo; -``` - - -## Functions -### constructor - - -```solidity -constructor(address _withdrawManager, address _depositManager) public ERC721Predicate(_withdrawManager, _depositManager); -``` - -### startExitForMintableBurntToken - -Start an exit for a token that was minted and burnt on the side chain - - -```solidity -function startExitForMintableBurntToken(bytes calldata data, bytes calldata mintTx) external; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`data`|`bytes`|RLP encoded data of the burn tx| -|`mintTx`|`bytes`|Signed mint transaction| - - -### startExitForMintableToken - -Start a MoreVP style exit for a token that was minted on the side chain - - -```solidity -function startExitForMintableToken(bytes calldata data, bytes calldata mintTx, bytes calldata exitTx) external payable; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`data`|`bytes`|RLP encoded data of the burn tx| -|`mintTx`|`bytes`|Signed mint transaction| -|`exitTx`|`bytes`|| - - -### startExitForMetadataMintableBurntToken - -Start an exit for a token with metadata that was minted and burnt on the side chain - - -```solidity -function startExitForMetadataMintableBurntToken(bytes calldata data, bytes calldata mintTx) external; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`data`|`bytes`|RLP encoded data of the burn tx| -|`mintTx`|`bytes`|Signed mint transaction| - - -### startExitForMetadataMintableToken - -Start a MoreVP style exit for a token with metadata that was minted on the side chain - - -```solidity -function startExitForMetadataMintableToken(bytes calldata data, bytes calldata mintTx, bytes calldata exitTx) external payable; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`data`|`bytes`|RLP encoded data of the burn tx| -|`mintTx`|`bytes`|Signed mint transaction| -|`exitTx`|`bytes`|Signed exit transaction| - - -### onFinalizeExit - - -```solidity -function onFinalizeExit(bytes calldata data) external onlyWithdrawManager; -``` - -### processMint - - -```solidity -function processMint(bytes memory mintTx, address rootToken, uint256 tokenId, address childToken, uint256 exitId) internal; -``` - -### _processRawMint - - -```solidity -function _processRawMint(bytes memory txData, uint256 tokenId) internal pure; -``` - -### processMintWithTokenURI - - -```solidity -function processMintWithTokenURI(bytes memory mintTx, address rootToken, uint256 tokenId, address childToken, uint256 exitId) internal; -``` - -### _processRawMintWithTokenURI - - -```solidity -function _processRawMintWithTokenURI(bytes memory txData, uint256 tokenId) internal pure returns (string memory uri); -``` - -## Structs -### MintableTokenInfo - -```solidity -struct MintableTokenInfo { - string uri; - address minter; - bool isVanillaMint; -} -``` - diff --git a/docs/autogen/src/contracts/root/predicates/README.md b/docs/autogen/src/contracts/root/predicates/README.md deleted file mode 100644 index 87cec9a7..00000000 --- a/docs/autogen/src/contracts/root/predicates/README.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# Contents -- [ERC20Predicate](ERC20Predicate.sol/contract.ERC20Predicate.md) -- [ERC20PredicateBurnOnly](ERC20PredicateBurnOnly.sol/contract.ERC20PredicateBurnOnly.md) -- [ERC721Predicate](ERC721Predicate.sol/contract.ERC721Predicate.md) -- [ERC721PredicateBurnOnly](ERC721PredicateBurnOnly.sol/contract.ERC721PredicateBurnOnly.md) -- [IPredicate](IPredicate.sol/interface.IPredicate.md) -- [PredicateUtils](IPredicate.sol/contract.PredicateUtils.md) -- [IErcPredicate](IPredicate.sol/contract.IErcPredicate.md) -- [MarketplacePredicate](MarketplacePredicate.sol/contract.MarketplacePredicate.md) -- [MintableERC721Predicate](MintableERC721Predicate.sol/contract.MintableERC721Predicate.md) -- [TransferWithSigPredicate](TransferWithSigPredicate.sol/contract.TransferWithSigPredicate.md) -- [TransferWithSigUtils](TransferWithSigUtils.sol/library.TransferWithSigUtils.md) diff --git a/docs/autogen/src/contracts/root/predicates/TransferWithSigPredicate.sol/contract.TransferWithSigPredicate.md b/docs/autogen/src/contracts/root/predicates/TransferWithSigPredicate.sol/contract.TransferWithSigPredicate.md deleted file mode 100644 index 98012424..00000000 --- a/docs/autogen/src/contracts/root/predicates/TransferWithSigPredicate.sol/contract.TransferWithSigPredicate.md +++ /dev/null @@ -1,154 +0,0 @@ -# TransferWithSigPredicate -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/root/predicates/TransferWithSigPredicate.sol) - -**Inherits:** -[PredicateUtils](/contracts/root/predicates/IPredicate.sol/contract.PredicateUtils.md) - - -## State Variables -### TRANSFER_WITH_SIG_FUNC_SIG - -```solidity -bytes4 constant TRANSFER_WITH_SIG_FUNC_SIG = 0x19d27d9c; -``` - - -### registry - -```solidity -Registry public registry; -``` - - -### rootChain - -```solidity -IRootChain public rootChain; -``` - - -## Functions -### constructor - - -```solidity -constructor(address _rootChain, address _withdrawManager, address _registry) public; -``` - -### startExitForOutgoingErc20Transfer - -Start an exit from in-flight transferWithSig tx while referencing the exitor's pre-existing balance on the chain for the token - - -```solidity -function startExitForOutgoingErc20Transfer(bytes calldata data, bytes calldata exitTx) external payable isBondProvided; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`data`|`bytes`|RLP encoded array of 1 input utxo (data format is to keep it consistent with other startExit methods) data[0] should be the exitor's proof-of-funds and encodes the following fields headerNumber Header block number of which the reference tx was a part of blockProof Proof that the block header (in the child chain) is a leaf in the submitted merkle root blockNumber Block number of which the reference tx is a part of blockTime Reference tx block time blocktxRoot Transactions root of block blockReceiptsRoot Receipts root of block receipt Receipt of the reference transaction receiptProof Merkle proof of the reference receipt branchMask Merkle proof branchMask for the receipt logIndex Log Index to read from the receipt| -|`exitTx`|`bytes`|ERC20 transfer executed using a transferWithSig| - - -### startExitForIncomingErc20Transfer - -Start an exit from in-flight transferWithSig tx while also referencing the exitor's pre-existing balance on the chain for the token - - -```solidity -function startExitForIncomingErc20Transfer(bytes calldata data, bytes calldata exitTx) external payable isBondProvided; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`data`|`bytes`|RLP encoded array of 2 input utxos data[0] should be the counterparty's proof-of-funds data[1] should be the exitor's proof-of-funds data[n] encodes the following fields headerNumber Header block number of which the reference tx was a part of blockProof Proof that the block header (in the child chain) is a leaf in the submitted merkle root blockNumber Block number of which the reference tx is a part of blockTime Reference tx block time blocktxRoot Transactions root of block blockReceiptsRoot Receipts root of block receipt Receipt of the reference transaction receiptProof Merkle proof of the reference receipt branchMask Merkle proof branchMask for the receipt logIndex Log Index to read from the receipt| -|`exitTx`|`bytes`|ERC20 transfer executed using a transferWithSig| - - -### verifyDeprecation - -Verify the deprecation of a state update - - -```solidity -function verifyDeprecation(bytes calldata exit, bytes calldata inputUtxo, bytes calldata challengeData) external view returns (bool); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`exit`|`bytes`|ABI encoded PlasmaExit data| -|`inputUtxo`|`bytes`|ABI encoded Input UTXO data| -|`challengeData`|`bytes`|RLP encoded data of the challenge reference tx that encodes the following fields headerNumber Header block number of which the reference tx was a part of blockProof Proof that the block header (in the child chain) is a leaf in the submitted merkle root blockNumber Block number of which the reference tx is a part of blockTime Reference tx block time blocktxRoot Transactions root of block blockReceiptsRoot Receipts root of block receipt Receipt of the reference transaction receiptProof Merkle proof of the reference receipt branchMask Merkle proof branchMask for the receipt logIndex Log Index to read from the receipt tx Challenge transaction txProof Merkle proof of the challenge tx| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`bool`|Whether or not the state is deprecated| - - -### getChildBlockNumberFromAge - - -```solidity -function getChildBlockNumberFromAge(uint256 age) internal pure returns (uint256); -``` - -### processLogTransferReceipt - - -```solidity -function processLogTransferReceipt(address predicate, bytes memory preState, address participant, bool verifyInclusionInCheckpoint, bool isChallenge) - internal - view - returns (ReferenceTxData memory _referenceTx); -``` - -### processExitTx - -Process the challenge transaction - - -```solidity -function processExitTx(bytes memory exitTx) internal pure returns (ExitTxData memory txData, uint256 expiration); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`exitTx`|`bytes`|Challenge transaction| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|`txData`|`ExitTxData`|ExitTxData Parsed challenge transaction data| -|`expiration`|`uint256`|| - - -## Structs -### ReferenceTxData - -```solidity -struct ReferenceTxData { - uint256 closingBalance; - uint256 age; - address childToken; - address rootToken; -} -``` - -### ExitTxData - -```solidity -struct ExitTxData { - uint256 amountOrToken; - bytes32 txHash; - address childToken; - address signer; -} -``` - diff --git a/docs/autogen/src/contracts/root/predicates/TransferWithSigUtils.sol/library.TransferWithSigUtils.md b/docs/autogen/src/contracts/root/predicates/TransferWithSigUtils.sol/library.TransferWithSigUtils.md deleted file mode 100644 index 1b7eb899..00000000 --- a/docs/autogen/src/contracts/root/predicates/TransferWithSigUtils.sol/library.TransferWithSigUtils.md +++ /dev/null @@ -1,26 +0,0 @@ -# TransferWithSigUtils -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/root/predicates/TransferWithSigUtils.sol) - - -## Functions -### getTokenTransferOrderHash - - -```solidity -function getTokenTransferOrderHash(address token, address spender, uint256 amount, bytes32 data, uint256 expiration) public pure returns (bytes32 orderHash); -``` - -### hashTokenTransferOrder - - -```solidity -function hashTokenTransferOrder(address spender, uint256 amount, bytes32 data, uint256 expiration) internal pure returns (bytes32 result); -``` - -### hashEIP712Message - - -```solidity -function hashEIP712Message(address token, bytes32 hashStruct) internal pure returns (bytes32 result); -``` - diff --git a/docs/autogen/src/contracts/root/stateSyncer/README.md b/docs/autogen/src/contracts/root/stateSyncer/README.md deleted file mode 100644 index fedaaa0e..00000000 --- a/docs/autogen/src/contracts/root/stateSyncer/README.md +++ /dev/null @@ -1,4 +0,0 @@ - - -# Contents -- [StateSender](StateSender.sol/contract.StateSender.md) diff --git a/docs/autogen/src/contracts/root/stateSyncer/StateSender.sol/contract.StateSender.md b/docs/autogen/src/contracts/root/stateSyncer/StateSender.sol/contract.StateSender.md deleted file mode 100644 index cbac4f8d..00000000 --- a/docs/autogen/src/contracts/root/stateSyncer/StateSender.sol/contract.StateSender.md +++ /dev/null @@ -1,63 +0,0 @@ -# StateSender -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/root/stateSyncer/StateSender.sol) - -**Inherits:** -Ownable - - -## State Variables -### counter - -```solidity -uint256 public counter; -``` - - -### registrations - -```solidity -mapping(address => address) public registrations; -``` - - -## Functions -### onlyRegistered - - -```solidity -modifier onlyRegistered(address receiver); -``` - -### syncState - - -```solidity -function syncState(address receiver, bytes calldata data) external onlyRegistered(receiver); -``` - -### register - - -```solidity -function register(address sender, address receiver) public; -``` - -## Events -### NewRegistration - -```solidity -event NewRegistration(address indexed user, address indexed sender, address indexed receiver); -``` - -### RegistrationUpdated - -```solidity -event RegistrationUpdated(address indexed user, address indexed sender, address indexed receiver); -``` - -### StateSynced - -```solidity -event StateSynced(uint256 indexed id, address indexed contractAddress, bytes data); -``` - diff --git a/docs/autogen/src/contracts/root/withdrawManager/ExitNFT.sol/contract.ExitNFT.md b/docs/autogen/src/contracts/root/withdrawManager/ExitNFT.sol/contract.ExitNFT.md deleted file mode 100644 index c01476b4..00000000 --- a/docs/autogen/src/contracts/root/withdrawManager/ExitNFT.sol/contract.ExitNFT.md +++ /dev/null @@ -1,51 +0,0 @@ -# ExitNFT -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/root/withdrawManager/ExitNFT.sol) - -**Inherits:** -ERC721 - - -## State Variables -### registry - -```solidity -Registry internal registry; -``` - - -## Functions -### onlyWithdrawManager - - -```solidity -modifier onlyWithdrawManager(); -``` - -### constructor - - -```solidity -constructor(address _registry) public; -``` - -### mint - - -```solidity -function mint(address _owner, uint256 _tokenId) external onlyWithdrawManager; -``` - -### burn - - -```solidity -function burn(uint256 _tokenId) external onlyWithdrawManager; -``` - -### exists - - -```solidity -function exists(uint256 tokenId) public view returns (bool); -``` - diff --git a/docs/autogen/src/contracts/root/withdrawManager/IWithdrawManager.sol/contract.IWithdrawManager.md b/docs/autogen/src/contracts/root/withdrawManager/IWithdrawManager.sol/contract.IWithdrawManager.md deleted file mode 100644 index 43cb154e..00000000 --- a/docs/autogen/src/contracts/root/withdrawManager/IWithdrawManager.sol/contract.IWithdrawManager.md +++ /dev/null @@ -1,48 +0,0 @@ -# IWithdrawManager -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/root/withdrawManager/IWithdrawManager.sol) - - -## Functions -### createExitQueue - - -```solidity -function createExitQueue(address token) external; -``` - -### verifyInclusion - - -```solidity -function verifyInclusion(bytes calldata data, uint8 offset, bool verifyTxInclusion) external view returns (uint256 age); -``` - -### addExitToQueue - - -```solidity -function addExitToQueue( - address exitor, - address childToken, - address rootToken, - uint256 exitAmountOrTokenId, - bytes32 txHash, - bool isRegularExit, - uint256 priority -) external; -``` - -### addInput - - -```solidity -function addInput(uint256 exitId, uint256 age, address utxoOwner, address token) external; -``` - -### challengeExit - - -```solidity -function challengeExit(uint256 exitId, uint256 inputId, bytes calldata challengeData, address adjudicatorPredicate) external; -``` - diff --git a/docs/autogen/src/contracts/root/withdrawManager/README.md b/docs/autogen/src/contracts/root/withdrawManager/README.md deleted file mode 100644 index cb629c15..00000000 --- a/docs/autogen/src/contracts/root/withdrawManager/README.md +++ /dev/null @@ -1,10 +0,0 @@ - - -# Contents -- [ExitNFT](ExitNFT.sol/contract.ExitNFT.md) -- [IWithdrawManager](IWithdrawManager.sol/contract.IWithdrawManager.md) -- [WithdrawManager](WithdrawManager.sol/contract.WithdrawManager.md) -- [WithdrawManagerProxy](WithdrawManagerProxy.sol/contract.WithdrawManagerProxy.md) -- [ExitsDataStructure](WithdrawManagerStorage.sol/contract.ExitsDataStructure.md) -- [WithdrawManagerHeader](WithdrawManagerStorage.sol/contract.WithdrawManagerHeader.md) -- [WithdrawManagerStorage](WithdrawManagerStorage.sol/contract.WithdrawManagerStorage.md) diff --git a/docs/autogen/src/contracts/root/withdrawManager/WithdrawManager.sol/contract.WithdrawManager.md b/docs/autogen/src/contracts/root/withdrawManager/WithdrawManager.sol/contract.WithdrawManager.md deleted file mode 100644 index 8c7976c2..00000000 --- a/docs/autogen/src/contracts/root/withdrawManager/WithdrawManager.sol/contract.WithdrawManager.md +++ /dev/null @@ -1,224 +0,0 @@ -# WithdrawManager -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/root/withdrawManager/WithdrawManager.sol) - -**Inherits:** -[WithdrawManagerStorage](/contracts/root/withdrawManager/WithdrawManagerStorage.sol/contract.WithdrawManagerStorage.md), [IWithdrawManager](/contracts/root/withdrawManager/IWithdrawManager.sol/contract.IWithdrawManager.md) - - -## Functions -### isBondProvided - - -```solidity -modifier isBondProvided(); -``` - -### isPredicateAuthorized - - -```solidity -modifier isPredicateAuthorized(); -``` - -### checkPredicateAndTokenMapping - - -```solidity -modifier checkPredicateAndTokenMapping(address rootToken); -``` - -### function - -*Receive bond for bonded exits* - - -```solidity -function() external payable; -``` - -### createExitQueue - - -```solidity -function createExitQueue(address token) external; -``` - -### verifyInclusion - -*Verify the inclusion of the receipt in the checkpoint* - - -```solidity -function verifyInclusion(bytes calldata data, uint8 offset, bool verifyTxInclusion) external view returns (uint256); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`data`|`bytes`|RLP encoded data of the reference tx(s) that encodes the following fields for each tx headerNumber Header block number of which the reference tx was a part of blockProof Proof that the block header (in the child chain) is a leaf in the submitted merkle root blockNumber Block number of which the reference tx is a part of blockTime Reference tx block time blocktxRoot Transactions root of block blockReceiptsRoot Receipts root of block receipt Receipt of the reference transaction receiptProof Merkle proof of the reference receipt branchMask Merkle proof branchMask for the receipt logIndex Log Index to read from the receipt| -|`offset`|`uint8`|offset in the data array| -|`verifyTxInclusion`|`bool`|Whether to also verify the inclusion of the raw tx in the txRoot| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`uint256`|ageOfInput Measure of the position of the receipt and the log in the child chain| - - -### startExitWithDepositedTokens - - -```solidity -function startExitWithDepositedTokens(uint256 depositId, address token, uint256 amountOrToken) external payable isBondProvided; -``` - -### addExitToQueue - - -```solidity -function addExitToQueue( - address exitor, - address childToken, - address rootToken, - uint256 exitAmountOrTokenId, - bytes32 txHash, - bool isRegularExit, - uint256 priority -) external checkPredicateAndTokenMapping(rootToken); -``` - -### challengeExit - - -```solidity -function challengeExit(uint256 exitId, uint256 inputId, bytes calldata challengeData, address adjudicatorPredicate) external; -``` - -### processExits - - -```solidity -function processExits(address _token) public; -``` - -### processExitsBatch - - -```solidity -function processExitsBatch(address[] calldata _tokens) external; -``` - -### addInput - -*Add a state update (UTXO style input) to an exit* - - -```solidity -function addInput(uint256 exitId, uint256 age, address utxoOwner, address token) external isPredicateAuthorized; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`exitId`|`uint256`|Exit ID| -|`age`|`uint256`|age of the UTXO style input| -|`utxoOwner`|`address`|User for whom the input acts as a proof-of-funds (alternate expression) User who could have potentially spent this UTXO| -|`token`|`address`|Token (Think of it like Utxo color)| - - -### _addInput - - -```solidity -function _addInput(uint256 exitId, uint256 age, address utxoOwner, address predicate, address token) internal; -``` - -### encodeExit - - -```solidity -function encodeExit(PlasmaExit storage exit) internal view returns (bytes memory); -``` - -### encodeExitForProcessExit - - -```solidity -function encodeExitForProcessExit(uint256 exitId) internal view returns (bytes memory); -``` - -### encodeInputUtxo - - -```solidity -function encodeInputUtxo(uint256 age, Input storage input) internal view returns (bytes memory); -``` - -### _addExitToQueue - - -```solidity -function _addExitToQueue(address exitor, address rootToken, uint256 exitAmountOrTokenId, bytes32 txHash, bool isRegularExit, uint256 exitId, address predicate) - internal; -``` - -### checkBlockMembershipInCheckpoint - - -```solidity -function checkBlockMembershipInCheckpoint( - uint256 blockNumber, - uint256 blockTime, - bytes32 txRoot, - bytes32 receiptRoot, - uint256 headerNumber, - bytes memory blockProof -) internal view returns (uint256); -``` - -### getKey - - -```solidity -function getKey(address token, address exitor, uint256 amountOrToken) internal view returns (bytes32 key); -``` - -### getDepositManager - - -```solidity -function getDepositManager() internal view returns (DepositManager); -``` - -### getExitableAt - - -```solidity -function getExitableAt(uint256 createdAt) internal view returns (uint256); -``` - -### updateExitPeriod - - -```solidity -function updateExitPeriod(uint256 halfExitPeriod) public onlyOwner; -``` - -## Structs -### VerifyInclusionVars -During coverage tests verifyInclusion fails co compile with "stack too deep" error. - - -```solidity -struct VerifyInclusionVars { - uint256 headerNumber; - uint256 blockNumber; - uint256 createdAt; - uint256 branchMask; - bytes32 txRoot; - bytes32 receiptRoot; - bytes branchMaskBytes; -} -``` - diff --git a/docs/autogen/src/contracts/root/withdrawManager/WithdrawManagerProxy.sol/contract.WithdrawManagerProxy.md b/docs/autogen/src/contracts/root/withdrawManager/WithdrawManagerProxy.sol/contract.WithdrawManagerProxy.md deleted file mode 100644 index cf78de95..00000000 --- a/docs/autogen/src/contracts/root/withdrawManager/WithdrawManagerProxy.sol/contract.WithdrawManagerProxy.md +++ /dev/null @@ -1,15 +0,0 @@ -# WithdrawManagerProxy -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/root/withdrawManager/WithdrawManagerProxy.sol) - -**Inherits:** -[Proxy](/contracts/common/misc/Proxy.sol/contract.Proxy.md), [WithdrawManagerStorage](/contracts/root/withdrawManager/WithdrawManagerStorage.sol/contract.WithdrawManagerStorage.md) - - -## Functions -### constructor - - -```solidity -constructor(address _proxyTo, address _registry, address _rootChain, address _exitNft) public Proxy(_proxyTo); -``` - diff --git a/docs/autogen/src/contracts/root/withdrawManager/WithdrawManagerStorage.sol/contract.ExitsDataStructure.md b/docs/autogen/src/contracts/root/withdrawManager/WithdrawManagerStorage.sol/contract.ExitsDataStructure.md deleted file mode 100644 index 46c48c95..00000000 --- a/docs/autogen/src/contracts/root/withdrawManager/WithdrawManagerStorage.sol/contract.ExitsDataStructure.md +++ /dev/null @@ -1,29 +0,0 @@ -# ExitsDataStructure -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/root/withdrawManager/WithdrawManagerStorage.sol) - - -## Structs -### Input - -```solidity -struct Input { - address utxoOwner; - address predicate; - address token; -} -``` - -### PlasmaExit - -```solidity -struct PlasmaExit { - uint256 receiptAmountOrNFTId; - bytes32 txHash; - address owner; - address token; - bool isRegularExit; - address predicate; - mapping(uint256 => Input) inputs; -} -``` - diff --git a/docs/autogen/src/contracts/root/withdrawManager/WithdrawManagerStorage.sol/contract.WithdrawManagerHeader.md b/docs/autogen/src/contracts/root/withdrawManager/WithdrawManagerStorage.sol/contract.WithdrawManagerHeader.md deleted file mode 100644 index d654f3ea..00000000 --- a/docs/autogen/src/contracts/root/withdrawManager/WithdrawManagerStorage.sol/contract.WithdrawManagerHeader.md +++ /dev/null @@ -1,38 +0,0 @@ -# WithdrawManagerHeader -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/root/withdrawManager/WithdrawManagerStorage.sol) - -**Inherits:** -[ExitsDataStructure](/contracts/root/withdrawManager/WithdrawManagerStorage.sol/contract.ExitsDataStructure.md) - - -## Events -### Withdraw - -```solidity -event Withdraw(uint256 indexed exitId, address indexed user, address indexed token, uint256 amount); -``` - -### ExitStarted - -```solidity -event ExitStarted(address indexed exitor, uint256 indexed exitId, address indexed token, uint256 amount, bool isRegularExit); -``` - -### ExitUpdated - -```solidity -event ExitUpdated(uint256 indexed exitId, uint256 indexed age, address signer); -``` - -### ExitPeriodUpdate - -```solidity -event ExitPeriodUpdate(uint256 indexed oldExitPeriod, uint256 indexed newExitPeriod); -``` - -### ExitCancelled - -```solidity -event ExitCancelled(uint256 indexed exitId); -``` - diff --git a/docs/autogen/src/contracts/root/withdrawManager/WithdrawManagerStorage.sol/contract.WithdrawManagerStorage.md b/docs/autogen/src/contracts/root/withdrawManager/WithdrawManagerStorage.sol/contract.WithdrawManagerStorage.md deleted file mode 100644 index e56601ed..00000000 --- a/docs/autogen/src/contracts/root/withdrawManager/WithdrawManagerStorage.sol/contract.WithdrawManagerStorage.md +++ /dev/null @@ -1,85 +0,0 @@ -# WithdrawManagerStorage -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/root/withdrawManager/WithdrawManagerStorage.sol) - -**Inherits:** -[ProxyStorage](/contracts/common/misc/ProxyStorage.sol/contract.ProxyStorage.md), [WithdrawManagerHeader](/contracts/root/withdrawManager/WithdrawManagerStorage.sol/contract.WithdrawManagerHeader.md) - - -## State Variables -### HALF_EXIT_PERIOD - -```solidity -uint256 public HALF_EXIT_PERIOD = 302_400; -``` - - -### BOND_AMOUNT - -```solidity -uint256 internal constant BOND_AMOUNT = 10 ** 17; -``` - - -### registry - -```solidity -Registry internal registry; -``` - - -### rootChain - -```solidity -RootChain internal rootChain; -``` - - -### isKnownExit - -```solidity -mapping(uint128 => bool) isKnownExit; -``` - - -### exits - -```solidity -mapping(uint256 => PlasmaExit) public exits; -``` - - -### ownerExits - -```solidity -mapping(bytes32 => uint256) public ownerExits; -``` - - -### exitsQueues - -```solidity -mapping(address => address) public exitsQueues; -``` - - -### exitNft - -```solidity -ExitNFT public exitNft; -``` - - -### ON_FINALIZE_GAS_LIMIT - -```solidity -uint32 public ON_FINALIZE_GAS_LIMIT = 300_000; -``` - - -### exitWindow - -```solidity -uint256 public exitWindow; -``` - - diff --git a/docs/autogen/src/contracts/staking/EventsHub.sol/contract.EventsHub.md b/docs/autogen/src/contracts/staking/EventsHub.sol/contract.EventsHub.md deleted file mode 100644 index 9fdfad88..00000000 --- a/docs/autogen/src/contracts/staking/EventsHub.sol/contract.EventsHub.md +++ /dev/null @@ -1,103 +0,0 @@ -# EventsHub -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/staking/EventsHub.sol) - -**Inherits:** -[Initializable](/contracts/common/mixin/Initializable.sol/contract.Initializable.md) - - -## State Variables -### registry - -```solidity -Registry public registry; -``` - - -## Functions -### onlyValidatorContract - - -```solidity -modifier onlyValidatorContract(uint256 validatorId); -``` - -### onlyStakeManager - - -```solidity -modifier onlyStakeManager(); -``` - -### initialize - - -```solidity -function initialize(Registry _registry) external initializer; -``` - -### logShareBurnedWithId - - -```solidity -function logShareBurnedWithId(uint256 validatorId, address user, uint256 amount, uint256 tokens, uint256 nonce) public onlyValidatorContract(validatorId); -``` - -### logDelegatorUnstakedWithId - - -```solidity -function logDelegatorUnstakedWithId(uint256 validatorId, address user, uint256 amount, uint256 nonce) public onlyValidatorContract(validatorId); -``` - -### logRewardParams - - -```solidity -function logRewardParams(uint256 rewardDecreasePerCheckpoint, uint256 maxRewardedCheckpoints, uint256 checkpointRewardDelta) public onlyStakeManager; -``` - -### logUpdateCommissionRate - - -```solidity -function logUpdateCommissionRate(uint256 validatorId, uint256 newCommissionRate, uint256 oldCommissionRate) public onlyStakeManager; -``` - -### logSharesTransfer - - -```solidity -function logSharesTransfer(uint256 validatorId, address from, address to, uint256 value) public onlyValidatorContract(validatorId); -``` - -## Events -### ShareBurnedWithId - -```solidity -event ShareBurnedWithId(uint256 indexed validatorId, address indexed user, uint256 indexed amount, uint256 tokens, uint256 nonce); -``` - -### DelegatorUnstakeWithId - -```solidity -event DelegatorUnstakeWithId(uint256 indexed validatorId, address indexed user, uint256 amount, uint256 nonce); -``` - -### RewardParams - -```solidity -event RewardParams(uint256 rewardDecreasePerCheckpoint, uint256 maxRewardedCheckpoints, uint256 checkpointRewardDelta); -``` - -### UpdateCommissionRate - -```solidity -event UpdateCommissionRate(uint256 indexed validatorId, uint256 indexed newCommissionRate, uint256 indexed oldCommissionRate); -``` - -### SharesTransfer - -```solidity -event SharesTransfer(uint256 indexed validatorId, address indexed from, address indexed to, uint256 value); -``` - diff --git a/docs/autogen/src/contracts/staking/EventsHub.sol/contract.IStakeManagerEventsHub.md b/docs/autogen/src/contracts/staking/EventsHub.sol/contract.IStakeManagerEventsHub.md deleted file mode 100644 index ea2fe04f..00000000 --- a/docs/autogen/src/contracts/staking/EventsHub.sol/contract.IStakeManagerEventsHub.md +++ /dev/null @@ -1,27 +0,0 @@ -# IStakeManagerEventsHub -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/staking/EventsHub.sol) - - -## State Variables -### validators - -```solidity -mapping(uint256 => Validator) public validators; -``` - - -## Structs -### Validator - -```solidity -struct Validator { - uint256 amount; - uint256 reward; - uint256 activationEpoch; - uint256 deactivationEpoch; - uint256 jailTime; - address signer; - address contractAddress; -} -``` - diff --git a/docs/autogen/src/contracts/staking/EventsHubProxy.sol/contract.EventsHubProxy.md b/docs/autogen/src/contracts/staking/EventsHubProxy.sol/contract.EventsHubProxy.md deleted file mode 100644 index 3fcde677..00000000 --- a/docs/autogen/src/contracts/staking/EventsHubProxy.sol/contract.EventsHubProxy.md +++ /dev/null @@ -1,15 +0,0 @@ -# EventsHubProxy -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/staking/EventsHubProxy.sol) - -**Inherits:** -[UpgradableProxy](/contracts/common/misc/UpgradableProxy.sol/contract.UpgradableProxy.md) - - -## Functions -### constructor - - -```solidity -constructor(address _proxyTo) public UpgradableProxy(_proxyTo); -``` - diff --git a/docs/autogen/src/contracts/staking/README.md b/docs/autogen/src/contracts/staking/README.md deleted file mode 100644 index ae4f565e..00000000 --- a/docs/autogen/src/contracts/staking/README.md +++ /dev/null @@ -1,11 +0,0 @@ - - -# Contents -- [slashing](/contracts/staking/slashing) -- [stakeManager](/contracts/staking/stakeManager) -- [validatorShare](/contracts/staking/validatorShare) -- [IStakeManagerEventsHub](EventsHub.sol/contract.IStakeManagerEventsHub.md) -- [EventsHub](EventsHub.sol/contract.EventsHub.md) -- [EventsHubProxy](EventsHubProxy.sol/contract.EventsHubProxy.md) -- [IStakeManagerLocal](StakingInfo.sol/contract.IStakeManagerLocal.md) -- [StakingInfo](StakingInfo.sol/contract.StakingInfo.md) diff --git a/docs/autogen/src/contracts/staking/StakingInfo.sol/contract.IStakeManagerLocal.md b/docs/autogen/src/contracts/staking/StakingInfo.sol/contract.IStakeManagerLocal.md deleted file mode 100644 index 97a0b660..00000000 --- a/docs/autogen/src/contracts/staking/StakingInfo.sol/contract.IStakeManagerLocal.md +++ /dev/null @@ -1,83 +0,0 @@ -# IStakeManagerLocal -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/staking/StakingInfo.sol) - - -## State Variables -### validators - -```solidity -mapping(uint256 => Validator) public validators; -``` - - -### accountStateRoot - -```solidity -bytes32 public accountStateRoot; -``` - - -### activeAmount - -```solidity -uint256 public activeAmount; -``` - - -### validatorRewards - -```solidity -uint256 public validatorRewards; -``` - - -## Functions -### currentValidatorSetTotalStake - - -```solidity -function currentValidatorSetTotalStake() public view returns (uint256); -``` - -### signerToValidator - - -```solidity -function signerToValidator(address validatorAddress) public view returns (uint256); -``` - -### isValidator - - -```solidity -function isValidator(uint256 validatorId) public view returns (bool); -``` - -## Structs -### Validator - -```solidity -struct Validator { - uint256 amount; - uint256 reward; - uint256 activationEpoch; - uint256 deactivationEpoch; - uint256 jailTime; - address signer; - address contractAddress; - Status status; -} -``` - -## Enums -### Status - -```solidity -enum Status { - Inactive, - Active, - Locked, - Unstaked -} -``` - diff --git a/docs/autogen/src/contracts/staking/StakingInfo.sol/contract.StakingInfo.md b/docs/autogen/src/contracts/staking/StakingInfo.sol/contract.StakingInfo.md deleted file mode 100644 index 087e045c..00000000 --- a/docs/autogen/src/contracts/staking/StakingInfo.sol/contract.StakingInfo.md +++ /dev/null @@ -1,472 +0,0 @@ -# StakingInfo -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/staking/StakingInfo.sol) - -**Inherits:** -Ownable - - -## State Variables -### validatorNonce - -```solidity -mapping(uint256 => uint256) public validatorNonce; -``` - - -### registry - -```solidity -Registry public registry; -``` - - -## Functions -### onlyValidatorContract - - -```solidity -modifier onlyValidatorContract(uint256 validatorId); -``` - -### StakeManagerOrValidatorContract - - -```solidity -modifier StakeManagerOrValidatorContract(uint256 validatorId); -``` - -### onlyStakeManager - - -```solidity -modifier onlyStakeManager(); -``` - -### onlySlashingManager - - -```solidity -modifier onlySlashingManager(); -``` - -### constructor - - -```solidity -constructor(address _registry) public; -``` - -### updateNonce - - -```solidity -function updateNonce(uint256[] calldata validatorIds, uint256[] calldata nonces) external onlyOwner; -``` - -### logStaked - - -```solidity -function logStaked(address signer, bytes memory signerPubkey, uint256 validatorId, uint256 activationEpoch, uint256 amount, uint256 total) - public - onlyStakeManager; -``` - -### logUnstaked - - -```solidity -function logUnstaked(address user, uint256 validatorId, uint256 amount, uint256 total) public onlyStakeManager; -``` - -### logUnstakeInit - - -```solidity -function logUnstakeInit(address user, uint256 validatorId, uint256 deactivationEpoch, uint256 amount) public onlyStakeManager; -``` - -### logSignerChange - - -```solidity -function logSignerChange(uint256 validatorId, address oldSigner, address newSigner, bytes memory signerPubkey) public onlyStakeManager; -``` - -### logRestaked - - -```solidity -function logRestaked(uint256 validatorId, uint256 amount, uint256 total) public onlyStakeManager; -``` - -### logJailed - - -```solidity -function logJailed(uint256 validatorId, uint256 exitEpoch, address signer) public onlyStakeManager; -``` - -### logUnjailed - - -```solidity -function logUnjailed(uint256 validatorId, address signer) public onlyStakeManager; -``` - -### logSlashed - - -```solidity -function logSlashed(uint256 nonce, uint256 amount) public onlySlashingManager; -``` - -### logThresholdChange - - -```solidity -function logThresholdChange(uint256 newThreshold, uint256 oldThreshold) public onlyStakeManager; -``` - -### logDynastyValueChange - - -```solidity -function logDynastyValueChange(uint256 newDynasty, uint256 oldDynasty) public onlyStakeManager; -``` - -### logProposerBonusChange - - -```solidity -function logProposerBonusChange(uint256 newProposerBonus, uint256 oldProposerBonus) public onlyStakeManager; -``` - -### logRewardUpdate - - -```solidity -function logRewardUpdate(uint256 newReward, uint256 oldReward) public onlyStakeManager; -``` - -### logStakeUpdate - - -```solidity -function logStakeUpdate(uint256 validatorId) public StakeManagerOrValidatorContract(validatorId); -``` - -### logClaimRewards - - -```solidity -function logClaimRewards(uint256 validatorId, uint256 amount, uint256 totalAmount) public onlyStakeManager; -``` - -### logStartAuction - - -```solidity -function logStartAuction(uint256 validatorId, uint256 amount, uint256 auctionAmount) public onlyStakeManager; -``` - -### logConfirmAuction - - -```solidity -function logConfirmAuction(uint256 newValidatorId, uint256 oldValidatorId, uint256 amount) public onlyStakeManager; -``` - -### logTopUpFee - - -```solidity -function logTopUpFee(address user, uint256 fee) public onlyStakeManager; -``` - -### logClaimFee - - -```solidity -function logClaimFee(address user, uint256 fee) public onlyStakeManager; -``` - -### getStakerDetails - - -```solidity -function getStakerDetails(uint256 validatorId) - public - view - returns (uint256 amount, uint256 reward, uint256 activationEpoch, uint256 deactivationEpoch, address signer, uint256 _status); -``` - -### totalValidatorStake - - -```solidity -function totalValidatorStake(uint256 validatorId) public view returns (uint256 validatorStake); -``` - -### getAccountStateRoot - - -```solidity -function getAccountStateRoot() public view returns (bytes32 accountStateRoot); -``` - -### getValidatorContractAddress - - -```solidity -function getValidatorContractAddress(uint256 validatorId) public view returns (address ValidatorContract); -``` - -### logShareMinted - - -```solidity -function logShareMinted(uint256 validatorId, address user, uint256 amount, uint256 tokens) public onlyValidatorContract(validatorId); -``` - -### logShareBurned - - -```solidity -function logShareBurned(uint256 validatorId, address user, uint256 amount, uint256 tokens) public onlyValidatorContract(validatorId); -``` - -### logDelegatorClaimRewards - - -```solidity -function logDelegatorClaimRewards(uint256 validatorId, address user, uint256 rewards) public onlyValidatorContract(validatorId); -``` - -### logDelegatorRestaked - - -```solidity -function logDelegatorRestaked(uint256 validatorId, address user, uint256 totalStaked) public onlyValidatorContract(validatorId); -``` - -### logDelegatorUnstaked - - -```solidity -function logDelegatorUnstaked(uint256 validatorId, address user, uint256 amount) public onlyValidatorContract(validatorId); -``` - -### logUpdateCommissionRate - - -```solidity -function logUpdateCommissionRate(uint256 validatorId, uint256 newCommissionRate, uint256 oldCommissionRate) public onlyValidatorContract(validatorId); -``` - -## Events -### Staked -*Emitted when validator stakes in '_stakeFor()' in StakeManager.* - - -```solidity -event Staked( - address indexed signer, uint256 indexed validatorId, uint256 nonce, uint256 indexed activationEpoch, uint256 amount, uint256 total, bytes signerPubkey -); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`signer`|`address`|validator address.| -|`validatorId`|`uint256`|unique integer to identify a validator.| -|`nonce`|`uint256`|to synchronize the events in heimdal.| -|`activationEpoch`|`uint256`|validator's first epoch as proposer.| -|`amount`|`uint256`|staking amount.| -|`total`|`uint256`|total staking amount.| -|`signerPubkey`|`bytes`|public key of the validator| - -### Unstaked -*Emitted when validator unstakes in 'unstakeClaim()'* - - -```solidity -event Unstaked(address indexed user, uint256 indexed validatorId, uint256 amount, uint256 total); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`user`|`address`|address of the validator.| -|`validatorId`|`uint256`|unique integer to identify a validator.| -|`amount`|`uint256`|staking amount.| -|`total`|`uint256`|total staking amount.| - -### UnstakeInit -*Emitted when validator unstakes in '_unstake()'.* - - -```solidity -event UnstakeInit(address indexed user, uint256 indexed validatorId, uint256 nonce, uint256 deactivationEpoch, uint256 indexed amount); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`user`|`address`|address of the validator.| -|`validatorId`|`uint256`|unique integer to identify a validator.| -|`nonce`|`uint256`|to synchronize the events in heimdal.| -|`deactivationEpoch`|`uint256`|last epoch for validator.| -|`amount`|`uint256`|staking amount.| - -### SignerChange -*Emitted when the validator public key is updated in 'updateSigner()'.* - - -```solidity -event SignerChange(uint256 indexed validatorId, uint256 nonce, address indexed oldSigner, address indexed newSigner, bytes signerPubkey); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`validatorId`|`uint256`|unique integer to identify a validator.| -|`nonce`|`uint256`|to synchronize the events in heimdal.| -|`oldSigner`|`address`|old address of the validator.| -|`newSigner`|`address`|new address of the validator.| -|`signerPubkey`|`bytes`|public key of the validator.| - -### Restaked - -```solidity -event Restaked(uint256 indexed validatorId, uint256 amount, uint256 total); -``` - -### Jailed - -```solidity -event Jailed(uint256 indexed validatorId, uint256 indexed exitEpoch, address indexed signer); -``` - -### UnJailed - -```solidity -event UnJailed(uint256 indexed validatorId, address indexed signer); -``` - -### Slashed - -```solidity -event Slashed(uint256 indexed nonce, uint256 indexed amount); -``` - -### ThresholdChange - -```solidity -event ThresholdChange(uint256 newThreshold, uint256 oldThreshold); -``` - -### DynastyValueChange - -```solidity -event DynastyValueChange(uint256 newDynasty, uint256 oldDynasty); -``` - -### ProposerBonusChange - -```solidity -event ProposerBonusChange(uint256 newProposerBonus, uint256 oldProposerBonus); -``` - -### RewardUpdate - -```solidity -event RewardUpdate(uint256 newReward, uint256 oldReward); -``` - -### StakeUpdate -*Emitted when validator confirms the auction bid and at the time of restaking in confirmAuctionBid() and restake().* - - -```solidity -event StakeUpdate(uint256 indexed validatorId, uint256 indexed nonce, uint256 indexed newAmount); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`validatorId`|`uint256`|unique integer to identify a validator.| -|`nonce`|`uint256`|to synchronize the events in heimdal.| -|`newAmount`|`uint256`|the updated stake amount.| - -### ClaimRewards - -```solidity -event ClaimRewards(uint256 indexed validatorId, uint256 indexed amount, uint256 indexed totalAmount); -``` - -### StartAuction - -```solidity -event StartAuction(uint256 indexed validatorId, uint256 indexed amount, uint256 indexed auctionAmount); -``` - -### ConfirmAuction - -```solidity -event ConfirmAuction(uint256 indexed newValidatorId, uint256 indexed oldValidatorId, uint256 indexed amount); -``` - -### TopUpFee - -```solidity -event TopUpFee(address indexed user, uint256 indexed fee); -``` - -### ClaimFee - -```solidity -event ClaimFee(address indexed user, uint256 indexed fee); -``` - -### ShareMinted - -```solidity -event ShareMinted(uint256 indexed validatorId, address indexed user, uint256 indexed amount, uint256 tokens); -``` - -### ShareBurned - -```solidity -event ShareBurned(uint256 indexed validatorId, address indexed user, uint256 indexed amount, uint256 tokens); -``` - -### DelegatorClaimedRewards - -```solidity -event DelegatorClaimedRewards(uint256 indexed validatorId, address indexed user, uint256 indexed rewards); -``` - -### DelegatorRestaked - -```solidity -event DelegatorRestaked(uint256 indexed validatorId, address indexed user, uint256 indexed totalStaked); -``` - -### DelegatorUnstaked - -```solidity -event DelegatorUnstaked(uint256 indexed validatorId, address indexed user, uint256 amount); -``` - -### UpdateCommissionRate - -```solidity -event UpdateCommissionRate(uint256 indexed validatorId, uint256 indexed newCommissionRate, uint256 indexed oldCommissionRate); -``` - diff --git a/docs/autogen/src/contracts/staking/slashing/ISlashingManager.sol/contract.ISlashingManager.md b/docs/autogen/src/contracts/staking/slashing/ISlashingManager.sol/contract.ISlashingManager.md deleted file mode 100644 index be43a121..00000000 --- a/docs/autogen/src/contracts/staking/slashing/ISlashingManager.sol/contract.ISlashingManager.md +++ /dev/null @@ -1,61 +0,0 @@ -# ISlashingManager -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/staking/slashing/ISlashingManager.sol) - - -## State Variables -### heimdallId - -```solidity -bytes32 public heimdallId; -``` - - -### VOTE_TYPE - -```solidity -uint8 public constant VOTE_TYPE = 2; -``` - - -### reportRate - -```solidity -uint256 public reportRate = 5; -``` - - -### proposerRate - -```solidity -uint256 public proposerRate = 50; -``` - - -### jailCheckpoints - -```solidity -uint256 public jailCheckpoints = 5; -``` - - -### slashingNonce - -```solidity -uint256 public slashingNonce; -``` - - -### registry - -```solidity -Registry public registry; -``` - - -### logger - -```solidity -StakingInfo public logger; -``` - - diff --git a/docs/autogen/src/contracts/staking/slashing/README.md b/docs/autogen/src/contracts/staking/slashing/README.md deleted file mode 100644 index 4d4d6aed..00000000 --- a/docs/autogen/src/contracts/staking/slashing/README.md +++ /dev/null @@ -1,5 +0,0 @@ - - -# Contents -- [ISlashingManager](ISlashingManager.sol/contract.ISlashingManager.md) -- [SlashingManager](SlashingManager.sol/contract.SlashingManager.md) diff --git a/docs/autogen/src/contracts/staking/slashing/SlashingManager.sol/contract.SlashingManager.md b/docs/autogen/src/contracts/staking/slashing/SlashingManager.sol/contract.SlashingManager.md deleted file mode 100644 index 70685c89..00000000 --- a/docs/autogen/src/contracts/staking/slashing/SlashingManager.sol/contract.SlashingManager.md +++ /dev/null @@ -1,64 +0,0 @@ -# SlashingManager -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/staking/slashing/SlashingManager.sol) - -**Inherits:** -[ISlashingManager](/contracts/staking/slashing/ISlashingManager.sol/contract.ISlashingManager.md), Ownable - - -## Functions -### onlyStakeManager - - -```solidity -modifier onlyStakeManager(); -``` - -### constructor - - -```solidity -constructor(address _registry, address _logger, string memory _heimdallId) public; -``` - -### updateSlashedAmounts - - -```solidity -function updateSlashedAmounts(bytes memory data, bytes memory sigs) public; -``` - -### verifyConsensus - - -```solidity -function verifyConsensus(bytes32 voteHash, bytes memory sigs) public view returns (bool); -``` - -### updateReportRate - - -```solidity -function updateReportRate(uint256 newReportRate) public onlyOwner; -``` - -### updateProposerRate - - -```solidity -function updateProposerRate(uint256 newProposerRate) public onlyOwner; -``` - -### setHeimdallId - - -```solidity -function setHeimdallId(string memory _heimdallId) public onlyOwner; -``` - -### drainTokens - - -```solidity -function drainTokens(uint256 value, address token, address destination) external onlyOwner; -``` - diff --git a/docs/autogen/src/contracts/staking/stakeManager/IStakeManager.sol/contract.IStakeManager.md b/docs/autogen/src/contracts/staking/stakeManager/IStakeManager.sol/contract.IStakeManager.md deleted file mode 100644 index 171dcb45..00000000 --- a/docs/autogen/src/contracts/staking/stakeManager/IStakeManager.sol/contract.IStakeManager.md +++ /dev/null @@ -1,152 +0,0 @@ -# IStakeManager -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/staking/stakeManager/IStakeManager.sol) - - -## Functions -### startAuction - - -```solidity -function startAuction(uint256 validatorId, uint256 amount, bool acceptDelegation, bytes calldata signerPubkey) external; -``` - -### confirmAuctionBid - - -```solidity -function confirmAuctionBid(uint256 validatorId, uint256 heimdallFee) external; -``` - -### transferFunds - - -```solidity -function transferFunds(uint256 validatorId, uint256 amount, address delegator) external returns (bool); -``` - -### delegationDeposit - - -```solidity -function delegationDeposit(uint256 validatorId, uint256 amount, address delegator) external returns (bool); -``` - -### unstake - - -```solidity -function unstake(uint256 validatorId) external; -``` - -### totalStakedFor - - -```solidity -function totalStakedFor(address addr) external view returns (uint256); -``` - -### stakeFor - - -```solidity -function stakeFor(address user, uint256 amount, uint256 heimdallFee, bool acceptDelegation, bytes memory signerPubkey) public; -``` - -### checkSignatures - - -```solidity -function checkSignatures(uint256 blockInterval, bytes32 voteHash, bytes32 stateRoot, address proposer, uint256[3][] calldata sigs) external returns (uint256); -``` - -### updateValidatorState - - -```solidity -function updateValidatorState(uint256 validatorId, int256 amount) public; -``` - -### ownerOf - - -```solidity -function ownerOf(uint256 tokenId) public view returns (address); -``` - -### slash - - -```solidity -function slash(bytes calldata slashingInfoList) external returns (uint256); -``` - -### validatorStake - - -```solidity -function validatorStake(uint256 validatorId) public view returns (uint256); -``` - -### epoch - - -```solidity -function epoch() public view returns (uint256); -``` - -### getRegistry - - -```solidity -function getRegistry() public view returns (address); -``` - -### withdrawalDelay - - -```solidity -function withdrawalDelay() public view returns (uint256); -``` - -### delegatedAmount - - -```solidity -function delegatedAmount(uint256 validatorId) public view returns (uint256); -``` - -### decreaseValidatorDelegatedAmount - - -```solidity -function decreaseValidatorDelegatedAmount(uint256 validatorId, uint256 amount) public; -``` - -### withdrawDelegatorsReward - - -```solidity -function withdrawDelegatorsReward(uint256 validatorId) public returns (uint256); -``` - -### delegatorsReward - - -```solidity -function delegatorsReward(uint256 validatorId) public view returns (uint256); -``` - -### dethroneAndStake - - -```solidity -function dethroneAndStake( - address auctionUser, - uint256 heimdallFee, - uint256 validatorId, - uint256 auctionAmount, - bool acceptDelegation, - bytes calldata signerPubkey -) external; -``` - diff --git a/docs/autogen/src/contracts/staking/stakeManager/README.md b/docs/autogen/src/contracts/staking/stakeManager/README.md deleted file mode 100644 index 98be2db3..00000000 --- a/docs/autogen/src/contracts/staking/stakeManager/README.md +++ /dev/null @@ -1,10 +0,0 @@ - - -# Contents -- [IStakeManager](IStakeManager.sol/contract.IStakeManager.md) -- [StakeManager](StakeManager.sol/contract.StakeManager.md) -- [StakeManagerExtension](StakeManagerExtension.sol/contract.StakeManagerExtension.md) -- [StakeManagerProxy](StakeManagerProxy.sol/contract.StakeManagerProxy.md) -- [StakeManagerStorage](StakeManagerStorage.sol/contract.StakeManagerStorage.md) -- [StakeManagerStorageExtension](StakeManagerStorageExtension.sol/contract.StakeManagerStorageExtension.md) -- [StakingNFT](StakingNFT.sol/contract.StakingNFT.md) diff --git a/docs/autogen/src/contracts/staking/stakeManager/StakeManager.sol/contract.StakeManager.md b/docs/autogen/src/contracts/staking/stakeManager/StakeManager.sol/contract.StakeManager.md deleted file mode 100644 index e0018517..00000000 --- a/docs/autogen/src/contracts/staking/stakeManager/StakeManager.sol/contract.StakeManager.md +++ /dev/null @@ -1,698 +0,0 @@ -# StakeManager -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/staking/stakeManager/StakeManager.sol) - -**Inherits:** -[StakeManagerStorage](/contracts/staking/stakeManager/StakeManagerStorage.sol/contract.StakeManagerStorage.md), [Initializable](/contracts/common/mixin/Initializable.sol/contract.Initializable.md), [IStakeManager](/contracts/staking/stakeManager/IStakeManager.sol/contract.IStakeManager.md), [DelegateProxyForwarder](/contracts/common/misc/DelegateProxyForwarder.sol/contract.DelegateProxyForwarder.md), [StakeManagerStorageExtension](/contracts/staking/stakeManager/StakeManagerStorageExtension.sol/contract.StakeManagerStorageExtension.md) - - -## Functions -### onlyStaker - - -```solidity -modifier onlyStaker(uint256 validatorId); -``` - -### _assertStaker - - -```solidity -function _assertStaker(uint256 validatorId) private view; -``` - -### onlyDelegation - - -```solidity -modifier onlyDelegation(uint256 validatorId); -``` - -### _assertDelegation - - -```solidity -function _assertDelegation(uint256 validatorId) private view; -``` - -### constructor - - -```solidity -constructor() public GovernanceLockable(address(0x0)) initializer; -``` - -### initialize - - -```solidity -function initialize( - address _registry, - address _rootchain, - address _token, - address _NFTContract, - address _stakingLogger, - address _validatorShareFactory, - address _governance, - address _owner, - address _extensionCode -) external initializer; -``` - -### isOwner - - -```solidity -function isOwner() public view returns (bool); -``` - -### getRegistry - -Public View Methods - - -```solidity -function getRegistry() public view returns (address); -``` - -### ownerOf - -*Owner of validator slot NFT* - - -```solidity -function ownerOf(uint256 tokenId) public view returns (address); -``` - -### epoch - - -```solidity -function epoch() public view returns (uint256); -``` - -### withdrawalDelay - - -```solidity -function withdrawalDelay() public view returns (uint256); -``` - -### validatorStake - - -```solidity -function validatorStake(uint256 validatorId) public view returns (uint256); -``` - -### getValidatorId - - -```solidity -function getValidatorId(address user) public view returns (uint256); -``` - -### delegatedAmount - - -```solidity -function delegatedAmount(uint256 validatorId) public view returns (uint256); -``` - -### delegatorsReward - - -```solidity -function delegatorsReward(uint256 validatorId) public view returns (uint256); -``` - -### validatorReward - - -```solidity -function validatorReward(uint256 validatorId) public view returns (uint256); -``` - -### currentValidatorSetSize - - -```solidity -function currentValidatorSetSize() public view returns (uint256); -``` - -### currentValidatorSetTotalStake - - -```solidity -function currentValidatorSetTotalStake() public view returns (uint256); -``` - -### getValidatorContract - - -```solidity -function getValidatorContract(uint256 validatorId) public view returns (address); -``` - -### isValidator - - -```solidity -function isValidator(uint256 validatorId) public view returns (bool); -``` - -### setDelegationEnabled - -Governance Methods - - -```solidity -function setDelegationEnabled(bool enabled) public onlyGovernance; -``` - -### forceUnstake - - -```solidity -function forceUnstake(uint256 validatorId) external onlyGovernance; -``` - -### setCurrentEpoch - - -```solidity -function setCurrentEpoch(uint256 _currentEpoch) external onlyGovernance; -``` - -### setStakingToken - - -```solidity -function setStakingToken(address _token) public onlyGovernance; -``` - -### updateValidatorThreshold - -*Change the number of validators required to allow a passed header root* - - -```solidity -function updateValidatorThreshold(uint256 newThreshold) public onlyGovernance; -``` - -### updateCheckPointBlockInterval - - -```solidity -function updateCheckPointBlockInterval(uint256 _blocks) public onlyGovernance; -``` - -### updateCheckpointReward - - -```solidity -function updateCheckpointReward(uint256 newReward) public onlyGovernance; -``` - -### updateCheckpointRewardParams - - -```solidity -function updateCheckpointRewardParams(uint256 _rewardDecreasePerCheckpoint, uint256 _maxRewardedCheckpoints, uint256 _checkpointRewardDelta) - public - onlyGovernance; -``` - -### migrateValidatorsData - - -```solidity -function migrateValidatorsData(uint256 validatorIdFrom, uint256 validatorIdTo) public onlyOwner; -``` - -### insertSigners - - -```solidity -function insertSigners(address[] memory _signers) public onlyOwner; -``` - -### updateValidatorContractAddress - -*Users must exit before this update or all funds may get lost* - - -```solidity -function updateValidatorContractAddress(uint256 validatorId, address newContractAddress) public onlyGovernance; -``` - -### updateDynastyValue - - -```solidity -function updateDynastyValue(uint256 newDynasty) public onlyGovernance; -``` - -### stopAuctions - - -```solidity -function stopAuctions(uint256 forNCheckpoints) public onlyGovernance; -``` - -### updateProposerBonus - - -```solidity -function updateProposerBonus(uint256 newProposerBonus) public onlyGovernance; -``` - -### updateSignerUpdateLimit - - -```solidity -function updateSignerUpdateLimit(uint256 _limit) public onlyGovernance; -``` - -### updateMinAmounts - - -```solidity -function updateMinAmounts(uint256 _minDeposit, uint256 _minHeimdallFee) public onlyGovernance; -``` - -### drainValidatorShares - - -```solidity -function drainValidatorShares(uint256 validatorId, address tokenAddr, address payable destination, uint256 amount) external onlyGovernance; -``` - -### drain - - -```solidity -function drain(address destination, uint256 amount) external onlyGovernance; -``` - -### reinitialize - - -```solidity -function reinitialize(address _NFTContract, address _stakingLogger, address _validatorShareFactory, address _extensionCode) external onlyGovernance; -``` - -### topUpForFee - -Public Methods - - -```solidity -function topUpForFee(address user, uint256 heimdallFee) public onlyWhenUnlocked; -``` - -### claimFee - - -```solidity -function claimFee(uint256 accumFeeAmount, uint256 index, bytes memory proof) public; -``` - -### totalStakedFor - - -```solidity -function totalStakedFor(address user) external view returns (uint256); -``` - -### startAuction - - -```solidity -function startAuction(uint256 validatorId, uint256 amount, bool _acceptDelegation, bytes calldata _signerPubkey) external onlyWhenUnlocked; -``` - -### confirmAuctionBid - - -```solidity -function confirmAuctionBid(uint256 validatorId, uint256 heimdallFee) external onlyWhenUnlocked; -``` - -### dethroneAndStake - - -```solidity -function dethroneAndStake( - address auctionUser, - uint256 heimdallFee, - uint256 validatorId, - uint256 auctionAmount, - bool acceptDelegation, - bytes calldata signerPubkey -) external; -``` - -### unstake - - -```solidity -function unstake(uint256 validatorId) external onlyStaker(validatorId); -``` - -### transferFunds - - -```solidity -function transferFunds(uint256 validatorId, uint256 amount, address delegator) external returns (bool); -``` - -### delegationDeposit - - -```solidity -function delegationDeposit(uint256 validatorId, uint256 amount, address delegator) external onlyDelegation(validatorId) returns (bool); -``` - -### stakeFor - - -```solidity -function stakeFor(address user, uint256 amount, uint256 heimdallFee, bool acceptDelegation, bytes memory signerPubkey) public onlyWhenUnlocked; -``` - -### unstakeClaim - - -```solidity -function unstakeClaim(uint256 validatorId) public onlyStaker(validatorId); -``` - -### restake - - -```solidity -function restake(uint256 validatorId, uint256 amount, bool stakeRewards) public onlyWhenUnlocked onlyStaker(validatorId); -``` - -### withdrawRewards - - -```solidity -function withdrawRewards(uint256 validatorId) public onlyStaker(validatorId); -``` - -### migrateDelegation - - -```solidity -function migrateDelegation(uint256 fromValidatorId, uint256 toValidatorId, uint256 amount) public; -``` - -### updateValidatorState - - -```solidity -function updateValidatorState(uint256 validatorId, int256 amount) public onlyDelegation(validatorId); -``` - -### increaseValidatorDelegatedAmount - - -```solidity -function increaseValidatorDelegatedAmount(uint256 validatorId, uint256 amount) private; -``` - -### decreaseValidatorDelegatedAmount - - -```solidity -function decreaseValidatorDelegatedAmount(uint256 validatorId, uint256 amount) public onlyDelegation(validatorId); -``` - -### updateSigner - - -```solidity -function updateSigner(uint256 validatorId, bytes memory signerPubkey) public onlyStaker(validatorId); -``` - -### checkSignatures - - -```solidity -function checkSignatures(uint256 blockInterval, bytes32 voteHash, bytes32 stateRoot, address proposer, uint256[3][] calldata sigs) - external - onlyRootChain - returns (uint256); -``` - -### updateCommissionRate - - -```solidity -function updateCommissionRate(uint256 validatorId, uint256 newCommissionRate) external onlyStaker(validatorId); -``` - -### withdrawDelegatorsReward - - -```solidity -function withdrawDelegatorsReward(uint256 validatorId) public onlyDelegation(validatorId) returns (uint256); -``` - -### slash - - -```solidity -function slash(bytes calldata _slashingInfoList) external returns (uint256); -``` - -### unjail - - -```solidity -function unjail(uint256 validatorId) public onlyStaker(validatorId); -``` - -### updateTimeline - - -```solidity -function updateTimeline(int256 amount, int256 stakerCount, uint256 targetEpoch) internal; -``` - -### updateValidatorDelegation - - -```solidity -function updateValidatorDelegation(bool delegation) external; -``` - -### _getAndAssertSigner - -Private Methods - - -```solidity -function _getAndAssertSigner(bytes memory pub) private view returns (address); -``` - -### _isValidator - - -```solidity -function _isValidator(Status status, uint256 amount, uint256 deactivationEpoch, uint256 _currentEpoch) private pure returns (bool); -``` - -### _fillUnsignedValidators - - -```solidity -function _fillUnsignedValidators(UnsignedValidatorsContext memory context, address signer) private view returns (UnsignedValidatorsContext memory); -``` - -### _calculateCheckpointReward - - -```solidity -function _calculateCheckpointReward(uint256 blockInterval, uint256 signedStakePower, uint256 currentTotalStake) internal returns (uint256); -``` - -### _increaseRewardAndAssertConsensus - - -```solidity -function _increaseRewardAndAssertConsensus( - uint256 blockInterval, - address proposer, - uint256 signedStakePower, - bytes32 stateRoot, - uint256[] memory unsignedValidators, - uint256 totalUnsignedValidators, - uint256[] memory deactivatedValidators, - uint256 totalDeactivatedValidators -) private returns (uint256); -``` - -### _updateValidatorsRewards - - -```solidity -function _updateValidatorsRewards(uint256[] memory unsignedValidators, uint256 totalUnsignedValidators, uint256 newRewardPerStake) private; -``` - -### _updateRewardsAndCommit - - -```solidity -function _updateRewardsAndCommit(uint256 validatorId, uint256 currentRewardPerStake, uint256 newRewardPerStake) private; -``` - -### _updateRewards - - -```solidity -function _updateRewards(uint256 validatorId) private; -``` - -### _getEligibleValidatorReward - - -```solidity -function _getEligibleValidatorReward(uint256 validatorId, uint256 validatorStakePower, uint256 currentRewardPerStake, uint256 initialRewardPerStake) - private - pure - returns (uint256); -``` - -### _increaseValidatorReward - - -```solidity -function _increaseValidatorReward(uint256 validatorId, uint256 reward) private; -``` - -### _increaseValidatorRewardWithDelegation - - -```solidity -function _increaseValidatorRewardWithDelegation(uint256 validatorId, uint256 validatorsStake, uint256 delegatedAmount, uint256 reward) private; -``` - -### _getValidatorAndDelegationReward - - -```solidity -function _getValidatorAndDelegationReward(uint256 validatorId, uint256 validatorsStake, uint256 reward, uint256 combinedStakePower) - internal - view - returns (uint256, uint256); -``` - -### _evaluateValidatorAndDelegationReward - - -```solidity -function _evaluateValidatorAndDelegationReward(uint256 validatorId) private view returns (uint256 validatorReward, uint256 delegatorsReward); -``` - -### _jail - - -```solidity -function _jail(uint256 validatorId, uint256 jailCheckpoints) internal returns (uint256); -``` - -### _stakeFor - - -```solidity -function _stakeFor(address user, uint256 amount, bool acceptDelegation, bytes memory signerPubkey) internal returns (uint256); -``` - -### _unstake - - -```solidity -function _unstake(uint256 validatorId, uint256 exitEpoch) internal; -``` - -### _finalizeCommit - - -```solidity -function _finalizeCommit() internal; -``` - -### _liquidateRewards - - -```solidity -function _liquidateRewards(uint256 validatorId, address validatorUser) private; -``` - -### _transferToken - - -```solidity -function _transferToken(address destination, uint256 amount) private; -``` - -### _transferTokenFrom - - -```solidity -function _transferTokenFrom(address from, address destination, uint256 amount) private; -``` - -### _transferAndTopUp - - -```solidity -function _transferAndTopUp(address user, address from, uint256 fee, uint256 additionalAmount) private; -``` - -### _claimFee - - -```solidity -function _claimFee(address user, uint256 amount) private; -``` - -### _insertSigner - - -```solidity -function _insertSigner(address newSigner) internal; -``` - -### _removeSigner - - -```solidity -function _removeSigner(address signerToDelete) internal; -``` - -## Structs -### UnsignedValidatorsContext - -```solidity -struct UnsignedValidatorsContext { - uint256 unsignedValidatorIndex; - uint256 validatorIndex; - uint256[] unsignedValidators; - address[] validators; - uint256 totalValidators; -} -``` - -### UnstakedValidatorsContext - -```solidity -struct UnstakedValidatorsContext { - uint256 deactivationEpoch; - uint256[] deactivatedValidators; - uint256 validatorIndex; -} -``` - diff --git a/docs/autogen/src/contracts/staking/stakeManager/StakeManagerExtension.sol/contract.StakeManagerExtension.md b/docs/autogen/src/contracts/staking/stakeManager/StakeManagerExtension.sol/contract.StakeManagerExtension.md deleted file mode 100644 index 6fa134d8..00000000 --- a/docs/autogen/src/contracts/staking/stakeManager/StakeManagerExtension.sol/contract.StakeManagerExtension.md +++ /dev/null @@ -1,57 +0,0 @@ -# StakeManagerExtension -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/staking/stakeManager/StakeManagerExtension.sol) - -**Inherits:** -[StakeManagerStorage](/contracts/staking/stakeManager/StakeManagerStorage.sol/contract.StakeManagerStorage.md), [Initializable](/contracts/common/mixin/Initializable.sol/contract.Initializable.md), [StakeManagerStorageExtension](/contracts/staking/stakeManager/StakeManagerStorageExtension.sol/contract.StakeManagerStorageExtension.md) - - -## Functions -### constructor - - -```solidity -constructor() public GovernanceLockable(address(0x0)); -``` - -### startAuction - - -```solidity -function startAuction(uint256 validatorId, uint256 amount, bool _acceptDelegation, bytes calldata _signerPubkey) external; -``` - -### confirmAuctionBid - - -```solidity -function confirmAuctionBid(uint256 validatorId, uint256 heimdallFee, IStakeManager stakeManager) external; -``` - -### migrateValidatorsData - - -```solidity -function migrateValidatorsData(uint256 validatorIdFrom, uint256 validatorIdTo) external; -``` - -### updateCheckpointRewardParams - - -```solidity -function updateCheckpointRewardParams(uint256 _rewardDecreasePerCheckpoint, uint256 _maxRewardedCheckpoints, uint256 _checkpointRewardDelta) external; -``` - -### updateCommissionRate - - -```solidity -function updateCommissionRate(uint256 validatorId, uint256 newCommissionRate) external; -``` - -### _getOrCacheEventsHub - - -```solidity -function _getOrCacheEventsHub() private returns (EventsHub); -``` - diff --git a/docs/autogen/src/contracts/staking/stakeManager/StakeManagerProxy.sol/contract.StakeManagerProxy.md b/docs/autogen/src/contracts/staking/stakeManager/StakeManagerProxy.sol/contract.StakeManagerProxy.md deleted file mode 100644 index e140b12a..00000000 --- a/docs/autogen/src/contracts/staking/stakeManager/StakeManagerProxy.sol/contract.StakeManagerProxy.md +++ /dev/null @@ -1,15 +0,0 @@ -# StakeManagerProxy -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/staking/stakeManager/StakeManagerProxy.sol) - -**Inherits:** -[UpgradableProxy](/contracts/common/misc/UpgradableProxy.sol/contract.UpgradableProxy.md) - - -## Functions -### constructor - - -```solidity -constructor(address _proxyTo) public UpgradableProxy(_proxyTo); -``` - diff --git a/docs/autogen/src/contracts/staking/stakeManager/StakeManagerStorage.sol/contract.StakeManagerStorage.md b/docs/autogen/src/contracts/staking/stakeManager/StakeManagerStorage.sol/contract.StakeManagerStorage.md deleted file mode 100644 index f707a0b4..00000000 --- a/docs/autogen/src/contracts/staking/stakeManager/StakeManagerStorage.sol/contract.StakeManagerStorage.md +++ /dev/null @@ -1,323 +0,0 @@ -# StakeManagerStorage -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/staking/stakeManager/StakeManagerStorage.sol) - -**Inherits:** -[GovernanceLockable](/contracts/common/mixin/GovernanceLockable.sol/contract.GovernanceLockable.md), [RootChainable](/contracts/common/mixin/RootChainable.sol/contract.RootChainable.md) - - -## State Variables -### MAX_COMMISION_RATE - -```solidity -uint256 constant MAX_COMMISION_RATE = 100; -``` - - -### MAX_PROPOSER_BONUS - -```solidity -uint256 constant MAX_PROPOSER_BONUS = 100; -``` - - -### REWARD_PRECISION - -```solidity -uint256 constant REWARD_PRECISION = 10 ** 25; -``` - - -### INCORRECT_VALIDATOR_ID - -```solidity -uint256 internal constant INCORRECT_VALIDATOR_ID = 2 ** 256 - 1; -``` - - -### INITIALIZED_AMOUNT - -```solidity -uint256 internal constant INITIALIZED_AMOUNT = 1; -``` - - -### token - -```solidity -IERC20 public token; -``` - - -### registry - -```solidity -address public registry; -``` - - -### logger - -```solidity -StakingInfo public logger; -``` - - -### NFTContract - -```solidity -StakingNFT public NFTContract; -``` - - -### validatorShareFactory - -```solidity -ValidatorShareFactory public validatorShareFactory; -``` - - -### WITHDRAWAL_DELAY - -```solidity -uint256 public WITHDRAWAL_DELAY; -``` - - -### currentEpoch - -```solidity -uint256 public currentEpoch; -``` - - -### dynasty - -```solidity -uint256 public dynasty; -``` - - -### CHECKPOINT_REWARD - -```solidity -uint256 public CHECKPOINT_REWARD; -``` - - -### minDeposit - -```solidity -uint256 public minDeposit; -``` - - -### minHeimdallFee - -```solidity -uint256 public minHeimdallFee; -``` - - -### checkPointBlockInterval - -```solidity -uint256 public checkPointBlockInterval; -``` - - -### signerUpdateLimit - -```solidity -uint256 public signerUpdateLimit; -``` - - -### validatorThreshold - -```solidity -uint256 public validatorThreshold; -``` - - -### totalStaked - -```solidity -uint256 public totalStaked; -``` - - -### NFTCounter - -```solidity -uint256 public NFTCounter; -``` - - -### totalRewards - -```solidity -uint256 public totalRewards; -``` - - -### totalRewardsLiquidated - -```solidity -uint256 public totalRewardsLiquidated; -``` - - -### auctionPeriod - -```solidity -uint256 public auctionPeriod; -``` - - -### proposerBonus - -```solidity -uint256 public proposerBonus; -``` - - -### accountStateRoot - -```solidity -bytes32 public accountStateRoot; -``` - - -### replacementCoolDown - -```solidity -uint256 public replacementCoolDown; -``` - - -### delegationEnabled - -```solidity -bool public delegationEnabled; -``` - - -### validators - -```solidity -mapping(uint256 => Validator) public validators; -``` - - -### signerToValidator - -```solidity -mapping(address => uint256) public signerToValidator; -``` - - -### validatorState - -```solidity -State public validatorState; -``` - - -### validatorStateChanges - -```solidity -mapping(uint256 => StateChange) public validatorStateChanges; -``` - - -### userFeeExit - -```solidity -mapping(address => uint256) public userFeeExit; -``` - - -### validatorAuction - -```solidity -mapping(uint256 => Auction) public validatorAuction; -``` - - -### latestSignerUpdateEpoch - -```solidity -mapping(uint256 => uint256) public latestSignerUpdateEpoch; -``` - - -### totalHeimdallFee - -```solidity -uint256 public totalHeimdallFee; -``` - - -## Structs -### Auction - -```solidity -struct Auction { - uint256 amount; - uint256 startEpoch; - address user; - bool acceptDelegation; - bytes signerPubkey; -} -``` - -### State - -```solidity -struct State { - uint256 amount; - uint256 stakerCount; -} -``` - -### StateChange - -```solidity -struct StateChange { - int256 amount; - int256 stakerCount; -} -``` - -### Validator - -```solidity -struct Validator { - uint256 amount; - uint256 reward; - uint256 activationEpoch; - uint256 deactivationEpoch; - uint256 jailTime; - address signer; - address contractAddress; - Status status; - uint256 commissionRate; - uint256 lastCommissionUpdate; - uint256 delegatorsReward; - uint256 delegatedAmount; - uint256 initialRewardPerStake; -} -``` - -## Enums -### Status - -```solidity -enum Status { - Inactive, - Active, - Locked, - Unstaked -} -``` - diff --git a/docs/autogen/src/contracts/staking/stakeManager/StakeManagerStorageExtension.sol/contract.StakeManagerStorageExtension.md b/docs/autogen/src/contracts/staking/stakeManager/StakeManagerStorageExtension.sol/contract.StakeManagerStorageExtension.md deleted file mode 100644 index 97157162..00000000 --- a/docs/autogen/src/contracts/staking/stakeManager/StakeManagerStorageExtension.sol/contract.StakeManagerStorageExtension.md +++ /dev/null @@ -1,68 +0,0 @@ -# StakeManagerStorageExtension -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/staking/stakeManager/StakeManagerStorageExtension.sol) - - -## State Variables -### eventsHub - -```solidity -address public eventsHub; -``` - - -### rewardPerStake - -```solidity -uint256 public rewardPerStake; -``` - - -### extensionCode - -```solidity -address public extensionCode; -``` - - -### signers - -```solidity -address[] public signers; -``` - - -### CHK_REWARD_PRECISION - -```solidity -uint256 constant CHK_REWARD_PRECISION = 100; -``` - - -### prevBlockInterval - -```solidity -uint256 public prevBlockInterval; -``` - - -### rewardDecreasePerCheckpoint - -```solidity -uint256 public rewardDecreasePerCheckpoint; -``` - - -### maxRewardedCheckpoints - -```solidity -uint256 public maxRewardedCheckpoints; -``` - - -### checkpointRewardDelta - -```solidity -uint256 public checkpointRewardDelta; -``` - - diff --git a/docs/autogen/src/contracts/staking/stakeManager/StakingNFT.sol/contract.StakingNFT.md b/docs/autogen/src/contracts/staking/stakeManager/StakingNFT.sol/contract.StakingNFT.md deleted file mode 100644 index 56c85956..00000000 --- a/docs/autogen/src/contracts/staking/stakeManager/StakingNFT.sol/contract.StakingNFT.md +++ /dev/null @@ -1,36 +0,0 @@ -# StakingNFT -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/staking/stakeManager/StakingNFT.sol) - -**Inherits:** -ERC721Full, Ownable - - -## Functions -### constructor - - -```solidity -constructor(string memory name, string memory symbol) public ERC721Full(name, symbol); -``` - -### mint - - -```solidity -function mint(address to, uint256 tokenId) public onlyOwner; -``` - -### burn - - -```solidity -function burn(uint256 tokenId) public onlyOwner; -``` - -### _transferFrom - - -```solidity -function _transferFrom(address from, address to, uint256 tokenId) internal; -``` - diff --git a/docs/autogen/src/contracts/staking/validatorShare/IValidatorShare.sol/contract.IValidatorShare.md b/docs/autogen/src/contracts/staking/validatorShare/IValidatorShare.sol/contract.IValidatorShare.md deleted file mode 100644 index 7a716779..00000000 --- a/docs/autogen/src/contracts/staking/validatorShare/IValidatorShare.sol/contract.IValidatorShare.md +++ /dev/null @@ -1,89 +0,0 @@ -# IValidatorShare -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/staking/validatorShare/IValidatorShare.sol) - - -## Functions -### withdrawRewards - - -```solidity -function withdrawRewards() public; -``` - -### unstakeClaimTokens - - -```solidity -function unstakeClaimTokens() public; -``` - -### getLiquidRewards - - -```solidity -function getLiquidRewards(address user) public view returns (uint256); -``` - -### owner - - -```solidity -function owner() public view returns (address); -``` - -### restake - - -```solidity -function restake() public returns (uint256, uint256); -``` - -### unlock - - -```solidity -function unlock() external; -``` - -### lock - - -```solidity -function lock() external; -``` - -### drain - - -```solidity -function drain(address token, address payable destination, uint256 amount) external; -``` - -### slash - - -```solidity -function slash(uint256 valPow, uint256 delegatedAmount, uint256 totalAmountToSlash) external returns (uint256); -``` - -### updateDelegation - - -```solidity -function updateDelegation(bool delegation) external; -``` - -### migrateOut - - -```solidity -function migrateOut(address user, uint256 amount) external; -``` - -### migrateIn - - -```solidity -function migrateIn(address user, uint256 amount) external; -``` - diff --git a/docs/autogen/src/contracts/staking/validatorShare/README.md b/docs/autogen/src/contracts/staking/validatorShare/README.md deleted file mode 100644 index ede1bc4c..00000000 --- a/docs/autogen/src/contracts/staking/validatorShare/README.md +++ /dev/null @@ -1,7 +0,0 @@ - - -# Contents -- [IValidatorShare](IValidatorShare.sol/contract.IValidatorShare.md) -- [ValidatorShare](ValidatorShare.sol/contract.ValidatorShare.md) -- [ValidatorShareFactory](ValidatorShareFactory.sol/contract.ValidatorShareFactory.md) -- [ValidatorShareProxy](ValidatorShareProxy.sol/contract.ValidatorShareProxy.md) diff --git a/docs/autogen/src/contracts/staking/validatorShare/ValidatorShare.sol/contract.ValidatorShare.md b/docs/autogen/src/contracts/staking/validatorShare/ValidatorShare.sol/contract.ValidatorShare.md deleted file mode 100644 index bb28a887..00000000 --- a/docs/autogen/src/contracts/staking/validatorShare/ValidatorShare.sol/contract.ValidatorShare.md +++ /dev/null @@ -1,384 +0,0 @@ -# ValidatorShare -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/staking/validatorShare/ValidatorShare.sol) - -**Inherits:** -[IValidatorShare](/contracts/staking/validatorShare/IValidatorShare.sol/contract.IValidatorShare.md), [ERC20NonTradable](/contracts/common/tokens/ERC20NonTradable.sol/contract.ERC20NonTradable.md), [OwnableLockable](/contracts/common/mixin/OwnableLockable.sol/contract.OwnableLockable.md), [Initializable](/contracts/common/mixin/Initializable.sol/contract.Initializable.md) - - -## State Variables -### EXCHANGE_RATE_PRECISION - -```solidity -uint256 constant EXCHANGE_RATE_PRECISION = 100; -``` - - -### EXCHANGE_RATE_HIGH_PRECISION - -```solidity -uint256 constant EXCHANGE_RATE_HIGH_PRECISION = 10 ** 29; -``` - - -### MAX_COMMISION_RATE - -```solidity -uint256 constant MAX_COMMISION_RATE = 100; -``` - - -### REWARD_PRECISION - -```solidity -uint256 constant REWARD_PRECISION = 10 ** 25; -``` - - -### stakingLogger - -```solidity -StakingInfo public stakingLogger; -``` - - -### stakeManager - -```solidity -IStakeManager public stakeManager; -``` - - -### validatorId - -```solidity -uint256 public validatorId; -``` - - -### validatorRewards_deprecated - -```solidity -uint256 public validatorRewards_deprecated; -``` - - -### commissionRate_deprecated - -```solidity -uint256 public commissionRate_deprecated; -``` - - -### lastCommissionUpdate_deprecated - -```solidity -uint256 public lastCommissionUpdate_deprecated; -``` - - -### minAmount - -```solidity -uint256 public minAmount; -``` - - -### totalStake_deprecated - -```solidity -uint256 public totalStake_deprecated; -``` - - -### rewardPerShare - -```solidity -uint256 public rewardPerShare; -``` - - -### activeAmount - -```solidity -uint256 public activeAmount; -``` - - -### delegation - -```solidity -bool public delegation; -``` - - -### withdrawPool - -```solidity -uint256 public withdrawPool; -``` - - -### withdrawShares - -```solidity -uint256 public withdrawShares; -``` - - -### amountStaked_deprecated - -```solidity -mapping(address => uint256) amountStaked_deprecated; -``` - - -### unbonds - -```solidity -mapping(address => DelegatorUnbond) public unbonds; -``` - - -### initalRewardPerShare - -```solidity -mapping(address => uint256) public initalRewardPerShare; -``` - - -### unbondNonces - -```solidity -mapping(address => uint256) public unbondNonces; -``` - - -### unbonds_new - -```solidity -mapping(address => mapping(uint256 => DelegatorUnbond)) public unbonds_new; -``` - - -### eventsHub - -```solidity -EventsHub public eventsHub; -``` - - -## Functions -### initialize - - -```solidity -function initialize(uint256 _validatorId, address _stakingLogger, address _stakeManager) external initializer; -``` - -### exchangeRate - -Public View Methods - - -```solidity -function exchangeRate() public view returns (uint256); -``` - -### getTotalStake - - -```solidity -function getTotalStake(address user) public view returns (uint256, uint256); -``` - -### withdrawExchangeRate - - -```solidity -function withdrawExchangeRate() public view returns (uint256); -``` - -### getLiquidRewards - - -```solidity -function getLiquidRewards(address user) public view returns (uint256); -``` - -### getRewardPerShare - - -```solidity -function getRewardPerShare() public view returns (uint256); -``` - -### buyVoucher - -Public Methods - - -```solidity -function buyVoucher(uint256 _amount, uint256 _minSharesToMint) public returns (uint256 amountToDeposit); -``` - -### restake - - -```solidity -function restake() public returns (uint256, uint256); -``` - -### sellVoucher - - -```solidity -function sellVoucher(uint256 claimAmount, uint256 maximumSharesToBurn) public; -``` - -### withdrawRewards - - -```solidity -function withdrawRewards() public; -``` - -### migrateOut - - -```solidity -function migrateOut(address user, uint256 amount) external onlyOwner; -``` - -### migrateIn - - -```solidity -function migrateIn(address user, uint256 amount) external onlyOwner; -``` - -### unstakeClaimTokens - - -```solidity -function unstakeClaimTokens() public; -``` - -### slash - - -```solidity -function slash(uint256 validatorStake, uint256 delegatedAmount, uint256 totalAmountToSlash) external onlyOwner returns (uint256); -``` - -### updateDelegation - - -```solidity -function updateDelegation(bool _delegation) external onlyOwner; -``` - -### drain - - -```solidity -function drain(address token, address payable destination, uint256 amount) external onlyOwner; -``` - -### sellVoucher_new - -New shares exit API - - -```solidity -function sellVoucher_new(uint256 claimAmount, uint256 maximumSharesToBurn) public; -``` - -### unstakeClaimTokens_new - - -```solidity -function unstakeClaimTokens_new(uint256 unbondNonce) public; -``` - -### _getOrCacheEventsHub - -Private Methods - - -```solidity -function _getOrCacheEventsHub() private returns (EventsHub); -``` - -### _sellVoucher - - -```solidity -function _sellVoucher(uint256 claimAmount, uint256 maximumSharesToBurn) private returns (uint256, uint256); -``` - -### _unstakeClaimTokens - - -```solidity -function _unstakeClaimTokens(DelegatorUnbond memory unbond) private returns (uint256); -``` - -### _getRatePrecision - - -```solidity -function _getRatePrecision() private view returns (uint256); -``` - -### _calculateRewardPerShareWithRewards - - -```solidity -function _calculateRewardPerShareWithRewards(uint256 accumulatedReward) private view returns (uint256); -``` - -### _calculateReward - - -```solidity -function _calculateReward(address user, uint256 _rewardPerShare) private view returns (uint256); -``` - -### _withdrawReward - - -```solidity -function _withdrawReward(address user) private returns (uint256); -``` - -### _withdrawAndTransferReward - - -```solidity -function _withdrawAndTransferReward(address user) private returns (uint256); -``` - -### _buyShares - - -```solidity -function _buyShares(uint256 _amount, uint256 _minSharesToMint, address user) private onlyWhenUnlocked returns (uint256); -``` - -### _transfer - - -```solidity -function _transfer(address from, address to, uint256 value) internal; -``` - -## Structs -### DelegatorUnbond - -```solidity -struct DelegatorUnbond { - uint256 shares; - uint256 withdrawEpoch; -} -``` - diff --git a/docs/autogen/src/contracts/staking/validatorShare/ValidatorShareFactory.sol/contract.ValidatorShareFactory.md b/docs/autogen/src/contracts/staking/validatorShare/ValidatorShareFactory.sol/contract.ValidatorShareFactory.md deleted file mode 100644 index fd57ab32..00000000 --- a/docs/autogen/src/contracts/staking/validatorShare/ValidatorShareFactory.sol/contract.ValidatorShareFactory.md +++ /dev/null @@ -1,14 +0,0 @@ -# ValidatorShareFactory -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/staking/validatorShare/ValidatorShareFactory.sol) - - -## Functions -### create - -- factory to create new validatorShare contracts - - -```solidity -function create(uint256 validatorId, address loggerAddress, address registry) public returns (address); -``` - diff --git a/docs/autogen/src/contracts/staking/validatorShare/ValidatorShareProxy.sol/contract.ValidatorShareProxy.md b/docs/autogen/src/contracts/staking/validatorShare/ValidatorShareProxy.sol/contract.ValidatorShareProxy.md deleted file mode 100644 index 71aa467d..00000000 --- a/docs/autogen/src/contracts/staking/validatorShare/ValidatorShareProxy.sol/contract.ValidatorShareProxy.md +++ /dev/null @@ -1,22 +0,0 @@ -# ValidatorShareProxy -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/staking/validatorShare/ValidatorShareProxy.sol) - -**Inherits:** -[UpgradableProxy](/contracts/common/misc/UpgradableProxy.sol/contract.UpgradableProxy.md) - - -## Functions -### constructor - - -```solidity -constructor(address _registry) public UpgradableProxy(_registry); -``` - -### loadImplementation - - -```solidity -function loadImplementation() internal view returns (address); -``` - diff --git a/docs/autogen/src/contracts/test/ContractActor.sol/contract.ContractWitRevertingFallback.md b/docs/autogen/src/contracts/test/ContractActor.sol/contract.ContractWitRevertingFallback.md deleted file mode 100644 index 93f81dac..00000000 --- a/docs/autogen/src/contracts/test/ContractActor.sol/contract.ContractWitRevertingFallback.md +++ /dev/null @@ -1,26 +0,0 @@ -# ContractWitRevertingFallback -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/test/ContractActor.sol) - - -## Functions -### deposit - - -```solidity -function deposit(address depositManager, address token, uint256 amount) public; -``` - -### startExitWithDepositedTokens - - -```solidity -function startExitWithDepositedTokens(address payable withdrawManager, uint256 depositId, address token, uint256 amountOrToken) public payable; -``` - -### function - - -```solidity -function() external payable; -``` - diff --git a/docs/autogen/src/contracts/test/ContractActor.sol/contract.ContractWithFallback.md b/docs/autogen/src/contracts/test/ContractActor.sol/contract.ContractWithFallback.md deleted file mode 100644 index 8fdecc63..00000000 --- a/docs/autogen/src/contracts/test/ContractActor.sol/contract.ContractWithFallback.md +++ /dev/null @@ -1,26 +0,0 @@ -# ContractWithFallback -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/test/ContractActor.sol) - - -## Functions -### deposit - - -```solidity -function deposit(address depositManager, address token, uint256 amount) public; -``` - -### startExitWithDepositedTokens - - -```solidity -function startExitWithDepositedTokens(address payable withdrawManager, uint256 depositId, address token, uint256 amountOrToken) public payable; -``` - -### function - - -```solidity -function() external payable; -``` - diff --git a/docs/autogen/src/contracts/test/ContractActor.sol/contract.ContractWithoutFallback.md b/docs/autogen/src/contracts/test/ContractActor.sol/contract.ContractWithoutFallback.md deleted file mode 100644 index b1c50b2e..00000000 --- a/docs/autogen/src/contracts/test/ContractActor.sol/contract.ContractWithoutFallback.md +++ /dev/null @@ -1,19 +0,0 @@ -# ContractWithoutFallback -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/test/ContractActor.sol) - - -## Functions -### deposit - - -```solidity -function deposit(address depositManager, address token, uint256 amount) public; -``` - -### startExitWithDepositedTokens - - -```solidity -function startExitWithDepositedTokens(address payable withdrawManager, uint256 depositId, address token, uint256 amountOrToken) public payable; -``` - diff --git a/docs/autogen/src/contracts/test/GovernanceLockableTest.sol/contract.GovernanceLockableTest.md b/docs/autogen/src/contracts/test/GovernanceLockableTest.sol/contract.GovernanceLockableTest.md deleted file mode 100644 index 3d1b0044..00000000 --- a/docs/autogen/src/contracts/test/GovernanceLockableTest.sol/contract.GovernanceLockableTest.md +++ /dev/null @@ -1,15 +0,0 @@ -# GovernanceLockableTest -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/test/GovernanceLockableTest.sol) - -**Inherits:** -[GovernanceLockable](/contracts/common/mixin/GovernanceLockable.sol/contract.GovernanceLockable.md) - - -## Functions -### constructor - - -```solidity -constructor(address governance) public GovernanceLockable(governance); -``` - diff --git a/docs/autogen/src/contracts/test/MarketplacePredicateTest.sol/contract.MarketplacePredicateTest.md b/docs/autogen/src/contracts/test/MarketplacePredicateTest.sol/contract.MarketplacePredicateTest.md deleted file mode 100644 index 3d2c8caf..00000000 --- a/docs/autogen/src/contracts/test/MarketplacePredicateTest.sol/contract.MarketplacePredicateTest.md +++ /dev/null @@ -1,43 +0,0 @@ -# MarketplacePredicateTest -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/test/MarketplacePredicateTest.sol) - -**Inherits:** -[MarketplacePredicate](/contracts/root/predicates/MarketplacePredicate.sol/contract.MarketplacePredicate.md) - - -## Functions -### constructor - - -```solidity -constructor() public MarketplacePredicate(address(0x0), address(0x0), address(0x0)); -``` - -### processLogTransferReceiptTest - - -```solidity -function processLogTransferReceiptTest(address predicate, bytes memory data, address participant) public view returns (bytes memory b); -``` - -### processExitTx - - -```solidity -function processExitTx(bytes memory exitTx) public view returns (bytes memory b); -``` - -### testGetAddressFromTx - - -```solidity -function testGetAddressFromTx(bytes memory exitTx) public pure returns (address signer, bytes32 txHash); -``` - -### decodeExitTx - - -```solidity -function decodeExitTx(bytes memory exitTx) internal pure returns (ExitTxData memory txData); -``` - diff --git a/docs/autogen/src/contracts/test/PolygonMigrationTest.sol/contract.PolygonMigrationTest.md b/docs/autogen/src/contracts/test/PolygonMigrationTest.sol/contract.PolygonMigrationTest.md deleted file mode 100644 index e58f7cef..00000000 --- a/docs/autogen/src/contracts/test/PolygonMigrationTest.sol/contract.PolygonMigrationTest.md +++ /dev/null @@ -1,51 +0,0 @@ -# PolygonMigrationTest -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/test/PolygonMigrationTest.sol) - - -## State Variables -### polygon - -```solidity -IERC20 public polygon; -``` - - -### matic - -```solidity -IERC20 public matic; -``` - - -## Functions -### setTokenAddresses - - -```solidity -function setTokenAddresses(address matic_, address polygon_) external; -``` - -### migrate - -This function allows for migrating MATIC tokens to POL tokens - -*The function does not do any validation since the migration is a one-way process* - - -```solidity -function migrate(uint256 amount) external; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`amount`|`uint256`|Amount of MATIC to migrate| - - -## Events -### Migrated - -```solidity -event Migrated(address indexed account, uint256 amount); -``` - diff --git a/docs/autogen/src/contracts/test/Proxy/ProxyTestImpl.sol/contract.ProxyTestImpl.md b/docs/autogen/src/contracts/test/Proxy/ProxyTestImpl.sol/contract.ProxyTestImpl.md deleted file mode 100644 index ce276e24..00000000 --- a/docs/autogen/src/contracts/test/Proxy/ProxyTestImpl.sol/contract.ProxyTestImpl.md +++ /dev/null @@ -1,44 +0,0 @@ -# ProxyTestImpl -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/test/Proxy/ProxyTestImpl.sol) - -**Inherits:** -[Initializable](/contracts/common/mixin/Initializable.sol/contract.Initializable.md) - - -## State Variables -### a - -```solidity -uint256 public a = 1; -``` - - -### b - -```solidity -uint256 public b = 2; -``` - - -### ctorInit - -```solidity -uint256 public ctorInit; -``` - - -## Functions -### constructor - - -```solidity -constructor() public; -``` - -### init - - -```solidity -function init() public initializer; -``` - diff --git a/docs/autogen/src/contracts/test/Proxy/ProxyTestImplStorageLayoutChange.sol/contract.ProxyTestImplStorageLayoutChange.md b/docs/autogen/src/contracts/test/Proxy/ProxyTestImplStorageLayoutChange.sol/contract.ProxyTestImplStorageLayoutChange.md deleted file mode 100644 index aa12a36f..00000000 --- a/docs/autogen/src/contracts/test/Proxy/ProxyTestImplStorageLayoutChange.sol/contract.ProxyTestImplStorageLayoutChange.md +++ /dev/null @@ -1,22 +0,0 @@ -# ProxyTestImplStorageLayoutChange -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/test/Proxy/ProxyTestImplStorageLayoutChange.sol) - -**Inherits:** -[Initializable](/contracts/common/mixin/Initializable.sol/contract.Initializable.md) - - -## State Variables -### b - -```solidity -uint256 public b; -``` - - -### a - -```solidity -uint256 public a; -``` - - diff --git a/docs/autogen/src/contracts/test/Proxy/README.md b/docs/autogen/src/contracts/test/Proxy/README.md deleted file mode 100644 index 37c1893c..00000000 --- a/docs/autogen/src/contracts/test/Proxy/README.md +++ /dev/null @@ -1,5 +0,0 @@ - - -# Contents -- [ProxyTestImpl](ProxyTestImpl.sol/contract.ProxyTestImpl.md) -- [ProxyTestImplStorageLayoutChange](ProxyTestImplStorageLayoutChange.sol/contract.ProxyTestImplStorageLayoutChange.md) diff --git a/docs/autogen/src/contracts/test/README.md b/docs/autogen/src/contracts/test/README.md deleted file mode 100644 index 992c35b5..00000000 --- a/docs/autogen/src/contracts/test/README.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# Contents -- [Proxy](/contracts/test/Proxy) -- [ContractWithFallback](ContractActor.sol/contract.ContractWithFallback.md) -- [ContractWithoutFallback](ContractActor.sol/contract.ContractWithoutFallback.md) -- [ContractWitRevertingFallback](ContractActor.sol/contract.ContractWitRevertingFallback.md) -- [GovernanceLockableTest](GovernanceLockableTest.sol/contract.GovernanceLockableTest.md) -- [MarketplacePredicateTest](MarketplacePredicateTest.sol/contract.MarketplacePredicateTest.md) -- [PolygonMigrationTest](PolygonMigrationTest.sol/contract.PolygonMigrationTest.md) -- [StakeManagerTest](StakeManagerTest.sol/contract.StakeManagerTest.md) -- [StakeManagerTestable](StakeManagerTestable.sol/contract.StakeManagerTestable.md) -- [TestMRC20](TestMaticChildERC20.sol/contract.TestMRC20.md) -- [ValidatorShareTest](ValidatorShareTest.sol/contract.ValidatorShareTest.md) diff --git a/docs/autogen/src/contracts/test/StakeManagerTest.sol/contract.StakeManagerTest.md b/docs/autogen/src/contracts/test/StakeManagerTest.sol/contract.StakeManagerTest.md deleted file mode 100644 index d91ae84a..00000000 --- a/docs/autogen/src/contracts/test/StakeManagerTest.sol/contract.StakeManagerTest.md +++ /dev/null @@ -1,18 +0,0 @@ -# StakeManagerTest -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/test/StakeManagerTest.sol) - -**Inherits:** -[StakeManager](/contracts/staking/stakeManager/StakeManager.sol/contract.StakeManager.md) - - -## Functions -### checkSignatures - - -```solidity -function checkSignatures(uint256 blockInterval, bytes32 voteHash, bytes32 stateRoot, address proposer, uint256[3][] calldata sigs) - external - onlyRootChain - returns (uint256); -``` - diff --git a/docs/autogen/src/contracts/test/StakeManagerTestable.sol/contract.StakeManagerTestable.md b/docs/autogen/src/contracts/test/StakeManagerTestable.sol/contract.StakeManagerTestable.md deleted file mode 100644 index 65c3bf8f..00000000 --- a/docs/autogen/src/contracts/test/StakeManagerTestable.sol/contract.StakeManagerTestable.md +++ /dev/null @@ -1,36 +0,0 @@ -# StakeManagerTestable -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/test/StakeManagerTestable.sol) - -**Inherits:** -[StakeManager](/contracts/staking/stakeManager/StakeManager.sol/contract.StakeManager.md) - - -## Functions -### advanceEpoch - - -```solidity -function advanceEpoch(uint256 delta) public; -``` - -### testLockShareContract - - -```solidity -function testLockShareContract(uint256 validatorId, bool lock) public; -``` - -### forceFinalizeCommit - - -```solidity -function forceFinalizeCommit() public; -``` - -### resetSignerUsed - - -```solidity -function resetSignerUsed(address signer) public; -``` - diff --git a/docs/autogen/src/contracts/test/TestMaticChildERC20.sol/contract.TestMRC20.md b/docs/autogen/src/contracts/test/TestMaticChildERC20.sol/contract.TestMRC20.md deleted file mode 100644 index 81134ef7..00000000 --- a/docs/autogen/src/contracts/test/TestMaticChildERC20.sol/contract.TestMRC20.md +++ /dev/null @@ -1,15 +0,0 @@ -# TestMRC20 -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/test/TestMaticChildERC20.sol) - -**Inherits:** -[MRC20](/contracts/child/MRC20.sol/contract.MRC20.md) - - -## Functions -### function - - -```solidity -function() external payable; -``` - diff --git a/docs/autogen/src/contracts/test/ValidatorShareTest.sol/contract.ValidatorShareTest.md b/docs/autogen/src/contracts/test/ValidatorShareTest.sol/contract.ValidatorShareTest.md deleted file mode 100644 index a24b1282..00000000 --- a/docs/autogen/src/contracts/test/ValidatorShareTest.sol/contract.ValidatorShareTest.md +++ /dev/null @@ -1,15 +0,0 @@ -# ValidatorShareTest -[Git Source](https://github.com/maticnetwork/contracts/blob/155f729fd8db0676297384375468d4d45b8aa44e/contracts/test/ValidatorShareTest.sol) - -**Inherits:** -[ValidatorShare](/contracts/staking/validatorShare/ValidatorShare.sol/contract.ValidatorShare.md) - - -## Functions -### amountStaked - - -```solidity -function amountStaked(address user) public view returns (uint256); -``` - diff --git a/foundry.toml b/foundry.toml index 5d299bcb..e653c671 100644 --- a/foundry.toml +++ b/foundry.toml @@ -10,11 +10,10 @@ cache_path = 'forge-cache' verbosity = 2 memory_limit = 40003554432 gas_limit = "18446744073709551615" +ignored_warnings_from = ["scripts/helpers/interfaces"] ffi = true remappings = [ - "openzeppelin-solidity/=node_modules/openzeppelin-solidity/", - "@ensdomains/=node_modules/@ensdomains/", "eth-gas-reporter/=node_modules/eth-gas-reporter/", "forge-std/=lib/forge-std/src/", "hardhat/=node_modules/hardhat/" @@ -34,13 +33,16 @@ runs = 10000 max_test_rejects = 999999 [fmt] -line_length = 160 +line_length = 120 number_underscore = "thousands" +multiline_func_header = "all" +wrap_comments = true +ignore = [] [rpc_endpoints] anvil = "http://127.0.0.1:8545" mainnet = "https://mainnet.infura.io/v3/${INFURA_TOKEN}" -goerli = "https://goerli.infura.io/v3/${INFURA_TOKEN}" +# mainnet = "https://eth-mainnet.g.alchemy.com/v2/${ALCHEMY_KEY}" sepolia = "https://sepolia.infura.io/v3/${INFURA_TOKEN}" polygon_pos = "https://polygon-mainnet.infura.io/v3/${INFURA_TOKEN}" mumbai = "https://polygon-mumbai.infura.io/v3/${INFURA_TOKEN}" @@ -49,11 +51,8 @@ polygon_zkevm_testnet = "https://rpc.public.zkevm-test.net" [etherscan] mainnet = { key = "${ETHERSCAN_API_KEY}" } -goerli = { key = "${ETHERSCAN_API_KEY}" } sepolia = { key = "${ETHERSCAN_API_KEY}" } polygon_pos = { key = "${POLYGONSCAN_API_KEY}" } mumbai = { key = "${POLYGONSCAN_API_KEY}" } polygon_zkevm = { key = "${POLYGONSCAN_ZKEVM_API_KEY}" } -polygon_zkevm_testnet = { key = "${POLYGONSCAN_ZKEVM_API_KEY}" } - -# See more config options https://github.com/foundry-rs/foundry/tree/master/config \ No newline at end of file +polygon_zkevm_testnet = { key = "${POLYGONSCAN_ZKEVM_API_KEY}" } \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 8cd33a6d..88044d27 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,24 +1,13 @@ { - "name": "matic-protocol", - "version": "0.3.2", + "name": "pos-contracts", + "version": "0.5.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "matic-protocol", - "version": "0.3.2", + "name": "pos-contracts", + "version": "0.5.0", "license": "MIT", - "dependencies": { - "ethereumjs-block": "^2.2.2", - "ethereumjs-tx": "^1.3.7", - "ethereumjs-util": "^6.0.0", - "ganache": "7.9.2", - "import-toml": "^1.0.0", - "merkle-patricia-tree": "^2.3.2", - "mocha": "10.2.0", - "nunjucks": "^3.2.0", - "openzeppelin-solidity": "2.2.0" - }, "devDependencies": { "@nomicfoundation/hardhat-toolbox": "^2.0.0", "@nomiclabs/hardhat-web3": "2.0.0", @@ -28,10 +17,16 @@ "eslint": "^8.55.0", "esm": "3.2.25", "eth-sig-util": "^2.1.1", + "ethereumjs-block": "^2.2.2", + "ethereumjs-tx": "^1.3.7", + "ethereumjs-util": "^6.0.0", "ethereumjs-wallet": "1.0.2", + "ganache": "7.9.2", + "import-toml": "^1.0.0", + "merkle-patricia-tree": "^2.3.2", + "mocha": "10.2.0", + "nunjucks": "^3.2.0", "prettier": "^3.0.3", - "prettier-plugin-solidity": "1.1.3", - "solhint": "^3.6.2", "solidity-coverage": "0.8.4" } }, @@ -44,42 +39,6 @@ "node": ">=0.10.0" } }, - "node_modules/@babel/code-frame": { - "version": "7.23.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.5.tgz", - "integrity": "sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==", - "dev": true, - "dependencies": { - "@babel/highlight": "^7.23.4", - "chalk": "^2.4.2" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-validator-identifier": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", - "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", - "dev": true, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/highlight": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", - "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.22.20", - "chalk": "^2.4.2", - "js-tokens": "^4.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/@babel/runtime": { "version": "7.23.6", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.6.tgz", @@ -1109,7 +1068,8 @@ "node_modules/@iarna/toml": { "version": "2.2.5", "resolved": "https://registry.npmjs.org/@iarna/toml/-/toml-2.2.5.tgz", - "integrity": "sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==" + "integrity": "sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==", + "dev": true }, "node_modules/@jridgewell/resolve-uri": { "version": "3.1.1", @@ -3346,6 +3306,7 @@ "version": "4.11.6", "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", + "dev": true, "dependencies": { "@types/node": "*" } @@ -3427,7 +3388,9 @@ "node_modules/@types/lru-cache": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/@types/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw==" + "integrity": "sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw==", + "dev": true, + "peer": true }, "node_modules/@types/minimatch": { "version": "5.1.2", @@ -3446,6 +3409,7 @@ "version": "20.10.5", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.5.tgz", "integrity": "sha512-nNPsNE65wjMxEKI93yOP+NPGGBJz/PoN3kZsVLee0XMiJolxSekEVD8wRwBUBqkwc7UWop0edW50yrCQW4CyRw==", + "dev": true, "dependencies": { "undici-types": "~5.26.4" } @@ -3454,6 +3418,7 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.2.tgz", "integrity": "sha512-uRwJqmiXmh9++aSu1VNEn3iIxWOhd8AHXNSdlaLfdAAdSTY9jYVeGWnzejM3dvrkbqE3/hyQkQQ29IFATEGlew==", + "dev": true, "dependencies": { "@types/node": "*" } @@ -3503,6 +3468,7 @@ "version": "4.0.6", "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.6.tgz", "integrity": "sha512-hHxJU6PAEUn0TP4S/ZOzuTUvJWuZ6eIKeNKb5RBpODvSl6hp1Wrw4s7ATY50rklRCScUDpHzVA/DQdSjJ3UoYQ==", + "dev": true, "dependencies": { "@types/node": "*" } @@ -3516,7 +3482,8 @@ "node_modules/a-sync-waterfall": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/a-sync-waterfall/-/a-sync-waterfall-1.0.1.tgz", - "integrity": "sha512-RYTOHHdWipFUliRFMCS4X2Yn2X8M87V/OpSqWzKKOGhzqyUxzyVmhHDH9sAvG+ZuQf/TAOFsLCpMw09I1ufUnA==" + "integrity": "sha512-RYTOHHdWipFUliRFMCS4X2Yn2X8M87V/OpSqWzKKOGhzqyUxzyVmhHDH9sAvG+ZuQf/TAOFsLCpMw09I1ufUnA==", + "dev": true }, "node_modules/abbrev": { "version": "1.0.9", @@ -3534,6 +3501,8 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/abstract-level/-/abstract-level-1.0.3.tgz", "integrity": "sha512-t6jv+xHy+VYwc4xqZMn2Pa9DjcdzvzZmQGRjTFc8spIbRGHgBrEKbPq+rYXc7CCo0lxgYvSgKVg9qZAhpVQSjA==", + "dev": true, + "peer": true, "dependencies": { "buffer": "^6.0.3", "catering": "^2.1.0", @@ -3551,6 +3520,7 @@ "version": "6.0.3", "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "dev": true, "funding": [ { "type": "github", @@ -3565,6 +3535,7 @@ "url": "https://feross.org/support" } ], + "peer": true, "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" @@ -3574,6 +3545,7 @@ "version": "2.6.3", "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz", "integrity": "sha512-2++wDf/DYqkPR3o5tbfdhF96EfMApo1GpPfzOsR/ZYXdkSmELlvOOEAl9iKkRsktMPHdGjO4rtkBpf2I7TiTeA==", + "dev": true, "dependencies": { "xtend": "~4.0.0" } @@ -3582,6 +3554,7 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true, "engines": { "node": ">=0.4" } @@ -3767,15 +3740,6 @@ "node": ">=4" } }, - "node_modules/antlr4": { - "version": "4.13.1", - "resolved": "https://registry.npmjs.org/antlr4/-/antlr4-4.13.1.tgz", - "integrity": "sha512-kiXTspaRYvnIArgE97z5YVVf/cDVQABr3abFRR6mE7yesLMkgu4ujuyV/sgxafQ8wgve0DJQUJ38Z8tkgA2izA==", - "dev": true, - "engines": { - "node": ">=16" - } - }, "node_modules/antlr4ts": { "version": "0.5.0-alpha.4", "resolved": "https://registry.npmjs.org/antlr4ts/-/antlr4ts-0.5.0-alpha.4.tgz", @@ -3786,6 +3750,7 @@ "version": "3.1.3", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, "dependencies": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" @@ -3804,7 +3769,8 @@ "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true }, "node_modules/array-back": { "version": "3.1.0", @@ -3897,7 +3863,8 @@ "node_modules/asap": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", - "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==" + "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==", + "dev": true }, "node_modules/asn1": { "version": "0.2.6", @@ -3926,17 +3893,12 @@ "node": "*" } }, - "node_modules/ast-parents": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/ast-parents/-/ast-parents-0.0.1.tgz", - "integrity": "sha512-XHusKxKz3zoYk1ic8Un640joHbFMhbqneyoZfoKnEGtf2ey9Uh/IdpcQplODdO/kENaMIWsD0nJm4+wX3UNLHA==", - "dev": true - }, "node_modules/astral-regex": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", "dev": true, + "peer": true, "engines": { "node": ">=8" } @@ -3945,6 +3907,7 @@ "version": "2.6.4", "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", + "dev": true, "dependencies": { "lodash": "^4.17.14" } @@ -4013,12 +3976,14 @@ "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true }, "node_modules/base-x": { "version": "3.0.9", "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.9.tgz", "integrity": "sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ==", + "dev": true, "dependencies": { "safe-buffer": "^5.0.1" } @@ -4027,6 +3992,7 @@ "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true, "funding": [ { "type": "github", @@ -4108,6 +4074,7 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true, "engines": { "node": ">=8" } @@ -4128,7 +4095,8 @@ "node_modules/blakejs": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.2.1.tgz", - "integrity": "sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==" + "integrity": "sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==", + "dev": true }, "node_modules/bluebird": { "version": "3.7.2", @@ -4139,7 +4107,8 @@ "node_modules/bn.js": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", - "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", + "dev": true }, "node_modules/body-parser": { "version": "1.20.2", @@ -4205,6 +4174,7 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -4214,6 +4184,7 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, "dependencies": { "fill-range": "^7.0.1" }, @@ -4224,7 +4195,8 @@ "node_modules/brorand": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==" + "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==", + "dev": true }, "node_modules/browser-level": { "version": "1.0.1", @@ -4242,12 +4214,14 @@ "node_modules/browser-stdout": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==" + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true }, "node_modules/browserify-aes": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "dev": true, "dependencies": { "buffer-xor": "^1.0.3", "cipher-base": "^1.0.0", @@ -4261,6 +4235,7 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", + "dev": true, "dependencies": { "base-x": "^3.0.2" } @@ -4269,6 +4244,7 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz", "integrity": "sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==", + "dev": true, "dependencies": { "bs58": "^4.0.0", "create-hash": "^1.1.0", @@ -4315,13 +4291,14 @@ "node_modules/buffer-xor": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==" + "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==", + "dev": true }, "node_modules/bufferutil": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.8.tgz", "integrity": "sha512-4T53u4PdgsXqKaIctwF8ifXlRTTmEPJ8iEPWFdGZvcf7sbwYo6FKFEX9eNNAnzFZ7EzJAQ3CJeOtCRA4rDp7Pw==", - "devOptional": true, + "dev": true, "hasInstallScript": true, "dependencies": { "node-gyp-build": "^4.3.0" @@ -4452,6 +4429,8 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/catering/-/catering-2.1.1.tgz", "integrity": "sha512-K7Qy8O9p76sL3/3m7/zLKbRkyOlSZAgzEaLhyj2mXS8PsCud2Eo4hAb8aLtZqHh0QGqLcb9dlJSu6lHRVENm1w==", + "dev": true, + "peer": true, "engines": { "node": ">=6" } @@ -4604,6 +4583,7 @@ "version": "3.5.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "dev": true, "funding": [ { "type": "individual", @@ -4630,6 +4610,7 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, "dependencies": { "is-glob": "^4.0.1" }, @@ -4683,6 +4664,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dev": true, "dependencies": { "inherits": "^2.0.1", "safe-buffer": "^5.0.1" @@ -4743,6 +4725,7 @@ "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", @@ -4753,6 +4736,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, "engines": { "node": ">=8" } @@ -4761,6 +4745,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, "engines": { "node": ">=8" } @@ -4769,6 +4754,7 @@ "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -4782,6 +4768,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -4909,6 +4896,7 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==", + "dev": true, "engines": { "node": ">= 6" } @@ -4916,7 +4904,8 @@ "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true }, "node_modules/concat-stream": { "version": "1.6.2", @@ -5028,7 +5017,8 @@ "node_modules/core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==" + "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", + "dev": true }, "node_modules/cors": { "version": "2.8.5", @@ -5043,32 +5033,6 @@ "node": ">= 0.10" } }, - "node_modules/cosmiconfig": { - "version": "8.3.6", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.3.6.tgz", - "integrity": "sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA==", - "dev": true, - "dependencies": { - "import-fresh": "^3.3.0", - "js-yaml": "^4.1.0", - "parse-json": "^5.2.0", - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/d-fischer" - }, - "peerDependencies": { - "typescript": ">=4.9.5" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, "node_modules/crc-32": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", @@ -5085,6 +5049,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dev": true, "dependencies": { "cipher-base": "^1.0.1", "inherits": "^2.0.1", @@ -5097,6 +5062,7 @@ "version": "1.1.7", "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dev": true, "dependencies": { "cipher-base": "^1.0.3", "create-hash": "^1.1.0", @@ -5221,6 +5187,7 @@ "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, "dependencies": { "ms": "2.1.2" }, @@ -5237,6 +5204,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "dev": true, "engines": { "node": ">=10" }, @@ -5321,6 +5289,7 @@ "version": "1.2.2", "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-1.2.2.tgz", "integrity": "sha512-uukrWD2bguRtXilKt6cAWKyoXrTSMo5m7crUdLfWQmu8kIm88w3QZoUL+6nhpfKVmhHANER6Re3sKoNoZ3IKMA==", + "dev": true, "dependencies": { "abstract-leveldown": "~2.6.0" } @@ -5420,6 +5389,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", + "dev": true, "engines": { "node": ">=0.3.1" } @@ -5562,6 +5532,7 @@ "version": "6.5.4", "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "dev": true, "dependencies": { "bn.js": "^4.11.9", "brorand": "^1.1.0", @@ -5575,12 +5546,14 @@ "node_modules/elliptic/node_modules/bn.js": { "version": "4.12.0", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true }, "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true }, "node_modules/encodeurl": { "version": "1.0.2", @@ -5673,6 +5646,7 @@ "version": "0.1.8", "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz", "integrity": "sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==", + "dev": true, "dependencies": { "prr": "~1.0.1" }, @@ -5852,6 +5826,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true, "engines": { "node": ">=6" } @@ -6480,12 +6455,14 @@ "node_modules/ethereum-common": { "version": "0.0.18", "resolved": "https://registry.npmjs.org/ethereum-common/-/ethereum-common-0.0.18.tgz", - "integrity": "sha512-EoltVQTRNg2Uy4o84qpa2aXymXDJhxm7eos/ACOg0DG4baAbMjhbdAEsx9GeE8sC3XCxnYvrrzZDH8D8MtA2iQ==" + "integrity": "sha512-EoltVQTRNg2Uy4o84qpa2aXymXDJhxm7eos/ACOg0DG4baAbMjhbdAEsx9GeE8sC3XCxnYvrrzZDH8D8MtA2iQ==", + "dev": true }, "node_modules/ethereum-cryptography": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "dev": true, "dependencies": { "@types/pbkdf2": "^3.0.0", "@types/secp256k1": "^4.0.1", @@ -6525,6 +6502,7 @@ "resolved": "https://registry.npmjs.org/ethereumjs-block/-/ethereumjs-block-2.2.2.tgz", "integrity": "sha512-2p49ifhek3h2zeg/+da6XpdFR3GlqY3BIEiqxGF8j9aSRIgkb7M1Ky+yULBKJOu8PAZxfhsYA+HxUk2aCQp3vg==", "deprecated": "New package name format for new versions: @ethereumjs/block. Please update.", + "dev": true, "dependencies": { "async": "^2.0.1", "ethereumjs-common": "^1.5.0", @@ -6536,13 +6514,15 @@ "node_modules/ethereumjs-block/node_modules/bn.js": { "version": "4.12.0", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true }, "node_modules/ethereumjs-block/node_modules/ethereumjs-tx": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-2.1.2.tgz", "integrity": "sha512-zZEK1onCeiORb0wyCXUvg94Ve5It/K6GD1K+26KfFKodiBiS6d9lfCXlUKGBBdQ+bv7Day+JK0tj1K+BeNFRAw==", "deprecated": "New package name format for new versions: @ethereumjs/tx. Please update.", + "dev": true, "dependencies": { "ethereumjs-common": "^1.5.0", "ethereumjs-util": "^6.0.0" @@ -6552,6 +6532,7 @@ "version": "6.2.1", "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", + "dev": true, "dependencies": { "@types/bn.js": "^4.11.3", "bn.js": "^4.11.0", @@ -6566,6 +6547,7 @@ "version": "5.2.1", "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz", "integrity": "sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ==", + "dev": true, "dependencies": { "bn.js": "^4.11.0", "create-hash": "^1.1.2", @@ -6580,13 +6562,15 @@ "version": "1.5.2", "resolved": "https://registry.npmjs.org/ethereumjs-common/-/ethereumjs-common-1.5.2.tgz", "integrity": "sha512-hTfZjwGX52GS2jcVO6E2sx4YuFnf0Fhp5ylo4pEPhEffNln7vS59Hr5sLnp3/QCazFLluuBZ+FZ6J5HTp0EqCA==", - "deprecated": "New package name format for new versions: @ethereumjs/common. Please update." + "deprecated": "New package name format for new versions: @ethereumjs/common. Please update.", + "dev": true }, "node_modules/ethereumjs-tx": { "version": "1.3.7", "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-1.3.7.tgz", "integrity": "sha512-wvLMxzt1RPhAQ9Yi3/HKZTn0FZYpnsmQdbKYfUUpi4j1SEIcbkd9tndVjcPrufY3V7j2IebOpC00Zp2P/Ay2kA==", "deprecated": "New package name format for new versions: @ethereumjs/tx. Please update.", + "dev": true, "dependencies": { "ethereum-common": "^0.0.18", "ethereumjs-util": "^5.0.0" @@ -6595,12 +6579,14 @@ "node_modules/ethereumjs-tx/node_modules/bn.js": { "version": "4.12.0", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true }, "node_modules/ethereumjs-tx/node_modules/ethereumjs-util": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz", "integrity": "sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ==", + "dev": true, "dependencies": { "bn.js": "^4.11.0", "create-hash": "^1.1.2", @@ -6615,6 +6601,7 @@ "version": "6.2.1", "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", + "dev": true, "dependencies": { "@types/bn.js": "^4.11.3", "bn.js": "^4.11.0", @@ -6628,7 +6615,8 @@ "node_modules/ethereumjs-util/node_modules/bn.js": { "version": "4.12.0", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true }, "node_modules/ethereumjs-wallet": { "version": "1.0.2", @@ -6770,6 +6758,7 @@ "version": "0.1.6", "resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz", "integrity": "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==", + "dev": true, "dependencies": { "is-hex-prefixed": "1.0.0", "strip-hex-prefix": "1.0.0" @@ -6789,6 +6778,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dev": true, "dependencies": { "md5.js": "^1.3.4", "safe-buffer": "^5.1.1" @@ -6966,12 +6956,6 @@ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, - "node_modules/fast-diff": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", - "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", - "dev": true - }, "node_modules/fast-glob": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", @@ -7037,6 +7021,7 @@ "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, "dependencies": { "to-regex-range": "^5.0.1" }, @@ -7107,6 +7092,7 @@ "version": "5.0.2", "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true, "bin": { "flat": "cli.js" } @@ -7250,12 +7236,14 @@ "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true }, "node_modules/fsevents": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, "hasInstallScript": true, "optional": true, "os": [ @@ -7295,7 +7283,8 @@ "node_modules/functional-red-black-tree": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==" + "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", + "dev": true }, "node_modules/functions-have-names": { "version": "1.2.3", @@ -7316,6 +7305,7 @@ "leveldown", "secp256k1" ], + "dev": true, "hasShrinkwrap": true, "dependencies": { "@trufflesuite/bigint-buffer": "1.1.10", @@ -7553,6 +7543,7 @@ "version": "1.1.10", "resolved": "https://registry.npmjs.org/@trufflesuite/bigint-buffer/-/bigint-buffer-1.1.10.tgz", "integrity": "sha512-pYIQC5EcMmID74t26GCC67946mgTJFiLXOT/BYozgrd4UEY2JHEGLhWi9cMiQCt5BSqFEvKkCHNnoj82SRjiEw==", + "dev": true, "hasInstallScript": true, "inBundle": true, "license": "Apache-2.0", @@ -7567,6 +7558,7 @@ "version": "4.4.0", "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.4.0.tgz", "integrity": "sha512-amJnQCcgtRVw9SvoebO3BKGESClrfXGCUTX9hSn1OuGQTQBOZmVd0Z0OlecpuRksKvbsUqALE8jls/ErClAPuQ==", + "dev": true, "inBundle": true, "license": "MIT", "bin": { @@ -7579,6 +7571,7 @@ "version": "20.30.0-unofficial.0", "resolved": "https://registry.npmjs.org/@trufflesuite/uws-js-unofficial/-/uws-js-unofficial-20.30.0-unofficial.0.tgz", "integrity": "sha512-r5X0aOQcuT6pLwTRLD+mPnAM/nlKtvIK4Z+My++A8tTOR0qTjNRx8UB8jzRj3D+p9PMAp5LnpCUUGmz7/TppwA==", + "dev": true, "dependencies": { "ws": "8.13.0" }, @@ -7591,6 +7584,7 @@ "version": "4.0.7", "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.7.tgz", "integrity": "sha512-kukuqc39WOHtdxtw4UScxF/WVnMFVSQVKhtx3AjZJzhd0RGZZldcrfSEbVsWWe6KNH253574cq5F+wpv0G9pJw==", + "dev": true, "hasInstallScript": true, "optional": true, "dependencies": { @@ -7604,6 +7598,7 @@ "version": "6.0.3", "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-6.0.3.tgz", "integrity": "sha512-uIuGf9TWQ/y+0Lp+KGZCMuJWc3N9BHA+l/UmHd/oUHwJJDeysyTRxNQVkbzsIWfGFbRe3OcgML/i0mvVRPOyDA==", + "dev": true, "hasInstallScript": true, "optional": true, "dependencies": { @@ -7617,6 +7612,7 @@ "version": "8.13.0", "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", + "dev": true, "engines": { "node": ">=10.0.0" }, @@ -7673,6 +7669,7 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.0.tgz", "integrity": "sha512-QSSVYj7pYFN49kW77o2s9xTCwZ8F2xLbjLLSEVh8D2F4JUhZtPAGOFLTD+ffqksBx/u4cE/KImFjyhqCjn/LIA==", + "dev": true, "dependencies": { "@types/node": "*" } @@ -7712,7 +7709,8 @@ "node_modules/ganache/node_modules/@types/lru-cache": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/@types/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw==" + "integrity": "sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw==", + "dev": true }, "node_modules/ganache/node_modules/@types/mocha": { "version": "9.0.0", @@ -7723,12 +7721,14 @@ "node_modules/ganache/node_modules/@types/node": { "version": "17.0.0", "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.0.tgz", - "integrity": "sha512-eMhwJXc931Ihh4tkU+Y7GiLzT/y/DBNpNtr4yU9O2w3SYBsr9NaOPhQlLKRmoWtI54uNwuo0IOUFQjVOTZYRvw==" + "integrity": "sha512-eMhwJXc931Ihh4tkU+Y7GiLzT/y/DBNpNtr4yU9O2w3SYBsr9NaOPhQlLKRmoWtI54uNwuo0IOUFQjVOTZYRvw==", + "dev": true }, "node_modules/ganache/node_modules/@types/seedrandom": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/@types/seedrandom/-/seedrandom-3.0.1.tgz", - "integrity": "sha512-giB9gzDeiCeloIXDgzFBCgjj1k4WxcDrZtGl6h1IqmUPlxF+Nx8Ve+96QCyDZ/HseB/uvDsKbpib9hU5cU53pw==" + "integrity": "sha512-giB9gzDeiCeloIXDgzFBCgjj1k4WxcDrZtGl6h1IqmUPlxF+Nx8Ve+96QCyDZ/HseB/uvDsKbpib9hU5cU53pw==", + "dev": true }, "node_modules/ganache/node_modules/@ungap/promise-all-settled": { "version": "1.1.2", @@ -7919,6 +7919,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/abstract-level/-/abstract-level-1.0.3.tgz", "integrity": "sha512-t6jv+xHy+VYwc4xqZMn2Pa9DjcdzvzZmQGRjTFc8spIbRGHgBrEKbPq+rYXc7CCo0lxgYvSgKVg9qZAhpVQSjA==", + "dev": true, "dependencies": { "buffer": "^6.0.3", "catering": "^2.1.0", @@ -7936,6 +7937,7 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/level-supports/-/level-supports-4.0.1.tgz", "integrity": "sha512-PbXpve8rKeNcZ9C1mUicC9auIYFyGpkV9/i6g76tLgANwWhtG2v7I4xNBUlkn3lE2/dZF3Pi0ygYGtLc4RXXdA==", + "dev": true, "engines": { "node": ">=12" } @@ -7944,6 +7946,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-7.2.0.tgz", "integrity": "sha512-DnhQwcFEaYsvYDnACLZhMmCWd3rkOeEvglpa4q5i/5Jlm3UIsWaxVzuXvDLFCSCWRO3yy2/+V/G7FusFgejnfQ==", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -8095,6 +8098,7 @@ "version": "2.6.4", "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", + "dev": true, "dependencies": { "lodash": "^4.17.14" } @@ -8103,6 +8107,7 @@ "version": "0.2.4", "resolved": "https://registry.npmjs.org/async-eventemitter/-/async-eventemitter-0.2.4.tgz", "integrity": "sha512-pd20BwL7Yt1zwDFy+8MX8F1+WCT8aQeKj0kQnTrH9WaeRETlRamVhD0JtRPmrV4GfOJ2F9CvdQkZeZhnh2TuHw==", + "dev": true, "dependencies": { "async": "^2.4.0" } @@ -8126,6 +8131,7 @@ "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true, "funding": [ { "type": "github", @@ -8193,6 +8199,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", + "dev": true, "inBundle": true, "license": "MIT" }, @@ -8288,6 +8295,7 @@ "version": "6.0.3", "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "dev": true, "funding": [ { "type": "github", @@ -8325,6 +8333,7 @@ "version": "4.0.5", "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.5.tgz", "integrity": "sha512-HTm14iMQKK2FjFLRTM5lAVcyaUzOnqbPtesFIvREgXpJHdQm8bWS+GkQgIkfaBYRHuCnea7w8UVNfwiAQhlr9A==", + "dev": true, "hasInstallScript": true, "optional": true, "dependencies": { @@ -8369,6 +8378,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/catering/-/catering-2.1.1.tgz", "integrity": "sha512-K7Qy8O9p76sL3/3m7/zLKbRkyOlSZAgzEaLhyj2mXS8PsCud2Eo4hAb8aLtZqHh0QGqLcb9dlJSu6lHRVENm1w==", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -8699,6 +8709,7 @@ "version": "6.5.4", "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -8715,6 +8726,7 @@ "version": "4.12.0", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true, "inBundle": true, "license": "MIT" }, @@ -8722,6 +8734,7 @@ "version": "0.10.0", "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.10.0.tgz", "integrity": "sha512-AGvFfs+d0JKCJQ4o01ASQLGPmSCxgfU9RFXvzPvZdjKK8oscynksuJhWrSTSw7j7Ep/sZct5b5ZhYCi8S/t0HQ==", + "dev": true, "engines": { "node": ">=12" } @@ -9137,6 +9150,7 @@ "version": "1.1.7", "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -9157,6 +9171,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -9184,6 +9199,7 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true, "funding": [ { "type": "github", @@ -9240,6 +9256,7 @@ "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true, "inBundle": true, "license": "ISC" }, @@ -9281,6 +9298,7 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==", + "dev": true, "funding": [ { "type": "github", @@ -9528,6 +9546,7 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.2.tgz", "integrity": "sha512-PyKKjkH53wDMLGrvmRGSNWgmSxZOUqbnXwKL9tmgbFYA1iAYqW21kfR7mZXV0MlESiefxQQE9X9fTa3X+2MPDQ==", + "dev": true, "hasInstallScript": true, "inBundle": true, "license": "MIT", @@ -9553,6 +9572,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/level-concat-iterator/-/level-concat-iterator-3.1.0.tgz", "integrity": "sha512-BWRCMHBxbIqPxJ8vHOvKUsaO0v1sLYZtjN3K2iZJsRBYtp+ONsY6Jfi6hy9K3+zolgQRryhIn2NRZjZnWJ9NmQ==", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -9579,6 +9599,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/level-supports/-/level-supports-2.1.0.tgz", "integrity": "sha512-E486g1NCjW5cF78KGPrMDRBYzPuueMZ6VBXHT6gC7A8UYWGiM14fGgp+s/L1oFfDWSPV/+SFkYCmZ0SiESkRKA==", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -9589,6 +9610,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/level-transcoder/-/level-transcoder-1.0.1.tgz", "integrity": "sha512-t7bFwFtsQeD8cl8NIoQ2iwxA0CL/9IFw7/9gAjOonH0PWTTiRfY7Hq+Ejbsxh86tXobDQ6IOiddjNYIfOBs06w==", + "dev": true, "dependencies": { "buffer": "^6.0.3", "module-error": "^1.0.1" @@ -9601,6 +9623,7 @@ "version": "6.1.0", "resolved": "https://registry.npmjs.org/leveldown/-/leveldown-6.1.0.tgz", "integrity": "sha512-8C7oJDT44JXxh04aSSsfcMI8YiaGRhOFI9/pMEL7nWJLVsWajDPTRxsSHTM2WcTVY5nXM+SuRHzPPi0GbnDX+w==", + "dev": true, "hasInstallScript": true, "inBundle": true, "license": "MIT", @@ -9651,7 +9674,8 @@ "node_modules/ganache/node_modules/lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true }, "node_modules/ganache/node_modules/lodash.get": { "version": "4.4.2", @@ -9794,6 +9818,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "dev": true, "inBundle": true, "license": "ISC" }, @@ -9801,6 +9826,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", + "dev": true, "inBundle": true, "license": "MIT" }, @@ -9865,6 +9891,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/module-error/-/module-error-1.0.2.tgz", "integrity": "sha512-0yuvsqSCv8LbaOKhnsQ/T5JhyFlCYLPXK3U2sgV10zoKQwzs/MyfuQUOZQ1V/6OCOJsK/TRgNVrPuPDqtdMFtA==", + "dev": true, "engines": { "node": ">=10" } @@ -9891,6 +9918,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/napi-macros/-/napi-macros-2.0.0.tgz", "integrity": "sha512-A0xLykHtARfueITVDernsAWdtIMbOJgKgcluwENp3AlsKN/PloyO10HtmoqnFAQAcxPkgZN7wdfPfEd0zNGxbg==", + "dev": true, "inBundle": true, "license": "MIT" }, @@ -9904,6 +9932,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==", + "dev": true, "inBundle": true, "license": "MIT" }, @@ -9911,6 +9940,7 @@ "version": "4.5.0", "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.5.0.tgz", "integrity": "sha512-2iGbaQBV+ITgCz76ZEjmhUKAKVf7xfY1sRl4UiKQspfZMH2h06SyhNsnSVy50cwkFQDGLyif6m/6uFXHkOZ6rg==", + "dev": true, "inBundle": true, "license": "MIT", "bin": { @@ -10227,6 +10257,7 @@ "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, "funding": [ { "type": "github", @@ -10267,6 +10298,7 @@ "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -10364,6 +10396,7 @@ "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, "funding": [ { "type": "github", @@ -10411,6 +10444,7 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.3.tgz", "integrity": "sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA==", + "dev": true, "hasInstallScript": true, "inBundle": true, "license": "MIT", @@ -10595,6 +10629,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -10828,6 +10863,7 @@ "version": "5.0.7", "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.7.tgz", "integrity": "sha512-vLt1O5Pp+flcArHGIyKEQq883nBt8nN8tVBcoL0qUXj2XT1n7p70yGIq2VK98I5FdZ1YHc0wk/koOnHjnXWk1Q==", + "dev": true, "hasInstallScript": true, "optional": true, "dependencies": { @@ -10855,6 +10891,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true, "inBundle": true, "license": "MIT" }, @@ -11172,6 +11209,7 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, "engines": { "node": "6.* || 8.* || >= 10.*" } @@ -11264,6 +11302,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -11893,6 +11932,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "dev": true, "dependencies": { "inherits": "^2.0.4", "readable-stream": "^3.6.0", @@ -11906,6 +11946,7 @@ "version": "1.1.7", "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dev": true, "dependencies": { "inherits": "^2.0.3", "minimalistic-assert": "^1.0.1" @@ -11927,6 +11968,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true, "bin": { "he": "bin/he" } @@ -11966,6 +12008,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", + "dev": true, "dependencies": { "hash.js": "^1.0.3", "minimalistic-assert": "^1.0.0", @@ -12128,6 +12171,7 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true, "funding": [ { "type": "github", @@ -12155,7 +12199,8 @@ "node_modules/immediate": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.3.0.tgz", - "integrity": "sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q==" + "integrity": "sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q==", + "dev": true }, "node_modules/immutable": { "version": "4.3.4", @@ -12184,6 +12229,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/import-toml/-/import-toml-1.0.0.tgz", "integrity": "sha512-TkYSG1Rs9GiKk+hE/+yzugkmB6RY6llF2BgfxjLMZEg1QV36WUxrqnGWzb+ZdU61v5Hn3UWk7ePADdymFERpvA==", + "dev": true, "dependencies": { "@iarna/toml": "^2.2.5" }, @@ -12214,6 +12260,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -12222,7 +12269,8 @@ "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true }, "node_modules/ini": { "version": "1.3.8", @@ -12333,6 +12381,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, "dependencies": { "binary-extensions": "^2.0.0" }, @@ -12360,6 +12409,7 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==", + "dev": true, "funding": [ { "type": "github", @@ -12409,6 +12459,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -12447,6 +12498,7 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, "dependencies": { "is-extglob": "^2.1.1" }, @@ -12458,6 +12510,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", "integrity": "sha512-WvtOiug1VFrE9v1Cydwm+FnXd3+w9GaeVUss5W4v/SLy3UW00vP+6iNF2SdnfiBoLy4bTqVdkftNGTUeOFVsbA==", + "dev": true, "engines": { "node": ">=6.5.0", "npm": ">=3" @@ -12488,6 +12541,7 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, "engines": { "node": ">=0.12.0" } @@ -12520,6 +12574,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true, "engines": { "node": ">=8" } @@ -12607,6 +12662,7 @@ "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true, "engines": { "node": ">=10" }, @@ -12644,7 +12700,8 @@ "node_modules/isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true }, "node_modules/isexe": { "version": "2.0.0", @@ -12675,16 +12732,11 @@ "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==", "dev": true }, - "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, "node_modules/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, "dependencies": { "argparse": "^2.0.1" }, @@ -12704,12 +12756,6 @@ "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", "dev": true }, - "node_modules/json-parse-even-better-errors": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", - "dev": true - }, "node_modules/json-schema": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", @@ -12771,6 +12817,7 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.4.tgz", "integrity": "sha512-3vKuW0jV8J3XNTzvfyicFR5qvxrSAGl7KIhvgOu5cmWwM7tZRj3fMbj/pfIf4be7aznbc+prBWGjywox/g2Y6Q==", + "dev": true, "hasInstallScript": true, "dependencies": { "node-addon-api": "^2.0.0", @@ -12841,12 +12888,14 @@ "node_modules/level-codec": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-7.0.1.tgz", - "integrity": "sha512-Ua/R9B9r3RasXdRmOtd+t9TCOEIIlts+TN/7XTT2unhDaL6sJn83S3rUyljbr6lVtw49N3/yA0HHjpV6Kzb2aQ==" + "integrity": "sha512-Ua/R9B9r3RasXdRmOtd+t9TCOEIIlts+TN/7XTT2unhDaL6sJn83S3rUyljbr6lVtw49N3/yA0HHjpV6Kzb2aQ==", + "dev": true }, "node_modules/level-errors": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-1.0.5.tgz", "integrity": "sha512-/cLUpQduF6bNrWuAC4pwtUKA5t669pCsCi2XbmojG2tFeOr9j6ShtdDCtFFQO1DRt+EVZhx9gPzP9G2bUaG4ig==", + "dev": true, "dependencies": { "errno": "~0.1.1" } @@ -12855,6 +12904,7 @@ "version": "1.3.1", "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-1.3.1.tgz", "integrity": "sha512-1qua0RHNtr4nrZBgYlpV0qHHeHpcRRWTxEZJ8xsemoHAXNL5tbooh4tPEEqIqsbWCAJBmUmkwYK/sW5OrFjWWw==", + "dev": true, "dependencies": { "inherits": "^2.0.1", "level-errors": "^1.0.3", @@ -12865,12 +12915,14 @@ "node_modules/level-iterator-stream/node_modules/isarray": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==" + "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", + "dev": true }, "node_modules/level-iterator-stream/node_modules/readable-stream": { "version": "1.1.14", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", "integrity": "sha512-+MeVjFf4L44XUkhM1eYbD8fyEsxcV81pqMSR5gblfcLCHfZvbrqy4/qYHE+/R5HoBUT11WV5O08Cr1n3YXkWVQ==", + "dev": true, "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.1", @@ -12881,12 +12933,14 @@ "node_modules/level-iterator-stream/node_modules/string_decoder": { "version": "0.10.31", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==" + "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==", + "dev": true }, "node_modules/level-iterator-stream/node_modules/xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true, "engines": { "node": ">=0.4" } @@ -12895,6 +12949,8 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/level-supports/-/level-supports-4.0.1.tgz", "integrity": "sha512-PbXpve8rKeNcZ9C1mUicC9auIYFyGpkV9/i6g76tLgANwWhtG2v7I4xNBUlkn3lE2/dZF3Pi0ygYGtLc4RXXdA==", + "dev": true, + "peer": true, "engines": { "node": ">=12" } @@ -12903,6 +12959,8 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/level-transcoder/-/level-transcoder-1.0.1.tgz", "integrity": "sha512-t7bFwFtsQeD8cl8NIoQ2iwxA0CL/9IFw7/9gAjOonH0PWTTiRfY7Hq+Ejbsxh86tXobDQ6IOiddjNYIfOBs06w==", + "dev": true, + "peer": true, "dependencies": { "buffer": "^6.0.3", "module-error": "^1.0.1" @@ -12915,6 +12973,7 @@ "version": "6.0.3", "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "dev": true, "funding": [ { "type": "github", @@ -12929,6 +12988,7 @@ "url": "https://feross.org/support" } ], + "peer": true, "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" @@ -12938,6 +12998,7 @@ "version": "0.0.0", "resolved": "https://registry.npmjs.org/level-ws/-/level-ws-0.0.0.tgz", "integrity": "sha512-XUTaO/+Db51Uiyp/t7fCMGVFOTdtLS/NIACxE/GHsij15mKzxksZifKVjlXDF41JMUP/oM1Oc4YNGdKnc3dVLw==", + "dev": true, "dependencies": { "readable-stream": "~1.0.15", "xtend": "~2.1.1" @@ -12946,12 +13007,14 @@ "node_modules/level-ws/node_modules/isarray": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==" + "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", + "dev": true }, "node_modules/level-ws/node_modules/readable-stream": { "version": "1.0.34", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", "integrity": "sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg==", + "dev": true, "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.1", @@ -12962,12 +13025,14 @@ "node_modules/level-ws/node_modules/string_decoder": { "version": "0.10.31", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==" + "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==", + "dev": true }, "node_modules/levelup": { "version": "1.3.9", "resolved": "https://registry.npmjs.org/levelup/-/levelup-1.3.9.tgz", "integrity": "sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ==", + "dev": true, "dependencies": { "deferred-leveldown": "~1.2.1", "level-codec": "~7.0.0", @@ -12982,6 +13047,7 @@ "version": "5.4.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==", + "dev": true, "bin": { "semver": "bin/semver" } @@ -12990,6 +13056,7 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true, "engines": { "node": ">=0.4" } @@ -13007,12 +13074,6 @@ "node": ">= 0.8.0" } }, - "node_modules/lines-and-columns": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", - "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", - "dev": true - }, "node_modules/load-json-file": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", @@ -13065,7 +13126,8 @@ "node_modules/lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true }, "node_modules/lodash.assign": { "version": "4.2.0", @@ -13096,12 +13158,14 @@ "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", "integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==", - "dev": true + "dev": true, + "peer": true }, "node_modules/log-symbols": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, "dependencies": { "chalk": "^4.1.0", "is-unicode-supported": "^0.1.0" @@ -13117,6 +13181,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -13131,6 +13196,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -13146,6 +13212,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -13156,12 +13223,14 @@ "node_modules/log-symbols/node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, "node_modules/log-symbols/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, "engines": { "node": ">=8" } @@ -13170,6 +13239,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -13233,7 +13303,8 @@ "node_modules/ltgt": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", - "integrity": "sha512-AI2r85+4MquTw9ZYqabu4nMwy9Oftlfa/e/52t9IjtfG+mGBbTNdAoZ3RQKLHR6r0wQnwZnPIEh/Ya6XTWAKNA==" + "integrity": "sha512-AI2r85+4MquTw9ZYqabu4nMwy9Oftlfa/e/52t9IjtfG+mGBbTNdAoZ3RQKLHR6r0wQnwZnPIEh/Ya6XTWAKNA==", + "dev": true }, "node_modules/make-error": { "version": "1.3.6", @@ -13263,6 +13334,7 @@ "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "dev": true, "dependencies": { "hash-base": "^3.0.0", "inherits": "^2.0.1", @@ -13282,6 +13354,7 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/memdown/-/memdown-1.4.1.tgz", "integrity": "sha512-iVrGHZB8i4OQfM155xx8akvG9FIj+ht14DX5CQkCTG4EHzZ3d3sgckIf/Lm9ivZalEsFuEVnWv2B2WZvbrro2w==", + "dev": true, "dependencies": { "abstract-leveldown": "~2.7.1", "functional-red-black-tree": "^1.0.1", @@ -13295,6 +13368,7 @@ "version": "2.7.2", "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz", "integrity": "sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w==", + "dev": true, "dependencies": { "xtend": "~4.0.0" } @@ -13302,12 +13376,14 @@ "node_modules/memdown/node_modules/safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true }, "node_modules/memdown/node_modules/xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true, "engines": { "node": ">=0.4" } @@ -13355,6 +13431,7 @@ "version": "2.3.2", "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz", "integrity": "sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g==", + "dev": true, "dependencies": { "async": "^1.4.2", "ethereumjs-util": "^5.0.0", @@ -13369,17 +13446,20 @@ "node_modules/merkle-patricia-tree/node_modules/async": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha512-nSVgobk4rv61R9PUSDtYt7mPVB2olxNR5RWJcAsH676/ef11bUZwvu7+RGYrYauVdDPcO519v68wRhXQtxsV9w==" + "integrity": "sha512-nSVgobk4rv61R9PUSDtYt7mPVB2olxNR5RWJcAsH676/ef11bUZwvu7+RGYrYauVdDPcO519v68wRhXQtxsV9w==", + "dev": true }, "node_modules/merkle-patricia-tree/node_modules/bn.js": { "version": "4.12.0", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true }, "node_modules/merkle-patricia-tree/node_modules/ethereumjs-util": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz", "integrity": "sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ==", + "dev": true, "dependencies": { "bn.js": "^4.11.0", "create-hash": "^1.1.2", @@ -13394,6 +13474,7 @@ "version": "2.3.8", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -13407,12 +13488,14 @@ "node_modules/merkle-patricia-tree/node_modules/safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true }, "node_modules/merkle-patricia-tree/node_modules/string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, "dependencies": { "safe-buffer": "~5.1.0" } @@ -13499,17 +13582,20 @@ "node_modules/minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "dev": true }, "node_modules/minimalistic-crypto-utils": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==" + "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==", + "dev": true }, "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -13584,6 +13670,7 @@ "version": "10.2.0", "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.2.0.tgz", "integrity": "sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg==", + "dev": true, "dependencies": { "ansi-colors": "4.1.1", "browser-stdout": "1.3.1", @@ -13623,6 +13710,7 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true, "engines": { "node": ">=6" } @@ -13631,6 +13719,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, "dependencies": { "balanced-match": "^1.0.0" } @@ -13639,6 +13728,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, "engines": { "node": ">=10" }, @@ -13650,6 +13740,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" @@ -13665,6 +13756,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, "engines": { "node": ">=8" } @@ -13673,6 +13765,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, "dependencies": { "p-locate": "^5.0.0" }, @@ -13687,6 +13780,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", + "dev": true, "dependencies": { "brace-expansion": "^2.0.1" }, @@ -13697,12 +13791,14 @@ "node_modules/mocha/node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true }, "node_modules/mocha/node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, "dependencies": { "yocto-queue": "^0.1.0" }, @@ -13717,6 +13813,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, "dependencies": { "p-limit": "^3.0.2" }, @@ -13731,6 +13828,7 @@ "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -13751,6 +13849,8 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/module-error/-/module-error-1.0.2.tgz", "integrity": "sha512-0yuvsqSCv8LbaOKhnsQ/T5JhyFlCYLPXK3U2sgV10zoKQwzs/MyfuQUOZQ1V/6OCOJsK/TRgNVrPuPDqtdMFtA==", + "dev": true, + "peer": true, "engines": { "node": ">=10" } @@ -13758,7 +13858,8 @@ "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true }, "node_modules/multibase": { "version": "0.6.1", @@ -13819,6 +13920,7 @@ "version": "3.3.3", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", "integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==", + "dev": true, "bin": { "nanoid": "bin/nanoid.cjs" }, @@ -13872,7 +13974,8 @@ "node_modules/node-addon-api": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", - "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==" + "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==", + "dev": true }, "node_modules/node-emoji": { "version": "1.11.0", @@ -13926,6 +14029,7 @@ "version": "4.7.1", "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.7.1.tgz", "integrity": "sha512-wTSrZ+8lsRRa3I3H8Xr65dLWSgCvY2l4AOnaeKdPA9TB/WYMPaTcrzf3rXvFoVvjKNVnu0CcWSx54qq9GKRUYg==", + "dev": true, "bin": { "node-gyp-build": "bin.js", "node-gyp-build-optional": "optional.js", @@ -13979,6 +14083,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -14040,6 +14145,7 @@ "version": "3.2.4", "resolved": "https://registry.npmjs.org/nunjucks/-/nunjucks-3.2.4.tgz", "integrity": "sha512-26XRV6BhkgK0VOxfbU5cQI+ICFUtMLixv1noZn1tGU38kQH5A5nmmbk/O45xdyBhD1esk47nKrY0mvQpZIhRjQ==", + "dev": true, "dependencies": { "a-sync-waterfall": "^1.0.0", "asap": "^2.0.3", @@ -14090,7 +14196,8 @@ "node_modules/object-keys": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", - "integrity": "sha512-ncrLw+X55z7bkl5PnUvHwFK9FcGuFYo9gtjws2XtSzL+aZ8tm830P60WJ0dSmFVaSalWieW5MD7kEdnXda9yJw==" + "integrity": "sha512-ncrLw+X55z7bkl5PnUvHwFK9FcGuFYo9gtjws2XtSzL+aZ8tm830P60WJ0dSmFVaSalWieW5MD7kEdnXda9yJw==", + "dev": true }, "node_modules/object.assign": { "version": "4.1.0", @@ -14167,15 +14274,11 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, "dependencies": { "wrappy": "1" } }, - "node_modules/openzeppelin-solidity": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/openzeppelin-solidity/-/openzeppelin-solidity-2.2.0.tgz", - "integrity": "sha512-HfQq0xyT+EPs/lTWEd5Odu4T7CYdYe+qwf54EH28FQZthp4Bs6IWvOlOumTdS2dvpwZoTXURAopHn2LN1pwAGQ==" - }, "node_modules/optionator": { "version": "0.9.3", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", @@ -14317,24 +14420,6 @@ "integrity": "sha512-ft3iAoLOB/MlwbNXgzy43SWGP6sQki2jQvAyBg/zDFAgr9bfNWZIUj42Kw2eJIl8kEi4PbgE6U1Zau/HwI75HA==", "dev": true }, - "node_modules/parse-json": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", - "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-even-better-errors": "^2.3.0", - "lines-and-columns": "^1.1.6" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/parse5": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", @@ -14392,6 +14477,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, "engines": { "node": ">=8" } @@ -14400,6 +14486,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -14447,6 +14534,7 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", + "dev": true, "dependencies": { "create-hash": "^1.1.2", "create-hmac": "^1.1.4", @@ -14468,6 +14556,7 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, "engines": { "node": ">=8.6" }, @@ -14505,15 +14594,6 @@ "node": ">=0.10.0" } }, - "node_modules/pluralize": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", - "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -14538,65 +14618,6 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, - "node_modules/prettier-plugin-solidity": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/prettier-plugin-solidity/-/prettier-plugin-solidity-1.1.3.tgz", - "integrity": "sha512-fQ9yucPi2sBbA2U2Xjh6m4isUTJ7S7QLc/XDDsktqqxYfTwdYKJ0EnnywXHwCGAaYbQNK+HIYPL1OemxuMsgeg==", - "dev": true, - "dependencies": { - "@solidity-parser/parser": "^0.16.0", - "semver": "^7.3.8", - "solidity-comments-extractor": "^0.0.7" - }, - "engines": { - "node": ">=12" - }, - "peerDependencies": { - "prettier": ">=2.3.0 || >=3.0.0-alpha.0" - } - }, - "node_modules/prettier-plugin-solidity/node_modules/@solidity-parser/parser": { - "version": "0.16.2", - "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.16.2.tgz", - "integrity": "sha512-PI9NfoA3P8XK2VBkK5oIfRgKDsicwDZfkVq9ZTBCQYGOP1N2owgY2dyLGyU5/J/hQs8KRk55kdmvTLjy3Mu3vg==", - "dev": true, - "dependencies": { - "antlr4ts": "^0.5.0-alpha.4" - } - }, - "node_modules/prettier-plugin-solidity/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/prettier-plugin-solidity/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/prettier-plugin-solidity/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/process": { "version": "0.11.10", "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", @@ -14609,7 +14630,8 @@ "node_modules/process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true }, "node_modules/promise": { "version": "8.3.0", @@ -14644,7 +14666,8 @@ "node_modules/prr": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", - "integrity": "sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==" + "integrity": "sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==", + "dev": true }, "node_modules/psl": { "version": "1.9.0", @@ -14721,6 +14744,7 @@ "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, "funding": [ { "type": "github", @@ -14752,6 +14776,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, "dependencies": { "safe-buffer": "^5.1.0" } @@ -14859,6 +14884,7 @@ "version": "3.6.2", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -14872,6 +14898,7 @@ "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, "dependencies": { "picomatch": "^2.2.1" }, @@ -15041,6 +15068,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -15137,6 +15165,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dev": true, "dependencies": { "hash-base": "^3.0.0", "inherits": "^2.0.1" @@ -15155,6 +15184,7 @@ "version": "2.2.7", "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.7.tgz", "integrity": "sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ==", + "dev": true, "dependencies": { "bn.js": "^5.2.0" }, @@ -15244,6 +15274,7 @@ "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, "funding": [ { "type": "github", @@ -15403,12 +15434,14 @@ "node_modules/scrypt-js": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", - "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==" + "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==", + "dev": true }, "node_modules/secp256k1": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.3.tgz", "integrity": "sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA==", + "dev": true, "hasInstallScript": true, "dependencies": { "elliptic": "^6.5.4", @@ -15423,6 +15456,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/semaphore/-/semaphore-1.1.0.tgz", "integrity": "sha512-O4OZEaNtkMd/K0i6js9SL+gqy0ZCBMgUvlSqHKi4IBdjhe7wB8pwztUk1BbZ1fmrvpwFrPbHzqd2w5pTcJH6LA==", + "dev": true, "engines": { "node": ">=0.8.0" } @@ -15496,6 +15530,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "dev": true, "dependencies": { "randombytes": "^2.1.0" } @@ -15569,7 +15604,8 @@ "node_modules/setimmediate": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==" + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", + "dev": true }, "node_modules/setprototypeof": { "version": "1.2.0", @@ -15581,6 +15617,7 @@ "version": "2.4.11", "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "dev": true, "dependencies": { "inherits": "^2.0.1", "safe-buffer": "^5.0.1" @@ -15745,6 +15782,7 @@ "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", "dev": true, + "peer": true, "dependencies": { "ansi-styles": "^4.0.0", "astral-regex": "^2.0.0", @@ -15762,6 +15800,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "peer": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -15777,6 +15816,7 @@ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, + "peer": true, "dependencies": { "color-name": "~1.1.4" }, @@ -15788,13 +15828,15 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "dev": true, + "peer": true }, "node_modules/slice-ansi/node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, + "peer": true, "engines": { "node": ">=8" } @@ -16000,241 +16042,6 @@ "lodash.assign": "^4.0.6" } }, - "node_modules/solhint": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/solhint/-/solhint-3.6.2.tgz", - "integrity": "sha512-85EeLbmkcPwD+3JR7aEMKsVC9YrRSxd4qkXuMzrlf7+z2Eqdfm1wHWq1ffTuo5aDhoZxp2I9yF3QkxZOxOL7aQ==", - "dev": true, - "dependencies": { - "@solidity-parser/parser": "^0.16.0", - "ajv": "^6.12.6", - "antlr4": "^4.11.0", - "ast-parents": "^0.0.1", - "chalk": "^4.1.2", - "commander": "^10.0.0", - "cosmiconfig": "^8.0.0", - "fast-diff": "^1.2.0", - "glob": "^8.0.3", - "ignore": "^5.2.4", - "js-yaml": "^4.1.0", - "lodash": "^4.17.21", - "pluralize": "^8.0.0", - "semver": "^7.5.2", - "strip-ansi": "^6.0.1", - "table": "^6.8.1", - "text-table": "^0.2.0" - }, - "bin": { - "solhint": "solhint.js" - }, - "optionalDependencies": { - "prettier": "^2.8.3" - } - }, - "node_modules/solhint/node_modules/@solidity-parser/parser": { - "version": "0.16.2", - "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.16.2.tgz", - "integrity": "sha512-PI9NfoA3P8XK2VBkK5oIfRgKDsicwDZfkVq9ZTBCQYGOP1N2owgY2dyLGyU5/J/hQs8KRk55kdmvTLjy3Mu3vg==", - "dev": true, - "dependencies": { - "antlr4ts": "^0.5.0-alpha.4" - } - }, - "node_modules/solhint/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/solhint/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/solhint/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/solhint/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/solhint/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/solhint/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/solhint/node_modules/commander": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", - "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", - "dev": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/solhint/node_modules/glob": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", - "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/solhint/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/solhint/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/solhint/node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/solhint/node_modules/prettier": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", - "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", - "dev": true, - "optional": true, - "bin": { - "prettier": "bin-prettier.js" - }, - "engines": { - "node": ">=10.13.0" - }, - "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" - } - }, - "node_modules/solhint/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/solhint/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/solhint/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/solhint/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, - "node_modules/solidity-comments-extractor": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/solidity-comments-extractor/-/solidity-comments-extractor-0.0.7.tgz", - "integrity": "sha512-wciNMLg/Irp8OKGrh3S2tfvZiZ0NEyILfcRCXCD4mp7SgK/i9gzLfhY2hY7VMCQJ3kH9UB9BzNdibIVMchzyYw==", - "dev": true - }, "node_modules/solidity-coverage": { "version": "0.8.4", "resolved": "https://registry.npmjs.org/solidity-coverage/-/solidity-coverage-0.8.4.tgz", @@ -16933,6 +16740,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, "dependencies": { "safe-buffer": "~5.2.0" } @@ -17030,6 +16838,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", "integrity": "sha512-q8d4ue7JGEiVcypji1bALTos+0pWtyGlivAWyPuTkHzuTCJqrK9sWxYQZUq6Nq3cuyv3bm734IhHvHtGGURU6A==", + "dev": true, "dependencies": { "is-hex-prefixed": "1.0.0" }, @@ -17051,6 +16860,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, "engines": { "node": ">=8" }, @@ -17217,6 +17027,7 @@ "resolved": "https://registry.npmjs.org/table/-/table-6.8.1.tgz", "integrity": "sha512-Y4X9zqrCftUhMeH2EptSSERdVKt/nEdijTOacGD/97EKjhQ/Qs8RTlEGABSJNNN8lac9kheH+af7yAkEWlgneA==", "dev": true, + "peer": true, "dependencies": { "ajv": "^8.0.1", "lodash.truncate": "^4.4.2", @@ -17269,6 +17080,7 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", "dev": true, + "peer": true, "dependencies": { "fast-deep-equal": "^3.1.1", "json-schema-traverse": "^1.0.0", @@ -17285,6 +17097,7 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, + "peer": true, "engines": { "node": ">=8" } @@ -17294,6 +17107,7 @@ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, + "peer": true, "engines": { "node": ">=8" } @@ -17302,13 +17116,15 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true + "dev": true, + "peer": true }, "node_modules/table/node_modules/require-from-string": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", "dev": true, + "peer": true, "engines": { "node": ">=0.10.0" } @@ -17318,6 +17134,7 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, + "peer": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -17332,6 +17149,7 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, + "peer": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -17451,6 +17269,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, "dependencies": { "is-number": "^7.0.0" }, @@ -17971,7 +17790,8 @@ "node_modules/undici-types": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true }, "node_modules/universalify": { "version": "0.1.2", @@ -18034,7 +17854,7 @@ "version": "5.0.10", "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz", "integrity": "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==", - "devOptional": true, + "dev": true, "hasInstallScript": true, "dependencies": { "node-gyp-build": "^4.3.0" @@ -18065,7 +17885,8 @@ "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true }, "node_modules/utils-merge": { "version": "1.0.1", @@ -19245,12 +19066,14 @@ "node_modules/workerpool": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", - "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==" + "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==", + "dev": true }, "node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -19267,6 +19090,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, "engines": { "node": ">=8" } @@ -19275,6 +19099,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -19289,6 +19114,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -19299,12 +19125,14 @@ "node_modules/wrap-ansi/node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, "node_modules/wrap-ansi/node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, "engines": { "node": ">=8" } @@ -19313,6 +19141,7 @@ "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -19326,6 +19155,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -19336,7 +19166,8 @@ "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true }, "node_modules/ws": { "version": "7.4.6", @@ -19417,6 +19248,7 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", "integrity": "sha512-vMNKzr2rHP9Dp/e1NQFnLQlwlhp9L/LfvnsVdHxN1f+uggyVI3i08uD14GPvCToPkdsRfyPqIyYGmIk58V98ZQ==", + "dev": true, "dependencies": { "object-keys": "~0.4.0" }, @@ -19428,6 +19260,7 @@ "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, "engines": { "node": ">=10" } @@ -19451,6 +19284,7 @@ "version": "16.2.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, "dependencies": { "cliui": "^7.0.2", "escalade": "^3.1.1", @@ -19468,6 +19302,7 @@ "version": "20.2.4", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", + "dev": true, "engines": { "node": ">=10" } @@ -19476,6 +19311,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", + "dev": true, "dependencies": { "camelcase": "^6.0.0", "decamelize": "^4.0.0", @@ -19490,6 +19326,7 @@ "version": "6.3.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, "engines": { "node": ">=10" }, @@ -19501,6 +19338,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, "engines": { "node": ">=8" } @@ -19509,6 +19347,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, "engines": { "node": ">=8" } @@ -19517,6 +19356,7 @@ "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -19530,6 +19370,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -19551,6 +19392,7 @@ "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, "engines": { "node": ">=10" }, diff --git a/package.json b/package.json index 851919ec..70140cfc 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { - "name": "matic-protocol", - "description": "New repo using Hardhat and Foundry", - "version": "0.4.0", + "name": "pos-contracts", + "description": "Contracts infrastructure of Polygon POS", + "version": "0.5.0", "main": "hardhat.config.cjs", "type": "module", "directories": { @@ -16,14 +16,10 @@ "test:ci": "scripts/run-test.sh", "testrpc": "ganache --chain.hardfork istanbul --wallet.mnemonic 'clock radar mass judge dismiss just intact mind resemble fringe diary casino' -p 8545 --gasLimit 10000000 --gasPrice 0 --chain.allowUnlimitedContractSize --accounts 200", "template:process": "node scripts/process-templates.cjs", - "generate:interfaces": "scripts/helpers/generateInterfaces.sh", "coverage": "LOCAL_NETWORK=true npx hardhat coverage --solcoverjs .solcover.cjs", "bor:simulate": "cd test-bor-docker && bash run-docker.sh", "bor:stop": "cd test-bor-docker && bash stop-docker.sh", - "bor:clean": "cd test-bor-docker && bash clean.sh", - "upgrade:stakeManager:sepolia": "forge script scripts/deployers/pol-upgrade/UpgradeStakeManager_Sepolia.s.sol --rpc-url sepolia", - "upgrade:depositManager:sepolia": "forge script scripts/deployers/pol-upgrade/UpgradeDepositManager_Sepolia.s.sol --rpc-url sepolia", - "upgrade:pol:mainnet": "forge script scripts/deployers/pol-upgrade/UpgradeStake_DepositManager_Mainnet.s.sol --rpc-url mainnet" + "bor:clean": "cd test-bor-docker && bash clean.sh" }, "keywords": [], "author": "Jaynti Kanani , Simon Dosch = 0, "Expected revert, got '" + error + "' instead") @@ -76,10 +75,13 @@ describe('DrainStakeManager', function (accounts) { }) it('must drain all funds when drained by owner (Gnosis safe)', async function () { - const balance = await this.polToken.balanceOf(this.stakeManager.address) - const data = this.stakeManagerDrainable.interface.encodeFunctionData('drain', [owner, balance.toString()]) + const balanceSM = await this.polToken.balanceOf(this.stakeManager.address) + const balanceO = await this.polToken.balanceOf(owner) + + const data = this.stakeManagerDrainable.interface.encodeFunctionData('drain', [owner]) await execSafe(this.gSafe, this.stakeManager.address, data, [accounts[1], accounts[2]]) assert.equal((await this.polToken.balanceOf(this.stakeManager.address)).toString(), '0') + assert.equal((await this.polToken.balanceOf(owner)).toString(), (balanceSM.add(balanceO)).toString()) }) it('must swap back to normal implementaion', async function () { diff --git a/test/units/staking/SlashingManager.test.js b/test/units/staking/SlashingManager.test.js deleted file mode 100644 index 8c0c2803..00000000 --- a/test/units/staking/SlashingManager.test.js +++ /dev/null @@ -1,284 +0,0 @@ -import deployer from '../../helpers/deployer.js' -import logDecoder from '../../helpers/log-decoder.js' -import { ValidatorShare, StakingInfo } from '../../helpers/artifacts.js' - -import { - checkPoint, - updateSlashedAmounts, - assertBigNumbergt, - assertBigNumberEquality, - assertInTransaction -} from '../../helpers/utils.js' -import { generateFirstWallets, mnemonics } from '../../helpers/wallets.js' -import { buyVoucher } from './ValidatorShareHelper.js' -import { BN } from 'ethereumjs-util' -import chaiAsPromised from 'chai-as-promised' -import * as chai from 'chai' - -chai.use(chaiAsPromised).should() -const assert = chai.assert - -// Slashing is currently disabled in StakeManager, so all these tests fail. -describe.skip('Slashing:validator', async function () { - let stakeToken - let stakeManager - let slashingManager - let stakingInfo - const wallets = generateFirstWallets(mnemonics, 10) - const DYNASTY = 8 - - describe('validator slashing', async function () { - const stakeAmount = web3.utils.toWei('1000') - - async function doDeploy() { - let contracts = await deployer.deployStakeManager(wallets) - stakeToken = contracts.stakeToken - stakeManager = contracts.stakeManager - slashingManager = contracts.slashingManager - stakingInfo = contracts.stakingInfo - - await contracts.governance.update( - stakeManager.address, - stakeManager.interface.encodeFunctionData('updateDynastyValue', [DYNASTY]) - ) - await contracts.governance.update( - stakeManager.address, - stakeManager.interface.encodeFunctionData('updateCheckPointBlockInterval', [1]) - ) - - await stakeManager.changeRootChain(wallets[0].getAddressString()) - - const amount = web3.utils.toWei('1002') - const heimdallFee = web3.utils.toWei('2') - - for (let i = 0; i < 2; i++) { - await stakeToken.mint(wallets[i].getAddressString(), amount) - - const stakeToken_i = stakeToken.connect(stakeToken.provider.getSigner(i)) - await stakeToken_i.approve(stakeManager.address, amount) - - const stakeManager_i = stakeManager.connect(stakeManager.provider.getSigner(i)) - await stakeManager_i.stakeFor( - wallets[i].getAddressString(), - stakeAmount, - heimdallFee, - false, - wallets[i].getPublicKeyString() - ) - } - await stakeToken.mint(stakeManager.address, web3.utils.toWei('1000000')) // rewards amount - } - - describe('when validator is not slashed to 0', function () { - beforeEach(doDeploy) - - it('should slash validators', async function () { - const amount = +web3.utils.toWei('100') - const slashingInfoList = [ - [1, amount, '0x0'], - [2, amount, '0x0'] - ] - - const result = await ( - await updateSlashedAmounts([wallets[0], wallets[1]], wallets[1], 1, slashingInfoList, slashingManager) - ).wait() - const logs = logDecoder.decodeLogs(result.events, stakingInfo.interface, stakeToken.interface) - logs.should.have.lengthOf(3) - logs[0].event.should.equal('Slashed') - logs[1].event.should.equal('Transfer') - logs[2].event.should.equal('Transfer') - assertBigNumberEquality(logs[0].args.amount, web3.utils.toWei('200')) - const validator1 = await stakeManager.validators(1) - const validator2 = await stakeManager.validators(2) - assertBigNumberEquality(validator1.amount, web3.utils.toWei('900')) - assertBigNumberEquality(validator2.amount, web3.utils.toWei('900')) - }) - - it('should slash validator:jail and send checkpoint', async function () { - const amount = +web3.utils.toWei('100') - const validator1Wallet = wallets[0] - const slashingInfoList = [[2, amount, '0x1']] - - const result = await ( - await updateSlashedAmounts([wallets[0], wallets[1]], wallets[1], 1, slashingInfoList, slashingManager) - ).wait() - - const logs = logDecoder.decodeLogs(result.events, stakingInfo.interface, stakeToken.interface) - logs.should.have.lengthOf(4) - logs[0].event.should.equal('Jailed') - logs[1].event.should.equal('Slashed') - assertBigNumberEquality(logs[1].args.amount, web3.utils.toWei('100')) - - const validator1 = await stakeManager.validators(1) - const val1RewardBefore = await stakeManager.validatorReward(1) - const validator2 = await stakeManager.validators(2) - - assertBigNumberEquality(validator2.amount, web3.utils.toWei('900')) - - assert.equal(await stakeManager.isValidator(2), false) - - assertBigNumberEquality(await stakeManager.currentValidatorSetTotalStake(), validator1.amount) - - await checkPoint([validator1Wallet], validator1Wallet, stakeManager) - - const val1RewardAfter = await stakeManager.validatorReward(1) - assertBigNumbergt(val1RewardAfter, val1RewardBefore) - assertBigNumberEquality(val1RewardAfter, await stakeManager.CHECKPOINT_REWARD()) // reward starts from 1, not 0 - }) - - it('should test jail/unjail', async function () { - const amount = +web3.utils.toWei('100') - const validator1Wallet = wallets[0] - const validator2Wallet = wallets[1] - const slashingInfoList = [[2, amount, '0x1']] - - await updateSlashedAmounts([wallets[0], wallets[1]], wallets[1], 1, slashingInfoList, slashingManager) - - await checkPoint([validator1Wallet], validator1Wallet, stakeManager) - const stakeManager2 = stakeManager.connect(stakeManager.provider.getSigner(validator2Wallet.getAddressString())) - await stakeManager2.unjail(2) - assert.equal(await stakeManager.isValidator(2), true) - await checkPoint([validator1Wallet, validator2Wallet], validator1Wallet, stakeManager) - const validator2Reward = await stakeManager.validatorReward(2) - let expectedRewards = await stakeManager.CHECKPOINT_REWARD() - expectedRewards = expectedRewards - .mul(web3.utils.toWei('900')) - .div(web3.utils.toWei('1900')) - expectedRewards = expectedRewards.mul(90).div(100) // reduce 10% commission - assertBigNumbergt(validator2Reward, expectedRewards) // change due to updated rewards 5047 - }) - - it('should test jail => unstake', async function () { - const amount = +web3.utils.toWei('100') - const validator2Wallet = wallets[1] - const slashingInfoList = [[2, amount, '0x1']] - - await updateSlashedAmounts([wallets[0], wallets[1]], wallets[1], 1, slashingInfoList, slashingManager) - - const stakeManager2 = stakeManager.connect(stakeManager.provider.getSigner(validator2Wallet.getAddressString())) - const result = await (await stakeManager2.unstake(2)).wait() - - assertInTransaction(result, StakingInfo, 'UnstakeInit', { - amount: web3.utils.toWei('900').toString(), - validatorId: '2' - }) - }) - }) - - describe('when validator is slashed to 0', function () { - const validatorAddr = wallets[1].getChecksumAddressString() - const slashedValidatorId = 2 - - before(doDeploy) - before(async function () { - const slashingInfoList = [[slashedValidatorId, new BN(stakeAmount), '0x1']] - await updateSlashedAmounts([wallets[0], wallets[1]], wallets[1], 1, slashingInfoList, slashingManager) - }) - - it('validator must have 0 amount', async function () { - assertBigNumberEquality(await stakeManager.validatorStake(slashedValidatorId), '0') - }) - - it('validator must be unstaked within current epoch', async function () { - const validatorData = await stakeManager.validators(slashedValidatorId) - assertBigNumberEquality(validatorData.deactivationEpoch, await stakeManager.currentEpoch()) - }) - - it('validator must not be jailed', async function () { - const validatorData = await stakeManager.validators(slashedValidatorId) - assertBigNumberEquality(validatorData.jailTime, '0') - }) - - it('checkpoint must go through with only unslashed validators', async function () { - await checkPoint([wallets[0]], wallets[0], stakeManager) - }) - - it('slashed validator must be able to claim his stake', async function () { - await stakeManager.advanceEpoch(DYNASTY) - const stakeManagerValidator = stakeManager.connect(stakeManager.provider.getSigner(validatorAddr)) - const result = await (await stakeManagerValidator.unstakeClaim(slashedValidatorId)).wait() - assertInTransaction(result, StakingInfo, 'Unstaked', { - user: validatorAddr, - validatorId: new BN(slashedValidatorId).toString(), - amount: '0' - }) - }) - }) - }) -}) -describe.skip('Slashing:delegation', async function () { - let stakeToken - let stakeManager - let slashingManager - let wallets - let stakingInfo - - describe('validator:delegator slashing', async function () { - beforeEach(async function () { - wallets = generateFirstWallets(mnemonics, 10) - let contracts = await deployer.deployStakeManager(wallets) - stakeToken = contracts.stakeToken - stakeManager = contracts.stakeManager - slashingManager = contracts.slashingManager - stakingInfo = contracts.stakingInfo - - await contracts.governance.update( - stakeManager.address, - stakeManager.interface.encodeFunctionData('updateDynastyValue', [8]) - ) - await contracts.governance.update( - stakeManager.address, - stakeManager.interface.encodeFunctionData('updateCheckPointBlockInterval', [1]) - ) - - await stakeManager.changeRootChain(wallets[0].getAddressString()) - const amount = web3.utils.toWei('1002') - const stakeAmount = web3.utils.toWei('1000') - const heimdallFee = web3.utils.toWei('2') - for (let i = 0; i < 2; i++) { - await stakeToken.mint(wallets[i].getAddressString(), amount) - const stakeToken_i = stakeToken.connect(stakeToken.provider.getSigner(i)) - await stakeToken_i.approve(stakeManager.address, amount) - - const stakeManager_i = stakeManager.connect(stakeManager.provider.getSigner(i)) - await stakeManager_i.stakeFor( - wallets[i].getAddressString(), - stakeAmount, - heimdallFee, - true, - wallets[i].getPublicKeyString() - ) - } - await stakeToken.mint(stakeManager.address, web3.utils.toWei('1000000')) // rewards amount - }) - - it('should slash validators and delegators', async function () { - let validator = await stakeManager.validators(2) - const validatorContract = await ValidatorShare.attach(validator.contractAddress) - const delegator = wallets[3].getAddressString() - await stakeToken.mint(delegator, web3.utils.toWei('250')) - const stakeTokenDelegator = stakeToken.connect(stakeToken.provider.getSigner(delegator)) - await stakeTokenDelegator.approve(stakeManager.address, web3.utils.toWei('250')) - await buyVoucher(validatorContract, web3.utils.toWei('250'), delegator) - const amount = +web3.utils.toWei('100') - - const slashingInfoList = [ - [1, amount, '0x0'], - [2, amount, '0x0'] - ] - - const result = await ( - await updateSlashedAmounts([wallets[0], wallets[1]], wallets[1], 1, slashingInfoList, slashingManager) - ).wait() - const logs = logDecoder.decodeLogs(result.events, stakingInfo.interface) - logs.should.have.lengthOf(3) - logs[0].event.should.equal('Slashed') - assertBigNumberEquality(logs[0].args.amount, web3.utils.toWei('200')) - const validator1 = await stakeManager.validators(1) - validator = await stakeManager.validators(2) - - assertBigNumberEquality(validator1.amount, web3.utils.toWei('900')) - assertBigNumberEquality(validator.delegatedAmount, web3.utils.toWei('230')) - }) - }) -}) diff --git a/test/units/staking/ValidatorShare.test.js b/test/units/staking/ValidatorShare.test.js index 375bfebd..e39f004e 100644 --- a/test/units/staking/ValidatorShare.test.js +++ b/test/units/staking/ValidatorShare.test.js @@ -1,76 +1,18 @@ -import ethUtils from 'ethereumjs-util' -import { TestToken, ERC20Permit, ValidatorShare, StakingInfo, EventsHub, ethers } from '../../helpers/artifacts.js' +import { TestToken, ValidatorShare, StakingInfo, EventsHub, ethers } from '../../helpers/artifacts.js' import testHelpers from '@openzeppelin/test-helpers' import { checkPoint, assertBigNumberEquality, assertInTransaction } from '../../helpers/utils.js' -import { wallets, freshDeploy, approveAndStake } from './deployment.js' -import { buyVoucher, buyVoucherWithPermit, sellVoucher, sellVoucherNew } from './ValidatorShareHelper.js' +import { wallets } from './deployment.js' +import { buyVoucher, buyVoucherWithPermit, sellVoucher, sellVoucherNew, doDeploy, ValidatorDefaultStake, Dynasty } from './ValidatorShareHelper.js' + const BN = testHelpers.BN const expectRevert = testHelpers.expectRevert const toWei = web3.utils.toWei const ZeroAddr = '0x0000000000000000000000000000000000000000' const ExchangeRatePrecision = new BN('100000000000000000000000000000') -const Dynasty = 8 -const ValidatorDefaultStake = new BN(toWei('100')) describe('ValidatorShare', async function () { const wei100 = toWei('100') - // async function slash(slashes = [], validators = [], proposer = wallets[1], nonce = 1) { - // let slashingInfoList = [] - // for (const slash of slashes) { - // slashingInfoList.push([parseInt(slash.validator), slash.amount, '0x0']) - // } - - // return updateSlashedAmounts(validators, proposer, nonce, slashingInfoList, this.slashingManager) - // } - - async function doDeploy() { - await freshDeploy.call(this, true) - - this.validatorId = '8' - this.validatorUser = wallets[0] - this.stakeAmount = ValidatorDefaultStake - - await this.governance.update( - this.stakeManager.address, - this.stakeManager.interface.encodeFunctionData('updateDynastyValue', [Dynasty]) - ) - await this.governance.update( - this.stakeManager.address, - this.stakeManager.interface.encodeFunctionData('updateValidatorThreshold', [8]) - ) - - // we need to increase validator id beyond foundation id, repeat 7 times - for (let i = 0; i < 7; ++i) { - await approveAndStake.call(this, { - wallet: this.validatorUser, - stakeAmount: this.stakeAmount, - acceptDelegation: true - }) - await this.governance.update( - this.stakeManager.address, - this.stakeManager.interface.encodeFunctionData('forceUnstake', [i + 1]) - ) - await this.stakeManager.forceFinalizeCommit() - await this.stakeManager.advanceEpoch(Dynasty) - const stakeManagerValidator = this.stakeManager.connect( - this.stakeManager.provider.getSigner(this.validatorUser.getChecksumAddressString()) - ) - await stakeManagerValidator.unstakeClaim(i + 1) - await this.stakeManager.resetSignerUsed(this.validatorUser.getChecksumAddressString()) - } - - await approveAndStake.call(this, { - wallet: this.validatorUser, - stakeAmount: this.stakeAmount, - acceptDelegation: true - }) - await this.stakeManager.forceFinalizeCommit() - - let validator = await this.stakeManager.validators(this.validatorId) - this.validatorContract = ValidatorShare.attach(validator.contractAddress) - } - describe('locking', function () { before(doDeploy) @@ -725,91 +667,6 @@ describe('ValidatorShare', async function () { assertBigNumberEquality(afterExchangeRate, this.beforeExchangeRate) }) }) - - // slashing currently disabled - describe.skip('when Alice is slashed by 50% and then Bob purchases voucher (both buy 100 eth worth of shares)', function () { - before(doDeploy) - - describe('when Alice is slashed by 50%', function () { - before(async function () { - this.user = wallets[2].getAddressString() - await this.stakeToken.mint(this.user, this.stakeAmount.toString()) - const stakeTokenUser = this.stakeToken.connect(this.stakeToken.provider.getSigner(this.user)) - await stakeTokenUser.approve(this.stakeManager.address, this.stakeAmount.toString()) - - await buyVoucher(this.validatorContract, this.stakeAmount, this.user) - }) - before('slash', async function () { - await slash.call( - this, - [{ validator: this.validatorId, amount: this.stakeAmount }], - [this.validatorUser], - this.validatorUser - ) - }) - - it('exchange rate == 50', async function () { - let rate = await this.validatorContract.exchangeRate() - assertBigNumberEquality(ExchangeRatePrecision.div(new BN(2)), rate) - }) - - it('Alice shares == 100 eth', async function () { - const shares = await this.validatorContract.balanceOf(this.user) - assertBigNumberEquality(this.stakeAmount, shares) - }) - }) - - describe('when Bob purchases a voucher', function () { - before(async function () { - this.user = wallets[1].getAddressString() - await this.stakeToken.mint(this.user, this.stakeAmount.toString()) - - this.beforeExchangeRate = await this.validatorContract.exchangeRate() - const stakeTokenUser = this.stakeToken.connect(this.stakeToken.provider.getSigner(this.user)) - await stakeTokenUser.approve(this.stakeManager.address, this.stakeAmount.toString()) - - await buyVoucher(this.validatorContract, this.stakeAmount, this.user) - }) - - it('exchange rate == 50', async function () { - let rate = await this.validatorContract.exchangeRate() - assertBigNumberEquality(ExchangeRatePrecision.div(new BN(2)), rate) - }) - - it('Bob shares == 200 eth', async function () { - const shares = await this.validatorContract.balanceOf(this.user) - assertBigNumberEquality(this.stakeAmount.mul(new BN(2)), shares) - }) - }) - }) - - describe.skip('when all tokens are slashed', function () { - before(doDeploy) - before(async function () { - this.user = wallets[2].getAddressString() - await this.stakeToken.mint(this.user, toWei('250')) - const stakeTokenUser = this.stakeToken.connect(this.stakeToken.provider.getSigner(this.user)) - await stakeTokenUser.approve(this.stakeManager.address, toWei('250')) - await buyVoucher(this.validatorContract, toWei('100'), this.user) - // slash all tokens - await slash.call( - this, - [ - { - validator: this.validatorId, - amount: new BN((await this.stakeManager.currentValidatorSetTotalStake()).toString()) - } - ], - [this.validatorUser], - this.validatorUser, - 1 - ) - }) - - it('exchange rate must be == 0', async function () { - assertBigNumberEquality(await this.validatorContract.exchangeRate(), '0') - }) - }) }) describe('sellVoucher', function () { @@ -957,54 +814,6 @@ describe('ValidatorShare', async function () { }) }) - // slashing currently disabled - describe.skip('when Alice sells voucher after 50% slash', function () { - before(doDeployAndBuyVoucherForAliceAndBob) - before('slash', async function () { - await slash.call( - this, - [{ validator: this.validatorId, amount: this.stakeAmount }], - [this.validatorUser], - this.validatorUser - ) - }) - - const halfStake = aliceStake.div(new BN(2)) - - testSellVoucher({ - returnedStake: halfStake, - reward: toWei('18000'), - initialBalance: new BN(0), - validatorId: '8', - user: Alice, - userTotalStaked: toWei('0'), - totalStaked: ValidatorDefaultStake.div(new BN(2)), - shares: aliceStake - }) - }) - - // slashing currently disabled - describe.skip('when all tokens are slashed', function () { - before(doDeployAndBuyVoucherForAliceAndBob) - before('slash', async function () { - await slash.call( - this, - [ - { - validator: this.validatorId, - amount: new BN((await this.stakeManager.currentValidatorSetTotalStake()).toString()) - } - ], - [this.validatorUser], - this.validatorUser - ) - }) - - it('reverts', async function () { - await expectRevert(sellVoucher(this.validatorContract, Alice, '0'), 'Too much requested') - }) - }) - describe('when delegation is disabled after voucher was purchased by Alice', function () { before(doDeployAndBuyVoucherForAliceAndBob) before('disable delegation', async function () { @@ -1111,7 +920,7 @@ describe('ValidatorShare', async function () { describe('partial sell', function () { describe('new API', function () { - describe('when Alice is not slashed', function () { + describe('when Alice sells', function () { before(doDeployAndBuyVoucherForAliceAndBob) const halfStake = aliceStake.div(new BN('2')) @@ -1150,61 +959,10 @@ describe('ValidatorShare', async function () { }) }) }) - - // slashing currently disabled - describe.skip('when Alice is slashed by 50%', function () { - before(doDeployAndBuyVoucherForAliceAndBob) - before(async function () { - await slash.call( - this, - [{ validator: this.validatorId, amount: new BN(toWei('100')) }], - [this.validatorUser], - this.validatorUser, - 1 - ) - }) - - const halfStake = aliceStake.div(new BN('4')) // slash by 50% occured - const validatorHalfStake = ValidatorDefaultStake.div(new BN(2)) - - describe('when Alice sells 50%', function () { - testSellVoucherNew({ - shares: new BN(toWei('50')), - minClaimAmount: halfStake, - returnedStake: halfStake, - reward: toWei('18000'), - initialBalance: toWei('805'), - validatorId: '8', - user: Alice, - nonce: '1', - userTotalStaked: halfStake, - totalStaked: halfStake.add(validatorHalfStake) - }) - }) - - describe('when Alice sells 50%, after 1 epoch, within withdrawal delay', function () { - before(async function () { - await this.stakeManager.advanceEpoch(1) - }) - - testSellVoucherNew({ - shares: new BN(toWei('50')), - minClaimAmount: halfStake, - returnedStake: halfStake, - reward: '0', - initialBalance: new BN(toWei('18805')), - validatorId: '8', - user: Alice, - userTotalStaked: '0', - nonce: '2', - totalStaked: validatorHalfStake - }) - }) - }) }) describe('old API', function () { - describe('when Alice is not slashed', function () { + describe('when Alice sells', function () { before(doDeployAndBuyVoucherForAliceAndBob) const halfStake = aliceStake.div(new BN('2')) @@ -1246,60 +1004,6 @@ describe('ValidatorShare', async function () { }) }) }) - - // slashing currently disabled - describe.skip('when Alice is slashed by 50%', function () { - before(doDeployAndBuyVoucherForAliceAndBob) - before(async function () { - await slash.call( - this, - [{ validator: this.validatorId, amount: new BN(toWei('100')) }], - [this.validatorUser], - this.validatorUser, - 1 - ) - }) - - const halfStake = aliceStake.div(new BN('4')) // slash by 50% occured - const validatorHalfStake = ValidatorDefaultStake.div(new BN(2)) - - describe('when Alice sells 50%', function () { - testSellVoucher({ - shares: new BN(toWei('50')), - minClaimAmount: halfStake, - returnedStake: halfStake, - reward: toWei('18000'), - initialBalance: new BN(0), - validatorId: '8', - user: Alice, - userTotalStaked: halfStake, - totalStaked: halfStake.add(validatorHalfStake) - }) - }) - - describe('when Alice sells 50%, after 1 epoch, within withdrawal delay', function () { - before(async function () { - await this.stakeManager.advanceEpoch(1) - }) - - testSellVoucher({ - shares: new BN(toWei('50')), - minClaimAmount: halfStake, - returnedStake: halfStake, - reward: '0', - initialBalance: new BN(toWei('18000')), - validatorId: '8', - user: Alice, - userTotalStaked: '0', - totalStaked: validatorHalfStake - }) - - it('unbond epoch must be set to current epoch', async function () { - const unbond = await this.validatorContract.unbonds(Alice) - assertBigNumberEquality(unbond.withdrawEpoch, await this.stakeManager.currentEpoch()) - }) - }) - }) }) }) }) @@ -1311,7 +1015,6 @@ describe('ValidatorShare', async function () { const Carol = wallets[8].getChecksumAddressString() let totalDelegatorRewardsReceived - //let totalSlashed let totalStaked let totalInitialBalance let delegators = [] @@ -1339,21 +1042,6 @@ describe('ValidatorShare', async function () { }) } - // function testSlash({ amount, nonce }) { - // describe('Slash', function () { - // it(`${amount.toString()} wei`, async function () { - // await slash.call( - // this, - // [{ validator: this.validatorId, amount: amount }], - // [this.validatorUser], - // this.validatorUser, - // nonce - // ) - // totalSlashed = totalSlashed.add(new BN(amount)) - // }) - // }) - // } - function testStake({ user, amount, label, initialBalance = new BN(0) }) { describe(`${label} buyVoucher for ${amount.toString()} wei`, function () { it(`must purchase voucher`, async function () { @@ -1433,7 +1121,6 @@ describe('ValidatorShare', async function () { this.initialStakeTokenBalance .add(totalStaked.toString()) .sub(totalReceived), - //.sub(totalSlashed.toString()), tokensLeft ) }) @@ -1446,15 +1133,11 @@ describe('ValidatorShare', async function () { delegators = {} totalInitialBalance = new BN(0) totalStaked = new BN(0) - //totalSlashed = new BN(0) totalDelegatorRewardsReceived = new BN(0) this.initialStakeTokenBalance = await this.polToken.balanceOf(this.stakeManager.address) }) for (const step of timeline) { - // if (step.slash) { - // testSlash(step.slash) - // } else if (step.stake) { testStake(step.stake) } else if (step.checkpoints) { @@ -1478,7 +1161,7 @@ describe('ValidatorShare', async function () { ]) }) - describe('when Alice is not slashed. 1 checkpoint passed', function () { + describe('when 1 checkpoint passed', function () { runWithdrawRewardsTest([ { stake: { user: Alice, label: 'Alice', amount: new BN(wei100) } }, { checkpoints: 1 }, @@ -1487,50 +1170,6 @@ describe('ValidatorShare', async function () { ]) }) - //slashing currently disabled - describe.skip('when Alice is slashed by 50% and Bob purchases voucher after', function () { - describe('when 1 checkpoint passes', function () { - describe('when Alice and Bob withdraw rewards after', function () { - runWithdrawRewardsTest([ - { stake: { user: Alice, label: 'Alice', amount: new BN(wei100) } }, - { slash: { amount: new BN(toWei('100')) } }, - { stake: { user: Bob, label: 'Bob', amount: new BN(wei100) } }, - { checkpoints: 1 }, - { withdraw: { label: 'Alice', user: Alice, expectedReward: toWei('2250') } }, - { withdraw: { label: 'Bob', user: Bob, expectedReward: toWei('4500') } }, - { allRewards: { validatorReward: toWei('2250'), totalExpectedRewards: toWei('9000') } } - ]) - }) - }) - - describe('when 2 checkpoints pass', function () { - describe('when Alice and Bob withdraw rewards after', function () { - runWithdrawRewardsTest([ - { stake: { user: Alice, label: 'Alice', amount: new BN(wei100) } }, - { slash: { amount: new BN(toWei('100')) } }, - { stake: { user: Bob, label: 'Bob', amount: new BN(wei100) } }, - { checkpoints: 2 }, - { liquidRewards: { user: Alice, label: 'Alice', expectedReward: toWei('4500') } }, - { liquidRewards: { user: Bob, label: 'Bob', expectedReward: toWei('9000') } }, - { withdraw: { label: 'Alice', user: Alice, expectedReward: toWei('4500') } }, - { withdraw: { label: 'Bob', user: Bob, expectedReward: toWei('9000') } }, - { allRewards: { validatorReward: toWei('4500'), totalExpectedRewards: toWei('18000') } } - ]) - }) - }) - }) - - describe.skip('when Alice is slashed after checkpoint', function () { - runWithdrawRewardsTest([ - { stake: { user: Alice, label: 'Alice', amount: new BN(wei100) } }, - { checkpoints: 1 }, - { slash: { amount: new BN(toWei('100')) } }, - { liquidRewards: { user: Alice, label: 'Alice', expectedReward: toWei('4500') } }, - { withdraw: { label: 'Alice', user: Alice, expectedReward: toWei('4500') } }, - { allRewards: { validatorReward: toWei('4500'), totalExpectedRewards: toWei('9000') } } - ]) - }) - describe('Alice, Bob, Eve and Carol stake #1', function () { runWithdrawRewardsTest([ { stake: { user: Alice, label: 'Alice', amount: new BN(toWei('100')) } }, @@ -1555,33 +1194,6 @@ describe('ValidatorShare', async function () { ]) }) - describe.skip('Alice, Bob, Eve and Carol stake #2', function () { - runWithdrawRewardsTest([ - { stake: { user: Alice, label: 'Alice', amount: new BN(toWei('100')) } }, - { checkpoints: 1 }, - { liquidRewards: { user: Alice, label: 'Alice', expectedReward: toWei('4500') } }, - { stake: { user: Bob, label: 'Bob', amount: new BN(toWei('500')) } }, - { slash: { amount: new BN(toWei('350')) } }, - { checkpoints: 1 }, - { liquidRewards: { user: Alice, label: 'Alice', expectedReward: '5785714285714285714285' } }, - { liquidRewards: { user: Bob, label: 'Bob', expectedReward: '6428571428571428571428' } }, - { stake: { user: Carol, label: 'Carol', amount: new BN(toWei('500')) } }, - { slash: { amount: new BN(toWei('425')), nonce: 2 } }, - { checkpoints: 1 }, - { liquidRewards: { user: Alice, label: 'Alice', expectedReward: '6315126050420168067226' } }, - { liquidRewards: { user: Bob, label: 'Bob', expectedReward: '9075630252100840336133' } }, - { liquidRewards: { user: Carol, label: 'Carol', expectedReward: '5294117647058823529411' } }, - { slash: { amount: new BN(toWei('215')), nonce: 3 } }, - { stake: { user: Eve, label: 'Eve', amount: new BN(toWei('500')), initialBalance: new BN(1) } }, - { checkpoints: 1 }, - { withdraw: { user: Alice, label: 'Alice', expectedReward: '6471712628713457213871' } }, - { withdraw: { user: Bob, label: 'Bob', expectedReward: '9858563143567286069357' } }, - { withdraw: { user: Carol, label: 'Carol', expectedReward: '6859983429991714995859' } }, - { withdraw: { user: Eve, label: 'Eve', expectedReward: '6338028169014084507041', initialBalance: new BN(1) } }, - { allRewards: { validatorReward: '6471712628713457213867', totalExpectedRewards: '35999999999999999999995' } } - ]) - }) - describe('when not enough rewards', function () { before(doDeploy) @@ -1654,42 +1266,6 @@ describe('ValidatorShare', async function () { reward: toWei('4500') }) }) - - // slashing is currently disabled - describe.skip('when all tokens are slashed', function () { - before(doDeploy) - before('slash', async function () { - const amount = toWei('100') - await this.stakeToken.mint(Alice, amount) - const stakeTokenAlice = this.stakeToken.connect(this.stakeToken.provider.getSigner(Alice)) - await stakeTokenAlice.approve(this.stakeManager.address, amount) - await buyVoucher(this.validatorContract, amount, Alice) - await checkPoint([this.validatorUser], this.rootChainOwner, this.stakeManager) - await slash.call( - this, - [ - { - validator: this.validatorId, - amount: new BN((await this.stakeManager.currentValidatorSetTotalStake()).toString()) - } - ], - [this.validatorUser], - this.validatorUser - ) - }) - - it('must withdraw rewards', async function () { - const validatorContractAlice = this.validatorContract.connect(this.validatorContract.provider.getSigner(Alice)) - this.receipt = await (await validatorContractAlice.withdrawRewards()).wait() - }) - - shouldWithdrawReward({ - initialBalance: new BN(0), - validatorId: '8', - user: Alice, - reward: toWei('4500') - }) - }) }) describe('restake', function () { diff --git a/test/units/staking/ValidatorShareHelper.js b/test/units/staking/ValidatorShareHelper.js index 7f86a55e..311cbafa 100644 --- a/test/units/staking/ValidatorShareHelper.js +++ b/test/units/staking/ValidatorShareHelper.js @@ -1,4 +1,12 @@ import { getPermitDigest } from './permitHelper.js' +import { wallets, freshDeploy, approveAndStake } from './deployment.js' +import testHelpers from '@openzeppelin/test-helpers' +import { ValidatorShare } from '../../helpers/artifacts.js' + +const BN = testHelpers.BN +const toWei = web3.utils.toWei +export const ValidatorDefaultStake = new BN(toWei('100')) +export const Dynasty = 8 export async function buyVoucher(validatorContract, amount, delegator, minSharesToMint) { const validatorContract_Delegator = validatorContract.connect(validatorContract.provider.getSigner(delegator)) @@ -86,3 +94,66 @@ export async function sellVoucherNewPOL(validatorContract, delegator, minClaimAm return validatorContract_Delegator.sellVoucher_newPOL(minClaimAmount.toString(), maxShares) } + +export async function doDeployPOL() { + await doDeploy.call(this, true) +} + +export async function doDeploy(pol = false) { + await freshDeploy.call(this) + this.validatorId = '8' + this.validatorUser = wallets[0] + this.stakeAmount = ValidatorDefaultStake + + await this.governance.update( + this.stakeManager.address, + this.stakeManager.interface.encodeFunctionData('updateDynastyValue', [Dynasty]) + ) + await this.governance.update( + this.stakeManager.address, + this.stakeManager.interface.encodeFunctionData('updateValidatorThreshold', [8]) + ) + + // we need to increase validator id beyond foundation id, repeat 7 times + for (let i = 0; i < 7; ++i) { + await approveAndStake.call(this, { + wallet: this.validatorUser, + stakeAmount: this.stakeAmount, + acceptDelegation: true, + pol: pol + }) + if(pol) { + await this.governance.update( + this.stakeManager.address, + this.stakeManager.interface.encodeFunctionData('forceUnstakePOL', [i + 1]) + ) + } else { + await this.governance.update( + this.stakeManager.address, + this.stakeManager.interface.encodeFunctionData('forceUnstake', [i + 1]) + ) + } + await this.stakeManager.forceFinalizeCommit() + await this.stakeManager.advanceEpoch(Dynasty) + const stakeManagerValidator = this.stakeManager.connect( + this.stakeManager.provider.getSigner(this.validatorUser.getChecksumAddressString()) + ) + if(pol) { + await stakeManagerValidator.unstakeClaimPOL(i + 1) + } else { + await stakeManagerValidator.unstakeClaim(i + 1) + } + await this.stakeManager.resetSignerUsed(this.validatorUser.getChecksumAddressString()) + } + + await approveAndStake.call(this, { + wallet: this.validatorUser, + stakeAmount: this.stakeAmount, + acceptDelegation: true, + pol: pol + }) + await this.stakeManager.forceFinalizeCommit() + + const validator = await this.stakeManager.validators(this.validatorId) + this.validatorContract = ValidatorShare.attach(validator.contractAddress) +} \ No newline at end of file diff --git a/test/units/staking/ValidatorSharePol.test.js b/test/units/staking/ValidatorSharePol.test.js index 8079aff4..6012145a 100644 --- a/test/units/staking/ValidatorSharePol.test.js +++ b/test/units/staking/ValidatorSharePol.test.js @@ -1,99 +1,25 @@ import { - PolygonMigration, TestToken, - ERC20Permit, ValidatorShare, StakingInfo, EventsHub } from '../../helpers/artifacts.js' import testHelpers from '@openzeppelin/test-helpers' import { checkPoint, assertBigNumberEquality, assertInTransaction } from '../../helpers/utils.js' -import { wallets, freshDeploy, approveAndStake } from './deployment.js' -import { buyVoucherPOL, sellVoucherPOL, sellVoucherNewPOL } from './ValidatorShareHelper.js' +import { wallets } from './deployment.js' +import { buyVoucherPOL, sellVoucherPOL, sellVoucherNewPOL, doDeployPOL, ValidatorDefaultStake, Dynasty } from './ValidatorShareHelper.js' + const BN = testHelpers.BN const expectRevert = testHelpers.expectRevert const toWei = web3.utils.toWei const ZeroAddr = '0x0000000000000000000000000000000000000000' const ExchangeRatePrecision = new BN('100000000000000000000000000000') -const Dynasty = 8 -const ValidatorDefaultStake = new BN(toWei('100')) describe('ValidatorSharePOL', function () { const wei100 = toWei('100') - async function doDeploy() { - await freshDeploy.call(this) - - this.polToken = await ERC20Permit.deploy('POL', 'POL', '1.1.0') - this.stakeToken = await TestToken.deploy('MATIC', 'MATIC') - - this.migration = await PolygonMigration.deploy(this.stakeToken.address, this.polToken.address) - - await this.stakeToken.mint(this.migration.address, toWei('30000000')) - await this.polToken.mint(this.migration.address, toWei('40000000')) - - await this.governance.update( - this.stakeManager.address, - this.stakeManager.interface.encodeFunctionData('setStakingToken', [this.stakeToken.address]) - ) - - await this.stakeToken.mint(this.stakeManager.address, toWei('10000000')) - - await this.governance.update( - this.stakeManager.address, - this.stakeManager.interface.encodeFunctionData('initializePOL', [this.polToken.address, this.migration.address]) - ) - - this.validatorId = '8' - this.validatorUser = wallets[0] - this.stakeAmount = ValidatorDefaultStake - - await this.governance.update( - this.stakeManager.address, - this.stakeManager.interface.encodeFunctionData('updateDynastyValue', [Dynasty]) - ) - await this.governance.update( - this.stakeManager.address, - this.stakeManager.interface.encodeFunctionData('updateValidatorThreshold', [8]) - ) - - // we need to increase validator id beyond foundation id, repeat 7 times - for (let i = 0; i < 7; ++i) { - await approveAndStake.call(this, { - wallet: this.validatorUser, - stakeAmount: this.stakeAmount, - acceptDelegation: true, - pol: true - }) - - await this.governance.update( - this.stakeManager.address, - this.stakeManager.interface.encodeFunctionData('forceUnstakePOL', [i + 1]) - ) - await this.stakeManager.forceFinalizeCommit() - await this.stakeManager.advanceEpoch(Dynasty) - const stakeManagerValidator = this.stakeManager.connect( - this.stakeManager.provider.getSigner(this.validatorUser.getChecksumAddressString()) - ) - await stakeManagerValidator.unstakeClaimPOL(i + 1) - await this.stakeManager.resetSignerUsed(this.validatorUser.getChecksumAddressString()) - } - - await approveAndStake.call(this, { - wallet: this.validatorUser, - stakeAmount: this.stakeAmount, - acceptDelegation: true, - pol: true - }) - await this.stakeManager.forceFinalizeCommit() - - let validator = await this.stakeManager.validators(this.validatorId) - this.validatorContract = await ValidatorShare.attach(validator.contractAddress) - } - - function deployAliceAndBob() { - before(doDeploy) + before(doDeployPOL) before('Alice & Bob', async function () { this.alice = wallets[2].getChecksumAddressString() this.bob = wallets[3].getChecksumAddressString() @@ -157,7 +83,7 @@ describe('ValidatorSharePOL', function () { totalStaked: toWei('200'), shares: toWei('100'), reward: '0', - initialBalance: toWei('69900') + initialBalance: toWei('70705') }) }) @@ -175,7 +101,7 @@ describe('ValidatorSharePOL', function () { totalStaked: toWei('200'), shares: toWei('100'), reward: '0', - initialBalance: toWei('69900') + initialBalance: toWei('70705') }) }) @@ -227,7 +153,7 @@ describe('ValidatorSharePOL', function () { totalStaked: toWei('200'), shares: toWei('100'), reward: '0', - initialBalance: toWei('69900') + initialBalance: toWei('70705') }) }) @@ -239,7 +165,7 @@ describe('ValidatorSharePOL', function () { totalStaked: toWei('350'), shares: toWei('150'), reward: '0', - initialBalance: toWei('69750') + initialBalance: toWei('70555') }) }) @@ -251,7 +177,7 @@ describe('ValidatorSharePOL', function () { totalStaked: toWei('600'), shares: toWei('250'), reward: '0', - initialBalance: toWei('69500') + initialBalance: toWei('70305') }) }) }) @@ -279,7 +205,7 @@ describe('ValidatorSharePOL', function () { totalStaked: toWei('200'), shares: toWei('100'), reward: '0', - initialBalance: toWei('69900') + initialBalance: toWei('70705') }) }) @@ -293,7 +219,7 @@ describe('ValidatorSharePOL', function () { totalStaked: toWei('350'), shares: toWei('150'), reward: toWei('4500'), - initialBalance: toWei('69750') + initialBalance: toWei('70555') }) }) @@ -305,7 +231,7 @@ describe('ValidatorSharePOL', function () { totalStaked: toWei('600'), shares: toWei('250'), reward: '6428571428571428571428', - initialBalance: toWei('74000') + initialBalance: toWei('74805') }) }) }) @@ -325,7 +251,7 @@ describe('ValidatorSharePOL', function () { totalStaked: toWei('200'), shares: toWei('100'), reward: '0', - initialBalance: toWei('69900') + initialBalance: toWei('70705') }) }) @@ -341,7 +267,7 @@ describe('ValidatorSharePOL', function () { totalStaked: toWei('300'), shares: toWei('100'), reward: '0', - initialBalance: toWei('69900') + initialBalance: toWei('70750') }) }) @@ -357,7 +283,7 @@ describe('ValidatorSharePOL', function () { totalStaked: toWei('500'), shares: toWei('200'), reward: '0', - initialBalance: toWei('69700') + initialBalance: toWei('70505') }) }) @@ -373,7 +299,7 @@ describe('ValidatorSharePOL', function () { totalStaked: toWei('700'), shares: toWei('200'), reward: '0', - initialBalance: toWei('69700') + initialBalance: toWei('70550') }) }) }) @@ -400,7 +326,7 @@ describe('ValidatorSharePOL', function () { totalStaked: toWei('200'), shares: toWei('100'), reward: '0', - initialBalance: toWei('69900') + initialBalance: toWei('70705') }) }) @@ -417,7 +343,7 @@ describe('ValidatorSharePOL', function () { totalStaked: toWei('300'), shares: toWei('100'), reward: '0', - initialBalance: toWei('69900') + initialBalance: toWei('70750') }) }) @@ -434,7 +360,7 @@ describe('ValidatorSharePOL', function () { totalStaked: toWei('500'), shares: toWei('200'), reward: toWei('7500'), - initialBalance: toWei('69700') + initialBalance: toWei('70505') }) }) @@ -450,7 +376,7 @@ describe('ValidatorSharePOL', function () { totalStaked: toWei('700'), shares: toWei('200'), reward: toWei('4800'), - initialBalance: toWei('69700') + initialBalance: toWei('70550') }) }) }) @@ -485,7 +411,7 @@ describe('ValidatorSharePOL', function () { describe('exchangeRate', function () { describe('when Alice purchases voucher 2 times, 1 epoch between', function () { - before(doDeploy) + before(doDeployPOL) before(async function () { this.user = wallets[2].getAddressString() @@ -522,7 +448,7 @@ describe('ValidatorSharePOL', function () { }) describe('when Alice purchases voucher and sells it', function () { - before(doDeploy) + before(doDeployPOL) before(async function () { this.user = wallets[2].getAddressString() await this.polToken.mint(this.user, toWei('250')) @@ -553,8 +479,8 @@ describe('ValidatorSharePOL', function () { const Alice = wallets[2].getChecksumAddressString() const Bob = wallets[1].getChecksumAddressString() - async function doDeployAndBuyVoucherForAliceAndBob(includeBob = false) { - await doDeploy.call(this) + async function doDeployPOLAndBuyVoucherForAliceAndBob(includeBob = false) { + await doDeployPOL.call(this) const stake = async ({ user, stake }) => { await this.polToken.mint(user, stake) @@ -678,12 +604,12 @@ describe('ValidatorSharePOL', function () { } describe('when Alice sells voucher', function () { - before(doDeployAndBuyVoucherForAliceAndBob) + before(doDeployPOLAndBuyVoucherForAliceAndBob) testsellVoucherPOL({ returnedStake: aliceStake, reward: toWei('18000'), - initialBalance: new BN(0), + initialBalance: toWei('805'), validatorId: '8', user: Alice, userTotalStaked: toWei('0'), @@ -693,7 +619,7 @@ describe('ValidatorSharePOL', function () { }) describe('when delegation is disabled after voucher was purchased by Alice', function () { - before(doDeployAndBuyVoucherForAliceAndBob) + before(doDeployPOLAndBuyVoucherForAliceAndBob) before('disable delegation', async function () { await this.governance.update( this.stakeManager.address, @@ -704,7 +630,7 @@ describe('ValidatorSharePOL', function () { testsellVoucherPOL({ returnedStake: aliceStake, reward: toWei('18000'), - initialBalance: new BN(0), + initialBalance: toWei('805'), validatorId: '8', user: Alice, userTotalStaked: toWei('0'), @@ -714,7 +640,7 @@ describe('ValidatorSharePOL', function () { }) describe('when Alice sells with claimAmount greater than expected', function () { - before(doDeployAndBuyVoucherForAliceAndBob) + before(doDeployPOLAndBuyVoucherForAliceAndBob) it('reverts', async function () { const maxShares = await this.validatorContract.balanceOf(Alice) @@ -724,7 +650,7 @@ describe('ValidatorSharePOL', function () { }) describe('when locked', function () { - before(doDeployAndBuyVoucherForAliceAndBob) + before(doDeployPOLAndBuyVoucherForAliceAndBob) before(async function () { await this.stakeManager.testLockShareContract(this.validatorId, true) @@ -733,7 +659,7 @@ describe('ValidatorSharePOL', function () { testsellVoucherPOL({ returnedStake: aliceStake, reward: toWei('18000'), - initialBalance: new BN(0), + initialBalance: toWei('805'), validatorId: '8', user: Alice, userTotalStaked: toWei('0'), @@ -743,7 +669,7 @@ describe('ValidatorSharePOL', function () { }) describe('when validator unstaked', function () { - before(doDeployAndBuyVoucherForAliceAndBob) + before(doDeployPOLAndBuyVoucherForAliceAndBob) before(async function () { const stakeManagerValidator = this.stakeManager.connect( this.stakeManager.provider.getSigner(this.validatorUser.getChecksumAddressString()) @@ -755,7 +681,7 @@ describe('ValidatorSharePOL', function () { testsellVoucherPOL({ returnedStake: aliceStake, reward: toWei('18000'), - initialBalance: new BN(0), + initialBalance: toWei('805'), validatorId: '8', user: Alice, userTotalStaked: toWei('0'), @@ -766,14 +692,14 @@ describe('ValidatorSharePOL', function () { describe('when Alice and Bob sell within withdrawal delay', function () { before(async function () { - await doDeployAndBuyVoucherForAliceAndBob.call(this, true) + await doDeployPOLAndBuyVoucherForAliceAndBob.call(this, true) }) describe('when Alice sells', function () { testsellVoucherPOL({ returnedStake: aliceStake, reward: toWei('9000'), - initialBalance: new BN(0), + initialBalance: toWei('805'), validatorId: '8', user: Alice, userTotalStaked: toWei('0'), @@ -786,7 +712,7 @@ describe('ValidatorSharePOL', function () { testsellVoucherPOL({ returnedStake: bobStake, reward: toWei('18000'), - initialBalance: new BN(0), + initialBalance: toWei('1200'), validatorId: '8', user: Bob, userTotalStaked: toWei('0'), @@ -798,8 +724,8 @@ describe('ValidatorSharePOL', function () { describe('partial sell', function () { describe('new API', function () { - describe('when Alice is not slashed', function () { - before(doDeployAndBuyVoucherForAliceAndBob) + describe('when Alice sells', function () { + before(doDeployPOLAndBuyVoucherForAliceAndBob) const halfStake = aliceStake.div(new BN('2')) @@ -809,7 +735,7 @@ describe('ValidatorSharePOL', function () { minClaimAmount: halfStake, returnedStake: halfStake, reward: toWei('18000'), - initialBalance: new BN(0), + initialBalance: toWei('805'), validatorId: '8', user: Alice, userTotalStaked: halfStake, @@ -828,7 +754,7 @@ describe('ValidatorSharePOL', function () { minClaimAmount: halfStake, returnedStake: halfStake, reward: '0', - initialBalance: new BN(toWei('18000')), + initialBalance: new BN(toWei('18805')), validatorId: '8', user: Alice, userTotalStaked: '0', @@ -840,8 +766,8 @@ describe('ValidatorSharePOL', function () { }) describe('old API', function () { - describe('when Alice is not slashed', function () { - before(doDeployAndBuyVoucherForAliceAndBob) + describe('when Alice sells', function () { + before(doDeployPOLAndBuyVoucherForAliceAndBob) const halfStake = aliceStake.div(new BN('2')) @@ -851,7 +777,7 @@ describe('ValidatorSharePOL', function () { minClaimAmount: halfStake, returnedStake: halfStake, reward: toWei('18000'), - initialBalance: new BN(0), + initialBalance: toWei('805'), validatorId: '8', user: Alice, userTotalStaked: halfStake, @@ -869,7 +795,7 @@ describe('ValidatorSharePOL', function () { minClaimAmount: halfStake, returnedStake: halfStake, reward: '0', - initialBalance: new BN(toWei('18000')), + initialBalance: new BN(toWei('18805')), validatorId: '8', user: Alice, userTotalStaked: '0', @@ -887,10 +813,10 @@ describe('ValidatorSharePOL', function () { }) describe('withdrawRewards', function () { - const Alice = wallets[2].getChecksumAddressString() - const Bob = wallets[3].getChecksumAddressString() - const Eve = wallets[4].getChecksumAddressString() - const Carol = wallets[5].getChecksumAddressString() + const Alice = wallets[5].getChecksumAddressString() + const Bob = wallets[6].getChecksumAddressString() + const Eve = wallets[7].getChecksumAddressString() + const Carol = wallets[8].getChecksumAddressString() let totalDelegatorRewardsReceived let totalStaked @@ -1006,7 +932,7 @@ describe('ValidatorSharePOL', function () { } function runWithdrawRewardsTest(timeline) { - before(doDeploy) + before(doDeployPOL) before(async function () { delegators = {} totalInitialBalance = new BN(0) @@ -1039,7 +965,7 @@ describe('ValidatorSharePOL', function () { ]) }) - describe('when Alice is not slashed. 1 checkpoint passed', function () { + describe('when 1 checkpoint passed', function () { runWithdrawRewardsTest([ { stake: { user: Alice, label: 'Alice', amount: new BN(wei100) } }, { checkpoints: 1 }, @@ -1073,7 +999,7 @@ describe('ValidatorSharePOL', function () { }) describe('when not enough rewards', function () { - before(doDeploy) + before(doDeployPOL) it('reverts', async function () { const validatorContractAlice = this.validatorContract.connect(this.validatorContract.provider.getSigner(Alice)) @@ -1091,7 +1017,7 @@ describe('ValidatorSharePOL', function () { }) describe('when locked', function () { - before(doDeploy) + before(doDeployPOL) before(async function () { const amount = toWei('100') @@ -1117,7 +1043,7 @@ describe('ValidatorSharePOL', function () { }) describe('when validator unstaked', function () { - before(doDeploy) + before(doDeployPOL) before(async function () { const amount = toWei('100') await this.polToken.mint(Alice, amount) @@ -1148,7 +1074,7 @@ describe('ValidatorSharePOL', function () { describe('restake', function () { function prepareForTest({ skipCheckpoint } = {}) { - before(doDeploy) + before(doDeployPOL) before(async function () { this.user = wallets[2].getChecksumAddressString() @@ -1260,7 +1186,7 @@ describe('ValidatorSharePOL', function () { describe('unstakeClaimTokens', function () { function prepareForTest({ skipSell, skipBuy } = {}) { - before(doDeploy) + before(doDeployPOL) before(async function () { this.user = wallets[2].getChecksumAddressString() @@ -1534,7 +1460,7 @@ describe('ValidatorSharePOL', function () { ) }) - it('Bob must have unchanged pol', async function () { + it('Bob must have unchanged matic', async function () { assertBigNumberEquality( await this.stakeToken.balanceOf(this.bob), initialBobStakeBalance diff --git a/test/units/staking/deployment.js b/test/units/staking/deployment.js index 9b28735b..31a678ff 100644 --- a/test/units/staking/deployment.js +++ b/test/units/staking/deployment.js @@ -34,8 +34,8 @@ export const walletAmounts = { } } -export async function freshDeploy(pol = false) { - let contracts = await deployer.deployStakeManager(wallets, pol) +export async function freshDeploy() { + let contracts = await deployer.deployStakeManager(wallets) this.stakeToken = contracts.stakeToken this.polToken = contracts.polToken this.stakeManager = contracts.stakeManager @@ -44,7 +44,6 @@ export async function freshDeploy(pol = false) { this.registry = contracts.registry this.governance = contracts.governance this.validatorShare = deployer.validatorShare - this.slashingManager = contracts.slashingManager await this.governance.update( this.stakeManager.address, @@ -57,9 +56,7 @@ export async function freshDeploy(pol = false) { for (const walletAddr in walletAmounts) { await this.stakeToken.mint(walletAddr, walletAmounts[walletAddr].initialBalance) - if (pol) { - await this.polToken.mint(walletAddr, walletAmounts[walletAddr].initialBalance) - } + await this.polToken.mint(walletAddr, walletAmounts[walletAddr].initialBalance) } this.defaultHeimdallFee = new BN(web3.utils.toWei('1')) diff --git a/test/units/staking/stakeManager/StakeManager.Staking.js b/test/units/staking/stakeManager/StakeManager.Staking.js index da71b106..4e7f9587 100644 --- a/test/units/staking/stakeManager/StakeManager.Staking.js +++ b/test/units/staking/stakeManager/StakeManager.Staking.js @@ -42,7 +42,7 @@ export function doUnstake(wallet) { export function prepareForTest(dynastyValue, validatorThreshold) { return async function () { - await freshDeploy.call(this, true) + await freshDeploy.call(this) await this.governance.update( this.stakeManager.address, @@ -209,7 +209,7 @@ describe('stake', function () { describe('double stake', async function () { before(async function() { - await freshDeploy.call(this, true) + await freshDeploy.call(this) }) describe('when stakes first time', function () { @@ -235,7 +235,7 @@ describe('stake', function () { describe('stake and restake following by another stake', function () { before(async function() { - await freshDeploy.call(this, true) + await freshDeploy.call(this) }) const amounts = walletAmounts[wallets[2].getAddressString()] @@ -259,27 +259,6 @@ describe('stake', function () { web3.utils.toWei('150') ) }) - describe('when reStakes while on going auction', function () { - it('when auction is active', async function () { - let auctionBid = web3.utils.toWei('10000') - const auctionUser = wallets[4].getAddressString() - await this.polToken.mint(auctionUser, auctionBid) - - const polTokenUser = this.polToken.connect(this.polToken.provider.getSigner(auctionUser)) - const stakeManagerUser = this.stakeManager.connect(this.stakeManager.provider.getSigner(auctionUser)) - - await polTokenUser.approve(this.stakeManager.address, auctionBid) - const validatorId = await this.stakeManager.getValidatorId(wallets[2].getChecksumAddressString()) - await stakeManagerUser.startAuction(validatorId, auctionBid, false, wallets[4].getPublicKeyString()) - testRestake( - wallets[2].getChecksumAddressString(), - amounts.restakeAmonut, - amounts.amount, - amounts.restakeAmonut, - amounts.amount - ) - }) - }) }) describe('stake beyond validator threshold', async function () { @@ -309,7 +288,7 @@ describe('stake', function () { describe('consecutive stakes', function () { before(async function() { - await freshDeploy.call(this, true) + await freshDeploy.call(this) }) it('validatorId must increment 1 by 1', async function () { @@ -329,7 +308,7 @@ describe('stake', function () { describe('stake with heimdall fee', function () { before(async function() { - await freshDeploy.call(this, true) + await freshDeploy.call(this) }) testStake( @@ -347,7 +326,7 @@ describe('stake', function () { const newSigner = wallets[2].getPublicKeyString() before(async function() { - await freshDeploy.call(this, true) + await freshDeploy.call(this) }) before(doStake(AliceWallet)) before('Change signer', async function () { @@ -376,7 +355,7 @@ describe('unstake', function () { let stakeManagerAlice before(async function() { - await freshDeploy.call(this, true) + await freshDeploy.call(this) }) before(doStake(AliceWallet)) before(doStake(BobWallet)) @@ -415,7 +394,7 @@ describe('unstake', function () { const others = [wallets[2], wallets[3]] before(async function() { - await freshDeploy.call(this, true) + await freshDeploy.call(this) }) before(doStake(AliceWallet)) before(doStake(others[0])) @@ -611,7 +590,7 @@ describe('unstake', function () { describe('reverts', function () { beforeEach('Fresh Deploy', async function() { - await freshDeploy.call(this, true) + await freshDeploy.call(this) }) const user = wallets[2].getChecksumAddressString() let stakeManagerUser @@ -637,20 +616,6 @@ describe('unstake', function () { await expectRevert.unspecified(stakeManagerUser.unstake(validatorId)) }) - - it('when unstakes during auction', async function () { - const amount = web3.utils.toWei('1200').toString() - const auctionUser = wallets[4].getAddressString() - await this.polToken.mint(auctionUser, amount) - - const polTokenAuctionUser = this.polToken.connect(this.polToken.provider.getSigner(auctionUser)) - const stakeManagerAuctionUser = this.stakeManager.connect(this.stakeManager.provider.getSigner(auctionUser)) - - await polTokenAuctionUser.approve(this.stakeManager.address, amount) - const validatorId = await this.stakeManager.getValidatorId(user) - await stakeManagerAuctionUser.startAuction(validatorId, amount, false, wallets[4].getPublicKeyString()) - await expectRevert.unspecified(stakeManagerUser.unstake(validatorId)) - }) }) }) @@ -887,18 +852,15 @@ describe('restake', function () { await approveAndStake.call(this, { wallet, stakeAmount: initialStake, acceptDelegation }) } - // cooldown period - let auctionPeriod = (await this.stakeManager.auctionPeriod()).toNumber() - let currentEpoch = (await this.stakeManager.currentEpoch()).toNumber() - - for (let i = currentEpoch; i <= auctionPeriod; i++) { + // wait two checkpoints for some rewards + for (let i = 0; i < 2; i++) { await checkPoint(initialStakers, this.rootChainOwner, this.stakeManager) } // without 10% proposer bonus this.validatorReward = checkpointReward .mul(new BN(100 - proposerBonus)) .div(new BN(100)) - .mul(new BN(auctionPeriod - currentEpoch)) + .mul(new BN(1)) this.validatorId = '1' this.user = initialStakers[0].getAddressString() this.amount = web3.utils.toWei('100') diff --git a/test/units/staking/stakeManager/StakeManager.StakingPol.js b/test/units/staking/stakeManager/StakeManager.StakingPol.js index e9f96b97..68b210fb 100644 --- a/test/units/staking/stakeManager/StakeManager.StakingPol.js +++ b/test/units/staking/stakeManager/StakeManager.StakingPol.js @@ -43,7 +43,7 @@ export function doUnstake(wallet) { export function prepareForTest(dynastyValue, validatorThreshold) { return async function () { - await freshDeploy.call(this, true) + await freshDeploy.call(this) await this.governance.update( this.stakeManager.address, @@ -57,127 +57,6 @@ export function prepareForTest(dynastyValue, validatorThreshold) { } } -describe('migrate matic', function (){ - describe('initializePOL', function(){ - before('Setup migration scenario', async function() { - await freshDeploy.call(this) - }) - - describe('must revert with pol functions', function(){ - let stakeTokenUser, user, stakeManagerUser, amount, userPubkey - before('', async function(){ - userPubkey = wallets[1].getPublicKeyString(), - user = wallets[1].getChecksumAddressString() - amount = web3.utils.toWei('10') - - stakeTokenUser = this.stakeToken.connect(this.stakeToken.provider.getSigner(user)) - stakeManagerUser = this.stakeManager.connect(this.stakeManager.provider.getSigner(user)) - }) - - it('on stake token', async function () { - await stakeTokenUser.approve(this.stakeManager.address, amount.toString()) - await expect(stakeManagerUser.stakeForPOL(user, amount.toString(), web3.utils.toWei('1'), false, userPubkey)) - .to.be.rejectedWith('') - }) - }) - - describe('run initializePOL', function(){ - let oldStakeToken, newStakeToken, migrationAmount - before('gov update', async function(){ - migrationAmount = web3.utils.toWei('20000000') - - oldStakeToken = await TestToken.deploy('MATIC', 'MAT') - await this.governance.update( - this.stakeManager.address, - this.stakeManager.interface.encodeFunctionData('setStakingToken', [oldStakeToken.address]) - ) - await oldStakeToken.mint(this.stakeManager.address, migrationAmount) - - newStakeToken = await TestToken.deploy('POL', 'POL') - - this.migration = await PolygonMigration.deploy(oldStakeToken.address, newStakeToken.address) - - await oldStakeToken.mint(this.migration.address, web3.utils.toWei('50000000')) - await newStakeToken.mint(this.migration.address, web3.utils.toWei('50000000')) - }) - - it('must initializePOL', async function () { - await this.governance.update( - this.stakeManager.address, - this.stakeManager.interface.encodeFunctionData('initializePOL', [newStakeToken.address, this.migration.address]) - ) - }) - - it('stakemanager must have correct pol balance', async function () { - let polBalance = await oldStakeToken.balanceOf(this.stakeManager.address) - assertBigNumberEquality(BN(0), polBalance) - }) - - it('stakemanager must have correct stake balance', async function () { - let stakeBalance = await newStakeToken.balanceOf(this.stakeManager.address) - assertBigNumberEquality(migrationAmount, stakeBalance) - }) - }) - }) - - describe('successful migration', function(){ - const migrationAmount = new BN('100000000000000') - const initalPolAmount = new BN('100000000000000') - const initalStakeAmount = new BN(0) - - before('Setup migration scenario', async function() { - await freshDeploy.call(this) - - this.stakeToken = await TestToken.deploy('POL', 'POL') - this.polToken = await TestToken.deploy('MATIC', 'MATIC') - - this.migration = await PolygonMigration.deploy(this.polToken.address, this.stakeToken.address) - - await this.governance.update( - this.stakeManager.address, - this.stakeManager.interface.encodeFunctionData('setStakingToken', [this.polToken.address]) - ) - - await this.governance.update( - this.stakeManager.address, - this.stakeManager.interface.encodeFunctionData('initializePOL', [this.stakeToken.address, this.migration.address]) - ) - - await this.stakeToken.mint(this.stakeManager.address, initalStakeAmount.toString()) - await this.polToken.mint(this.stakeManager.address, initalPolAmount.toString()) - - await this.stakeToken.mint(this.migration.address, web3.utils.toWei('50000000')) - await this.polToken.mint(this.migration.address, web3.utils.toWei('50000000')) - }) - - it('must revert with too many token', async function () { - const bigAmount = initalPolAmount.mul(new BN('20')) - await expectRevert( this.governance.update( - this.stakeManager.address, - this.stakeManager.interface.encodeFunctionData('convertMaticToPOL', [bigAmount.toString()]) - ), 'Update failed') - //'Insufficient MATIC balance' - }) - - it('must migrate', async function () { - await this.governance.update( - this.stakeManager.address, - this.stakeManager.interface.encodeFunctionData('convertMaticToPOL', [migrationAmount.toString()]) - ) - }) - it('must have correct pol balance', async function(){ - const polBalance = await this.polToken.balanceOf(this.stakeManager.address) - assertBigNumberEquality(polBalance, initalPolAmount.sub(migrationAmount)) - }) - - it('must have correct stake balance', async function(){ - const stakeBalance = await this.stakeToken.balanceOf(this.stakeManager.address) - assertBigNumberEquality(stakeBalance, initalStakeAmount.add(migrationAmount)) - }) - }) -}) - - describe('stake POL', function () { function testStakeRevert(user, userPubkey, amount, stakeAmount, unspecified = false) { let stakeManagerUser, polTokenUser @@ -331,7 +210,7 @@ describe('stake POL', function () { describe('double stake', async function () { before('deploy', async function() { - await freshDeploy.call(this, true) + await freshDeploy.call(this) }) describe('when stakes first time', function () { @@ -357,7 +236,7 @@ describe('stake POL', function () { describe('stake and restake following by another stake', function () { before('deploy', async function() { - await freshDeploy.call(this, true) + await freshDeploy.call(this) }) const amounts = walletAmounts[wallets[2].getAddressString()] @@ -381,27 +260,6 @@ describe('stake POL', function () { web3.utils.toWei('150') ) }) - describe('when reStakes while on going auction', function () { - it('when auction is active', async function () { - let auctionBid = web3.utils.toWei('10000') - const auctionUser = wallets[4].getAddressString() - await this.polToken.mint(auctionUser, auctionBid) - - const polTokenUser = this.polToken.connect(this.polToken.provider.getSigner(auctionUser)) - const stakeManagerUser = this.stakeManager.connect(this.stakeManager.provider.getSigner(auctionUser)) - - await polTokenUser.approve(this.stakeManager.address, auctionBid) - const validatorId = await this.stakeManager.getValidatorId(wallets[2].getChecksumAddressString()) - await stakeManagerUser.startAuction(validatorId, auctionBid, false, auctionUser) - testRestake( - wallets[2].getChecksumAddressString(), - amounts.restakeAmonut, - amounts.amount, - amounts.restakeAmonut, - amounts.amount - ) - }) - }) }) describe('stake beyond validator threshold', async function () { @@ -431,7 +289,7 @@ describe('stake POL', function () { describe('consecutive stakes', function () { before('deploy', async function() { - await freshDeploy.call(this, true) + await freshDeploy.call(this) }) it('validatorId must increment 1 by 1', async function () { @@ -451,7 +309,7 @@ describe('stake POL', function () { describe('stake with heimdall fee', function () { before('deploy', async function() { - await freshDeploy.call(this, true) + await freshDeploy.call(this) }) testStake( @@ -469,7 +327,7 @@ describe('stake POL', function () { const newSigner = wallets[2].getPublicKeyString() before('deploy', async function() { - await freshDeploy.call(this, true) + await freshDeploy.call(this) }) before(doStake(AliceWallet)) before('Change signer', async function () { @@ -498,7 +356,7 @@ describe('unstake POL', function () { let stakeManagerAlice before('deploy', async function() { - await freshDeploy.call(this, true) + await freshDeploy.call(this) }) before(doStake(AliceWallet)) before(doStake(BobWallet)) @@ -681,7 +539,7 @@ describe('unstake POL', function () { describe('reverts', function () { beforeEach('deploy', async function() { - await freshDeploy.call(this, true) + await freshDeploy.call(this) }) const user = wallets[2].getChecksumAddressString() let stakeManagerUser @@ -706,20 +564,6 @@ describe('unstake POL', function () { await expectRevert.unspecified(stakeManagerUser.unstakePOL(validatorId)) }) - - it('when unstakes during auction', async function () { - const amount = web3.utils.toWei('1200').toString() - const auctionUser = wallets[4].getAddressString() - await this.polToken.mint(auctionUser, amount) - - const polTokenAuctionUser = this.polToken.connect(this.polToken.provider.getSigner(auctionUser)) - const stakeManagerAuctionUser = this.stakeManager.connect(this.stakeManager.provider.getSigner(auctionUser)) - - await polTokenAuctionUser.approve(this.stakeManager.address, amount) - const validatorId = await this.stakeManager.getValidatorId(user) - await stakeManagerAuctionUser.startAuction(validatorId, amount, false, wallets[4].getPublicKeyString()) - await expectRevert.unspecified(stakeManagerUser.unstakePOL(validatorId)) - }) }) }) @@ -956,18 +800,15 @@ describe('restake POL', function () { await approveAndStake.call(this, { wallet, stakeAmount: initialStake, acceptDelegation, pol: true }) } - // cooldown period - let auctionPeriod = (await this.stakeManager.auctionPeriod()).toNumber() - let currentEpoch = (await this.stakeManager.currentEpoch()).toNumber() - - for (let i = currentEpoch; i <= auctionPeriod; i++) { + // wait 2 checkpoints for some rewards + for (let i = 0; i < 2; i++) { await checkPoint(initialStakers, this.rootChainOwner, this.stakeManager) } // without 10% proposer bonus this.validatorReward = checkpointReward .mul(new BN(100 - proposerBonus)) .div(new BN(100)) - .mul(new BN(auctionPeriod - currentEpoch)) + .mul(new BN(1)) this.validatorId = '1' this.user = initialStakers[0].getAddressString() this.amount = web3.utils.toWei('100') diff --git a/test/units/staking/stakeManager/StakeManager.test.js b/test/units/staking/stakeManager/StakeManager.test.js index 631eb83d..65e3a41b 100644 --- a/test/units/staking/stakeManager/StakeManager.test.js +++ b/test/units/staking/stakeManager/StakeManager.test.js @@ -92,6 +92,8 @@ describe('StakeManager', function (accounts) { ZeroAddr, ZeroAddr, ZeroAddr, + ZeroAddr, + ZeroAddr, ZeroAddr ), 'already inited' @@ -276,7 +278,7 @@ describe('StakeManager', function (accounts) { function doDeploy(acceptDelegation) { before('Fresh deploy', async function() { - await freshDeploy.call(this, true) + await freshDeploy.call(this) }) before('Approve and stake', async function () { await approveAndStake.call(this, { wallet: staker, stakeAmount: stakeAmount, acceptDelegation }) @@ -332,7 +334,7 @@ describe('StakeManager', function (accounts) { describe('checkSignatures', function () { function prepareToTest(stakers, checkpointBlockInterval = 1) { before('Fresh deploy', async function(){ - await freshDeploy.call(this, true) + await freshDeploy.call(this) }) before('updateCheckPointBlockInterval', async function () { await this.governance.update( @@ -819,7 +821,7 @@ describe('StakeManager', function (accounts) { describe('when payload is invalid', function () { beforeEach('Fresh deploy', async function(){ - await freshDeploy.call(this, true) + await freshDeploy.call(this) }) beforeEach('Prepare to test', async function () { this.amount = new BN(web3.utils.toWei('200')) @@ -920,7 +922,7 @@ describe('StakeManager', function (accounts) { } async function doDeploy() { - await freshDeploy.call(this, true) + await freshDeploy.call(this) this.checkpointIndex = 0 this.validators = [] @@ -985,7 +987,7 @@ describe('StakeManager', function (accounts) { describe("when trying to checkpoint when 1 of the validators unstakes with more than 1/3 stake and don't sign", function () { before('Fresh deploy', async function(){ - await freshDeploy.call(this, true) + await freshDeploy.call(this) }) before('Alice And Bob Stake', async function () { for (const wallet of [wallets[2], wallets[3]]) { @@ -1007,31 +1009,10 @@ describe('StakeManager', function (accounts) { }) }) - describe('dethroneAndStake', function () { - describe('when from is not stake manager', function () { - before('Fresh deploy', async function(){ - await freshDeploy.call(this, true) - }) - it('reverts', async function () { - await expectRevert( - this.stakeManager.dethroneAndStake( - wallets[2].getAddressString(), - this.defaultHeimdallFee.toString(), - '1', - '1000', - true, - wallets[2].getPublicKeyString() - ), - 'not allowed' - ) - }) - }) - }) - describe('setDelegationEnabled', function () { describe('when from is governance', function () { before('Fresh deploy', async function(){ - await freshDeploy.call(this, true) + await freshDeploy.call(this) }) it('must disable delegation', async function () { @@ -1059,7 +1040,7 @@ describe('StakeManager', function (accounts) { describe('when from is not governance', function () { before('Fresh deploy', async function(){ - await freshDeploy.call(this, true) + await freshDeploy.call(this) }) it('reverts', async function () { await expectRevert(this.stakeManager.setDelegationEnabled(false), 'Only governance contract is authorized') @@ -1073,7 +1054,7 @@ describe('StakeManager', function (accounts) { const userOriginalPubKey = wallets[3].getPublicKeyString() async function doDeploy() { - await freshDeploy.call(this, true) + await freshDeploy.call(this) const amount = web3.utils.toWei('200') for (const wallet of w) { @@ -1277,7 +1258,7 @@ describe('StakeManager', function (accounts) { describe('updateDynastyValue', function () { describe('when set dynasty to 10', function () { before('Fresh deploy', async function(){ - await freshDeploy.call(this, true) + await freshDeploy.call(this) }) it('must update dynasty', async function () { @@ -1302,19 +1283,11 @@ describe('StakeManager', function (accounts) { it('dynasty must be 10', async function () { assertBigNumberEquality('10', await this.stakeManager.dynasty()) }) - - it('auctionPeriod must be 2', async function () { - assertBigNumberEquality('2', await this.stakeManager.auctionPeriod()) - }) - - it('replacementCooldown must be 3', async function () { - assertBigNumberEquality('3', await this.stakeManager.replacementCoolDown()) - }) }) describe('when set dynasty to 0', function () { before('Fresh deploy', async function(){ - await freshDeploy.call(this, true) + await freshDeploy.call(this) }) it('must revert', async function () { @@ -1324,7 +1297,7 @@ describe('StakeManager', function (accounts) { describe('when from is not governance', function () { before('Fresh deploy', async function(){ - await freshDeploy.call(this, true) + await freshDeploy.call(this) }) it('reverts', async function () { @@ -1337,7 +1310,7 @@ describe('StakeManager', function (accounts) { describe('updateCheckpointReward', function () { describe('when set reward to 20', function () { before('Fresh deploy', async function(){ - await freshDeploy.call(this, true) + await freshDeploy.call(this) }) it('must update', async function () { @@ -1360,7 +1333,7 @@ describe('StakeManager', function (accounts) { describe('when set reward to 0', function () { before('Fresh deploy', async function(){ - await freshDeploy.call(this, true) + await freshDeploy.call(this) }) it('must revert', async function () { @@ -1370,7 +1343,7 @@ describe('StakeManager', function (accounts) { describe('when from is not governance', function () { before('Fresh deploy', async function(){ - await freshDeploy.call(this, true) + await freshDeploy.call(this) }) it('reverts', async function () { @@ -1387,7 +1360,7 @@ describe('StakeManager', function (accounts) { let _wallets = [Alice, Bob] async function doDeploy() { - await freshDeploy.call(this, true) + await freshDeploy.call(this) this.amount = new BN(web3.utils.toWei('200')) this.totalStaked = new BN(0) @@ -1492,7 +1465,7 @@ describe('StakeManager', function (accounts) { const fee = new BN(web3.utils.toWei('50')).toString() async function doDeploy() { - await freshDeploy.call(this, true) + await freshDeploy.call(this) await approveAndStake.call(this, { wallet, stakeAmount: amount }) } @@ -1645,7 +1618,7 @@ describe('StakeManager', function (accounts) { } async function doDeploy() { - await freshDeploy.call(this, true) + await freshDeploy.call(this) this.checkpointIndex = 0 this.validators = [] @@ -1928,469 +1901,6 @@ describe('StakeManager', function (accounts) { }) }) - describe('startAuction', function () { - const _initialStakers = [wallets[1], wallets[2]] - const initialStakeAmount = web3.utils.toWei('200') - - describe('Alice and Bob bid', function () { - const Alice = wallets[3] - const Bob = wallets[4] - - let aliceBidAmount = web3.utils.toWei('1200') - let bobBidAmount = web3.utils.toWei('1250') - - before('deploy', doDeploy) - before(async function () { - await this.polToken.mint(Alice.getAddressString(), aliceBidAmount) - const polTokenAlice = this.polToken.connect(this.polToken.provider.getSigner(Alice.getAddressString())) - await polTokenAlice.approve(this.stakeManager.address, aliceBidAmount) - - await this.polToken.mint(Bob.getAddressString(), bobBidAmount) - const polTokenBob = this.polToken.connect(this.polToken.provider.getSigner(Bob.getAddressString())) - await polTokenBob.approve(this.stakeManager.address, bobBidAmount) - - this.userOldBalance = await this.polToken.balanceOf(Alice.getAddressString()) - this.bobOldBalance = await this.polToken.balanceOf(Bob.getAddressString()) - - this.validatorId = '1' - this.initialStakeAmount = initialStakeAmount - }) - - describe('when Alice bids', function () { - testStartAuction(Alice.getChecksumAddressString(), Alice.getPrivateKeyString(), aliceBidAmount) - }) - - describe('when Bob bids', function () { - testStartAuction(Bob.getChecksumAddressString(), Bob.getPublicKeyString(), bobBidAmount) - - it('Alice must get her bid back', async function () { - const currentBalance = await this.polToken.balanceOf(Alice.getAddressString()) - assertBigNumberEquality(this.userOldBalance, currentBalance) - }) - }) - }) - - describe('reverts', function () { - beforeEach('deploy', doDeploy) - - it('when bid during non-auction period', async function () { - let auctionPeriod = await this.stakeManager.auctionPeriod() - await this.stakeManager.advanceEpoch(auctionPeriod.toNumber()) - const stakeManager3 = this.stakeManager.connect(this.stakeManager.provider.getSigner(3)) - await expectRevert( - stakeManager3.startAuction(1, this.amount, false, wallets[3].getPrivateKeyString()), - 'Invalid auction period' - ) - }) - - it('when trying to start and confirm in last epoch', async function () { - this.validatorId = 1 - await this.stakeManager.advanceEpoch(1) - const stakeManager3 = this.stakeManager.connect(this.stakeManager.provider.getSigner(3)) - await stakeManager3.startAuction(this.validatorId, this.amount, false, wallets[3].getPublicKeyString()) - - const polToken3 = this.polToken.connect(this.polToken.provider.getSigner(3)) - await polToken3.approve(this.stakeManager.address, web3.utils.toWei('1')) - await expectRevert( - stakeManager3.confirmAuctionBid(this.validatorId, web3.utils.toWei('1')), - 'Not allowed before auctionPeriod' - ) - await stakeManager3.advanceEpoch(1) - await stakeManager3.confirmAuctionBid(this.validatorId, web3.utils.toWei('1')) - assert.ok(!(await this.stakeManager.isValidator(this.validatorId))) - }) - - it('when bid during replacement cooldown', async function () { - await this.governance.update( - this.stakeManager.address, - this.stakeManager.interface.encodeFunctionData('updateDynastyValue', ['7']) - ) - - const stakeManager3 = this.stakeManager.connect(this.stakeManager.provider.getSigner(3)) - await expectRevert( - stakeManager3.startAuction(1, this.amount, false, wallets[3].getPrivateKeyString()), - 'Cooldown period' - ) - }) - - it('when bid on unstaking validator', async function () { - const stakeManagerStaker = this.stakeManager.connect( - this.stakeManager.provider.getSigner(_initialStakers[0].getAddressString()) - ) - await stakeManagerStaker.unstake(1) - const stakeManager3 = this.stakeManager.connect(this.stakeManager.provider.getSigner(3)) - await expectRevert( - stakeManager3.startAuction(1, this.amount, false, wallets[3].getPrivateKeyString()), - 'Invalid validator for an auction' - ) - }) - - it('when restake on unstaking validator', async function () { - const stakeManagerStaker = this.stakeManager.connect( - this.stakeManager.provider.getSigner(_initialStakers[0].getAddressString()) - ) - await (await stakeManagerStaker.unstake(1)).wait() - await expectRevert(stakeManagerStaker.restake(1, this.amount, false), 'No restaking') - }) - - // since all the rewards are given in unstake already - it('Must not transfer any rewards after unstaking', async function () { - const stakeManagerStaker = this.stakeManager.connect( - this.stakeManager.provider.getSigner(_initialStakers[0].getAddressString()) - ) - await stakeManagerStaker.unstake(1) - const receipt = await (await stakeManagerStaker.withdrawRewards(1)).wait() - await assertInTransaction(receipt, StakingInfo, 'ClaimRewards', { - validatorId: '1', - amount: '0', - totalAmount: await this.stakeManager.totalRewardsLiquidated() - }) - }) - - it('when validatorId is invalid', async function () { - const stakeManager3 = this.stakeManager.connect(this.stakeManager.provider.getSigner(3)) - await expectRevert.unspecified( - stakeManager3.startAuction(0, this.amount, false, wallets[3].getPrivateKeyString()) - ) - }) - - it('when bid is too low', async function () { - const stakeManager3 = this.stakeManager.connect(this.stakeManager.provider.getSigner(3)) - await expectRevert( - stakeManager3.startAuction(1, web3.utils.toWei('100'), false, wallets[3].getPrivateKeyString()), - 'Must bid higher' - ) - }) - }) - - async function doDeploy() { - await Staking.prepareForTest(8, 10).call(this) - - for (const wallet of _initialStakers) { - await approveAndStake.call(this, { wallet, stakeAmount: initialStakeAmount }) - } - - // cooldown period - let auctionPeriod = (await this.stakeManager.auctionPeriod()).toNumber() - let currentEpoch = (await this.stakeManager.currentEpoch()).toNumber() - for (let i = currentEpoch; i <= auctionPeriod + (await this.stakeManager.dynasty()).toNumber(); i++) { - await checkPoint(_initialStakers, this.rootChainOwner, this.stakeManager) - } - this.amount = web3.utils.toWei('500') - const polToken3 = this.polToken.connect(this.polToken.provider.getSigner(3)) - await polToken3.approve(this.stakeManager.address, this.amount) - } - }) - - describe.skip('confirmAuctionBid', function () { - const initialStakers = [wallets[1], wallets[2]] - const bidAmount = new BN(web3.utils.toWei('1200')) - const initialStakeAmount = web3.utils.toWei('200') - - function doDeploy(skipAuctionPeriod = true) { - return async function () { - await Staking.prepareForTest(8, 10).call(this) - - // cooldown period - const replacementCooldown = await this.stakeManager.replacementCoolDown() - await this.stakeManager.advanceEpoch(replacementCooldown.toString()) - - for (const wallet of initialStakers) { - await approveAndStake.call(this, { wallet, stakeAmount: initialStakeAmount }) - } - - const polToken3 = this.polToken.connect(this.polToken.provider.getSigner(3)) - this.amount = web3.utils.toWei('500') - await polToken3.approve(this.stakeManager.address, this.amount) - - // bid - const mintAmount = bidAmount.add(new BN(this.heimdallFee || this.defaultHeimdallFee)).toString() - await this.polToken.mint(this.bidder, mintAmount) - const polTokenBidder = this.polToken.connect(this.polToken.provider.getSigner(this.bidder)) - await polTokenBidder.approve(this.stakeManager.address, mintAmount) - - this.bidderBalanceBeforeAuction = await this.polToken.balanceOf(this.bidder) - this.totalStakedBeforeAuction = await this.stakeManager.totalStaked() - - const stakeManagerBidder = this.stakeManager.connect(this.stakeManager.provider.getSigner(this.bidder)) - await stakeManagerBidder.startAuction(this.validatorId, bidAmount.toString(), false, this.bidderPubKey) - - if (skipAuctionPeriod) { - const auction = await this.stakeManager.validatorAuction(this.validatorId) - const currentEpoch = await this.stakeManager.currentEpoch() - const dynasty = await this.stakeManager.dynasty() - - const end = auction.startEpoch.add(dynasty).toNumber() - for (let i = currentEpoch.toNumber(); i <= end; i++) { - await checkPoint(initialStakers, this.rootChainOwner, this.stakeManager) - } - } - } - } - - describe('when last auctioner is not validator', function () { - const heimdallFee = web3.utils.toWei('100') - - function prepareToTest() { - before(async function () { - this.validatorId = '1' - this.newValidatorId = '3' - this.bidder = wallets[4].getChecksumAddressString() - this.bidderPubKey = wallets[4].getPublicKeyString() - this.heimdallFee = heimdallFee - this.bidAmount = bidAmount - }) - - before(doDeploy()) - - before(async function () { - this.prevValidatorAddr = initialStakers[0].getChecksumAddressString() - this.prevValidatorOldBalance = await this.polToken.balanceOf(this.prevValidatorAddr) - - this.validator = await this.stakeManager.validators(this.validatorId) - this.reward = await this.stakeManager.validatorReward(this.validatorId) - }) - } - - describe('when 0 dynasties has passed', function () { - prepareToTest() - testConfirmAuctionBidForNewValidator() - }) - describe('when 10 dynasties has passed', function () { - prepareToTest() - before(async function () { - const currentDynasty = await this.stakeManager.dynasty() - await this.stakeManager.advanceEpoch(currentDynasty.mul(10)) - }) - - testConfirmAuctionBidForNewValidator() - }) - describe('when validator has more stake then last bid', function () { - prepareToTest() - before(async function () { - let restakeAmount = web3.utils.toWei('10000') - await this.polToken.mint(this.prevValidatorAddr, restakeAmount) - - const stakeTokenValidator = this.polToken.connect( - this.polToken.provider.getSigner(this.prevValidatorAddr) - ) - await stakeTokenValidator.approve(this.stakeManager.address, restakeAmount) - - // restake - const stakeManagerValidator = this.stakeManager.connect( - this.stakeManager.provider.getSigner(this.prevValidatorAddr) - ) - await stakeManagerValidator.restake(this.validatorId, restakeAmount, false) - this.validator = await this.stakeManager.validators(this.validatorId) - }) - - testConfirmAuctionBidForOldValidator() - }) - }) - - describe("when auction period hasn't been passed after initial stake", function () { - before(async function () { - this.validatorId = '1' - this.bidder = wallets[3].getChecksumAddressString() - this.bidderPubKey = wallets[3].getPublicKeyString() - this.bidAmount = bidAmount - }) - - beforeEach(doDeploy(false)) - - describe('when 0 dynasties has passed', function () { - it('reverts', async function () { - const stakeManagerBidder = this.stakeManager.connect(this.stakeManager.provider.getSigner(this.bidder)) - await expectRevert( - stakeManagerBidder.confirmAuctionBid(this.validatorId, this.defaultHeimdallFee.toString()), - 'Not allowed before auctionPeriod' - ) - }) - }) - - describe('when 10 dynasties has passed', function () { - beforeEach(async function () { - const currentDynasty = await this.stakeManager.dynasty() - await this.stakeManager.advanceEpoch(currentDynasty.mul(10)) - }) - - it('reverts', async function () { - const stakeManagerBidder = this.stakeManager.connect(this.stakeManager.provider.getSigner(this.bidder)) - await expectRevert( - stakeManagerBidder.confirmAuctionBid(this.validatorId, this.defaultHeimdallFee.toString()), - 'Not allowed before auctionPeriod' - ) - }) - }) - }) - - describe('when from is not bidder', function () { - before(async function () { - this.validatorId = '1' - this.bidder = wallets[3].getChecksumAddressString() - this.bidderPubKey = wallets[3].getPublicKeyString() - this.bidAmount = bidAmount - }) - - before(doDeploy()) - - it('reverts', async function () { - const stakeManager4 = this.stakeManager.connect(this.stakeManager.provider.getSigner(4)) - await expectRevert.unspecified(stakeManager4.confirmAuctionBid(this.validatorId, 0)) - }) - }) - }) - - describe('auction with delegator, 3 validators initially', function () { - const initialStakers = [wallets[1], wallets[2]] - const delegatedValidatorId = '3' - const delegator = wallets[3].getChecksumAddressString() - const validatorUser = wallets[4] - const validatorUserAddr = wallets[4].getChecksumAddressString() - const auctionValidatorAddr = wallets[5].getChecksumAddressString() - const auctionValidatorPubKey = wallets[5].getPublicKeyString() - const stakeAmount = web3.utils.toWei('1250').toString() - const bidAmount = web3.utils.toWei('2555').toString() - - function doDeploy() { - return async function () { - await Staking.prepareForTest(8, 10).call(this) - - for (const wallet of initialStakers) { - await approveAndStake.call(this, { wallet, stakeAmount }) - } - } - } - - before('fresh deploy', doDeploy()) - before(async function () { - await this.stakeToken.mint(this.stakeManager.address, web3.utils.toWei('1000000')) // rewards amount - - await approveAndStake.call(this, { wallet: validatorUser, stakeAmount, acceptDelegation: true }) - - let validator = await this.stakeManager.validators(delegatedValidatorId) - - this.validatorContract = await ValidatorShare.attach(validator.contractAddress) - - await this.stakeToken.mint(delegator, stakeAmount) - const stakeTokenDelegator = this.stakeToken.connect(this.stakeToken.provider.getSigner(delegator)) - await stakeTokenDelegator.approve(this.stakeManager.address, stakeAmount) - - // cooldown period - let auctionPeriod = (await this.stakeManager.auctionPeriod()).toNumber() - let currentEpoch = (await this.stakeManager.currentEpoch()).toNumber() - for (let i = currentEpoch; i <= auctionPeriod + (await this.stakeManager.dynasty()).toNumber(); i++) { - await checkPoint([...initialStakers, validatorUser], this.rootChainOwner, this.stakeManager) - } - - await buyVoucher(this.validatorContract, stakeAmount, delegator) - - this.heimdallFee = this.defaultHeimdallFee - - const approveAmount = new BN(bidAmount).add(this.heimdallFee).toString() - await this.polToken.mint(auctionValidatorAddr, approveAmount) - const polTokenValidator = this.polToken.connect(this.polToken.provider.getSigner(auctionValidatorAddr)) - await polTokenValidator.approve(this.stakeManager.address, approveAmount) - - this.totalStakedBeforeAuction = await this.stakeManager.totalStaked() - this.bidderBalanceBeforeAuction = await this.polToken.balanceOf(auctionValidatorAddr) - }) - - describe('when new validator bids', function () { - before(async function () { - this.initialStakeAmount = stakeAmount - this.validatorId = delegatedValidatorId - this.userOldBalance = this.bidderBalanceBeforeAuction - }) - - after('skip auction', async function () { - let auctionPeriod = (await this.stakeManager.auctionPeriod()).toNumber() - for (let i = 0; i <= auctionPeriod; i++) { - await checkPoint([...initialStakers, validatorUser], this.rootChainOwner, this.stakeManager) - } - }) - - testStartAuction(auctionValidatorAddr, auctionValidatorPubKey, bidAmount) - }) - - describe('when new validator confirm auction', function () { - before(async function () { - this.validatorId = delegatedValidatorId - this.bidderPubKey = auctionValidatorPubKey - this.bidder = auctionValidatorAddr - this.newValidatorId = '4' - this.bidAmount = bidAmount - this.prevValidatorAddr = validatorUserAddr - this.prevValidatorOldBalance = await this.stakeToken.balanceOf(validatorUserAddr) - this.validator = await this.stakeManager.validators(delegatedValidatorId) - this.reward = await this.stakeManager.validatorReward(delegatedValidatorId) - }) - - testConfirmAuctionBidForNewValidator() - }) - }) - - describe('stopAuctions', function () { - const initialStakers = [wallets[1], wallets[2]] - const stakeAmount = web3.utils.toWei('1250').toString() - const bidAmount = web3.utils.toWei('1350').toString() - const bidder = wallets[3].getChecksumAddressString() - const bidderPubKey = wallets[3].getPublicKeyString() - - async function doDeploy() { - await Staking.prepareForTest(8, 10).call(this) - - for (const wallet of initialStakers) { - await approveAndStake.call(this, { wallet, stakeAmount, approveAmount: web3.utils.toWei('12500') }) - } - } - - before(doDeploy) - before(async function () { - this.initialStakeAmount = stakeAmount - this.validatorId = '1' - this.oldReplacementCoolDownPeriod = await this.stakeManager.replacementCoolDown() - this.newReplacementCoolDownPeriod = new BN(100) - }) - - it('must increase replacement cooldown', async function () { - await this.governance.update( - this.stakeManager.address, - this.stakeManager.interface.encodeFunctionData('stopAuctions', [this.newReplacementCoolDownPeriod.toString()]) - ) - const currentReplacementCooldown = await this.stakeManager.replacementCoolDown() - assertBigNumberEquality( - currentReplacementCooldown, - this.newReplacementCoolDownPeriod.add(new BN((await this.stakeManager.epoch()).toString())) - ) - }) - - it('bid must revert', async function () { - const stakeManager3 = this.stakeManager.connect(this.stakeManager.provider.getSigner(3)) - await expectRevert( - stakeManager3.startAuction(this.validatorId, bidAmount, false, bidderPubKey), - 'Cooldown period' - ) - }) - - it('must reset replacement cooldown to current epoch', async function () { - await this.governance.update( - this.stakeManager.address, - this.stakeManager.interface.encodeFunctionData('stopAuctions', [0]) - ) - const currentReplacementCooldown = await this.stakeManager.replacementCoolDown() - assertBigNumberEquality(currentReplacementCooldown, await this.stakeManager.epoch()) - }) - - it('must bid', async function () { - await this.polToken.mint(bidder, bidAmount) - const polToken3 = this.polToken.connect(this.polToken.provider.getSigner(3)) - await polToken3.approve(this.stakeManager.address, bidAmount) - const stakeManager3 = this.stakeManager.connect(this.stakeManager.provider.getSigner(3)) - await stakeManager3.startAuction(this.validatorId, bidAmount, false, bidderPubKey) - }) - }) - describe('stake migration', function () { const initialStakers = [ wallets[1], @@ -2413,7 +1923,7 @@ describe('StakeManager', function (accounts) { let stakeToken9, stakeManager9 async function prepareForTest() { - await freshDeploy.call(this, true) + await freshDeploy.call(this) stakeManager9 = this.stakeManager.connect(this.stakeManager.provider.getSigner(9)) stakeToken9 = this.stakeToken.connect(this.stakeToken.provider.getSigner(9)) await this.governance.update( @@ -2749,124 +2259,4 @@ describe('StakeManager', function (accounts) { let expectedBalance = amount.mul(new BN(expectedCheckpointReward.toString())).div(totalAmount) return expectedBalance.mul(new BN(checkpointsPassed)) } - - function testStartAuction(address, signerPubkey, bidAmount) { - it('should bid', async function () { - const stakeManagerX = this.stakeManager.connect(this.stakeManager.provider.getSigner(address)) - this.receipt = await (await stakeManagerX.startAuction(this.validatorId, bidAmount, false, signerPubkey)).wait() - }) - - it('must emit StartAuction', async function () { - await assertInTransaction(this.receipt, StakingInfo, 'StartAuction', { - validatorId: this.validatorId, - amount: this.initialStakeAmount.toString(), - auctionAmount: bidAmount - }) - }) - - it('validator auction must have correct balance equal to bid amount', async function () { - let auctionData = await this.stakeManager.validatorAuction(this.validatorId) - assertBigNumberEquality(auctionData.amount, bidAmount) - }) - - it('validator auction must have correct user', async function () { - let auctionData = await this.stakeManager.validatorAuction(this.validatorId) - assert(auctionData.user === address) - }) - - it('balance must decrease by bid amount', async function () { - assertBigNumberEquality(await this.polToken.balanceOf(address), this.userOldBalance.sub(bidAmount).toString()) - }) - } - - function testConfirmAuctionBidForNewValidator() { - it('must confirm auction with heimdall fee', async function () { - const stakeManagerBidder = this.stakeManager.connect(this.stakeManager.provider.getSigner(this.bidder)) - this.receipt = await ( - await stakeManagerBidder.confirmAuctionBid(this.validatorId, this.heimdallFee.toString()) - ).wait() - }) - - it('must emit Staked', async function () { - await assertInTransaction(this.receipt, StakingInfo, 'Staked', { - signer: this.bidder, - signerPubkey: this.bidderPubKey, - activationEpoch: await this.stakeManager.currentEpoch(), - validatorId: this.newValidatorId, - amount: this.bidAmount.toString(), - total: this.totalStakedBeforeAuction.add(this.bidAmount.toString()) - }) - }) - - it('must emit UnstakeInit', async function () { - await assertInTransaction(this.receipt, StakingInfo, 'UnstakeInit', { - user: this.prevValidatorAddr, - validatorId: this.validatorId, - deactivationEpoch: await this.stakeManager.currentEpoch(), - amount: this.validator.amount - }) - }) - - it('must emit ConfirmAuction', async function () { - await assertInTransaction(this.receipt, StakingInfo, 'ConfirmAuction', { - newValidatorId: this.newValidatorId, - oldValidatorId: this.validatorId, - amount: this.bidAmount.toString() - }) - }) - - it('must emit TopUpFee', async function () { - await assertInTransaction(this.receipt, StakingInfo, 'TopUpFee', { - user: this.bidder, - fee: this.heimdallFee.toString() - }) - }) - - it('previous validator must get his reward', async function () { - let prevValidatorBalance = await this.polToken.balanceOf(this.prevValidatorAddr) - assertBigNumberEquality(prevValidatorBalance, this.prevValidatorOldBalance.add(this.reward)) - }) - - it('previous validator is not validator anymore', async function () { - assert.ok(!(await this.stakeManager.isValidator(this.validatorId))) - }) - - it('new validator is validator', async function () { - assert.ok(await this.stakeManager.isValidator(this.newValidatorId)) - }) - - it('bidder balance must be correct', async function () { - const currentBalance = await this.polToken.balanceOf(this.bidder) - assertBigNumberEquality( - this.bidderBalanceBeforeAuction.sub(this.bidAmount.toString()).sub(this.heimdallFee.toString()), - currentBalance - ) - }) - } - - function testConfirmAuctionBidForOldValidator() { - it('must confirm auction', async function () { - const stakeManager_prevValidator = this.stakeManager.connect( - this.stakeManager.provider.getSigner(this.prevValidatorAddr) - ) - this.receipt = await (await stakeManager_prevValidator.confirmAuctionBid(this.validatorId, 0)).wait() - }) - - it('must emit ConfirmAuction', async function () { - await assertInTransaction(this.receipt, StakingInfo, 'ConfirmAuction', { - newValidatorId: this.validatorId, - oldValidatorId: this.validatorId, - amount: this.validator.amount - }) - }) - - it('validator is still a validator', async function () { - assert.ok(await this.stakeManager.isValidator(this.validatorId)) - }) - - it('bidder balance must be correct', async function () { - const currentBalance = await this.stakeToken.balanceOf(this.bidder) - assertBigNumberEquality(this.bidderBalanceBeforeAuction, currentBalance) - }) - } })