diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e57fcf..eb3ca35 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changes +## [3.2.0] - 2021-06-28 + +### Added + +- Deploy to ropsten + ## [3.1.0] - 2021-06-13 ### Added @@ -160,7 +166,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - First public release -[unreleased]: https://github.com/cartesi/solidity-util/compare/v3.1.0...HEAD +[unreleased]: https://github.com/cartesi/solidity-util/compare/v3.2.0...HEAD +[3.2.0]: https://github.com/cartesi/solidity-util/compare/v3.1.0...v3.2.0 [3.1.0]: https://github.com/cartesi/solidity-util/compare/v3.0.0...v3.1.0 [3.0.0]: https://github.com/cartesi/solidity-util/compare/v2.0.1...v3.0.0 [2.0.1]: https://github.com/cartesi/solidity-util/compare/v2.0.0...v2.0.1 diff --git a/deployments/ropsten/.chainId b/deployments/ropsten/.chainId new file mode 100644 index 0000000..e440e5c --- /dev/null +++ b/deployments/ropsten/.chainId @@ -0,0 +1 @@ +3 \ No newline at end of file diff --git a/deployments/ropsten/Bitmask.json b/deployments/ropsten/Bitmask.json new file mode 100644 index 0000000..0f52a5d --- /dev/null +++ b/deployments/ropsten/Bitmask.json @@ -0,0 +1,49 @@ +{ + "address": "0x9fB2a46ca249b56E89F9956d8552E5Df1161E340", + "abi": [], + "transactionHash": "0x3b3872e845530de59c8ef0396e83972b59268b661dc54d21fd4febbf12f12281", + "receipt": { + "to": null, + "from": "0x18930e8a66a1DbE21D00581216789AAB7460Afd0", + "contractAddress": "0x9fB2a46ca249b56E89F9956d8552E5Df1161E340", + "transactionIndex": 17, + "gasUsed": "171268", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x48c55f820ad89c459e084610c17d65cde91da692640cdcfe53e0fe09394bc851", + "transactionHash": "0x3b3872e845530de59c8ef0396e83972b59268b661dc54d21fd4febbf12f12281", + "logs": [], + "blockNumber": 10530859, + "cumulativeGasUsed": "7830015", + "status": 1, + "byzantium": true + }, + "args": [], + "solcInputHash": "5b07a7c7918b23d3bd0429b384ba8870", + "metadata": "{\"compiler\":{\"version\":\"0.8.4+commit.c7e474f2\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"author\":\"Stephen Chen\",\"kind\":\"dev\",\"methods\":{},\"title\":\"Bit Mask Library\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"getBit(mapping(uint248 => uint256) storage,uint256)\":{\"notice\":\"Get a bit in the bit mask\"},\"setBit(mapping(uint248 => uint256) storage,uint256,bool)\":{\"notice\":\"Set a bit in the bit mask\"}},\"notice\":\"Implements bit mask with dynamic array\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/Bitmask.sol\":\"Bitmask\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/Bitmask.sol\":{\"content\":\"// Copyright 2021 Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.0;\\n\\n/// @title Bit Mask Library\\n/// @author Stephen Chen\\n/// @notice Implements bit mask with dynamic array\\nlibrary Bitmask {\\n /// @notice Set a bit in the bit mask\\n function setBit(\\n mapping(uint248 => uint256) storage bitmask,\\n uint256 _bit,\\n bool _value\\n ) public {\\n // calculate the number of bits has been store in bitmask now\\n uint248 positionOfMask = uint248(_bit / 256);\\n uint256 positionOfBit = _bit % 256;\\n\\n if (_value) {\\n bitmask[positionOfMask] =\\n bitmask[positionOfMask] |\\n (1 << positionOfBit);\\n } else {\\n bitmask[positionOfMask] =\\n bitmask[positionOfMask] &\\n ~(1 << positionOfBit);\\n }\\n }\\n\\n /// @notice Get a bit in the bit mask\\n function getBit(mapping(uint248 => uint256) storage bitmask, uint256 _bit)\\n public\\n view\\n returns (bool)\\n {\\n // calculate the number of bits has been store in bitmask now\\n uint248 positionOfMask = uint248(_bit / 256);\\n uint256 positionOfBit = _bit % 256;\\n\\n return ((bitmask[positionOfMask] & (1 << positionOfBit)) != 0);\\n }\\n}\\n\",\"keccak256\":\"0x69f3ae9c413903ba715139aa8c808ad7bedffdd1bad23c3944f4657f8674171f\",\"license\":\"Apache-2.0\"}},\"version\":1}", + "bytecode": "0x61022261003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100405760003560e01c806361d26f481461004557806366817f0b1461006c575b600080fd5b610058610053366004610151565b61008e565b604051901515815260200160405180910390f35b81801561007857600080fd5b5061008c610087366004610172565b6100db565b005b60008061009d610100846101ae565b905060006100ad610100856101c2565b6001600160f81b03909216600090815260208690526040902054600190921b91909116151591505092915050565b60006100e9610100846101ae565b905060006100f9610100856101c2565b90508215610127576001600160f81b038216600090815260208690526040902080546001831b17905561014a565b6001600160f81b038216600090815260208690526040902080546001831b191690555b5050505050565b60008060408385031215610163578182fd5b50508035926020909101359150565b600080600060608486031215610186578081fd5b8335925060208401359150604084013580151581146101a3578182fd5b809150509250925092565b6000826101bd576101bd6101d6565b500490565b6000826101d1576101d16101d6565b500690565b634e487b7160e01b600052601260045260246000fdfea264697066735822122054ab0957d3726505d01bfaa699fd88bec9e0dbdaaca4d9d3843a9780185fe60864736f6c63430008040033", + "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600436106100405760003560e01c806361d26f481461004557806366817f0b1461006c575b600080fd5b610058610053366004610151565b61008e565b604051901515815260200160405180910390f35b81801561007857600080fd5b5061008c610087366004610172565b6100db565b005b60008061009d610100846101ae565b905060006100ad610100856101c2565b6001600160f81b03909216600090815260208690526040902054600190921b91909116151591505092915050565b60006100e9610100846101ae565b905060006100f9610100856101c2565b90508215610127576001600160f81b038216600090815260208690526040902080546001831b17905561014a565b6001600160f81b038216600090815260208690526040902080546001831b191690555b5050505050565b60008060408385031215610163578182fd5b50508035926020909101359150565b600080600060608486031215610186578081fd5b8335925060208401359150604084013580151581146101a3578182fd5b809150509250925092565b6000826101bd576101bd6101d6565b500490565b6000826101d1576101d16101d6565b500690565b634e487b7160e01b600052601260045260246000fdfea264697066735822122054ab0957d3726505d01bfaa699fd88bec9e0dbdaaca4d9d3843a9780185fe60864736f6c63430008040033", + "devdoc": { + "author": "Stephen Chen", + "kind": "dev", + "methods": {}, + "title": "Bit Mask Library", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "getBit(mapping(uint248 => uint256) storage,uint256)": { + "notice": "Get a bit in the bit mask" + }, + "setBit(mapping(uint248 => uint256) storage,uint256,bool)": { + "notice": "Set a bit in the bit mask" + } + }, + "notice": "Implements bit mask with dynamic array", + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/deployments/ropsten/BitsManipulation.json b/deployments/ropsten/BitsManipulation.json new file mode 100644 index 0000000..449766f --- /dev/null +++ b/deployments/ropsten/BitsManipulation.json @@ -0,0 +1,165 @@ +{ + "address": "0x2dC8b1A27F7Ccd071559b9B10077EfA6bE0AA7B8", + "abi": [ + { + "inputs": [ + { + "internalType": "int32", + "name": "number", + "type": "int32" + }, + { + "internalType": "uint32", + "name": "wordSize", + "type": "uint32" + } + ], + "name": "int32SignExtension", + "outputs": [ + { + "internalType": "int32", + "name": "", + "type": "int32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "num", + "type": "uint32" + } + ], + "name": "uint32SwapEndian", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "number", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "wordSize", + "type": "uint64" + } + ], + "name": "uint64SignExtension", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "num", + "type": "uint64" + } + ], + "name": "uint64SwapEndian", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "pure", + "type": "function" + } + ], + "transactionHash": "0x1a6325fcef3a23b8deb31ba83a8a681e38d671fbb83ad8c4268b4c4e1b3c79b2", + "receipt": { + "to": null, + "from": "0x18930e8a66a1DbE21D00581216789AAB7460Afd0", + "contractAddress": "0x2dC8b1A27F7Ccd071559b9B10077EfA6bE0AA7B8", + "transactionIndex": 4, + "gasUsed": "376733", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x05431a80fe9c215a24bb10a5ecb57c743bc607a5cad1ee6266f87c6307413149", + "transactionHash": "0x1a6325fcef3a23b8deb31ba83a8a681e38d671fbb83ad8c4268b4c4e1b3c79b2", + "logs": [], + "blockNumber": 10530858, + "cumulativeGasUsed": "1336438", + "status": 1, + "byzantium": true + }, + "args": [], + "solcInputHash": "fae7314c66b31753e5e29e8fe977a227", + "metadata": "{\"compiler\":{\"version\":\"0.8.4+commit.c7e474f2\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"int32\",\"name\":\"number\",\"type\":\"int32\"},{\"internalType\":\"uint32\",\"name\":\"wordSize\",\"type\":\"uint32\"}],\"name\":\"int32SignExtension\",\"outputs\":[{\"internalType\":\"int32\",\"name\":\"\",\"type\":\"int32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"num\",\"type\":\"uint32\"}],\"name\":\"uint32SwapEndian\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"number\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"wordSize\",\"type\":\"uint64\"}],\"name\":\"uint64SignExtension\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"num\",\"type\":\"uint64\"}],\"name\":\"uint64SwapEndian\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Felipe Argento / Stephen Chen\",\"kind\":\"dev\",\"methods\":{\"int32SignExtension(int32,uint32)\":{\"params\":{\"number\":\"signed number to be extended\",\"wordSize\":\"number of bits of the signed number, ie, 8 for int8\"}},\"uint32SwapEndian(uint32)\":{\"params\":{\"num\":\"number to have bytes swapped\"}},\"uint64SignExtension(uint64,uint64)\":{\"params\":{\"number\":\"signed number to be extended\",\"wordSize\":\"number of bits of the signed number, ie, 8 for int8\"}},\"uint64SwapEndian(uint64)\":{\"params\":{\"num\":\"number to have bytes swapped\"}}},\"title\":\"Bits Manipulation Library\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"int32SignExtension(int32,uint32)\":{\"notice\":\"Sign extend a shorter signed value to the full int32\"},\"uint32SwapEndian(uint32)\":{\"notice\":\"Swap byte order of unsigned ints with 32 bytes\"},\"uint64SignExtension(uint64,uint64)\":{\"notice\":\"Sign extend a shorter signed value to the full uint64\"},\"uint64SwapEndian(uint64)\":{\"notice\":\"Swap byte order of unsigned ints with 64 bytes\"}},\"notice\":\"Implements bit manipulation helper functions\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/BitsManipulation.sol\":\"BitsManipulation\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/BitsManipulation.sol\":{\"content\":\"// Copyright 2020 Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.0;\\n\\n/// @title Bits Manipulation Library\\n/// @author Felipe Argento / Stephen Chen\\n/// @notice Implements bit manipulation helper functions\\nlibrary BitsManipulation {\\n\\n /// @notice Sign extend a shorter signed value to the full int32\\n /// @param number signed number to be extended\\n /// @param wordSize number of bits of the signed number, ie, 8 for int8\\n function int32SignExtension(int32 number, uint32 wordSize)\\n public pure returns(int32)\\n {\\n uint32 uNumber = uint32(number);\\n bool isNegative = ((uint64(1) << (wordSize - 1)) & uNumber) > 0;\\n uint32 mask = ((uint32(2) ** wordSize) - 1);\\n\\n if (isNegative) {\\n uNumber = uNumber | ~mask;\\n }\\n\\n return int32(uNumber);\\n }\\n\\n /// @notice Sign extend a shorter signed value to the full uint64\\n /// @param number signed number to be extended\\n /// @param wordSize number of bits of the signed number, ie, 8 for int8\\n function uint64SignExtension(uint64 number, uint64 wordSize)\\n public pure returns(uint64)\\n {\\n uint64 uNumber = number;\\n bool isNegative = ((uint64(1) << (wordSize - 1)) & uNumber) > 0;\\n uint64 mask = ((uint64(2) ** wordSize) - 1);\\n\\n if (isNegative) {\\n uNumber = uNumber | ~mask;\\n }\\n\\n return uNumber;\\n }\\n\\n /// @notice Swap byte order of unsigned ints with 64 bytes\\n /// @param num number to have bytes swapped\\n function uint64SwapEndian(uint64 num) public pure returns(uint64) {\\n uint64 output = ((num & 0x00000000000000ff) << 56)|\\n ((num & 0x000000000000ff00) << 40)|\\n ((num & 0x0000000000ff0000) << 24)|\\n ((num & 0x00000000ff000000) << 8) |\\n ((num & 0x000000ff00000000) >> 8) |\\n ((num & 0x0000ff0000000000) >> 24)|\\n ((num & 0x00ff000000000000) >> 40)|\\n ((num & 0xff00000000000000) >> 56);\\n\\n return output;\\n }\\n\\n /// @notice Swap byte order of unsigned ints with 32 bytes\\n /// @param num number to have bytes swapped\\n function uint32SwapEndian(uint32 num) public pure returns(uint32) {\\n uint32 output = ((num >> 24) & 0xff) | ((num << 8) & 0xff0000) | ((num >> 8) & 0xff00) | ((num << 24) & 0xff000000);\\n return output;\\n }\\n}\\n\\n\",\"keccak256\":\"0x09e8d9397126dfc40a92d4099060c1615a4fbd99edd12afea5e5163ec8ce8aba\",\"license\":\"Apache-2.0\"}},\"version\":1}", + "bytecode": "0x6105da61003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100565760003560e01c8063240034ec1461005b578063bf1924c5146100b0578063ef7c79491461014d578063f69c389b14610160575b600080fd5b6100966100693660046102ab565b601881811b63ff00000016600883811c61ff00169084901b62ff0000169390921c60ff1692909217171790565b60405163ffffffff90911681526020015b60405180910390f35b6101356100be3660046102cc565b603881811b67ff0000000000000016602883811b66ff0000000000001691909117601884811b65ff00000000001691909117600885811b64ff00000000169190911763ff0000009186901c919091161762ff00009185901c919091161761ff009184901c919091161760ff9290911c919091161790565b6040516001600160401b0390911681526020016100a7565b61013561015b3660046102e6565b610186565b61017361016e366004610272565b6101f0565b60405160039190910b81526020016100a7565b600082818082610197600187610572565b6001600160401b031660016001600160401b0316901b166001600160401b0316119050600060018560026101cb91906103b1565b6101d59190610572565b905081156101e4578019831792505b50909150505b92915050565b600082818063ffffffff831661020760018761054d565b63ffffffff1660016001600160401b0316901b166001600160401b0316119050600060018560026102389190610394565b6101d5919061054d565b803563ffffffff8116811461025657600080fd5b919050565b80356001600160401b038116811461025657600080fd5b60008060408385031215610284578182fd5b82358060030b8114610294578283fd5b91506102a260208401610242565b90509250929050565b6000602082840312156102bc578081fd5b6102c582610242565b9392505050565b6000602082840312156102dd578081fd5b6102c58261025b565b600080604083850312156102f8578182fd5b6103018361025b565b91506102a26020840161025b565b600181815b8085111561034c578163ffffffff048211156103325761033261058e565b8085161561033f57918102915b93841c9390800290610314565b509250929050565b600181815b8085111561034c57816001600160401b030482111561037a5761037a61058e565b8085161561038757918102915b93841c9390800290610359565b600063ffffffff6103a98185168285166103c9565b949350505050565b60006001600160401b036103a9818516828516610495565b6000826103d8575060016101ea565b816103e5575060006101ea565b81600181146103fb576002811461040557610436565b60019150506101ea565b60ff8411156104165761041661058e565b6001841b915063ffffffff8211156104305761043061058e565b506101ea565b5060208310610133831016604e8410600b841016171561046d575081810a63ffffffff8111156104685761046861058e565b6101ea565b610477838361030f565b8063ffffffff0482111561048d5761048d61058e565b029392505050565b6000826104a4575060016101ea565b816104b1575060006101ea565b81600181146103fb57600281146104c7576104f5565b60ff8411156104d8576104d861058e565b6001841b91506001600160401b038211156104305761043061058e565b5060208310610133831016604e8410600b841016171561052a575081810a6001600160401b038111156104685761046861058e565b6105348383610354565b806001600160401b030482111561048d5761048d61058e565b600063ffffffff8381169083168181101561056a5761056a61058e565b039392505050565b60006001600160401b038381169083168181101561056a5761056a5b634e487b7160e01b600052601160045260246000fdfea2646970667358221220d1a282b405bea3ac1b1041d4f9042915951dc97e60ea81d0a585311c188e81e664736f6c63430008040033", + "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600436106100565760003560e01c8063240034ec1461005b578063bf1924c5146100b0578063ef7c79491461014d578063f69c389b14610160575b600080fd5b6100966100693660046102ab565b601881811b63ff00000016600883811c61ff00169084901b62ff0000169390921c60ff1692909217171790565b60405163ffffffff90911681526020015b60405180910390f35b6101356100be3660046102cc565b603881811b67ff0000000000000016602883811b66ff0000000000001691909117601884811b65ff00000000001691909117600885811b64ff00000000169190911763ff0000009186901c919091161762ff00009185901c919091161761ff009184901c919091161760ff9290911c919091161790565b6040516001600160401b0390911681526020016100a7565b61013561015b3660046102e6565b610186565b61017361016e366004610272565b6101f0565b60405160039190910b81526020016100a7565b600082818082610197600187610572565b6001600160401b031660016001600160401b0316901b166001600160401b0316119050600060018560026101cb91906103b1565b6101d59190610572565b905081156101e4578019831792505b50909150505b92915050565b600082818063ffffffff831661020760018761054d565b63ffffffff1660016001600160401b0316901b166001600160401b0316119050600060018560026102389190610394565b6101d5919061054d565b803563ffffffff8116811461025657600080fd5b919050565b80356001600160401b038116811461025657600080fd5b60008060408385031215610284578182fd5b82358060030b8114610294578283fd5b91506102a260208401610242565b90509250929050565b6000602082840312156102bc578081fd5b6102c582610242565b9392505050565b6000602082840312156102dd578081fd5b6102c58261025b565b600080604083850312156102f8578182fd5b6103018361025b565b91506102a26020840161025b565b600181815b8085111561034c578163ffffffff048211156103325761033261058e565b8085161561033f57918102915b93841c9390800290610314565b509250929050565b600181815b8085111561034c57816001600160401b030482111561037a5761037a61058e565b8085161561038757918102915b93841c9390800290610359565b600063ffffffff6103a98185168285166103c9565b949350505050565b60006001600160401b036103a9818516828516610495565b6000826103d8575060016101ea565b816103e5575060006101ea565b81600181146103fb576002811461040557610436565b60019150506101ea565b60ff8411156104165761041661058e565b6001841b915063ffffffff8211156104305761043061058e565b506101ea565b5060208310610133831016604e8410600b841016171561046d575081810a63ffffffff8111156104685761046861058e565b6101ea565b610477838361030f565b8063ffffffff0482111561048d5761048d61058e565b029392505050565b6000826104a4575060016101ea565b816104b1575060006101ea565b81600181146103fb57600281146104c7576104f5565b60ff8411156104d8576104d861058e565b6001841b91506001600160401b038211156104305761043061058e565b5060208310610133831016604e8410600b841016171561052a575081810a6001600160401b038111156104685761046861058e565b6105348383610354565b806001600160401b030482111561048d5761048d61058e565b600063ffffffff8381169083168181101561056a5761056a61058e565b039392505050565b60006001600160401b038381169083168181101561056a5761056a5b634e487b7160e01b600052601160045260246000fdfea2646970667358221220d1a282b405bea3ac1b1041d4f9042915951dc97e60ea81d0a585311c188e81e664736f6c63430008040033", + "devdoc": { + "author": "Felipe Argento / Stephen Chen", + "kind": "dev", + "methods": { + "int32SignExtension(int32,uint32)": { + "params": { + "number": "signed number to be extended", + "wordSize": "number of bits of the signed number, ie, 8 for int8" + } + }, + "uint32SwapEndian(uint32)": { + "params": { + "num": "number to have bytes swapped" + } + }, + "uint64SignExtension(uint64,uint64)": { + "params": { + "number": "signed number to be extended", + "wordSize": "number of bits of the signed number, ie, 8 for int8" + } + }, + "uint64SwapEndian(uint64)": { + "params": { + "num": "number to have bytes swapped" + } + } + }, + "title": "Bits Manipulation Library", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "int32SignExtension(int32,uint32)": { + "notice": "Sign extend a shorter signed value to the full int32" + }, + "uint32SwapEndian(uint32)": { + "notice": "Swap byte order of unsigned ints with 32 bytes" + }, + "uint64SignExtension(uint64,uint64)": { + "notice": "Sign extend a shorter signed value to the full uint64" + }, + "uint64SwapEndian(uint64)": { + "notice": "Swap byte order of unsigned ints with 64 bytes" + } + }, + "notice": "Implements bit manipulation helper functions", + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/deployments/ropsten/CartesiMath.json b/deployments/ropsten/CartesiMath.json new file mode 100644 index 0000000..d798129 --- /dev/null +++ b/deployments/ropsten/CartesiMath.json @@ -0,0 +1,218 @@ +{ + "address": "0x598b68c8234F201aC984Bd33D7678D2E3aC8f179", + "abi": [ + { + "inputs": [ + { + "internalType": "uint256", + "name": "_num", + "type": "uint256" + } + ], + "name": "clz", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_num", + "type": "uint256" + } + ], + "name": "ctz", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_num", + "type": "uint256" + } + ], + "name": "getLog2Floor", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_num", + "type": "uint256" + } + ], + "name": "getLog2TableTimes1M", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_num", + "type": "uint256" + } + ], + "name": "isPowerOf2", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_num", + "type": "uint256" + } + ], + "name": "log2ApproxTimes1M", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + } + ], + "transactionHash": "0x4c3cbfc03702f9269793c904c82479818120d87cd74a770af23e28f119b4fdc4", + "receipt": { + "to": null, + "from": "0x18930e8a66a1DbE21D00581216789AAB7460Afd0", + "contractAddress": "0x598b68c8234F201aC984Bd33D7678D2E3aC8f179", + "transactionIndex": 0, + "gasUsed": "479702", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x6ee74a21002e420878b86dde99dd56223fb7f2c966b80e3041e724304fb28d84", + "transactionHash": "0x4c3cbfc03702f9269793c904c82479818120d87cd74a770af23e28f119b4fdc4", + "logs": [], + "blockNumber": 10530860, + "cumulativeGasUsed": "479702", + "status": 1, + "byzantium": true + }, + "args": [], + "solcInputHash": "74deced164c6fb3999cefd8fa8f47469", + "metadata": "{\"compiler\":{\"version\":\"0.8.4+commit.c7e474f2\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_num\",\"type\":\"uint256\"}],\"name\":\"clz\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_num\",\"type\":\"uint256\"}],\"name\":\"ctz\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_num\",\"type\":\"uint256\"}],\"name\":\"getLog2Floor\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_num\",\"type\":\"uint256\"}],\"name\":\"getLog2TableTimes1M\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_num\",\"type\":\"uint256\"}],\"name\":\"isPowerOf2\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_num\",\"type\":\"uint256\"}],\"name\":\"log2ApproxTimes1M\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"clz(uint256)\":{\"details\":\"this a binary search implementation\",\"params\":{\"_num\":\"number you want the clz of\"}},\"ctz(uint256)\":{\"details\":\"this a binary search implementation\",\"params\":{\"_num\":\"number you want the ctz of\"}},\"getLog2Floor(uint256)\":{\"params\":{\"_num\":\"number to take floor(log2) of\"},\"returns\":{\"_0\":\"floor(log2) of _num\"}},\"getLog2TableTimes1M(uint256)\":{\"params\":{\"_num\":\"number to take log2 of\"},\"returns\":{\"_0\":\"result after table look-up\"}},\"isPowerOf2(uint256)\":{\"params\":{\"_num\":\"number to check\"},\"returns\":{\"_0\":\"true if number is power of 2, false if not\"}},\"log2ApproxTimes1M(uint256)\":{\"params\":{\"_num\":\"number to take log2 * 1M of\"},\"returns\":{\"_0\":\"approximate log2 times 1M\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"clz(uint256)\":{\"notice\":\"count leading zeros\"},\"ctz(uint256)\":{\"notice\":\"count trailing zeros\"},\"getLog2Floor(uint256)\":{\"notice\":\"get floor of log2 of number\"},\"getLog2TableTimes1M(uint256)\":{\"notice\":\"navigates log2tableTimes1M\"},\"isPowerOf2(uint256)\":{\"notice\":\"checks if a number is Power of 2\"},\"log2ApproxTimes1M(uint256)\":{\"notice\":\"Approximates log2 * 1M\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/CartesiMath.sol\":\"CartesiMath\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/CartesiMath.sol\":{\"content\":\"// Copyright 2020 Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\n/// @title CartesiMath\\n/// @author Felipe Argento\\npragma solidity ^0.8.0;\\n\\nlibrary CartesiMath {\\n // mapping values are packed as bytes3 each\\n // see test/TestCartesiMath.ts for decimal values\\n bytes constant log2tableTimes1M =\\n hex\\\"0000000F4240182F421E8480236E082771822AD63A2DC6C0305E8532B04834C96736B3C23876D73A187A3B9D4A3D09003E5EA63FA0C540D17741F28843057D440BA745062945F60246DC1047B917488DC7495ABA4A207C4ADF8A4B98544C4B404CF8AA4DA0E64E44434EE3054F7D6D5013B750A61A5134C851BFF05247BD52CC58534DE753CC8D54486954C19C55384255AC75561E50568DE956FB575766B057D00758376F589CFA5900BA5962BC59C3135A21CA5A7EF15ADA945B34BF5B8D805BE4DF5C3AEA5C8FA95CE3265D356C5D86835DD6735E25455E73005EBFAD5F0B525F55F75F9FA25FE85A60302460770860BD0A61023061467F6189FD61CCAE620E98624FBF62902762CFD5630ECD634D12638AA963C7966403DC643F7F647A8264B4E864EEB56527EC6560906598A365D029660724663D9766738566A8F066DDDA6712476746386779AF67ACAF67DF3A6811526842FA68743268A4FC68D55C6905536934E169640A6992CF69C13169EF326A1CD46A4A186A76FF6AA38C6ACFC0\\\";\\n\\n /// @notice Approximates log2 * 1M\\n /// @param _num number to take log2 * 1M of\\n /// @return approximate log2 times 1M\\n function log2ApproxTimes1M(uint256 _num) public pure returns (uint256) {\\n require(_num > 0, \\\"Number cannot be zero\\\");\\n uint256 leading = 0;\\n\\n if (_num == 1) return 0;\\n\\n while (_num > 128) {\\n _num = _num >> 1;\\n leading += 1;\\n }\\n return (leading * uint256(1000000)) + (getLog2TableTimes1M(_num));\\n }\\n\\n /// @notice navigates log2tableTimes1M\\n /// @param _num number to take log2 of\\n /// @return result after table look-up\\n function getLog2TableTimes1M(uint256 _num) public pure returns (uint256) {\\n bytes3 result = 0;\\n for (uint8 i = 0; i < 3; i++) {\\n bytes3 tempResult = log2tableTimes1M[(_num - 1) * 3 + i];\\n result = result | (tempResult >> (i * 8));\\n }\\n\\n return uint256(uint24(result));\\n }\\n\\n /// @notice get floor of log2 of number\\n /// @param _num number to take floor(log2) of\\n /// @return floor(log2) of _num\\n function getLog2Floor(uint256 _num) public pure returns (uint8) {\\n require(_num != 0, \\\"log of zero is undefined\\\");\\n\\n return uint8(255 - clz(_num));\\n }\\n\\n /// @notice checks if a number is Power of 2\\n /// @param _num number to check\\n /// @return true if number is power of 2, false if not\\n function isPowerOf2(uint256 _num) public pure returns (bool) {\\n if (_num == 0) return false;\\n\\n return _num & (_num - 1) == 0;\\n }\\n\\n /// @notice count trailing zeros\\n /// @param _num number you want the ctz of\\n /// @dev this a binary search implementation\\n function ctz(uint256 _num) public pure returns (uint256) {\\n if (_num == 0) return 256;\\n\\n uint256 n = 0;\\n if (_num & 0x00000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF == 0) { n = n + 128; _num = _num >> 128; }\\n if (_num & 0x000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFF == 0) { n = n + 64; _num = _num >> 64; }\\n if (_num & 0x00000000000000000000000000000000000000000000000000000000FFFFFFFF == 0) { n = n + 32; _num = _num >> 32; }\\n if (_num & 0x000000000000000000000000000000000000000000000000000000000000FFFF == 0) { n = n + 16; _num = _num >> 16; }\\n if (_num & 0x00000000000000000000000000000000000000000000000000000000000000FF == 0) { n = n + 8; _num = _num >> 8; }\\n if (_num & 0x000000000000000000000000000000000000000000000000000000000000000F == 0) { n = n + 4; _num = _num >> 4; }\\n if (_num & 0x0000000000000000000000000000000000000000000000000000000000000003 == 0) { n = n + 2; _num = _num >> 2; }\\n if (_num & 0x0000000000000000000000000000000000000000000000000000000000000001 == 0) { n = n + 1; }\\n\\n return n;\\n }\\n\\n /// @notice count leading zeros\\n /// @param _num number you want the clz of\\n /// @dev this a binary search implementation\\n function clz(uint256 _num) public pure returns (uint256) {\\n if (_num == 0) return 256;\\n\\n uint256 n = 0;\\n if (_num & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000000000 == 0) { n = n + 128; _num = _num << 128; }\\n if (_num & 0xFFFFFFFFFFFFFFFF000000000000000000000000000000000000000000000000 == 0) { n = n + 64; _num = _num << 64; }\\n if (_num & 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 == 0) { n = n + 32; _num = _num << 32; }\\n if (_num & 0xFFFF000000000000000000000000000000000000000000000000000000000000 == 0) { n = n + 16; _num = _num << 16; }\\n if (_num & 0xFF00000000000000000000000000000000000000000000000000000000000000 == 0) { n = n + 8; _num = _num << 8; }\\n if (_num & 0xF000000000000000000000000000000000000000000000000000000000000000 == 0) { n = n + 4; _num = _num << 4; }\\n if (_num & 0xC000000000000000000000000000000000000000000000000000000000000000 == 0) { n = n + 2; _num = _num << 2; }\\n if (_num & 0x8000000000000000000000000000000000000000000000000000000000000000 == 0) { n = n + 1; }\\n\\n return n;\\n }\\n}\\n\",\"keccak256\":\"0x28b74012e966438edff701decdc5ffd207b3f0244af65fbd7d397050986e58d4\",\"license\":\"Apache-2.0\"}},\"version\":1}", + "bytecode": "0x6107b661003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe730000000000000000000000000000000000000000301460806040526004361061006c5760003560e01c806306c8e54b14610071578063296e7af81461009b57806330244f7a146100bc57806332ef283b146100cf578063d82ae4b1146100e2578063e3581b6814610105575b600080fd5b61008461007f36600461053b565b610118565b60405160ff90911681526020015b60405180910390f35b6100ae6100a936600461053b565b610186565b604051908152602001610092565b6100ae6100ca36600461053b565b610297565b6100ae6100dd36600461053b565b6103bc565b6100f56100f036600461053b565b61047b565b6040519015158152602001610092565b6100ae61011336600461053b565b61049e565b60008161016c5760405162461bcd60e51b815260206004820152601860248201527f6c6f67206f66207a65726f20697320756e646566696e6564000000000000000060448201526064015b60405180910390fd5b61017582610297565b6101809060ff6105b3565b92915050565b6000816101965750610100919050565b60006fffffffffffffffffffffffffffffffff83166101c4576101ba816080610553565b9050608083901c92505b67ffffffffffffffff83166101e8576101de816040610553565b9050604083901c92505b63ffffffff8316610208576101fe816020610553565b9050602083901c92505b61ffff83166102265761021c816010610553565b9050601083901c92505b60ff831661024357610239816008610553565b9050600883901c92505b600f831661026057610256816004610553565b9050600483901c92505b6003831661027d57610273816002610553565b9050600283901c92505b6001831661018057610290816001610553565b9392505050565b6000816102a75750610100919050565b60006fffffffffffffffffffffffffffffffff1983166102d6576102cc816080610553565b9050608083901b92505b6001600160c01b031983166102fa576102f0816040610553565b9050604083901b92505b6001600160e01b0319831661031e57610314816020610553565b9050602083901b92505b6001600160f01b0319831661034257610338816010610553565b9050601083901b92505b6001600160f81b031983166103665761035c816008610553565b9050600883901b92505b600f60fc1b83166103865761037c816004610553565b9050600483901b92505b600360fe1b83166103a65761039c816002610553565b9050600283901b92505b600160ff1b831661018057610290816001610553565b600080805b60038160ff161015610471576000604051806101a001604052806101808152602001610601610180913960ff83166103fa6001886105b3565b61040590600361056b565b61040f9190610553565b8151811061042d57634e487b7160e01b600052603260045260246000fd5b01602001516001600160f81b031916905061044982600861058a565b60ff16816001600160e81b031916901c83179250508080610469906105ca565b9150506103c1565b5060e81c92915050565b60008161048a57506000919050565b6104956001836105b3565b90911615919050565b60008082116104e75760405162461bcd60e51b81526020600482015260156024820152744e756d6265722063616e6e6f74206265207a65726f60581b6044820152606401610163565b600082600114156104fb5750600092915050565b608083111561051b57600192831c926105149082610553565b90506104fb565b610524836103bc565b610531620f42408361056b565b6102909190610553565b60006020828403121561054c578081fd5b5035919050565b60008219821115610566576105666105ea565b500190565b6000816000190483118215151615610585576105856105ea565b500290565b600060ff821660ff84168160ff04811182151516156105ab576105ab6105ea565b029392505050565b6000828210156105c5576105c56105ea565b500390565b600060ff821660ff8114156105e1576105e16105ea565b60010192915050565b634e487b7160e01b600052601160045260246000fdfe0000000f4240182f421e8480236e082771822ad63a2dc6c0305e8532b04834c96736b3c23876d73a187a3b9d4a3d09003e5ea63fa0c540d17741f28843057d440ba745062945f60246dc1047b917488dc7495aba4a207c4adf8a4b98544c4b404cf8aa4da0e64e44434ee3054f7d6d5013b750a61a5134c851bff05247bd52cc58534de753cc8d54486954c19c55384255ac75561e50568de956fb575766b057d00758376f589cfa5900ba5962bc59c3135a21ca5a7ef15ada945b34bf5b8d805be4df5c3aea5c8fa95ce3265d356c5d86835dd6735e25455e73005ebfad5f0b525f55f75f9fa25fe85a60302460770860bd0a61023061467f6189fd61ccae620e98624fbf62902762cfd5630ecd634d12638aa963c7966403dc643f7f647a8264b4e864eeb56527ec6560906598a365d029660724663d9766738566a8f066ddda6712476746386779af67acaf67df3a6811526842fa68743268a4fc68d55c6905536934e169640a6992cf69c13169ef326a1cd46a4a186a76ff6aa38c6acfc0a26469706673582212209ec06539722b047c33e8d359cfc9b7cd43d1170f471e94162e8503d48b06b59e64736f6c63430008040033", + "deployedBytecode": "0x730000000000000000000000000000000000000000301460806040526004361061006c5760003560e01c806306c8e54b14610071578063296e7af81461009b57806330244f7a146100bc57806332ef283b146100cf578063d82ae4b1146100e2578063e3581b6814610105575b600080fd5b61008461007f36600461053b565b610118565b60405160ff90911681526020015b60405180910390f35b6100ae6100a936600461053b565b610186565b604051908152602001610092565b6100ae6100ca36600461053b565b610297565b6100ae6100dd36600461053b565b6103bc565b6100f56100f036600461053b565b61047b565b6040519015158152602001610092565b6100ae61011336600461053b565b61049e565b60008161016c5760405162461bcd60e51b815260206004820152601860248201527f6c6f67206f66207a65726f20697320756e646566696e6564000000000000000060448201526064015b60405180910390fd5b61017582610297565b6101809060ff6105b3565b92915050565b6000816101965750610100919050565b60006fffffffffffffffffffffffffffffffff83166101c4576101ba816080610553565b9050608083901c92505b67ffffffffffffffff83166101e8576101de816040610553565b9050604083901c92505b63ffffffff8316610208576101fe816020610553565b9050602083901c92505b61ffff83166102265761021c816010610553565b9050601083901c92505b60ff831661024357610239816008610553565b9050600883901c92505b600f831661026057610256816004610553565b9050600483901c92505b6003831661027d57610273816002610553565b9050600283901c92505b6001831661018057610290816001610553565b9392505050565b6000816102a75750610100919050565b60006fffffffffffffffffffffffffffffffff1983166102d6576102cc816080610553565b9050608083901b92505b6001600160c01b031983166102fa576102f0816040610553565b9050604083901b92505b6001600160e01b0319831661031e57610314816020610553565b9050602083901b92505b6001600160f01b0319831661034257610338816010610553565b9050601083901b92505b6001600160f81b031983166103665761035c816008610553565b9050600883901b92505b600f60fc1b83166103865761037c816004610553565b9050600483901b92505b600360fe1b83166103a65761039c816002610553565b9050600283901b92505b600160ff1b831661018057610290816001610553565b600080805b60038160ff161015610471576000604051806101a001604052806101808152602001610601610180913960ff83166103fa6001886105b3565b61040590600361056b565b61040f9190610553565b8151811061042d57634e487b7160e01b600052603260045260246000fd5b01602001516001600160f81b031916905061044982600861058a565b60ff16816001600160e81b031916901c83179250508080610469906105ca565b9150506103c1565b5060e81c92915050565b60008161048a57506000919050565b6104956001836105b3565b90911615919050565b60008082116104e75760405162461bcd60e51b81526020600482015260156024820152744e756d6265722063616e6e6f74206265207a65726f60581b6044820152606401610163565b600082600114156104fb5750600092915050565b608083111561051b57600192831c926105149082610553565b90506104fb565b610524836103bc565b610531620f42408361056b565b6102909190610553565b60006020828403121561054c578081fd5b5035919050565b60008219821115610566576105666105ea565b500190565b6000816000190483118215151615610585576105856105ea565b500290565b600060ff821660ff84168160ff04811182151516156105ab576105ab6105ea565b029392505050565b6000828210156105c5576105c56105ea565b500390565b600060ff821660ff8114156105e1576105e16105ea565b60010192915050565b634e487b7160e01b600052601160045260246000fdfe0000000f4240182f421e8480236e082771822ad63a2dc6c0305e8532b04834c96736b3c23876d73a187a3b9d4a3d09003e5ea63fa0c540d17741f28843057d440ba745062945f60246dc1047b917488dc7495aba4a207c4adf8a4b98544c4b404cf8aa4da0e64e44434ee3054f7d6d5013b750a61a5134c851bff05247bd52cc58534de753cc8d54486954c19c55384255ac75561e50568de956fb575766b057d00758376f589cfa5900ba5962bc59c3135a21ca5a7ef15ada945b34bf5b8d805be4df5c3aea5c8fa95ce3265d356c5d86835dd6735e25455e73005ebfad5f0b525f55f75f9fa25fe85a60302460770860bd0a61023061467f6189fd61ccae620e98624fbf62902762cfd5630ecd634d12638aa963c7966403dc643f7f647a8264b4e864eeb56527ec6560906598a365d029660724663d9766738566a8f066ddda6712476746386779af67acaf67df3a6811526842fa68743268a4fc68d55c6905536934e169640a6992cf69c13169ef326a1cd46a4a186a76ff6aa38c6acfc0a26469706673582212209ec06539722b047c33e8d359cfc9b7cd43d1170f471e94162e8503d48b06b59e64736f6c63430008040033", + "devdoc": { + "kind": "dev", + "methods": { + "clz(uint256)": { + "details": "this a binary search implementation", + "params": { + "_num": "number you want the clz of" + } + }, + "ctz(uint256)": { + "details": "this a binary search implementation", + "params": { + "_num": "number you want the ctz of" + } + }, + "getLog2Floor(uint256)": { + "params": { + "_num": "number to take floor(log2) of" + }, + "returns": { + "_0": "floor(log2) of _num" + } + }, + "getLog2TableTimes1M(uint256)": { + "params": { + "_num": "number to take log2 of" + }, + "returns": { + "_0": "result after table look-up" + } + }, + "isPowerOf2(uint256)": { + "params": { + "_num": "number to check" + }, + "returns": { + "_0": "true if number is power of 2, false if not" + } + }, + "log2ApproxTimes1M(uint256)": { + "params": { + "_num": "number to take log2 * 1M of" + }, + "returns": { + "_0": "approximate log2 times 1M" + } + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "clz(uint256)": { + "notice": "count leading zeros" + }, + "ctz(uint256)": { + "notice": "count trailing zeros" + }, + "getLog2Floor(uint256)": { + "notice": "get floor of log2 of number" + }, + "getLog2TableTimes1M(uint256)": { + "notice": "navigates log2tableTimes1M" + }, + "isPowerOf2(uint256)": { + "notice": "checks if a number is Power of 2" + }, + "log2ApproxTimes1M(uint256)": { + "notice": "Approximates log2 * 1M" + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/deployments/ropsten/Merkle.json b/deployments/ropsten/Merkle.json new file mode 100644 index 0000000..8ca4381 --- /dev/null +++ b/deployments/ropsten/Merkle.json @@ -0,0 +1,340 @@ +{ + "address": "0x627bF4558cb62028fA3d398Aa6bBEF5B5AAFE2ad", + "abi": [ + { + "inputs": [ + { + "internalType": "bytes32[]", + "name": "hashes", + "type": "bytes32[]" + } + ], + "name": "calculateRootFromPowerOfTwo", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_index", + "type": "uint256" + } + ], + "name": "getEmptyTreeHashAtIndex", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "_wordIndex", + "type": "uint256" + } + ], + "name": "getHashOfWordAtIndex", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + }, + { + "internalType": "uint8", + "name": "_log2Size", + "type": "uint8" + } + ], + "name": "getMerkleRootFromBytes", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint8", + "name": "_log2Size", + "type": "uint8" + } + ], + "name": "getPristineHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "_position", + "type": "uint64" + }, + { + "internalType": "bytes8", + "name": "_value", + "type": "bytes8" + }, + { + "internalType": "bytes32[]", + "name": "proof", + "type": "bytes32[]" + } + ], + "name": "getRoot", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "_position", + "type": "uint64" + }, + { + "internalType": "uint8", + "name": "_logSizeOfReplacement", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "_logSizeOfFullDrive", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "_replacement", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "siblings", + "type": "bytes32[]" + } + ], + "name": "getRootAfterReplacementInDrive", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "_position", + "type": "uint64" + }, + { + "internalType": "uint8", + "name": "_logOfSize", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "_drive", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "siblings", + "type": "bytes32[]" + } + ], + "name": "getRootWithDrive", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + } + ], + "transactionHash": "0xded9f6369d664300d87c74b72314af67311074b77d828373d69d26b6163cf059", + "receipt": { + "to": null, + "from": "0x18930e8a66a1DbE21D00581216789AAB7460Afd0", + "contractAddress": "0x627bF4558cb62028fA3d398Aa6bBEF5B5AAFE2ad", + "transactionIndex": 4, + "gasUsed": "1610647", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x715c0e92b579142eec8bd240169cf1665f72d9d8dd8fcd1506394e97790cf9f6", + "transactionHash": "0xded9f6369d664300d87c74b72314af67311074b77d828373d69d26b6163cf059", + "logs": [], + "blockNumber": 10530861, + "cumulativeGasUsed": "1977337", + "status": 1, + "byzantium": true + }, + "args": [], + "solcInputHash": "74deced164c6fb3999cefd8fa8f47469", + "metadata": "{\"compiler\":{\"version\":\"0.8.4+commit.c7e474f2\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"hashes\",\"type\":\"bytes32[]\"}],\"name\":\"calculateRootFromPowerOfTwo\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_index\",\"type\":\"uint256\"}],\"name\":\"getEmptyTreeHashAtIndex\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_wordIndex\",\"type\":\"uint256\"}],\"name\":\"getHashOfWordAtIndex\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"},{\"internalType\":\"uint8\",\"name\":\"_log2Size\",\"type\":\"uint8\"}],\"name\":\"getMerkleRootFromBytes\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"_log2Size\",\"type\":\"uint8\"}],\"name\":\"getPristineHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"_position\",\"type\":\"uint64\"},{\"internalType\":\"bytes8\",\"name\":\"_value\",\"type\":\"bytes8\"},{\"internalType\":\"bytes32[]\",\"name\":\"proof\",\"type\":\"bytes32[]\"}],\"name\":\"getRoot\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"_position\",\"type\":\"uint64\"},{\"internalType\":\"uint8\",\"name\":\"_logSizeOfReplacement\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"_logSizeOfFullDrive\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"_replacement\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32[]\",\"name\":\"siblings\",\"type\":\"bytes32[]\"}],\"name\":\"getRootAfterReplacementInDrive\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"_position\",\"type\":\"uint64\"},{\"internalType\":\"uint8\",\"name\":\"_logOfSize\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"_drive\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32[]\",\"name\":\"siblings\",\"type\":\"bytes32[]\"}],\"name\":\"getRootWithDrive\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"calculateRootFromPowerOfTwo(bytes32[])\":{\"params\":{\"hashes\":\"The array containing power of 2 elements\"},\"returns\":{\"_0\":\"byte32 the root hash being calculated\"}},\"getEmptyTreeHashAtIndex(uint256)\":{\"details\":\"first index is keccak(0), second index is keccak(keccak(0), keccak(0))\",\"params\":{\"_index\":\"of hash wanted\"}},\"getHashOfWordAtIndex(bytes,uint256)\":{\"details\":\"if word is incomplete (< 8 bytes) it gets padded with zeroes\",\"params\":{\"_data\":\"array of bytes\",\"_wordIndex\":\"index of word inside the bytes to get the hash of\"}},\"getMerkleRootFromBytes(bytes,uint8)\":{\"details\":\"_data is padded with zeroes until is multiple of 8root is completed with zero tree until log2size is completehashes are taken word by word (8 bytes by 8 bytes)\",\"params\":{\"_data\":\"array of bytes to be merklelized\",\"_log2Size\":\"log2 of total size of the drive\"}},\"getPristineHash(uint8)\":{\"details\":\"using the precomputed EMPTY_TREE_HASHES is cheaper\",\"params\":{\"_log2Size\":\"log2 of size of the empty drive\"},\"returns\":{\"_0\":\"merkle root hash of the drive of size 1 << log2Size filled with zeros\"}},\"getRoot(uint64,bytes8,bytes32[])\":{\"params\":{\"_position\":\"position of word in drive\",\"_value\":\"word to include in drive\",\"proof\":\"array of siblings to generate merkle root\"},\"returns\":{\"_0\":\"new merkle root hash after _value inclusion\"}},\"getRootAfterReplacementInDrive(uint64,uint8,uint8,bytes32,bytes32[])\":{\"params\":{\"_logSizeOfFullDrive\":\"log2 of size the full drive, which can be the entire machine\",\"_logSizeOfReplacement\":\"log2 of size the replacement\",\"_position\":\"position of _drive\",\"_replacement\":\"hash of the replacement\",\"siblings\":\"of replacement that merkle root can be calculated\"}},\"getRootWithDrive(uint64,uint8,bytes32,bytes32[])\":{\"params\":{\"_drive\":\"drive to be included\",\"_logOfSize\":\"log2 of size of _drive\",\"_position\":\"position of _drive\",\"siblings\":\"_drive's so that merkle root can be calculated\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"calculateRootFromPowerOfTwo(bytes32[])\":{\"notice\":\"Calculate the root of Merkle tree from an array of power of 2 elements\"},\"getEmptyTreeHashAtIndex(uint256)\":{\"notice\":\"Gets precomputed hash of zero in empty tree hashes\"},\"getHashOfWordAtIndex(bytes,uint256)\":{\"notice\":\"Get the hash of a word in an array of bytes\"},\"getMerkleRootFromBytes(bytes,uint8)\":{\"notice\":\"get merkle root of generic array of bytes\"},\"getPristineHash(uint8)\":{\"notice\":\"Gets the pristine hash of a drive full of zeroes\"},\"getRoot(uint64,bytes8,bytes32[])\":{\"notice\":\"Gets merkle root of drive with _value on _position\"},\"getRootAfterReplacementInDrive(uint64,uint8,uint8,bytes32,bytes32[])\":{\"notice\":\"Gets merkle root hash of drive with a replacement\"},\"getRootWithDrive(uint64,uint8,bytes32,bytes32[])\":{\"notice\":\"Gets merkle root hash of machine with drive _drive\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/Merkle.sol\":\"Merkle\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/CartesiMath.sol\":{\"content\":\"// Copyright 2020 Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\n/// @title CartesiMath\\n/// @author Felipe Argento\\npragma solidity ^0.8.0;\\n\\nlibrary CartesiMath {\\n // mapping values are packed as bytes3 each\\n // see test/TestCartesiMath.ts for decimal values\\n bytes constant log2tableTimes1M =\\n hex\\\"0000000F4240182F421E8480236E082771822AD63A2DC6C0305E8532B04834C96736B3C23876D73A187A3B9D4A3D09003E5EA63FA0C540D17741F28843057D440BA745062945F60246DC1047B917488DC7495ABA4A207C4ADF8A4B98544C4B404CF8AA4DA0E64E44434EE3054F7D6D5013B750A61A5134C851BFF05247BD52CC58534DE753CC8D54486954C19C55384255AC75561E50568DE956FB575766B057D00758376F589CFA5900BA5962BC59C3135A21CA5A7EF15ADA945B34BF5B8D805BE4DF5C3AEA5C8FA95CE3265D356C5D86835DD6735E25455E73005EBFAD5F0B525F55F75F9FA25FE85A60302460770860BD0A61023061467F6189FD61CCAE620E98624FBF62902762CFD5630ECD634D12638AA963C7966403DC643F7F647A8264B4E864EEB56527EC6560906598A365D029660724663D9766738566A8F066DDDA6712476746386779AF67ACAF67DF3A6811526842FA68743268A4FC68D55C6905536934E169640A6992CF69C13169EF326A1CD46A4A186A76FF6AA38C6ACFC0\\\";\\n\\n /// @notice Approximates log2 * 1M\\n /// @param _num number to take log2 * 1M of\\n /// @return approximate log2 times 1M\\n function log2ApproxTimes1M(uint256 _num) public pure returns (uint256) {\\n require(_num > 0, \\\"Number cannot be zero\\\");\\n uint256 leading = 0;\\n\\n if (_num == 1) return 0;\\n\\n while (_num > 128) {\\n _num = _num >> 1;\\n leading += 1;\\n }\\n return (leading * uint256(1000000)) + (getLog2TableTimes1M(_num));\\n }\\n\\n /// @notice navigates log2tableTimes1M\\n /// @param _num number to take log2 of\\n /// @return result after table look-up\\n function getLog2TableTimes1M(uint256 _num) public pure returns (uint256) {\\n bytes3 result = 0;\\n for (uint8 i = 0; i < 3; i++) {\\n bytes3 tempResult = log2tableTimes1M[(_num - 1) * 3 + i];\\n result = result | (tempResult >> (i * 8));\\n }\\n\\n return uint256(uint24(result));\\n }\\n\\n /// @notice get floor of log2 of number\\n /// @param _num number to take floor(log2) of\\n /// @return floor(log2) of _num\\n function getLog2Floor(uint256 _num) public pure returns (uint8) {\\n require(_num != 0, \\\"log of zero is undefined\\\");\\n\\n return uint8(255 - clz(_num));\\n }\\n\\n /// @notice checks if a number is Power of 2\\n /// @param _num number to check\\n /// @return true if number is power of 2, false if not\\n function isPowerOf2(uint256 _num) public pure returns (bool) {\\n if (_num == 0) return false;\\n\\n return _num & (_num - 1) == 0;\\n }\\n\\n /// @notice count trailing zeros\\n /// @param _num number you want the ctz of\\n /// @dev this a binary search implementation\\n function ctz(uint256 _num) public pure returns (uint256) {\\n if (_num == 0) return 256;\\n\\n uint256 n = 0;\\n if (_num & 0x00000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF == 0) { n = n + 128; _num = _num >> 128; }\\n if (_num & 0x000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFF == 0) { n = n + 64; _num = _num >> 64; }\\n if (_num & 0x00000000000000000000000000000000000000000000000000000000FFFFFFFF == 0) { n = n + 32; _num = _num >> 32; }\\n if (_num & 0x000000000000000000000000000000000000000000000000000000000000FFFF == 0) { n = n + 16; _num = _num >> 16; }\\n if (_num & 0x00000000000000000000000000000000000000000000000000000000000000FF == 0) { n = n + 8; _num = _num >> 8; }\\n if (_num & 0x000000000000000000000000000000000000000000000000000000000000000F == 0) { n = n + 4; _num = _num >> 4; }\\n if (_num & 0x0000000000000000000000000000000000000000000000000000000000000003 == 0) { n = n + 2; _num = _num >> 2; }\\n if (_num & 0x0000000000000000000000000000000000000000000000000000000000000001 == 0) { n = n + 1; }\\n\\n return n;\\n }\\n\\n /// @notice count leading zeros\\n /// @param _num number you want the clz of\\n /// @dev this a binary search implementation\\n function clz(uint256 _num) public pure returns (uint256) {\\n if (_num == 0) return 256;\\n\\n uint256 n = 0;\\n if (_num & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000000000 == 0) { n = n + 128; _num = _num << 128; }\\n if (_num & 0xFFFFFFFFFFFFFFFF000000000000000000000000000000000000000000000000 == 0) { n = n + 64; _num = _num << 64; }\\n if (_num & 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 == 0) { n = n + 32; _num = _num << 32; }\\n if (_num & 0xFFFF000000000000000000000000000000000000000000000000000000000000 == 0) { n = n + 16; _num = _num << 16; }\\n if (_num & 0xFF00000000000000000000000000000000000000000000000000000000000000 == 0) { n = n + 8; _num = _num << 8; }\\n if (_num & 0xF000000000000000000000000000000000000000000000000000000000000000 == 0) { n = n + 4; _num = _num << 4; }\\n if (_num & 0xC000000000000000000000000000000000000000000000000000000000000000 == 0) { n = n + 2; _num = _num << 2; }\\n if (_num & 0x8000000000000000000000000000000000000000000000000000000000000000 == 0) { n = n + 1; }\\n\\n return n;\\n }\\n}\\n\",\"keccak256\":\"0x28b74012e966438edff701decdc5ffd207b3f0244af65fbd7d397050986e58d4\",\"license\":\"Apache-2.0\"},\"contracts/Merkle.sol\":{\"content\":\"// Copyright 2020 Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\n/// @title Library for Merkle proofs\\npragma solidity ^0.8.0;\\n\\nimport \\\"./CartesiMath.sol\\\";\\n\\nlibrary Merkle {\\n using CartesiMath for uint256;\\n\\n uint256 constant L_WORD_SIZE = 3; // word = 8 bytes, log = 3\\n\\n // merkle root hashes of trees of zero concatenated\\n // 32 bytes for each root, first one is keccak(0), second one is\\n // keccak(keccack(0), keccak(0)) and so on\\n\\n bytes constant EMPTY_TREE_HASHES =\\n hex\\\"011b4d03dd8c01f1049143cf9c4c817e4b167f1d1b83e5c6f0f10d89ba1e7bce4d9470a821fbe90117ec357e30bad9305732fb19ddf54a07dd3e29f440619254ae39ce8537aca75e2eff3e38c98011dfe934e700a0967732fc07b430dd656a233fc9a15f5b4869c872f81087bb6104b7d63e6f9ab47f2c43f3535eae7172aa7f17d2dd614cddaa4d879276b11e0672c9560033d3e8453a1d045339d34ba601b9c37b8b13ca95166fb7af16988a70fcc90f38bf9126fd833da710a47fb37a55e68e7a427fa943d9966b389f4f257173676090c6e95f43e2cb6d65f8758111e30930b0b9deb73e155c59740bacf14a6ff04b64bb8e201a506409c3fe381ca4ea90cd5deac729d0fdaccc441d09d7325f41586ba13c801b7eccae0f95d8f3933efed8b96e5b7f6f459e9cb6a2f41bf276c7b85c10cd4662c04cbbb365434726c0a0c9695393027fb106a8153109ac516288a88b28a93817899460d6310b71cf1e6163e8806fa0d4b197a259e8c3ac28864268159d0ac85f8581ca28fa7d2c0c03eb91e3eee5ca7a3da2b3053c9770db73599fb149f620e3facef95e947c0ee860b72122e31e4bbd2b7c783d79cc30f60c6238651da7f0726f767d22747264fdb046f7549f26cc70ed5e18baeb6c81bb0625cb95bb4019aeecd40774ee87ae29ec517a71f6ee264c5d761379b3d7d617ca83677374b49d10aec50505ac087408ca892b573c267a712a52e1d06421fe276a03efb1889f337201110fdc32a81f8e152499af665835aabfdc6740c7e2c3791a31c3cdc9f5ab962f681b12fc092816a62f27d86025599a41233848702f0cfc0437b445682df51147a632a0a083d2d38b5e13e466a8935afff58bb533b3ef5d27fba63ee6b0fd9e67ff20af9d50deee3f8bf065ec220c1fd4ba57e341261d55997f85d66d32152526736872693d2b437a233e2337b715f6ac9a6a272622fdc2d67fcfe1da3459f8dab4ed7e40a657a54c36766c5e8ac9a88b35b05c34747e6507f6b044ab66180dc76ac1a696de03189593fedc0d0dbbd855c8ead673544899b0960e4a5a7ca43b4ef90afe607de7698caefdc242788f654b57a4fb32a71b335ef6ff9a4cc118b282b53bdd6d6192b7a82c3c5126b9c7e33c8e5a5ac9738b8bd31247fb7402054f97b573e8abb9faad219f4fd085aceaa7f542d787ee4196d365f3cc566e7bbcfbfd451230c48d804c017d21e2d8fa914e2559bb72bf0ab78c8ab92f00ef0d0d576eccdd486b64138a4172674857e543d1d5b639058dd908186597e366ad5f3d9c7ceaff44d04d1550b8d33abc751df07437834ba5acb32328a396994aebb3c40f759c2d6d7a3cb5377e55d5d218ef5a296dda8ddc355f3f50c3d0b660a51dfa4d98a6a5a33564556cf83c1373a814641d6a1dcef97b883fee61bb84fe60a3409340217e629cc7e4dcc93b85d8820921ff5826148b60e6939acd7838e1d7f20562bff8ee4b5ec4a05ad997a57b9796fdcb2eda87883c2640b072b140b946bfdf6575cacc066fdae04f6951e63624cbd316a677cad529bbe4e97b9144e4bc06c4afd1de55dd3e1175f90423847a230d34dfb71ed56f2965a7f6c72e6aa33c24c303fd67745d632656c5ef90bec80f4f5d1daa251988826cef375c81c36bf457e09687056f924677cb0bccf98dff81e014ce25f2d132497923e267363963cdf4302c5049d63131dc03fd95f65d8b6aa5934f817252c028c90f56d413b9d5d10d89790707dae2fabb249f649929927c21dd71e3f656826de5451c5da375aadecbd59d5ebf3a31fae65ac1b316a1611f1b276b26530f58d7247df459ce1f86db1d734f6f811932f042cee45d0e455306d01081bc3384f82c5fb2aacaa19d89cdfa46cc916eac61121475ba2e6191b4feecbe1789717021a158ace5d06744b40f551076b67cd63af60007f8c99876e1424883a45ec49d497ddaf808a5521ca74a999ab0b3c7aa9c80f85e93977ec61ce68b20307a1a81f71ca645b568fcd319ccbb5f651e87b707d37c39e15f945ea69e2f7c7d2ccc85b7e654c07e96f0636ae4044fe0e38590b431795ad0f8647bdd613713ada493cc17efd313206380e6a685b8198475bbd021c6e9d94daab2214947127506073e44d5408ba166c512a0b86805d07f5a44d3c41706be2bc15e712e55805248b92e8677d90f6d284d1d6ffaff2c430657042a0e82624fa3717b06cc0a6fd12230ea586dae83019fb9e06034ed2803c98d554b93c9a52348cafff75c40174a91f9ae6b8647854a156029f0b88b83316663ce574a4978277bb6bb27a31085634b6ec78864b6d8201c7e93903d75815067e378289a3d072ae172dafa6a452470f8d645bebfad9779594fc0784bb764a22e3a8181d93db7bf97893c414217a618ccb14caa9e92e8c61673afc9583662e812adba1f87a9c68202d60e909efab43c42c0cb00695fc7f1ffe67c75ca894c3c51e1e5e731360199e600f6ced9a87b2a6a87e70bf251bb5075ab222138288164b2eda727515ea7de12e2496d4fe42ea8d1a120c03cf9c50622c2afe4acb0dad98fd62d07ab4e828a94495f6d1ab973982c7ccbe6c1fae02788e4422ae22282fa49cbdb04ba54a7a238c6fc41187451383460762c06d1c8a72b9cd718866ad4b689e10c9a8c38fe5ef045bd785b01e980fc82c7e3532ce81876b778dd9f1ceeba4478e86411fb6fdd790683916ca832592485093644e8760cd7b4c01dba1ccc82b661bf13f0e3f34acd6b88\\\";\\n\\n // number of hashes in EMPTY_TREE_HASHES\\n uint256 constant EMPTY_TREE_SIZE = 61 * 32; // 32 bytes per 61 indexes (64 words)\\n\\n /// @notice Gets the pristine hash of a drive full of zeroes\\n /// @param _log2Size log2 of size of the empty drive\\n /// @return merkle root hash of the drive of size 1 << log2Size filled with zeros\\n /// @dev using the precomputed EMPTY_TREE_HASHES is cheaper\\n function getPristineHash(uint8 _log2Size) public pure returns (bytes32) {\\n require(_log2Size >= 3, \\\"Has to be at least one word\\\");\\n require(_log2Size <= 64, \\\"Cannot be bigger than the machine itself\\\");\\n\\n bytes8 value = 0;\\n bytes32 runningHash = keccak256(abi.encodePacked(value));\\n\\n for (uint256 i = 3; i < _log2Size; i++) {\\n runningHash = keccak256(abi.encodePacked(runningHash, runningHash));\\n }\\n\\n return runningHash;\\n }\\n\\n /// @notice Gets merkle root of drive with _value on _position\\n /// @param _position position of word in drive\\n /// @param _value word to include in drive\\n /// @param proof array of siblings to generate merkle root\\n /// @return new merkle root hash after _value inclusion\\n function getRoot(\\n uint64 _position,\\n bytes8 _value,\\n bytes32[] memory proof\\n ) public pure returns (bytes32) {\\n bytes32 runningHash = keccak256(abi.encodePacked(_value));\\n\\n return getRootAfterReplacementInDrive(\\n _position,\\n 3,\\n 64,\\n runningHash,\\n proof\\n );\\n }\\n\\n /// @notice Gets merkle root hash of machine with drive _drive\\n /// @param _position position of _drive\\n /// @param _logOfSize log2 of size of _drive\\n /// @param _drive drive to be included\\n /// @param siblings _drive's so that merkle root can be calculated\\n function getRootWithDrive(\\n uint64 _position,\\n uint8 _logOfSize,\\n bytes32 _drive,\\n bytes32[] memory siblings\\n ) public pure returns (bytes32) {\\n // treating the full 2**64 machine as a drive\\n return getRootAfterReplacementInDrive(\\n _position,\\n _logOfSize,\\n 64,\\n _drive,\\n siblings\\n );\\n }\\n\\n /// @notice Gets merkle root hash of drive with a replacement\\n /// @param _position position of _drive\\n /// @param _logSizeOfReplacement log2 of size the replacement\\n /// @param _logSizeOfFullDrive log2 of size the full drive, which can be the entire machine\\n /// @param _replacement hash of the replacement\\n /// @param siblings of replacement that merkle root can be calculated\\n function getRootAfterReplacementInDrive(\\n uint64 _position,\\n uint8 _logSizeOfReplacement,\\n uint8 _logSizeOfFullDrive,\\n bytes32 _replacement,\\n bytes32[] memory siblings\\n ) public pure returns (bytes32) {\\n require(_logSizeOfFullDrive >= _logSizeOfReplacement, \\\"Replacement bigger than original drive\\\");\\n require(_logSizeOfReplacement >= 3, \\\"Replacement must be at least one word\\\");\\n require(_logSizeOfFullDrive <= 64, \\\"Full drive can't be bigger than the machine itself\\\");\\n\\n uint64 size = uint64(1) << _logSizeOfReplacement;\\n\\n require(((size - 1) & _position) == 0, \\\"Position is not aligned\\\");\\n require(\\n siblings.length == _logSizeOfFullDrive - _logSizeOfReplacement,\\n \\\"Proof length does not match\\\"\\n );\\n\\n for (uint64 i = 0; i < siblings.length; i++) {\\n if ((_position & (size << i)) == 0) {\\n _replacement = keccak256(abi.encodePacked(_replacement, siblings[i]));\\n } else {\\n _replacement = keccak256(abi.encodePacked(siblings[i], _replacement));\\n }\\n }\\n\\n return _replacement;\\n }\\n\\n /// @notice Gets precomputed hash of zero in empty tree hashes\\n /// @param _index of hash wanted\\n /// @dev first index is keccak(0), second index is keccak(keccak(0), keccak(0))\\n function getEmptyTreeHashAtIndex(uint256 _index)\\n public\\n pure\\n returns (bytes32)\\n {\\n uint256 start = _index * 32;\\n require(EMPTY_TREE_SIZE >= start + 32, \\\"index out of bounds\\\");\\n bytes32 hashedZeros;\\n bytes memory zeroTree = EMPTY_TREE_HASHES;\\n\\n // first word is length, then skip index words\\n assembly {\\n hashedZeros := mload(add(add(zeroTree, 0x20), start))\\n }\\n return hashedZeros;\\n }\\n\\n /// @notice get merkle root of generic array of bytes\\n /// @param _data array of bytes to be merklelized\\n /// @param _log2Size log2 of total size of the drive\\n /// @dev _data is padded with zeroes until is multiple of 8\\n /// @dev root is completed with zero tree until log2size is complete\\n /// @dev hashes are taken word by word (8 bytes by 8 bytes)\\n function getMerkleRootFromBytes(bytes calldata _data, uint8 _log2Size)\\n public\\n pure\\n returns (bytes32)\\n {\\n require(_log2Size >= 3, \\\"Must be at least a word\\\");\\n require(_log2Size <= 64, \\\"Cannot be bigger than the machine itself\\\");\\n\\n // if _data is empty return pristine drive of size log2size\\n if (_data.length == 0) return getEmptyTreeHashAtIndex(_log2Size - 3);\\n\\n // total size of the drive in words\\n uint256 size = 1 << uint256(_log2Size - 3);\\n require(\\n size << L_WORD_SIZE >= _data.length,\\n \\\"data is bigger than drive\\\"\\n );\\n // the stack depth is log2(_data.length / 8) + 2\\n uint256 stack_depth =\\n 2 + ((_data.length) >> L_WORD_SIZE).getLog2Floor();\\n bytes32[] memory stack = new bytes32[](stack_depth);\\n\\n uint256 numOfHashes; // total number of hashes on stack (counting levels)\\n uint256 stackLength; // total length of stack\\n uint256 numOfJoins; // number of hashes of the same level on stack\\n uint256 topStackLevel; // hash level of the top of the stack\\n\\n while (numOfHashes < size) {\\n if ((numOfHashes << L_WORD_SIZE) < _data.length) {\\n // we still have words to hash\\n stack[stackLength] = getHashOfWordAtIndex(_data, numOfHashes);\\n numOfHashes++;\\n\\n numOfJoins = numOfHashes;\\n } else {\\n // since padding happens in hashOfWordAtIndex function\\n // we only need to complete the stack with pre-computed\\n // hash(0), hash(hash(0),hash(0)) and so on\\n topStackLevel = numOfHashes.ctz();\\n\\n stack[stackLength] = getEmptyTreeHashAtIndex(topStackLevel);\\n\\n //Empty Tree Hash summarizes many hashes\\n numOfHashes = numOfHashes + (1 << topStackLevel);\\n numOfJoins = numOfHashes >> topStackLevel;\\n }\\n\\n stackLength++;\\n\\n // while there are joins, hash top of stack together\\n while (numOfJoins & 1 == 0) {\\n bytes32 h2 = stack[stackLength - 1];\\n bytes32 h1 = stack[stackLength - 2];\\n\\n stack[stackLength - 2] = keccak256(abi.encodePacked(h1, h2));\\n stackLength = stackLength - 1; // remove hashes from stack\\n\\n numOfJoins = numOfJoins >> 1;\\n }\\n }\\n require(\\n stackLength == 1,\\n \\\"function ended but stack has more than one element\\\"\\n );\\n\\n return stack[0];\\n }\\n\\n /// @notice Get the hash of a word in an array of bytes\\n /// @param _data array of bytes\\n /// @param _wordIndex index of word inside the bytes to get the hash of\\n /// @dev if word is incomplete (< 8 bytes) it gets padded with zeroes\\n function getHashOfWordAtIndex(bytes calldata _data, uint256 _wordIndex)\\n public\\n pure\\n returns (bytes32)\\n {\\n uint256 start = _wordIndex << L_WORD_SIZE;\\n uint256 end = start + (1 << L_WORD_SIZE);\\n\\n // TODO: in .lua this just returns zero, but this might be more consistent\\n require(start <= _data.length, \\\"word out of bounds\\\");\\n\\n if (end <= _data.length) {\\n return keccak256(abi.encodePacked(_data[start:end]));\\n }\\n\\n // word is incomplete\\n // fill paddedSlice with incomplete words - the rest is going to be bytes(0)\\n bytes memory paddedSlice = new bytes(8);\\n uint256 remaining = _data.length - start;\\n\\n for (uint256 i = 0; i < remaining; i++) {\\n paddedSlice[i] = _data[start + i];\\n }\\n\\n return keccak256(paddedSlice);\\n }\\n\\n /// @notice Calculate the root of Merkle tree from an array of power of 2 elements\\n /// @param hashes The array containing power of 2 elements\\n /// @return byte32 the root hash being calculated\\n function calculateRootFromPowerOfTwo(bytes32[] memory hashes)\\n public\\n pure\\n returns (bytes32)\\n {\\n // revert when the input is not of power of 2\\n require(\\n (hashes.length).isPowerOf2(),\\n \\\"The input array must contain power of 2 elements\\\"\\n );\\n\\n if (hashes.length == 1) {\\n return hashes[0];\\n } else {\\n bytes32[] memory newHashes = new bytes32[](hashes.length >> 1);\\n\\n for (uint256 i = 0; i < hashes.length; i += 2) {\\n newHashes[i >> 1] = keccak256(\\n abi.encodePacked(hashes[i], hashes[i + 1])\\n );\\n }\\n\\n return calculateRootFromPowerOfTwo(newHashes);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x7593e7dda88e5bee5347abef5b5077ea1434c091819ad961b8a7cde10c6efa6d\",\"license\":\"Apache-2.0\"}},\"version\":1}", + "bytecode": "0x611c2b61003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100925760003560e01c806382b0eab81161006557806382b0eab8146100f55780638492d93b14610108578063a73426881461011b578063d7304dd91461012e57600080fd5b8063297081181461009757806334bd712d146100bc578063451a1055146100cf57806349fd2697146100e2575b600080fd5b6100aa6100a53660046111e5565b610141565b60405190815260200160405180910390f35b6100aa6100ca366004611048565b610460565b6100aa6100dd3660046110e5565b6105c9565b6100aa6100f0366004611091565b61065a565b6100aa610103366004610fee565b610b35565b6100aa610116366004611115565b610da3565b6100aa61012936600461125f565b610dee565b6100aa61013c36600461117e565b610ee4565b60008460ff168460ff1610156101ad5760405162461bcd60e51b815260206004820152602660248201527f5265706c6163656d656e7420626967676572207468616e206f726967696e616c60448201526520647269766560d01b60648201526084015b60405180910390fd5b60038560ff16101561020f5760405162461bcd60e51b815260206004820152602560248201527f5265706c6163656d656e74206d757374206265206174206c65617374206f6e65604482015264081ddbdc9960da1b60648201526084016101a4565b60408460ff16111561027e5760405162461bcd60e51b815260206004820152603260248201527f46756c6c2064726976652063616e277420626520626967676572207468616e206044820152713a34329036b0b1b434b7329034ba39b2b63360711b60648201526084016101a4565b600160ff861681901b908790610294908361138a565b166001600160401b03166000146102ed5760405162461bcd60e51b815260206004820152601760248201527f506f736974696f6e206973206e6f7420616c69676e656400000000000000000060448201526064016101a4565b6102f786866113b2565b60ff168351146103495760405162461bcd60e51b815260206004820152601b60248201527f50726f6f66206c656e67746820646f6573206e6f74206d61746368000000000060448201526064016101a4565b60005b8351816001600160401b03161015610454576001600160401b038281168183161b8916166103dd578484826001600160401b03168151811061039e57634e487b7160e01b600052603260045260246000fd5b60200260200101516040516020016103c0929190918252602082015260400190565b604051602081830303815290604052805190602001209450610442565b83816001600160401b03168151811061040657634e487b7160e01b600052603260045260246000fd5b602002602001015185604051602001610429929190918252602082015260400190565b6040516020818303038152906040528051906020012094505b8061044c816113f0565b91505061034c565b50929695505050505050565b6000600382901b81610473600883611317565b9050848211156104ba5760405162461bcd60e51b8152602060048201526012602482015271776f7264206f7574206f6620626f756e647360701b60448201526064016101a4565b8481116104fd576104cd818387896112ef565b6040516020016104de929190611297565b60405160208183030381529060405280519060200120925050506105c2565b604080516008808252818301909252600091602082018180368337019050509050600061052a8488611373565b905060005b818110156105b35788886105438388611317565b81811061056057634e487b7160e01b600052603260045260246000fd5b9050013560f81c60f81b83828151811061058a57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350806105ab816113d5565b91505061052f565b50508051602090910120925050505b9392505050565b6000806105d7836020611354565b90506105e4816020611317565b6107a0101561062b5760405162461bcd60e51b8152602060048201526013602482015272696e646578206f7574206f6620626f756e647360681b60448201526064016101a4565b600080604051806107c001604052806107a081526020016114566107a091399290920160200151949350505050565b600060038260ff1610156106b05760405162461bcd60e51b815260206004820152601760248201527f4d757374206265206174206c65617374206120776f726400000000000000000060448201526064016101a4565b60408260ff1611156106d45760405162461bcd60e51b81526004016101a4906112a7565b826106f6576106ef6106e76003846113b2565b60ff166105c9565b90506105c2565b60006107036003846113b2565b60ff166001901b905084849050600382901b10156107635760405162461bcd60e51b815260206004820152601960248201527f6461746120697320626967676572207468616e2064726976650000000000000060448201526064016101a4565b6040516306c8e54b60e01b8152600385901c600482015260009073598b68c8234F201aC984Bd33D7678D2E3aC8f179906306c8e54b9060240160206040518083038186803b1580156107b457600080fd5b505af41580156107c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ec919061127b565b6107f790600261132f565b60ff1690506000816001600160401b0381111561082457634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561084d578160200160208202803683370190505b5090506000806000805b86841015610a9157600384901b8a11156108b6576108768b8b86610460565b85848151811061089657634e487b7160e01b600052603260045260246000fd5b6020908102919091010152836108ab816113d5565b945050839150610984565b60405163052dcf5f60e31b81526004810185905273598b68c8234F201aC984Bd33D7678D2E3aC8f1799063296e7af89060240160206040518083038186803b15801561090157600080fd5b505af4158015610915573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061093991906110fd565b9050610944816105c9565b85848151811061096457634e487b7160e01b600052603260045260246000fd5b602090810291909101015261097c6001821b85611317565b935083811c91505b8261098e816113d5565b9350505b60018216610a8c576000856109a8600186611373565b815181106109c657634e487b7160e01b600052603260045260246000fd5b602002602001015190506000866002866109e09190611373565b815181106109fe57634e487b7160e01b600052603260045260246000fd5b602002602001015190508082604051602001610a24929190918252602082015260400190565b6040516020818303038152906040528051906020012087600287610a489190611373565b81518110610a6657634e487b7160e01b600052603260045260246000fd5b6020908102919091010152610a7c600186611373565b9450600184901c93505050610992565b610857565b82600114610afc5760405162461bcd60e51b815260206004820152603260248201527f66756e6374696f6e20656e6465642062757420737461636b20686173206d6f7260448201527119481d1a185b881bdb9948195b195b595b9d60721b60648201526084016101a4565b84600081518110610b1d57634e487b7160e01b600052603260045260246000fd5b60200260200101519750505050505050509392505050565b805160405163d82ae4b160e01b815260009173598b68c8234F201aC984Bd33D7678D2E3aC8f1799163d82ae4b191610b739160040190815260200190565b60206040518083038186803b158015610b8b57600080fd5b505af4158015610b9f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc39190611028565b610c285760405162461bcd60e51b815260206004820152603060248201527f54686520696e707574206172726179206d75737420636f6e7461696e20706f7760448201526f6572206f66203220656c656d656e747360801b60648201526084016101a4565b815160011415610c625781600081518110610c5357634e487b7160e01b600052603260045260246000fd5b60200260200101519050919050565b600060018351901c6001600160401b03811115610c8f57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610cb8578160200160208202803683370190505b50905060005b8351811015610d9457838181518110610ce757634e487b7160e01b600052603260045260246000fd5b602002602001015184826001610cfd9190611317565b81518110610d1b57634e487b7160e01b600052603260045260246000fd5b6020026020010151604051602001610d3d929190918252602082015260400190565b6040516020818303038152906040528051906020012082600183901c81518110610d7757634e487b7160e01b600052603260045260246000fd5b6020908102919091010152610d8d600282611317565b9050610cbe565b506105c281610b35565b919050565b6040516001600160c01b0319831660208201526000908190602801604051602081830303815290604052805190602001209050610de585600360408487610141565b95945050505050565b600060038260ff161015610e445760405162461bcd60e51b815260206004820152601b60248201527f48617320746f206265206174206c65617374206f6e6520776f7264000000000060448201526064016101a4565b60408260ff161115610e685760405162461bcd60e51b81526004016101a4906112a7565b60408051600060208083018290528351600881850301815260289093019093528151919092012060035b8460ff16811015610edc5760408051602081018490529081018390526060016040516020818303038152906040528051906020012091508080610ed4906113d5565b915050610e92565b509392505050565b6000610de5858560408686610141565b600082601f830112610f04578081fd5b813560206001600160401b0380831115610f2057610f2061142d565b8260051b604051601f19603f83011681018181108482111715610f4557610f4561142d565b60405284815283810192508684018288018501891015610f63578687fd5b8692505b85831015610f85578035845292840192600192909201918401610f67565b50979650505050505050565b60008083601f840112610fa2578182fd5b5081356001600160401b03811115610fb8578182fd5b602083019150836020828501011115610fd057600080fd5b9250929050565b80356001600160401b0381168114610d9e57600080fd5b600060208284031215610fff578081fd5b81356001600160401b03811115611014578182fd5b61102084828501610ef4565b949350505050565b600060208284031215611039578081fd5b815180151581146105c2578182fd5b60008060006040848603121561105c578182fd5b83356001600160401b03811115611071578283fd5b61107d86828701610f91565b909790965060209590950135949350505050565b6000806000604084860312156110a5578283fd5b83356001600160401b038111156110ba578384fd5b6110c686828701610f91565b90945092505060208401356110da81611443565b809150509250925092565b6000602082840312156110f6578081fd5b5035919050565b60006020828403121561110e578081fd5b5051919050565b600080600060608486031215611129578283fd5b61113284610fd7565b925060208401356001600160c01b03198116811461114e578283fd5b915060408401356001600160401b03811115611168578182fd5b61117486828701610ef4565b9150509250925092565b60008060008060808587031215611193578081fd5b61119c85610fd7565b935060208501356111ac81611443565b92506040850135915060608501356001600160401b038111156111cd578182fd5b6111d987828801610ef4565b91505092959194509250565b600080600080600060a086880312156111fc578081fd5b61120586610fd7565b9450602086013561121581611443565b9350604086013561122581611443565b92506060860135915060808601356001600160401b03811115611246578182fd5b61125288828901610ef4565b9150509295509295909350565b600060208284031215611270578081fd5b81356105c281611443565b60006020828403121561128c578081fd5b81516105c281611443565b8183823760009101908152919050565b60208082526028908201527f43616e6e6f7420626520626967676572207468616e20746865206d616368696e604082015267329034ba39b2b63360c11b606082015260800190565b600080858511156112fe578182fd5b8386111561130a578182fd5b5050820193919092039150565b6000821982111561132a5761132a611417565b500190565b600060ff821660ff84168060ff0382111561134c5761134c611417565b019392505050565b600081600019048311821515161561136e5761136e611417565b500290565b60008282101561138557611385611417565b500390565b60006001600160401b03838116908316818110156113aa576113aa611417565b039392505050565b600060ff821660ff8416808210156113cc576113cc611417565b90039392505050565b60006000198214156113e9576113e9611417565b5060010190565b60006001600160401b038083168181141561140d5761140d611417565b6001019392505050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b60ff8116811461145257600080fd5b5056fe011b4d03dd8c01f1049143cf9c4c817e4b167f1d1b83e5c6f0f10d89ba1e7bce4d9470a821fbe90117ec357e30bad9305732fb19ddf54a07dd3e29f440619254ae39ce8537aca75e2eff3e38c98011dfe934e700a0967732fc07b430dd656a233fc9a15f5b4869c872f81087bb6104b7d63e6f9ab47f2c43f3535eae7172aa7f17d2dd614cddaa4d879276b11e0672c9560033d3e8453a1d045339d34ba601b9c37b8b13ca95166fb7af16988a70fcc90f38bf9126fd833da710a47fb37a55e68e7a427fa943d9966b389f4f257173676090c6e95f43e2cb6d65f8758111e30930b0b9deb73e155c59740bacf14a6ff04b64bb8e201a506409c3fe381ca4ea90cd5deac729d0fdaccc441d09d7325f41586ba13c801b7eccae0f95d8f3933efed8b96e5b7f6f459e9cb6a2f41bf276c7b85c10cd4662c04cbbb365434726c0a0c9695393027fb106a8153109ac516288a88b28a93817899460d6310b71cf1e6163e8806fa0d4b197a259e8c3ac28864268159d0ac85f8581ca28fa7d2c0c03eb91e3eee5ca7a3da2b3053c9770db73599fb149f620e3facef95e947c0ee860b72122e31e4bbd2b7c783d79cc30f60c6238651da7f0726f767d22747264fdb046f7549f26cc70ed5e18baeb6c81bb0625cb95bb4019aeecd40774ee87ae29ec517a71f6ee264c5d761379b3d7d617ca83677374b49d10aec50505ac087408ca892b573c267a712a52e1d06421fe276a03efb1889f337201110fdc32a81f8e152499af665835aabfdc6740c7e2c3791a31c3cdc9f5ab962f681b12fc092816a62f27d86025599a41233848702f0cfc0437b445682df51147a632a0a083d2d38b5e13e466a8935afff58bb533b3ef5d27fba63ee6b0fd9e67ff20af9d50deee3f8bf065ec220c1fd4ba57e341261d55997f85d66d32152526736872693d2b437a233e2337b715f6ac9a6a272622fdc2d67fcfe1da3459f8dab4ed7e40a657a54c36766c5e8ac9a88b35b05c34747e6507f6b044ab66180dc76ac1a696de03189593fedc0d0dbbd855c8ead673544899b0960e4a5a7ca43b4ef90afe607de7698caefdc242788f654b57a4fb32a71b335ef6ff9a4cc118b282b53bdd6d6192b7a82c3c5126b9c7e33c8e5a5ac9738b8bd31247fb7402054f97b573e8abb9faad219f4fd085aceaa7f542d787ee4196d365f3cc566e7bbcfbfd451230c48d804c017d21e2d8fa914e2559bb72bf0ab78c8ab92f00ef0d0d576eccdd486b64138a4172674857e543d1d5b639058dd908186597e366ad5f3d9c7ceaff44d04d1550b8d33abc751df07437834ba5acb32328a396994aebb3c40f759c2d6d7a3cb5377e55d5d218ef5a296dda8ddc355f3f50c3d0b660a51dfa4d98a6a5a33564556cf83c1373a814641d6a1dcef97b883fee61bb84fe60a3409340217e629cc7e4dcc93b85d8820921ff5826148b60e6939acd7838e1d7f20562bff8ee4b5ec4a05ad997a57b9796fdcb2eda87883c2640b072b140b946bfdf6575cacc066fdae04f6951e63624cbd316a677cad529bbe4e97b9144e4bc06c4afd1de55dd3e1175f90423847a230d34dfb71ed56f2965a7f6c72e6aa33c24c303fd67745d632656c5ef90bec80f4f5d1daa251988826cef375c81c36bf457e09687056f924677cb0bccf98dff81e014ce25f2d132497923e267363963cdf4302c5049d63131dc03fd95f65d8b6aa5934f817252c028c90f56d413b9d5d10d89790707dae2fabb249f649929927c21dd71e3f656826de5451c5da375aadecbd59d5ebf3a31fae65ac1b316a1611f1b276b26530f58d7247df459ce1f86db1d734f6f811932f042cee45d0e455306d01081bc3384f82c5fb2aacaa19d89cdfa46cc916eac61121475ba2e6191b4feecbe1789717021a158ace5d06744b40f551076b67cd63af60007f8c99876e1424883a45ec49d497ddaf808a5521ca74a999ab0b3c7aa9c80f85e93977ec61ce68b20307a1a81f71ca645b568fcd319ccbb5f651e87b707d37c39e15f945ea69e2f7c7d2ccc85b7e654c07e96f0636ae4044fe0e38590b431795ad0f8647bdd613713ada493cc17efd313206380e6a685b8198475bbd021c6e9d94daab2214947127506073e44d5408ba166c512a0b86805d07f5a44d3c41706be2bc15e712e55805248b92e8677d90f6d284d1d6ffaff2c430657042a0e82624fa3717b06cc0a6fd12230ea586dae83019fb9e06034ed2803c98d554b93c9a52348cafff75c40174a91f9ae6b8647854a156029f0b88b83316663ce574a4978277bb6bb27a31085634b6ec78864b6d8201c7e93903d75815067e378289a3d072ae172dafa6a452470f8d645bebfad9779594fc0784bb764a22e3a8181d93db7bf97893c414217a618ccb14caa9e92e8c61673afc9583662e812adba1f87a9c68202d60e909efab43c42c0cb00695fc7f1ffe67c75ca894c3c51e1e5e731360199e600f6ced9a87b2a6a87e70bf251bb5075ab222138288164b2eda727515ea7de12e2496d4fe42ea8d1a120c03cf9c50622c2afe4acb0dad98fd62d07ab4e828a94495f6d1ab973982c7ccbe6c1fae02788e4422ae22282fa49cbdb04ba54a7a238c6fc41187451383460762c06d1c8a72b9cd718866ad4b689e10c9a8c38fe5ef045bd785b01e980fc82c7e3532ce81876b778dd9f1ceeba4478e86411fb6fdd790683916ca832592485093644e8760cd7b4c01dba1ccc82b661bf13f0e3f34acd6b88a2646970667358221220813b9a38cd5e0772b16f859d9a66ce6200c68281ffac8c91413c40f7bf8e5d8c64736f6c63430008040033", + "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600436106100925760003560e01c806382b0eab81161006557806382b0eab8146100f55780638492d93b14610108578063a73426881461011b578063d7304dd91461012e57600080fd5b8063297081181461009757806334bd712d146100bc578063451a1055146100cf57806349fd2697146100e2575b600080fd5b6100aa6100a53660046111e5565b610141565b60405190815260200160405180910390f35b6100aa6100ca366004611048565b610460565b6100aa6100dd3660046110e5565b6105c9565b6100aa6100f0366004611091565b61065a565b6100aa610103366004610fee565b610b35565b6100aa610116366004611115565b610da3565b6100aa61012936600461125f565b610dee565b6100aa61013c36600461117e565b610ee4565b60008460ff168460ff1610156101ad5760405162461bcd60e51b815260206004820152602660248201527f5265706c6163656d656e7420626967676572207468616e206f726967696e616c60448201526520647269766560d01b60648201526084015b60405180910390fd5b60038560ff16101561020f5760405162461bcd60e51b815260206004820152602560248201527f5265706c6163656d656e74206d757374206265206174206c65617374206f6e65604482015264081ddbdc9960da1b60648201526084016101a4565b60408460ff16111561027e5760405162461bcd60e51b815260206004820152603260248201527f46756c6c2064726976652063616e277420626520626967676572207468616e206044820152713a34329036b0b1b434b7329034ba39b2b63360711b60648201526084016101a4565b600160ff861681901b908790610294908361138a565b166001600160401b03166000146102ed5760405162461bcd60e51b815260206004820152601760248201527f506f736974696f6e206973206e6f7420616c69676e656400000000000000000060448201526064016101a4565b6102f786866113b2565b60ff168351146103495760405162461bcd60e51b815260206004820152601b60248201527f50726f6f66206c656e67746820646f6573206e6f74206d61746368000000000060448201526064016101a4565b60005b8351816001600160401b03161015610454576001600160401b038281168183161b8916166103dd578484826001600160401b03168151811061039e57634e487b7160e01b600052603260045260246000fd5b60200260200101516040516020016103c0929190918252602082015260400190565b604051602081830303815290604052805190602001209450610442565b83816001600160401b03168151811061040657634e487b7160e01b600052603260045260246000fd5b602002602001015185604051602001610429929190918252602082015260400190565b6040516020818303038152906040528051906020012094505b8061044c816113f0565b91505061034c565b50929695505050505050565b6000600382901b81610473600883611317565b9050848211156104ba5760405162461bcd60e51b8152602060048201526012602482015271776f7264206f7574206f6620626f756e647360701b60448201526064016101a4565b8481116104fd576104cd818387896112ef565b6040516020016104de929190611297565b60405160208183030381529060405280519060200120925050506105c2565b604080516008808252818301909252600091602082018180368337019050509050600061052a8488611373565b905060005b818110156105b35788886105438388611317565b81811061056057634e487b7160e01b600052603260045260246000fd5b9050013560f81c60f81b83828151811061058a57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350806105ab816113d5565b91505061052f565b50508051602090910120925050505b9392505050565b6000806105d7836020611354565b90506105e4816020611317565b6107a0101561062b5760405162461bcd60e51b8152602060048201526013602482015272696e646578206f7574206f6620626f756e647360681b60448201526064016101a4565b600080604051806107c001604052806107a081526020016114566107a091399290920160200151949350505050565b600060038260ff1610156106b05760405162461bcd60e51b815260206004820152601760248201527f4d757374206265206174206c65617374206120776f726400000000000000000060448201526064016101a4565b60408260ff1611156106d45760405162461bcd60e51b81526004016101a4906112a7565b826106f6576106ef6106e76003846113b2565b60ff166105c9565b90506105c2565b60006107036003846113b2565b60ff166001901b905084849050600382901b10156107635760405162461bcd60e51b815260206004820152601960248201527f6461746120697320626967676572207468616e2064726976650000000000000060448201526064016101a4565b6040516306c8e54b60e01b8152600385901c600482015260009073__$8b7ebe2a69e01741840a6648963dfd5409$__906306c8e54b9060240160206040518083038186803b1580156107b457600080fd5b505af41580156107c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ec919061127b565b6107f790600261132f565b60ff1690506000816001600160401b0381111561082457634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561084d578160200160208202803683370190505b5090506000806000805b86841015610a9157600384901b8a11156108b6576108768b8b86610460565b85848151811061089657634e487b7160e01b600052603260045260246000fd5b6020908102919091010152836108ab816113d5565b945050839150610984565b60405163052dcf5f60e31b81526004810185905273__$8b7ebe2a69e01741840a6648963dfd5409$__9063296e7af89060240160206040518083038186803b15801561090157600080fd5b505af4158015610915573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061093991906110fd565b9050610944816105c9565b85848151811061096457634e487b7160e01b600052603260045260246000fd5b602090810291909101015261097c6001821b85611317565b935083811c91505b8261098e816113d5565b9350505b60018216610a8c576000856109a8600186611373565b815181106109c657634e487b7160e01b600052603260045260246000fd5b602002602001015190506000866002866109e09190611373565b815181106109fe57634e487b7160e01b600052603260045260246000fd5b602002602001015190508082604051602001610a24929190918252602082015260400190565b6040516020818303038152906040528051906020012087600287610a489190611373565b81518110610a6657634e487b7160e01b600052603260045260246000fd5b6020908102919091010152610a7c600186611373565b9450600184901c93505050610992565b610857565b82600114610afc5760405162461bcd60e51b815260206004820152603260248201527f66756e6374696f6e20656e6465642062757420737461636b20686173206d6f7260448201527119481d1a185b881bdb9948195b195b595b9d60721b60648201526084016101a4565b84600081518110610b1d57634e487b7160e01b600052603260045260246000fd5b60200260200101519750505050505050509392505050565b805160405163d82ae4b160e01b815260009173__$8b7ebe2a69e01741840a6648963dfd5409$__9163d82ae4b191610b739160040190815260200190565b60206040518083038186803b158015610b8b57600080fd5b505af4158015610b9f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc39190611028565b610c285760405162461bcd60e51b815260206004820152603060248201527f54686520696e707574206172726179206d75737420636f6e7461696e20706f7760448201526f6572206f66203220656c656d656e747360801b60648201526084016101a4565b815160011415610c625781600081518110610c5357634e487b7160e01b600052603260045260246000fd5b60200260200101519050919050565b600060018351901c6001600160401b03811115610c8f57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610cb8578160200160208202803683370190505b50905060005b8351811015610d9457838181518110610ce757634e487b7160e01b600052603260045260246000fd5b602002602001015184826001610cfd9190611317565b81518110610d1b57634e487b7160e01b600052603260045260246000fd5b6020026020010151604051602001610d3d929190918252602082015260400190565b6040516020818303038152906040528051906020012082600183901c81518110610d7757634e487b7160e01b600052603260045260246000fd5b6020908102919091010152610d8d600282611317565b9050610cbe565b506105c281610b35565b919050565b6040516001600160c01b0319831660208201526000908190602801604051602081830303815290604052805190602001209050610de585600360408487610141565b95945050505050565b600060038260ff161015610e445760405162461bcd60e51b815260206004820152601b60248201527f48617320746f206265206174206c65617374206f6e6520776f7264000000000060448201526064016101a4565b60408260ff161115610e685760405162461bcd60e51b81526004016101a4906112a7565b60408051600060208083018290528351600881850301815260289093019093528151919092012060035b8460ff16811015610edc5760408051602081018490529081018390526060016040516020818303038152906040528051906020012091508080610ed4906113d5565b915050610e92565b509392505050565b6000610de5858560408686610141565b600082601f830112610f04578081fd5b813560206001600160401b0380831115610f2057610f2061142d565b8260051b604051601f19603f83011681018181108482111715610f4557610f4561142d565b60405284815283810192508684018288018501891015610f63578687fd5b8692505b85831015610f85578035845292840192600192909201918401610f67565b50979650505050505050565b60008083601f840112610fa2578182fd5b5081356001600160401b03811115610fb8578182fd5b602083019150836020828501011115610fd057600080fd5b9250929050565b80356001600160401b0381168114610d9e57600080fd5b600060208284031215610fff578081fd5b81356001600160401b03811115611014578182fd5b61102084828501610ef4565b949350505050565b600060208284031215611039578081fd5b815180151581146105c2578182fd5b60008060006040848603121561105c578182fd5b83356001600160401b03811115611071578283fd5b61107d86828701610f91565b909790965060209590950135949350505050565b6000806000604084860312156110a5578283fd5b83356001600160401b038111156110ba578384fd5b6110c686828701610f91565b90945092505060208401356110da81611443565b809150509250925092565b6000602082840312156110f6578081fd5b5035919050565b60006020828403121561110e578081fd5b5051919050565b600080600060608486031215611129578283fd5b61113284610fd7565b925060208401356001600160c01b03198116811461114e578283fd5b915060408401356001600160401b03811115611168578182fd5b61117486828701610ef4565b9150509250925092565b60008060008060808587031215611193578081fd5b61119c85610fd7565b935060208501356111ac81611443565b92506040850135915060608501356001600160401b038111156111cd578182fd5b6111d987828801610ef4565b91505092959194509250565b600080600080600060a086880312156111fc578081fd5b61120586610fd7565b9450602086013561121581611443565b9350604086013561122581611443565b92506060860135915060808601356001600160401b03811115611246578182fd5b61125288828901610ef4565b9150509295509295909350565b600060208284031215611270578081fd5b81356105c281611443565b60006020828403121561128c578081fd5b81516105c281611443565b8183823760009101908152919050565b60208082526028908201527f43616e6e6f7420626520626967676572207468616e20746865206d616368696e604082015267329034ba39b2b63360c11b606082015260800190565b600080858511156112fe578182fd5b8386111561130a578182fd5b5050820193919092039150565b6000821982111561132a5761132a611417565b500190565b600060ff821660ff84168060ff0382111561134c5761134c611417565b019392505050565b600081600019048311821515161561136e5761136e611417565b500290565b60008282101561138557611385611417565b500390565b60006001600160401b03838116908316818110156113aa576113aa611417565b039392505050565b600060ff821660ff8416808210156113cc576113cc611417565b90039392505050565b60006000198214156113e9576113e9611417565b5060010190565b60006001600160401b038083168181141561140d5761140d611417565b6001019392505050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b60ff8116811461145257600080fd5b5056fe011b4d03dd8c01f1049143cf9c4c817e4b167f1d1b83e5c6f0f10d89ba1e7bce4d9470a821fbe90117ec357e30bad9305732fb19ddf54a07dd3e29f440619254ae39ce8537aca75e2eff3e38c98011dfe934e700a0967732fc07b430dd656a233fc9a15f5b4869c872f81087bb6104b7d63e6f9ab47f2c43f3535eae7172aa7f17d2dd614cddaa4d879276b11e0672c9560033d3e8453a1d045339d34ba601b9c37b8b13ca95166fb7af16988a70fcc90f38bf9126fd833da710a47fb37a55e68e7a427fa943d9966b389f4f257173676090c6e95f43e2cb6d65f8758111e30930b0b9deb73e155c59740bacf14a6ff04b64bb8e201a506409c3fe381ca4ea90cd5deac729d0fdaccc441d09d7325f41586ba13c801b7eccae0f95d8f3933efed8b96e5b7f6f459e9cb6a2f41bf276c7b85c10cd4662c04cbbb365434726c0a0c9695393027fb106a8153109ac516288a88b28a93817899460d6310b71cf1e6163e8806fa0d4b197a259e8c3ac28864268159d0ac85f8581ca28fa7d2c0c03eb91e3eee5ca7a3da2b3053c9770db73599fb149f620e3facef95e947c0ee860b72122e31e4bbd2b7c783d79cc30f60c6238651da7f0726f767d22747264fdb046f7549f26cc70ed5e18baeb6c81bb0625cb95bb4019aeecd40774ee87ae29ec517a71f6ee264c5d761379b3d7d617ca83677374b49d10aec50505ac087408ca892b573c267a712a52e1d06421fe276a03efb1889f337201110fdc32a81f8e152499af665835aabfdc6740c7e2c3791a31c3cdc9f5ab962f681b12fc092816a62f27d86025599a41233848702f0cfc0437b445682df51147a632a0a083d2d38b5e13e466a8935afff58bb533b3ef5d27fba63ee6b0fd9e67ff20af9d50deee3f8bf065ec220c1fd4ba57e341261d55997f85d66d32152526736872693d2b437a233e2337b715f6ac9a6a272622fdc2d67fcfe1da3459f8dab4ed7e40a657a54c36766c5e8ac9a88b35b05c34747e6507f6b044ab66180dc76ac1a696de03189593fedc0d0dbbd855c8ead673544899b0960e4a5a7ca43b4ef90afe607de7698caefdc242788f654b57a4fb32a71b335ef6ff9a4cc118b282b53bdd6d6192b7a82c3c5126b9c7e33c8e5a5ac9738b8bd31247fb7402054f97b573e8abb9faad219f4fd085aceaa7f542d787ee4196d365f3cc566e7bbcfbfd451230c48d804c017d21e2d8fa914e2559bb72bf0ab78c8ab92f00ef0d0d576eccdd486b64138a4172674857e543d1d5b639058dd908186597e366ad5f3d9c7ceaff44d04d1550b8d33abc751df07437834ba5acb32328a396994aebb3c40f759c2d6d7a3cb5377e55d5d218ef5a296dda8ddc355f3f50c3d0b660a51dfa4d98a6a5a33564556cf83c1373a814641d6a1dcef97b883fee61bb84fe60a3409340217e629cc7e4dcc93b85d8820921ff5826148b60e6939acd7838e1d7f20562bff8ee4b5ec4a05ad997a57b9796fdcb2eda87883c2640b072b140b946bfdf6575cacc066fdae04f6951e63624cbd316a677cad529bbe4e97b9144e4bc06c4afd1de55dd3e1175f90423847a230d34dfb71ed56f2965a7f6c72e6aa33c24c303fd67745d632656c5ef90bec80f4f5d1daa251988826cef375c81c36bf457e09687056f924677cb0bccf98dff81e014ce25f2d132497923e267363963cdf4302c5049d63131dc03fd95f65d8b6aa5934f817252c028c90f56d413b9d5d10d89790707dae2fabb249f649929927c21dd71e3f656826de5451c5da375aadecbd59d5ebf3a31fae65ac1b316a1611f1b276b26530f58d7247df459ce1f86db1d734f6f811932f042cee45d0e455306d01081bc3384f82c5fb2aacaa19d89cdfa46cc916eac61121475ba2e6191b4feecbe1789717021a158ace5d06744b40f551076b67cd63af60007f8c99876e1424883a45ec49d497ddaf808a5521ca74a999ab0b3c7aa9c80f85e93977ec61ce68b20307a1a81f71ca645b568fcd319ccbb5f651e87b707d37c39e15f945ea69e2f7c7d2ccc85b7e654c07e96f0636ae4044fe0e38590b431795ad0f8647bdd613713ada493cc17efd313206380e6a685b8198475bbd021c6e9d94daab2214947127506073e44d5408ba166c512a0b86805d07f5a44d3c41706be2bc15e712e55805248b92e8677d90f6d284d1d6ffaff2c430657042a0e82624fa3717b06cc0a6fd12230ea586dae83019fb9e06034ed2803c98d554b93c9a52348cafff75c40174a91f9ae6b8647854a156029f0b88b83316663ce574a4978277bb6bb27a31085634b6ec78864b6d8201c7e93903d75815067e378289a3d072ae172dafa6a452470f8d645bebfad9779594fc0784bb764a22e3a8181d93db7bf97893c414217a618ccb14caa9e92e8c61673afc9583662e812adba1f87a9c68202d60e909efab43c42c0cb00695fc7f1ffe67c75ca894c3c51e1e5e731360199e600f6ced9a87b2a6a87e70bf251bb5075ab222138288164b2eda727515ea7de12e2496d4fe42ea8d1a120c03cf9c50622c2afe4acb0dad98fd62d07ab4e828a94495f6d1ab973982c7ccbe6c1fae02788e4422ae22282fa49cbdb04ba54a7a238c6fc41187451383460762c06d1c8a72b9cd718866ad4b689e10c9a8c38fe5ef045bd785b01e980fc82c7e3532ce81876b778dd9f1ceeba4478e86411fb6fdd790683916ca832592485093644e8760cd7b4c01dba1ccc82b661bf13f0e3f34acd6b88a2646970667358221220813b9a38cd5e0772b16f859d9a66ce6200c68281ffac8c91413c40f7bf8e5d8c64736f6c63430008040033", + "libraries": { + "CartesiMath": "0x598b68c8234F201aC984Bd33D7678D2E3aC8f179" + }, + "devdoc": { + "kind": "dev", + "methods": { + "calculateRootFromPowerOfTwo(bytes32[])": { + "params": { + "hashes": "The array containing power of 2 elements" + }, + "returns": { + "_0": "byte32 the root hash being calculated" + } + }, + "getEmptyTreeHashAtIndex(uint256)": { + "details": "first index is keccak(0), second index is keccak(keccak(0), keccak(0))", + "params": { + "_index": "of hash wanted" + } + }, + "getHashOfWordAtIndex(bytes,uint256)": { + "details": "if word is incomplete (< 8 bytes) it gets padded with zeroes", + "params": { + "_data": "array of bytes", + "_wordIndex": "index of word inside the bytes to get the hash of" + } + }, + "getMerkleRootFromBytes(bytes,uint8)": { + "details": "_data is padded with zeroes until is multiple of 8root is completed with zero tree until log2size is completehashes are taken word by word (8 bytes by 8 bytes)", + "params": { + "_data": "array of bytes to be merklelized", + "_log2Size": "log2 of total size of the drive" + } + }, + "getPristineHash(uint8)": { + "details": "using the precomputed EMPTY_TREE_HASHES is cheaper", + "params": { + "_log2Size": "log2 of size of the empty drive" + }, + "returns": { + "_0": "merkle root hash of the drive of size 1 << log2Size filled with zeros" + } + }, + "getRoot(uint64,bytes8,bytes32[])": { + "params": { + "_position": "position of word in drive", + "_value": "word to include in drive", + "proof": "array of siblings to generate merkle root" + }, + "returns": { + "_0": "new merkle root hash after _value inclusion" + } + }, + "getRootAfterReplacementInDrive(uint64,uint8,uint8,bytes32,bytes32[])": { + "params": { + "_logSizeOfFullDrive": "log2 of size the full drive, which can be the entire machine", + "_logSizeOfReplacement": "log2 of size the replacement", + "_position": "position of _drive", + "_replacement": "hash of the replacement", + "siblings": "of replacement that merkle root can be calculated" + } + }, + "getRootWithDrive(uint64,uint8,bytes32,bytes32[])": { + "params": { + "_drive": "drive to be included", + "_logOfSize": "log2 of size of _drive", + "_position": "position of _drive", + "siblings": "_drive's so that merkle root can be calculated" + } + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "calculateRootFromPowerOfTwo(bytes32[])": { + "notice": "Calculate the root of Merkle tree from an array of power of 2 elements" + }, + "getEmptyTreeHashAtIndex(uint256)": { + "notice": "Gets precomputed hash of zero in empty tree hashes" + }, + "getHashOfWordAtIndex(bytes,uint256)": { + "notice": "Get the hash of a word in an array of bytes" + }, + "getMerkleRootFromBytes(bytes,uint8)": { + "notice": "get merkle root of generic array of bytes" + }, + "getPristineHash(uint8)": { + "notice": "Gets the pristine hash of a drive full of zeroes" + }, + "getRoot(uint64,bytes8,bytes32[])": { + "notice": "Gets merkle root of drive with _value on _position" + }, + "getRootAfterReplacementInDrive(uint64,uint8,uint8,bytes32,bytes32[])": { + "notice": "Gets merkle root hash of drive with a replacement" + }, + "getRootWithDrive(uint64,uint8,bytes32,bytes32[])": { + "notice": "Gets merkle root hash of machine with drive _drive" + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/deployments/ropsten/WorkerAuthManagerImpl.json b/deployments/ropsten/WorkerAuthManagerImpl.json new file mode 100644 index 0000000..b08d8b9 --- /dev/null +++ b/deployments/ropsten/WorkerAuthManagerImpl.json @@ -0,0 +1,255 @@ +{ + "address": "0x82a2fac7211cE5b0D44B7BC63C09716e1c4fF3D6", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_workerManager", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "worker", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "dapp", + "type": "address" + } + ], + "name": "Authorization", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "worker", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "dapp", + "type": "address" + } + ], + "name": "Deauthorization", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_workerAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "_dappAddress", + "type": "address" + } + ], + "name": "authorize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_workerAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "_dappAddress", + "type": "address" + } + ], + "name": "deauthorize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_workerAddress", + "type": "address" + } + ], + "name": "getOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_workerAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "_dappAddress", + "type": "address" + } + ], + "name": "isAuthorized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0x8a1e58d2acd11dc8b70c12e684b404601b91f3d780e2c9854c7c5f2ab9defa69", + "receipt": { + "to": null, + "from": "0x18930e8a66a1DbE21D00581216789AAB7460Afd0", + "contractAddress": "0x82a2fac7211cE5b0D44B7BC63C09716e1c4fF3D6", + "transactionIndex": 23, + "gasUsed": "425379", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xa8fb24926de43f9e388b671bcfd94c67e88aebd9b17abd1f0284d3f9edfce1e9", + "transactionHash": "0x8a1e58d2acd11dc8b70c12e684b404601b91f3d780e2c9854c7c5f2ab9defa69", + "logs": [], + "blockNumber": 10530864, + "cumulativeGasUsed": "5655817", + "status": 1, + "byzantium": true + }, + "args": [ + "0x381e64Cb649A98E2B2FBb440E528A44D21B5B9c0" + ], + "solcInputHash": "30c2f6f98bb0d009fa19f91b4a6473d4", + "metadata": "{\"compiler\":{\"version\":\"0.8.4+commit.c7e474f2\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_workerManager\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"worker\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dapp\",\"type\":\"address\"}],\"name\":\"Authorization\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"worker\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dapp\",\"type\":\"address\"}],\"name\":\"Deauthorization\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_workerAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_dappAddress\",\"type\":\"address\"}],\"name\":\"authorize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_workerAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_dappAddress\",\"type\":\"address\"}],\"name\":\"deauthorize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_workerAddress\",\"type\":\"address\"}],\"name\":\"getOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_workerAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_dappAddress\",\"type\":\"address\"}],\"name\":\"isAuthorized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"authorize(address,address)\":{\"params\":{\"_dappAddress\":\"address of the dapp that permission will be given to\",\"_workerAddress\":\"address of the worker node to given permission\"}},\"isAuthorized(address,address)\":{\"params\":{\"_dappAddress\":\"address of the DApp\",\"_workerAddress\":\"address of the worker\"}}},\"stateVariables\":{\"permissions\":{\"details\":\"permissions keyed by hash(user, worker, dapp)\"}},\"version\":1},\"userdoc\":{\"events\":{\"Authorization(address,address,address)\":{\"notice\":\"A DApp has been authorized by a user for a worker\"},\"Deauthorization(address,address,address)\":{\"notice\":\"A DApp has been deauthorized by a user for a worker\"}},\"kind\":\"user\",\"methods\":{\"authorize(address,address)\":{\"notice\":\"Gives worker permission to act on a DApp\"},\"isAuthorized(address,address)\":{\"notice\":\"Returns is the dapp is authorized to be called by that worker\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/WorkerAuthManagerImpl.sol\":\"WorkerAuthManagerImpl\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/WorkerAuthManager.sol\":{\"content\":\"// Copyright 2020 Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\n/// @title WorkerAuthManager\\n/// @author Danilo Tuler\\npragma solidity >=0.7.0;\\n\\ninterface WorkerAuthManager {\\n /// @notice Gives worker permission to act on a DApp\\n /// @param _workerAddress address of the worker node to given permission\\n /// @param _dappAddress address of the dapp that permission will be given to\\n function authorize(address _workerAddress, address _dappAddress) external;\\n\\n /// @notice Removes worker's permission to act on a DApp\\n /// @param _workerAddress address of the proxy that will lose permission\\n /// @param _dappAddresses addresses of dapps that will lose permission\\n function deauthorize(address _workerAddress, address _dappAddresses)\\n external;\\n\\n /// @notice Returns is the dapp is authorized to be called by that worker\\n /// @param _workerAddress address of the worker\\n /// @param _dappAddress address of the DApp\\n function isAuthorized(address _workerAddress, address _dappAddress)\\n external\\n view\\n returns (bool);\\n\\n /// @notice Get the owner of the worker node\\n /// @param workerAddress address of the worker node\\n function getOwner(address workerAddress) external view returns (address);\\n\\n /// @notice A DApp has been authorized by a user for a worker\\n event Authorization(\\n address indexed user,\\n address indexed worker,\\n address indexed dapp\\n );\\n\\n /// @notice A DApp has been deauthorized by a user for a worker\\n event Deauthorization(\\n address indexed user,\\n address indexed worker,\\n address indexed dapp\\n );\\n}\\n\",\"keccak256\":\"0xb69b2fc75aae609d5a4098b77fb8f48dc87ff8073a8a3b70c0261af5f62f36db\",\"license\":\"Apache-2.0\"},\"contracts/WorkerAuthManagerImpl.sol\":{\"content\":\"// Copyright 2020 Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\n/// @title WorkerAuthManagerImpl\\n/// @author Danilo Tuler\\npragma solidity ^0.8.0;\\n\\nimport \\\"./WorkerManager.sol\\\";\\nimport \\\"./WorkerAuthManager.sol\\\";\\n\\ncontract WorkerAuthManagerImpl is WorkerAuthManager {\\n WorkerManager workerManager;\\n\\n /// @dev permissions keyed by hash(user, worker, dapp)\\n mapping(bytes32 => bool) private permissions;\\n\\n constructor(address _workerManager) {\\n workerManager = WorkerManager(_workerManager);\\n }\\n\\n modifier onlyByOwner(address _workerAddress) {\\n require(\\n workerManager.getOwner(_workerAddress) == msg.sender,\\n \\\"worker not hired by sender\\\"\\n );\\n _;\\n }\\n\\n function getAuthorizationKey(\\n address _user,\\n address _worker,\\n address _dapp\\n ) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(_user, _worker, _dapp));\\n }\\n\\n function authorize(address _workerAddress, address _dappAddress)\\n public\\n override\\n onlyByOwner(_workerAddress)\\n {\\n bytes32 key = getAuthorizationKey(\\n msg.sender,\\n _workerAddress,\\n _dappAddress\\n );\\n require(permissions[key] == false, \\\"dapp already authorized\\\");\\n\\n // record authorization from that user\\n permissions[key] = true;\\n\\n // emit event\\n emit Authorization(msg.sender, _workerAddress, _dappAddress);\\n }\\n\\n function deauthorize(address _workerAddress, address _dappAddress)\\n public\\n override\\n onlyByOwner(_workerAddress)\\n {\\n bytes32 key = getAuthorizationKey(\\n msg.sender,\\n _workerAddress,\\n _dappAddress\\n );\\n require(permissions[key] == true, \\\"dapp not authorized\\\");\\n\\n // record deauthorization from that user\\n permissions[key] = false;\\n\\n // emit event\\n emit Deauthorization(msg.sender, _workerAddress, _dappAddress);\\n }\\n\\n function isAuthorized(address _workerAddress, address _dappAddress)\\n public\\n override\\n view\\n returns (bool)\\n {\\n return\\n permissions[getAuthorizationKey(\\n workerManager.getOwner(_workerAddress),\\n _workerAddress,\\n _dappAddress\\n )];\\n }\\n\\n function getOwner(address _workerAddress)\\n public\\n override\\n view\\n returns (address)\\n {\\n return workerManager.getOwner(_workerAddress);\\n }\\n\\n /*\\n // XXX: we can't do this because the worker need to accept the job before receiving an authorization\\n function hireAndAuthorize(\\n address payable _workerAddress,\\n address _dappAddress\\n ) public override payable {\\n workerManager.hire(_workerAddress);\\n authorize(_workerAddress, _dappAddress);\\n }\\n */\\n}\\n\",\"keccak256\":\"0x3c97f9e58f8190f0a081cf753c47dec51806ec4994ed66608e73522086ae0785\",\"license\":\"Apache-2.0\"},\"contracts/WorkerManager.sol\":{\"content\":\"// Copyright 2010 Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\n/// @title WorkerManager\\n/// @author Danilo Tuler\\npragma solidity >=0.7.0;\\n\\ninterface WorkerManager {\\n /// @notice Returns true if worker node is available\\n /// @param workerAddress address of the worker node\\n function isAvailable(address workerAddress) external view returns (bool);\\n\\n /// @notice Returns true if worker node is pending\\n /// @param workerAddress address of the worker node\\n function isPending(address workerAddress) external view returns (bool);\\n\\n /// @notice Get the owner of the worker node\\n /// @param workerAddress address of the worker node\\n function getOwner(address workerAddress) external view returns (address);\\n\\n /// @notice Get the user of the worker node, which may not be the owner yet, or how was the previous owner of a retired node\\n function getUser(address workerAddress) external view returns (address);\\n\\n /// @notice Returns true if worker node is owned by some user\\n function isOwned(address workerAddress) external view returns (bool);\\n\\n /// @notice Asks the worker to work for the sender. Sender needs to pay something.\\n /// @param workerAddress address of the worker\\n function hire(address payable workerAddress) external payable;\\n\\n /// @notice Called by the worker to accept the job\\n function acceptJob() external;\\n\\n /// @notice Called by the worker to reject a job offer\\n function rejectJob() external payable;\\n\\n /// @notice Called by the user to cancel a job offer\\n /// @param workerAddress address of the worker node\\n function cancelHire(address workerAddress) external;\\n\\n /// @notice Called by the user to retire his worker.\\n /// @param workerAddress address of the worker to be retired\\n /// @dev this also removes all authorizations in place\\n function retire(address payable workerAddress) external;\\n\\n /// @notice Returns true if worker node was retired by its owner\\n function isRetired(address workerAddress) external view returns (bool);\\n\\n /// @notice Events signalling every state transition\\n event JobOffer(address indexed worker, address indexed user);\\n event JobAccepted(address indexed worker, address indexed user);\\n event JobRejected(address indexed worker, address indexed user);\\n event Retired(address indexed worker, address indexed user);\\n}\\n\",\"keccak256\":\"0xb93bac1de98b3fb44421c2498f11bcd246795c7cffeeebb535a046e88c303410\",\"license\":\"Apache-2.0\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516106dc3803806106dc83398101604081905261002f91610054565b600080546001600160a01b0319166001600160a01b0392909216919091179055610082565b600060208284031215610065578081fd5b81516001600160a01b038116811461007b578182fd5b9392505050565b61064b806100916000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80632bef45951461005157806365e4ad9e146100665780636d892f7e1461008e578063fa544161146100a1575b600080fd5b61006461005f3660046105c5565b6100cc565b005b6100796100743660046105c5565b61026f565b60405190151581526020015b60405180910390f35b61006461009c3660046105c5565b610318565b6100b46100af366004610586565b6104ad565b6040516001600160a01b039091168152602001610085565b60005460405163fa54416160e01b81526001600160a01b0380851660048301528492339291169063fa5441619060240160206040518083038186803b15801561011457600080fd5b505afa158015610128573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061014c91906105a9565b6001600160a01b0316146101a75760405162461bcd60e51b815260206004820152601a60248201527f776f726b6572206e6f742068697265642062792073656e64657200000000000060448201526064015b60405180910390fd5b60006101b4338585610531565b60008181526001602052604090205490915060ff16156102165760405162461bcd60e51b815260206004820152601760248201527f6461707020616c726561647920617574686f72697a6564000000000000000000604482015260640161019e565b6000818152600160208190526040808320805460ff1916909217909155516001600160a01b03808616929087169133917fde756a416a233cdb16c23a1fa5dcb3113164968df8607e0a4eeca25974b96e0391a450505050565b6000805460405163fa54416160e01b81526001600160a01b03858116600483015260019284926102fd929091169063fa5441619060240160206040518083038186803b1580156102be57600080fd5b505afa1580156102d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102f691906105a9565b8686610531565b815260208101919091526040016000205460ff169392505050565b60005460405163fa54416160e01b81526001600160a01b0380851660048301528492339291169063fa5441619060240160206040518083038186803b15801561036057600080fd5b505afa158015610374573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061039891906105a9565b6001600160a01b0316146103ee5760405162461bcd60e51b815260206004820152601a60248201527f776f726b6572206e6f742068697265642062792073656e646572000000000000604482015260640161019e565b60006103fb338585610531565b60008181526001602081905260409091205491925060ff90911615151461045a5760405162461bcd60e51b815260206004820152601360248201527219185c1c081b9bdd08185d5d1a1bdc9a5e9959606a1b604482015260640161019e565b600081815260016020526040808220805460ff19169055516001600160a01b03808616929087169133917f4d2275ddb8a6d9c36c95476c2eaf9746c1785b4ab76a99719fd647b36da46cee91a450505050565b6000805460405163fa54416160e01b81526001600160a01b0384811660048301529091169063fa5441619060240160206040518083038186803b1580156104f357600080fd5b505afa158015610507573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061052b91906105a9565b92915050565b6040516bffffffffffffffffffffffff19606085811b8216602084015284811b8216603484015283901b166048820152600090605c016040516020818303038152906040528051906020012090509392505050565b600060208284031215610597578081fd5b81356105a2816105fd565b9392505050565b6000602082840312156105ba578081fd5b81516105a2816105fd565b600080604083850312156105d7578081fd5b82356105e2816105fd565b915060208301356105f2816105fd565b809150509250929050565b6001600160a01b038116811461061257600080fd5b5056fea2646970667358221220b1862e5175b3b9a9fc5da21d120da98326517836ca159b01590210084513622d64736f6c63430008040033", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80632bef45951461005157806365e4ad9e146100665780636d892f7e1461008e578063fa544161146100a1575b600080fd5b61006461005f3660046105c5565b6100cc565b005b6100796100743660046105c5565b61026f565b60405190151581526020015b60405180910390f35b61006461009c3660046105c5565b610318565b6100b46100af366004610586565b6104ad565b6040516001600160a01b039091168152602001610085565b60005460405163fa54416160e01b81526001600160a01b0380851660048301528492339291169063fa5441619060240160206040518083038186803b15801561011457600080fd5b505afa158015610128573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061014c91906105a9565b6001600160a01b0316146101a75760405162461bcd60e51b815260206004820152601a60248201527f776f726b6572206e6f742068697265642062792073656e64657200000000000060448201526064015b60405180910390fd5b60006101b4338585610531565b60008181526001602052604090205490915060ff16156102165760405162461bcd60e51b815260206004820152601760248201527f6461707020616c726561647920617574686f72697a6564000000000000000000604482015260640161019e565b6000818152600160208190526040808320805460ff1916909217909155516001600160a01b03808616929087169133917fde756a416a233cdb16c23a1fa5dcb3113164968df8607e0a4eeca25974b96e0391a450505050565b6000805460405163fa54416160e01b81526001600160a01b03858116600483015260019284926102fd929091169063fa5441619060240160206040518083038186803b1580156102be57600080fd5b505afa1580156102d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102f691906105a9565b8686610531565b815260208101919091526040016000205460ff169392505050565b60005460405163fa54416160e01b81526001600160a01b0380851660048301528492339291169063fa5441619060240160206040518083038186803b15801561036057600080fd5b505afa158015610374573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061039891906105a9565b6001600160a01b0316146103ee5760405162461bcd60e51b815260206004820152601a60248201527f776f726b6572206e6f742068697265642062792073656e646572000000000000604482015260640161019e565b60006103fb338585610531565b60008181526001602081905260409091205491925060ff90911615151461045a5760405162461bcd60e51b815260206004820152601360248201527219185c1c081b9bdd08185d5d1a1bdc9a5e9959606a1b604482015260640161019e565b600081815260016020526040808220805460ff19169055516001600160a01b03808616929087169133917f4d2275ddb8a6d9c36c95476c2eaf9746c1785b4ab76a99719fd647b36da46cee91a450505050565b6000805460405163fa54416160e01b81526001600160a01b0384811660048301529091169063fa5441619060240160206040518083038186803b1580156104f357600080fd5b505afa158015610507573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061052b91906105a9565b92915050565b6040516bffffffffffffffffffffffff19606085811b8216602084015284811b8216603484015283901b166048820152600090605c016040516020818303038152906040528051906020012090509392505050565b600060208284031215610597578081fd5b81356105a2816105fd565b9392505050565b6000602082840312156105ba578081fd5b81516105a2816105fd565b600080604083850312156105d7578081fd5b82356105e2816105fd565b915060208301356105f2816105fd565b809150509250929050565b6001600160a01b038116811461061257600080fd5b5056fea2646970667358221220b1862e5175b3b9a9fc5da21d120da98326517836ca159b01590210084513622d64736f6c63430008040033", + "devdoc": { + "kind": "dev", + "methods": { + "authorize(address,address)": { + "params": { + "_dappAddress": "address of the dapp that permission will be given to", + "_workerAddress": "address of the worker node to given permission" + } + }, + "isAuthorized(address,address)": { + "params": { + "_dappAddress": "address of the DApp", + "_workerAddress": "address of the worker" + } + } + }, + "stateVariables": { + "permissions": { + "details": "permissions keyed by hash(user, worker, dapp)" + } + }, + "version": 1 + }, + "userdoc": { + "events": { + "Authorization(address,address,address)": { + "notice": "A DApp has been authorized by a user for a worker" + }, + "Deauthorization(address,address,address)": { + "notice": "A DApp has been deauthorized by a user for a worker" + } + }, + "kind": "user", + "methods": { + "authorize(address,address)": { + "notice": "Gives worker permission to act on a DApp" + }, + "isAuthorized(address,address)": { + "notice": "Returns is the dapp is authorized to be called by that worker" + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 63, + "contract": "contracts/WorkerAuthManagerImpl.sol:WorkerAuthManagerImpl", + "label": "workerManager", + "offset": 0, + "slot": "0", + "type": "t_contract(WorkerManager)343" + }, + { + "astId": 68, + "contract": "contracts/WorkerAuthManagerImpl.sol:WorkerAuthManagerImpl", + "label": "permissions", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes32,t_bool)" + } + ], + "types": { + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(WorkerManager)343": { + "encoding": "inplace", + "label": "contract WorkerManager", + "numberOfBytes": "20" + }, + "t_mapping(t_bytes32,t_bool)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => bool)", + "numberOfBytes": "32", + "value": "t_bool" + } + } + } +} \ No newline at end of file diff --git a/deployments/ropsten/WorkerManagerAuthManagerImpl.json b/deployments/ropsten/WorkerManagerAuthManagerImpl.json new file mode 100644 index 0000000..91ed231 --- /dev/null +++ b/deployments/ropsten/WorkerManagerAuthManagerImpl.json @@ -0,0 +1,553 @@ +{ + "address": "0xFCf6ED0062c5Df801784c58503F893591466329D", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "worker", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "dapp", + "type": "address" + } + ], + "name": "Authorization", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "worker", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "dapp", + "type": "address" + } + ], + "name": "Deauthorization", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "worker", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "JobAccepted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "worker", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "JobOffer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "worker", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "JobRejected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "worker", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "Retired", + "type": "event" + }, + { + "inputs": [], + "name": "acceptJob", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_workerAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "_dappAddress", + "type": "address" + } + ], + "name": "authorize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_workerAddress", + "type": "address" + } + ], + "name": "cancelHire", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_workerAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "_dappAddress", + "type": "address" + } + ], + "name": "deauthorize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_workerAddress", + "type": "address" + } + ], + "name": "getOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_workerAddress", + "type": "address" + } + ], + "name": "getUser", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_workerAddress", + "type": "address" + } + ], + "name": "hire", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_workerAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "_dappAddress", + "type": "address" + } + ], + "name": "hireAndAuthorize", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_workerAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "_dappAddress", + "type": "address" + } + ], + "name": "isAuthorized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "workerAddress", + "type": "address" + } + ], + "name": "isAvailable", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_workerAddress", + "type": "address" + } + ], + "name": "isOwned", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "workerAddress", + "type": "address" + } + ], + "name": "isPending", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_workerAddress", + "type": "address" + } + ], + "name": "isRetired", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rejectJob", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_workerAddress", + "type": "address" + } + ], + "name": "retire", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x4ff5247ef22242530e39dd83725f828657868c54a74f59757c30c3aee2d1a0af", + "receipt": { + "to": null, + "from": "0x18930e8a66a1DbE21D00581216789AAB7460Afd0", + "contractAddress": "0xFCf6ED0062c5Df801784c58503F893591466329D", + "transactionIndex": 4, + "gasUsed": "790079", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xcd6c3112f7d6025ec2c61257d6ffc9b1998047260b7c3fc06b96d670c33cc9e3", + "transactionHash": "0x4ff5247ef22242530e39dd83725f828657868c54a74f59757c30c3aee2d1a0af", + "logs": [], + "blockNumber": 10530865, + "cumulativeGasUsed": "972354", + "status": 1, + "byzantium": true + }, + "args": [], + "solcInputHash": "30c2f6f98bb0d009fa19f91b4a6473d4", + "metadata": "{\"compiler\":{\"version\":\"0.8.4+commit.c7e474f2\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"worker\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dapp\",\"type\":\"address\"}],\"name\":\"Authorization\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"worker\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dapp\",\"type\":\"address\"}],\"name\":\"Deauthorization\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"worker\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"JobAccepted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"worker\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"JobOffer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"worker\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"JobRejected\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"worker\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"Retired\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptJob\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_workerAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_dappAddress\",\"type\":\"address\"}],\"name\":\"authorize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_workerAddress\",\"type\":\"address\"}],\"name\":\"cancelHire\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_workerAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_dappAddress\",\"type\":\"address\"}],\"name\":\"deauthorize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_workerAddress\",\"type\":\"address\"}],\"name\":\"getOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_workerAddress\",\"type\":\"address\"}],\"name\":\"getUser\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"_workerAddress\",\"type\":\"address\"}],\"name\":\"hire\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"_workerAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_dappAddress\",\"type\":\"address\"}],\"name\":\"hireAndAuthorize\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_workerAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_dappAddress\",\"type\":\"address\"}],\"name\":\"isAuthorized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"workerAddress\",\"type\":\"address\"}],\"name\":\"isAvailable\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_workerAddress\",\"type\":\"address\"}],\"name\":\"isOwned\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"workerAddress\",\"type\":\"address\"}],\"name\":\"isPending\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_workerAddress\",\"type\":\"address\"}],\"name\":\"isRetired\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"rejectJob\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"_workerAddress\",\"type\":\"address\"}],\"name\":\"retire\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"authorize(address,address)\":{\"params\":{\"_dappAddress\":\"address of the dapp that permission will be given to\",\"_workerAddress\":\"address of the worker node to given permission\"}},\"isAuthorized(address,address)\":{\"params\":{\"_dappAddress\":\"address of the DApp\",\"_workerAddress\":\"address of the worker\"}},\"isAvailable(address)\":{\"params\":{\"workerAddress\":\"address of the worker node\"}},\"isPending(address)\":{\"params\":{\"workerAddress\":\"address of the worker node\"}}},\"stateVariables\":{\"MAXIMUM_FUNDING\":{\"details\":\"transfers bigger than maximum value should be done directly\"},\"MINIMUM_FUNDING\":{\"details\":\"user can only hire a worker if he sends more than minimum value\"},\"permissions\":{\"details\":\"permissions keyed by hash(user, worker, dapp)\"},\"stateOf\":{\"details\":\"mapping from worker to its internal state\"},\"userOf\":{\"details\":\"mapping from worker to its user\"}},\"version\":1},\"userdoc\":{\"events\":{\"Authorization(address,address,address)\":{\"notice\":\"A DApp has been authorized by a user for a worker\"},\"Deauthorization(address,address,address)\":{\"notice\":\"A DApp has been deauthorized by a user for a worker\"},\"JobOffer(address,address)\":{\"notice\":\"Events signalling every state transition\"}},\"kind\":\"user\",\"methods\":{\"acceptJob()\":{\"notice\":\"Called by the worker to accept the job\"},\"authorize(address,address)\":{\"notice\":\"Gives worker permission to act on a DApp\"},\"isAuthorized(address,address)\":{\"notice\":\"Returns is the dapp is authorized to be called by that worker\"},\"isAvailable(address)\":{\"notice\":\"Returns true if worker node is available\"},\"isPending(address)\":{\"notice\":\"Returns true if worker node is pending\"},\"rejectJob()\":{\"notice\":\"Called by the worker to reject a job offer\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/WorkerManagerAuthManagerImpl.sol\":\"WorkerManagerAuthManagerImpl\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/WorkerAuthManager.sol\":{\"content\":\"// Copyright 2020 Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\n/// @title WorkerAuthManager\\n/// @author Danilo Tuler\\npragma solidity >=0.7.0;\\n\\ninterface WorkerAuthManager {\\n /// @notice Gives worker permission to act on a DApp\\n /// @param _workerAddress address of the worker node to given permission\\n /// @param _dappAddress address of the dapp that permission will be given to\\n function authorize(address _workerAddress, address _dappAddress) external;\\n\\n /// @notice Removes worker's permission to act on a DApp\\n /// @param _workerAddress address of the proxy that will lose permission\\n /// @param _dappAddresses addresses of dapps that will lose permission\\n function deauthorize(address _workerAddress, address _dappAddresses)\\n external;\\n\\n /// @notice Returns is the dapp is authorized to be called by that worker\\n /// @param _workerAddress address of the worker\\n /// @param _dappAddress address of the DApp\\n function isAuthorized(address _workerAddress, address _dappAddress)\\n external\\n view\\n returns (bool);\\n\\n /// @notice Get the owner of the worker node\\n /// @param workerAddress address of the worker node\\n function getOwner(address workerAddress) external view returns (address);\\n\\n /// @notice A DApp has been authorized by a user for a worker\\n event Authorization(\\n address indexed user,\\n address indexed worker,\\n address indexed dapp\\n );\\n\\n /// @notice A DApp has been deauthorized by a user for a worker\\n event Deauthorization(\\n address indexed user,\\n address indexed worker,\\n address indexed dapp\\n );\\n}\\n\",\"keccak256\":\"0xb69b2fc75aae609d5a4098b77fb8f48dc87ff8073a8a3b70c0261af5f62f36db\",\"license\":\"Apache-2.0\"},\"contracts/WorkerManager.sol\":{\"content\":\"// Copyright 2010 Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\n/// @title WorkerManager\\n/// @author Danilo Tuler\\npragma solidity >=0.7.0;\\n\\ninterface WorkerManager {\\n /// @notice Returns true if worker node is available\\n /// @param workerAddress address of the worker node\\n function isAvailable(address workerAddress) external view returns (bool);\\n\\n /// @notice Returns true if worker node is pending\\n /// @param workerAddress address of the worker node\\n function isPending(address workerAddress) external view returns (bool);\\n\\n /// @notice Get the owner of the worker node\\n /// @param workerAddress address of the worker node\\n function getOwner(address workerAddress) external view returns (address);\\n\\n /// @notice Get the user of the worker node, which may not be the owner yet, or how was the previous owner of a retired node\\n function getUser(address workerAddress) external view returns (address);\\n\\n /// @notice Returns true if worker node is owned by some user\\n function isOwned(address workerAddress) external view returns (bool);\\n\\n /// @notice Asks the worker to work for the sender. Sender needs to pay something.\\n /// @param workerAddress address of the worker\\n function hire(address payable workerAddress) external payable;\\n\\n /// @notice Called by the worker to accept the job\\n function acceptJob() external;\\n\\n /// @notice Called by the worker to reject a job offer\\n function rejectJob() external payable;\\n\\n /// @notice Called by the user to cancel a job offer\\n /// @param workerAddress address of the worker node\\n function cancelHire(address workerAddress) external;\\n\\n /// @notice Called by the user to retire his worker.\\n /// @param workerAddress address of the worker to be retired\\n /// @dev this also removes all authorizations in place\\n function retire(address payable workerAddress) external;\\n\\n /// @notice Returns true if worker node was retired by its owner\\n function isRetired(address workerAddress) external view returns (bool);\\n\\n /// @notice Events signalling every state transition\\n event JobOffer(address indexed worker, address indexed user);\\n event JobAccepted(address indexed worker, address indexed user);\\n event JobRejected(address indexed worker, address indexed user);\\n event Retired(address indexed worker, address indexed user);\\n}\\n\",\"keccak256\":\"0xb93bac1de98b3fb44421c2498f11bcd246795c7cffeeebb535a046e88c303410\",\"license\":\"Apache-2.0\"},\"contracts/WorkerManagerAuthManagerImpl.sol\":{\"content\":\"// Copyright 2020 Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\n/// @title WorkerManagerAuthManagerImpl\\n/// @author Danilo Tuler\\npragma solidity ^0.8.0;\\n\\nimport \\\"./WorkerManager.sol\\\";\\nimport \\\"./WorkerAuthManager.sol\\\";\\n\\ncontract WorkerManagerAuthManagerImpl is WorkerManager, WorkerAuthManager {\\n /// @dev user can only hire a worker if he sends more than minimum value\\n uint256 constant MINIMUM_FUNDING = 0.001 ether;\\n\\n /// @dev transfers bigger than maximum value should be done directly\\n uint256 constant MAXIMUM_FUNDING = 3 ether;\\n\\n /// @notice A worker can be in 4 different states, starting from Available\\n enum WorkerState {Available, Pending, Owned, Retired}\\n\\n /// @dev mapping from worker to its user\\n mapping(address => address payable) private userOf;\\n\\n /// @dev mapping from worker to its internal state\\n mapping(address => WorkerState) private stateOf;\\n\\n /// @dev permissions keyed by hash(user, worker, dapp)\\n mapping(bytes32 => bool) private permissions;\\n\\n function isAvailable(address workerAddress)\\n public\\n override\\n view\\n returns (bool)\\n {\\n return stateOf[workerAddress] == WorkerState.Available;\\n }\\n\\n function isPending(address workerAddress)\\n public\\n override\\n view\\n returns (bool)\\n {\\n return stateOf[workerAddress] == WorkerState.Pending;\\n }\\n\\n function getOwner(address _workerAddress)\\n public\\n override(WorkerManager, WorkerAuthManager)\\n view\\n returns (address)\\n {\\n return\\n stateOf[_workerAddress] == WorkerState.Owned\\n ? userOf[_workerAddress]\\n : address(0);\\n }\\n\\n function getUser(address _workerAddress)\\n public\\n override\\n view\\n returns (address)\\n {\\n return userOf[_workerAddress];\\n }\\n\\n function isOwned(address _workerAddress)\\n public\\n override\\n view\\n returns (bool)\\n {\\n return stateOf[_workerAddress] == WorkerState.Owned;\\n }\\n\\n function hire(address payable _workerAddress) public override payable {\\n require(isAvailable(_workerAddress), \\\"worker is not available\\\");\\n require(_workerAddress != address(0), \\\"worker address can not be 0x0\\\");\\n require(msg.value >= MINIMUM_FUNDING, \\\"funding below minimum\\\");\\n require(msg.value <= MAXIMUM_FUNDING, \\\"funding above maximum\\\");\\n\\n // set owner\\n userOf[_workerAddress] = payable(msg.sender);\\n\\n // change state\\n stateOf[_workerAddress] = WorkerState.Pending;\\n\\n // transfer ether to worker\\n _workerAddress.transfer(msg.value);\\n\\n // emit event\\n emit JobOffer(_workerAddress, msg.sender);\\n }\\n\\n function acceptJob() public override {\\n require(\\n stateOf[msg.sender] == WorkerState.Pending,\\n \\\"worker not is not in pending state\\\"\\n );\\n\\n // change state\\n stateOf[msg.sender] = WorkerState.Owned;\\n // from now on getOwner will return the user\\n\\n // emit event\\n emit JobAccepted(msg.sender, userOf[msg.sender]);\\n }\\n\\n function rejectJob() public override payable {\\n require(\\n userOf[msg.sender] != address(0),\\n \\\"worker does not have a job offer\\\"\\n );\\n\\n address payable owner = userOf[msg.sender];\\n\\n // reset hirer back to null\\n userOf[msg.sender] = payable(address(0));\\n\\n // change state\\n stateOf[msg.sender] = WorkerState.Available;\\n\\n // return the money\\n owner.transfer(msg.value);\\n\\n // emit event\\n emit JobRejected(msg.sender, userOf[msg.sender]);\\n }\\n\\n function cancelHire(address _workerAddress) public override {\\n require(\\n userOf[_workerAddress] == msg.sender,\\n \\\"only hirer can cancel the offer\\\"\\n );\\n\\n // change state\\n stateOf[_workerAddress] = WorkerState.Retired;\\n\\n // emit event\\n emit JobRejected(_workerAddress, msg.sender);\\n }\\n\\n function retire(address payable _workerAddress) public override {\\n require(\\n stateOf[_workerAddress] == WorkerState.Owned,\\n \\\"worker not owned\\\"\\n );\\n require(\\n userOf[_workerAddress] == msg.sender,\\n \\\"only owner can retire worker\\\"\\n );\\n\\n // change state\\n stateOf[_workerAddress] = WorkerState.Retired;\\n\\n // emit event\\n emit Retired(_workerAddress, msg.sender);\\n }\\n\\n function isRetired(address _workerAddress)\\n public\\n override\\n view\\n returns (bool)\\n {\\n return stateOf[_workerAddress] == WorkerState.Retired;\\n }\\n\\n modifier onlyByUser(address _workerAddress) {\\n require(\\n getUser(_workerAddress) == msg.sender,\\n \\\"worker not hired by sender\\\"\\n );\\n _;\\n }\\n\\n function getAuthorizationKey(\\n address _user,\\n address _worker,\\n address _dapp\\n ) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(_user, _worker, _dapp));\\n }\\n\\n function authorize(address _workerAddress, address _dappAddress)\\n public\\n override\\n onlyByUser(_workerAddress)\\n {\\n bytes32 key = getAuthorizationKey(\\n msg.sender,\\n _workerAddress,\\n _dappAddress\\n );\\n require(permissions[key] == false, \\\"dapp already authorized\\\");\\n\\n // record authorization from that user\\n permissions[key] = true;\\n\\n // emit event\\n emit Authorization(msg.sender, _workerAddress, _dappAddress);\\n }\\n\\n function deauthorize(address _workerAddress, address _dappAddress)\\n public\\n override\\n onlyByUser(_workerAddress)\\n {\\n bytes32 key = getAuthorizationKey(\\n msg.sender,\\n _workerAddress,\\n _dappAddress\\n );\\n require(permissions[key] == true, \\\"dapp not authorized\\\");\\n\\n // record deauthorization from that user\\n permissions[key] = false;\\n\\n // emit event\\n emit Deauthorization(msg.sender, _workerAddress, _dappAddress);\\n }\\n\\n function isAuthorized(address _workerAddress, address _dappAddress)\\n public\\n override\\n view\\n returns (bool)\\n {\\n return\\n permissions[getAuthorizationKey(\\n getOwner(_workerAddress),\\n _workerAddress,\\n _dappAddress\\n )];\\n }\\n\\n function hireAndAuthorize(\\n address payable _workerAddress,\\n address _dappAddress\\n ) public payable {\\n hire(_workerAddress);\\n authorize(_workerAddress, _dappAddress);\\n }\\n}\\n\",\"keccak256\":\"0xc145dc336591683430027dc4149b0306d949a6aa9679d4200987a5bc8f5e731b\",\"license\":\"Apache-2.0\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b50610d56806100206000396000f3fe6080604052600436106100e85760003560e01c80639b789b7e1161008a578063d9d6bd8611610059578063d9d6bd8614610272578063dbd9655414610285578063f4dc754b14610298578063fa544161146102b857600080fd5b80639b789b7e146101fd5780639e6371ba14610212578063a00745b614610232578063b64b3bed1461025257600080fd5b806365e4ad9e116100c657806365e4ad9e1461014c5780636d3c62751461016c5780636d892f7e1461018c5780636f77926b146101ac57600080fd5b806303d6e81e146100ed5780632896f60b146100f75780632bef45951461012c575b600080fd5b6100f56102d8565b005b34801561010357600080fd5b50610117610112366004610c9b565b6103f0565b60405190151581526020015b60405180910390f35b34801561013857600080fd5b506100f5610147366004610cf6565b610436565b34801561015857600080fd5b50610117610167366004610cf6565b610575565b34801561017857600080fd5b50610117610187366004610c9b565b6105a9565b34801561019857600080fd5b506100f56101a7366004610cf6565b6105b2565b3480156101b857600080fd5b506101e56101c7366004610c9b565b6001600160a01b039081166000908152602081905260409020541690565b6040516001600160a01b039091168152602001610123565b34801561020957600080fd5b506100f56106e8565b34801561021e57600080fd5b506100f561022d366004610c9b565b6107cd565b34801561023e57600080fd5b5061011761024d366004610c9b565b610901565b34801561025e57600080fd5b506100f561026d366004610c9b565b61090a565b6100f5610280366004610c9b565b6109c1565b6100f5610293366004610cbe565b610bb9565b3480156102a457600080fd5b506101176102b3366004610c9b565b610bd0565b3480156102c457600080fd5b506101e56102d3366004610c9b565b610bd9565b336000908152602081905260409020546001600160a01b03166103425760405162461bcd60e51b815260206004820181905260248201527f776f726b657220646f6573206e6f7420686176652061206a6f62206f6666657260448201526064015b60405180910390fd5b3360009081526020818152604080832080546001600160a01b031981169091556001909252808320805460ff19169055516001600160a01b039091169182913480156108fc0292909190818181858888f193505050501580156103a9573d6000803e3d6000fd5b50336000818152602081905260408082205490516001600160a01b0390911692917fac8bfc64efe7b663f325ca81c7468a291a868aacc74c8f91cdc5c8141c15e38a91a350565b6000805b6001600160a01b03831660009081526001602052604090205460ff16600381111561042f57634e487b7160e01b600052602160045260246000fd5b1492915050565b813361045a826001600160a01b039081166000908152602081905260409020541690565b6001600160a01b0316146104b05760405162461bcd60e51b815260206004820152601a60248201527f776f726b6572206e6f742068697265642062792073656e6465720000000000006044820152606401610339565b60006104bd338585610c46565b60008181526002602052604090205490915060ff161561051f5760405162461bcd60e51b815260206004820152601760248201527f6461707020616c726561647920617574686f72697a65640000000000000000006044820152606401610339565b600081815260026020526040808220805460ff19166001179055516001600160a01b03808616929087169133917fde756a416a233cdb16c23a1fa5dcb3113164968df8607e0a4eeca25974b96e0391a450505050565b60006002600061058e61058786610bd9565b8686610c46565b815260208101919091526040016000205460ff169392505050565b600060036103f4565b81336105d6826001600160a01b039081166000908152602081905260409020541690565b6001600160a01b03161461062c5760405162461bcd60e51b815260206004820152601a60248201527f776f726b6572206e6f742068697265642062792073656e6465720000000000006044820152606401610339565b6000610639338585610c46565b60008181526002602052604090205490915060ff1615156001146106955760405162461bcd60e51b815260206004820152601360248201527219185c1c081b9bdd08185d5d1a1bdc9a5e9959606a1b6044820152606401610339565b600081815260026020526040808220805460ff19169055516001600160a01b03808616929087169133917f4d2275ddb8a6d9c36c95476c2eaf9746c1785b4ab76a99719fd647b36da46cee91a450505050565b60013360009081526001602052604090205460ff16600381111561071c57634e487b7160e01b600052602160045260246000fd5b146107745760405162461bcd60e51b815260206004820152602260248201527f776f726b6572206e6f74206973206e6f7420696e2070656e64696e6720737461604482015261746560f01b6064820152608401610339565b336000818152600160209081526040808320805460ff19166002179055908290528082205490516001600160a01b0390911692917f0cfa12ab8ee8dc6f9b68938d5e764dafed737d43dc5ec8443abf81e645276eb691a3565b60026001600160a01b03821660009081526001602052604090205460ff16600381111561080a57634e487b7160e01b600052602160045260246000fd5b1461084a5760405162461bcd60e51b815260206004820152601060248201526f1ddbdc9ad95c881b9bdd081bdddb995960821b6044820152606401610339565b6001600160a01b038181166000908152602081905260409020541633146108b35760405162461bcd60e51b815260206004820152601c60248201527f6f6e6c79206f776e65722063616e2072657469726520776f726b6572000000006044820152606401610339565b6001600160a01b038116600081815260016020526040808220805460ff19166003179055513392917f657b373e1262c26d1f1a83e8949f0af9067fe48026b308e47eec5ef6b40ff25d91a350565b600060016103f4565b6001600160a01b038181166000908152602081905260409020541633146109735760405162461bcd60e51b815260206004820152601f60248201527f6f6e6c792068697265722063616e2063616e63656c20746865206f66666572006044820152606401610339565b6001600160a01b038116600081815260016020526040808220805460ff19166003179055513392917fac8bfc64efe7b663f325ca81c7468a291a868aacc74c8f91cdc5c8141c15e38a91a350565b6109ca816103f0565b610a165760405162461bcd60e51b815260206004820152601760248201527f776f726b6572206973206e6f7420617661696c61626c650000000000000000006044820152606401610339565b6001600160a01b038116610a6c5760405162461bcd60e51b815260206004820152601d60248201527f776f726b657220616464726573732063616e206e6f74206265203078300000006044820152606401610339565b66038d7ea4c68000341015610abb5760405162461bcd60e51b815260206004820152601560248201527466756e64696e672062656c6f77206d696e696d756d60581b6044820152606401610339565b6729a2241af62c0000341115610b0b5760405162461bcd60e51b815260206004820152601560248201527466756e64696e672061626f7665206d6178696d756d60581b6044820152606401610339565b6001600160a01b03811660009081526020818152604080832080546001600160a01b03191633179055600191829052909120805460ff1916828002179055506040516001600160a01b038216903480156108fc02916000818181858888f19350505050158015610b7f573d6000803e3d6000fd5b5060405133906001600160a01b038316907f2e0aa97ef0e6f4f76319861c90e91beec7a7a44a698cab856dfc1985a0c588f090600090a350565b610bc2826109c1565b610bcc8282610436565b5050565b600060026103f4565b600060026001600160a01b03831660009081526001602052604090205460ff166003811115610c1857634e487b7160e01b600052602160045260246000fd5b14610c24576000610c40565b6001600160a01b03808316600090815260208190526040902054165b92915050565b6040516bffffffffffffffffffffffff19606085811b8216602084015284811b8216603484015283901b166048820152600090605c016040516020818303038152906040528051906020012090509392505050565b600060208284031215610cac578081fd5b8135610cb781610d08565b9392505050565b60008060408385031215610cd0578081fd5b8235610cdb81610d08565b91506020830135610ceb81610d08565b809150509250929050565b60008060408385031215610cd0578182fd5b6001600160a01b0381168114610d1d57600080fd5b5056fea2646970667358221220e972b3a076c30e372bdde288541c57a1beec9f29ec9a35f4a46b9b9f40a7c69464736f6c63430008040033", + "deployedBytecode": "0x6080604052600436106100e85760003560e01c80639b789b7e1161008a578063d9d6bd8611610059578063d9d6bd8614610272578063dbd9655414610285578063f4dc754b14610298578063fa544161146102b857600080fd5b80639b789b7e146101fd5780639e6371ba14610212578063a00745b614610232578063b64b3bed1461025257600080fd5b806365e4ad9e116100c657806365e4ad9e1461014c5780636d3c62751461016c5780636d892f7e1461018c5780636f77926b146101ac57600080fd5b806303d6e81e146100ed5780632896f60b146100f75780632bef45951461012c575b600080fd5b6100f56102d8565b005b34801561010357600080fd5b50610117610112366004610c9b565b6103f0565b60405190151581526020015b60405180910390f35b34801561013857600080fd5b506100f5610147366004610cf6565b610436565b34801561015857600080fd5b50610117610167366004610cf6565b610575565b34801561017857600080fd5b50610117610187366004610c9b565b6105a9565b34801561019857600080fd5b506100f56101a7366004610cf6565b6105b2565b3480156101b857600080fd5b506101e56101c7366004610c9b565b6001600160a01b039081166000908152602081905260409020541690565b6040516001600160a01b039091168152602001610123565b34801561020957600080fd5b506100f56106e8565b34801561021e57600080fd5b506100f561022d366004610c9b565b6107cd565b34801561023e57600080fd5b5061011761024d366004610c9b565b610901565b34801561025e57600080fd5b506100f561026d366004610c9b565b61090a565b6100f5610280366004610c9b565b6109c1565b6100f5610293366004610cbe565b610bb9565b3480156102a457600080fd5b506101176102b3366004610c9b565b610bd0565b3480156102c457600080fd5b506101e56102d3366004610c9b565b610bd9565b336000908152602081905260409020546001600160a01b03166103425760405162461bcd60e51b815260206004820181905260248201527f776f726b657220646f6573206e6f7420686176652061206a6f62206f6666657260448201526064015b60405180910390fd5b3360009081526020818152604080832080546001600160a01b031981169091556001909252808320805460ff19169055516001600160a01b039091169182913480156108fc0292909190818181858888f193505050501580156103a9573d6000803e3d6000fd5b50336000818152602081905260408082205490516001600160a01b0390911692917fac8bfc64efe7b663f325ca81c7468a291a868aacc74c8f91cdc5c8141c15e38a91a350565b6000805b6001600160a01b03831660009081526001602052604090205460ff16600381111561042f57634e487b7160e01b600052602160045260246000fd5b1492915050565b813361045a826001600160a01b039081166000908152602081905260409020541690565b6001600160a01b0316146104b05760405162461bcd60e51b815260206004820152601a60248201527f776f726b6572206e6f742068697265642062792073656e6465720000000000006044820152606401610339565b60006104bd338585610c46565b60008181526002602052604090205490915060ff161561051f5760405162461bcd60e51b815260206004820152601760248201527f6461707020616c726561647920617574686f72697a65640000000000000000006044820152606401610339565b600081815260026020526040808220805460ff19166001179055516001600160a01b03808616929087169133917fde756a416a233cdb16c23a1fa5dcb3113164968df8607e0a4eeca25974b96e0391a450505050565b60006002600061058e61058786610bd9565b8686610c46565b815260208101919091526040016000205460ff169392505050565b600060036103f4565b81336105d6826001600160a01b039081166000908152602081905260409020541690565b6001600160a01b03161461062c5760405162461bcd60e51b815260206004820152601a60248201527f776f726b6572206e6f742068697265642062792073656e6465720000000000006044820152606401610339565b6000610639338585610c46565b60008181526002602052604090205490915060ff1615156001146106955760405162461bcd60e51b815260206004820152601360248201527219185c1c081b9bdd08185d5d1a1bdc9a5e9959606a1b6044820152606401610339565b600081815260026020526040808220805460ff19169055516001600160a01b03808616929087169133917f4d2275ddb8a6d9c36c95476c2eaf9746c1785b4ab76a99719fd647b36da46cee91a450505050565b60013360009081526001602052604090205460ff16600381111561071c57634e487b7160e01b600052602160045260246000fd5b146107745760405162461bcd60e51b815260206004820152602260248201527f776f726b6572206e6f74206973206e6f7420696e2070656e64696e6720737461604482015261746560f01b6064820152608401610339565b336000818152600160209081526040808320805460ff19166002179055908290528082205490516001600160a01b0390911692917f0cfa12ab8ee8dc6f9b68938d5e764dafed737d43dc5ec8443abf81e645276eb691a3565b60026001600160a01b03821660009081526001602052604090205460ff16600381111561080a57634e487b7160e01b600052602160045260246000fd5b1461084a5760405162461bcd60e51b815260206004820152601060248201526f1ddbdc9ad95c881b9bdd081bdddb995960821b6044820152606401610339565b6001600160a01b038181166000908152602081905260409020541633146108b35760405162461bcd60e51b815260206004820152601c60248201527f6f6e6c79206f776e65722063616e2072657469726520776f726b6572000000006044820152606401610339565b6001600160a01b038116600081815260016020526040808220805460ff19166003179055513392917f657b373e1262c26d1f1a83e8949f0af9067fe48026b308e47eec5ef6b40ff25d91a350565b600060016103f4565b6001600160a01b038181166000908152602081905260409020541633146109735760405162461bcd60e51b815260206004820152601f60248201527f6f6e6c792068697265722063616e2063616e63656c20746865206f66666572006044820152606401610339565b6001600160a01b038116600081815260016020526040808220805460ff19166003179055513392917fac8bfc64efe7b663f325ca81c7468a291a868aacc74c8f91cdc5c8141c15e38a91a350565b6109ca816103f0565b610a165760405162461bcd60e51b815260206004820152601760248201527f776f726b6572206973206e6f7420617661696c61626c650000000000000000006044820152606401610339565b6001600160a01b038116610a6c5760405162461bcd60e51b815260206004820152601d60248201527f776f726b657220616464726573732063616e206e6f74206265203078300000006044820152606401610339565b66038d7ea4c68000341015610abb5760405162461bcd60e51b815260206004820152601560248201527466756e64696e672062656c6f77206d696e696d756d60581b6044820152606401610339565b6729a2241af62c0000341115610b0b5760405162461bcd60e51b815260206004820152601560248201527466756e64696e672061626f7665206d6178696d756d60581b6044820152606401610339565b6001600160a01b03811660009081526020818152604080832080546001600160a01b03191633179055600191829052909120805460ff1916828002179055506040516001600160a01b038216903480156108fc02916000818181858888f19350505050158015610b7f573d6000803e3d6000fd5b5060405133906001600160a01b038316907f2e0aa97ef0e6f4f76319861c90e91beec7a7a44a698cab856dfc1985a0c588f090600090a350565b610bc2826109c1565b610bcc8282610436565b5050565b600060026103f4565b600060026001600160a01b03831660009081526001602052604090205460ff166003811115610c1857634e487b7160e01b600052602160045260246000fd5b14610c24576000610c40565b6001600160a01b03808316600090815260208190526040902054165b92915050565b6040516bffffffffffffffffffffffff19606085811b8216602084015284811b8216603484015283901b166048820152600090605c016040516020818303038152906040528051906020012090509392505050565b600060208284031215610cac578081fd5b8135610cb781610d08565b9392505050565b60008060408385031215610cd0578081fd5b8235610cdb81610d08565b91506020830135610ceb81610d08565b809150509250929050565b60008060408385031215610cd0578182fd5b6001600160a01b0381168114610d1d57600080fd5b5056fea2646970667358221220e972b3a076c30e372bdde288541c57a1beec9f29ec9a35f4a46b9b9f40a7c69464736f6c63430008040033", + "devdoc": { + "kind": "dev", + "methods": { + "authorize(address,address)": { + "params": { + "_dappAddress": "address of the dapp that permission will be given to", + "_workerAddress": "address of the worker node to given permission" + } + }, + "isAuthorized(address,address)": { + "params": { + "_dappAddress": "address of the DApp", + "_workerAddress": "address of the worker" + } + }, + "isAvailable(address)": { + "params": { + "workerAddress": "address of the worker node" + } + }, + "isPending(address)": { + "params": { + "workerAddress": "address of the worker node" + } + } + }, + "stateVariables": { + "MAXIMUM_FUNDING": { + "details": "transfers bigger than maximum value should be done directly" + }, + "MINIMUM_FUNDING": { + "details": "user can only hire a worker if he sends more than minimum value" + }, + "permissions": { + "details": "permissions keyed by hash(user, worker, dapp)" + }, + "stateOf": { + "details": "mapping from worker to its internal state" + }, + "userOf": { + "details": "mapping from worker to its user" + } + }, + "version": 1 + }, + "userdoc": { + "events": { + "Authorization(address,address,address)": { + "notice": "A DApp has been authorized by a user for a worker" + }, + "Deauthorization(address,address,address)": { + "notice": "A DApp has been deauthorized by a user for a worker" + }, + "JobOffer(address,address)": { + "notice": "Events signalling every state transition" + } + }, + "kind": "user", + "methods": { + "acceptJob()": { + "notice": "Called by the worker to accept the job" + }, + "authorize(address,address)": { + "notice": "Gives worker permission to act on a DApp" + }, + "isAuthorized(address,address)": { + "notice": "Returns is the dapp is authorized to be called by that worker" + }, + "isAvailable(address)": { + "notice": "Returns true if worker node is available" + }, + "isPending(address)": { + "notice": "Returns true if worker node is pending" + }, + "rejectJob()": { + "notice": "Called by the worker to reject a job offer" + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 369, + "contract": "contracts/WorkerManagerAuthManagerImpl.sol:WorkerManagerAuthManagerImpl", + "label": "userOf", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_address,t_address_payable)" + }, + { + "astId": 375, + "contract": "contracts/WorkerManagerAuthManagerImpl.sol:WorkerManagerAuthManagerImpl", + "label": "stateOf", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_address,t_enum(WorkerState)364)" + }, + { + "astId": 380, + "contract": "contracts/WorkerManagerAuthManagerImpl.sol:WorkerManagerAuthManagerImpl", + "label": "permissions", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_bytes32,t_bool)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_address_payable": { + "encoding": "inplace", + "label": "address payable", + "numberOfBytes": "20" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_enum(WorkerState)364": { + "encoding": "inplace", + "label": "enum WorkerManagerAuthManagerImpl.WorkerState", + "numberOfBytes": "1" + }, + "t_mapping(t_address,t_address_payable)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => address payable)", + "numberOfBytes": "32", + "value": "t_address_payable" + }, + "t_mapping(t_address,t_enum(WorkerState)364)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => enum WorkerManagerAuthManagerImpl.WorkerState)", + "numberOfBytes": "32", + "value": "t_enum(WorkerState)364" + }, + "t_mapping(t_bytes32,t_bool)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => bool)", + "numberOfBytes": "32", + "value": "t_bool" + } + } + } +} \ No newline at end of file diff --git a/deployments/ropsten/WorkerManagerImpl.json b/deployments/ropsten/WorkerManagerImpl.json new file mode 100644 index 0000000..1e08a4d --- /dev/null +++ b/deployments/ropsten/WorkerManagerImpl.json @@ -0,0 +1,373 @@ +{ + "address": "0x381e64Cb649A98E2B2FBb440E528A44D21B5B9c0", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "worker", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "JobAccepted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "worker", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "JobOffer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "worker", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "JobRejected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "worker", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "Retired", + "type": "event" + }, + { + "inputs": [], + "name": "acceptJob", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_workerAddress", + "type": "address" + } + ], + "name": "cancelHire", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_workerAddress", + "type": "address" + } + ], + "name": "getOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_workerAddress", + "type": "address" + } + ], + "name": "getUser", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_workerAddress", + "type": "address" + } + ], + "name": "hire", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "workerAddress", + "type": "address" + } + ], + "name": "isAvailable", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_workerAddress", + "type": "address" + } + ], + "name": "isOwned", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "workerAddress", + "type": "address" + } + ], + "name": "isPending", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_workerAddress", + "type": "address" + } + ], + "name": "isRetired", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rejectJob", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_workerAddress", + "type": "address" + } + ], + "name": "retire", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x85ab7561100c8b269f83cd993689df8f0b3775a99fc353d1809b12af1f178ae3", + "receipt": { + "to": null, + "from": "0x18930e8a66a1DbE21D00581216789AAB7460Afd0", + "contractAddress": "0x381e64Cb649A98E2B2FBb440E528A44D21B5B9c0", + "transactionIndex": 12, + "gasUsed": "587886", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x39bb2bf79133e71a7d17592ff8d79e69de1624c6874af4d224b31bd8d1bdce89", + "transactionHash": "0x85ab7561100c8b269f83cd993689df8f0b3775a99fc353d1809b12af1f178ae3", + "logs": [], + "blockNumber": 10530863, + "cumulativeGasUsed": "6239060", + "status": 1, + "byzantium": true + }, + "args": [], + "solcInputHash": "30c2f6f98bb0d009fa19f91b4a6473d4", + "metadata": "{\"compiler\":{\"version\":\"0.8.4+commit.c7e474f2\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"worker\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"JobAccepted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"worker\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"JobOffer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"worker\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"JobRejected\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"worker\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"Retired\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptJob\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_workerAddress\",\"type\":\"address\"}],\"name\":\"cancelHire\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_workerAddress\",\"type\":\"address\"}],\"name\":\"getOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_workerAddress\",\"type\":\"address\"}],\"name\":\"getUser\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"_workerAddress\",\"type\":\"address\"}],\"name\":\"hire\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"workerAddress\",\"type\":\"address\"}],\"name\":\"isAvailable\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_workerAddress\",\"type\":\"address\"}],\"name\":\"isOwned\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"workerAddress\",\"type\":\"address\"}],\"name\":\"isPending\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_workerAddress\",\"type\":\"address\"}],\"name\":\"isRetired\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"rejectJob\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"_workerAddress\",\"type\":\"address\"}],\"name\":\"retire\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"isAvailable(address)\":{\"params\":{\"workerAddress\":\"address of the worker node\"}},\"isPending(address)\":{\"params\":{\"workerAddress\":\"address of the worker node\"}}},\"stateVariables\":{\"MAXIMUM_FUNDING\":{\"details\":\"transfers bigger than maximum value should be done directly\"},\"MINIMUM_FUNDING\":{\"details\":\"user can only hire a worker if he sends more than minimum value\"},\"stateOf\":{\"details\":\"mapping from worker to its internal state\"},\"userOf\":{\"details\":\"mapping from worker to its user\"}},\"version\":1},\"userdoc\":{\"events\":{\"JobOffer(address,address)\":{\"notice\":\"Events signalling every state transition\"}},\"kind\":\"user\",\"methods\":{\"acceptJob()\":{\"notice\":\"Called by the worker to accept the job\"},\"isAvailable(address)\":{\"notice\":\"Returns true if worker node is available\"},\"isPending(address)\":{\"notice\":\"Returns true if worker node is pending\"},\"rejectJob()\":{\"notice\":\"Called by the worker to reject a job offer\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/WorkerManagerImpl.sol\":\"WorkerManagerImpl\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/WorkerManager.sol\":{\"content\":\"// Copyright 2010 Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\n/// @title WorkerManager\\n/// @author Danilo Tuler\\npragma solidity >=0.7.0;\\n\\ninterface WorkerManager {\\n /// @notice Returns true if worker node is available\\n /// @param workerAddress address of the worker node\\n function isAvailable(address workerAddress) external view returns (bool);\\n\\n /// @notice Returns true if worker node is pending\\n /// @param workerAddress address of the worker node\\n function isPending(address workerAddress) external view returns (bool);\\n\\n /// @notice Get the owner of the worker node\\n /// @param workerAddress address of the worker node\\n function getOwner(address workerAddress) external view returns (address);\\n\\n /// @notice Get the user of the worker node, which may not be the owner yet, or how was the previous owner of a retired node\\n function getUser(address workerAddress) external view returns (address);\\n\\n /// @notice Returns true if worker node is owned by some user\\n function isOwned(address workerAddress) external view returns (bool);\\n\\n /// @notice Asks the worker to work for the sender. Sender needs to pay something.\\n /// @param workerAddress address of the worker\\n function hire(address payable workerAddress) external payable;\\n\\n /// @notice Called by the worker to accept the job\\n function acceptJob() external;\\n\\n /// @notice Called by the worker to reject a job offer\\n function rejectJob() external payable;\\n\\n /// @notice Called by the user to cancel a job offer\\n /// @param workerAddress address of the worker node\\n function cancelHire(address workerAddress) external;\\n\\n /// @notice Called by the user to retire his worker.\\n /// @param workerAddress address of the worker to be retired\\n /// @dev this also removes all authorizations in place\\n function retire(address payable workerAddress) external;\\n\\n /// @notice Returns true if worker node was retired by its owner\\n function isRetired(address workerAddress) external view returns (bool);\\n\\n /// @notice Events signalling every state transition\\n event JobOffer(address indexed worker, address indexed user);\\n event JobAccepted(address indexed worker, address indexed user);\\n event JobRejected(address indexed worker, address indexed user);\\n event Retired(address indexed worker, address indexed user);\\n}\\n\",\"keccak256\":\"0xb93bac1de98b3fb44421c2498f11bcd246795c7cffeeebb535a046e88c303410\",\"license\":\"Apache-2.0\"},\"contracts/WorkerManagerImpl.sol\":{\"content\":\"// Copyright 2020 Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\n/// @title WorkerManagerImpl\\n/// @author Danilo Tuler\\npragma solidity ^0.8.0;\\n\\nimport \\\"./WorkerManager.sol\\\";\\n\\ncontract WorkerManagerImpl is WorkerManager {\\n /// @dev user can only hire a worker if he sends more than minimum value\\n uint256 constant MINIMUM_FUNDING = 0.001 ether;\\n\\n /// @dev transfers bigger than maximum value should be done directly\\n uint256 constant MAXIMUM_FUNDING = 3 ether;\\n\\n /// @notice A worker can be in 4 different states, starting from Available\\n enum WorkerState {Available, Pending, Owned, Retired}\\n\\n /// @dev mapping from worker to its user\\n mapping(address => address payable) private userOf;\\n\\n /// @dev mapping from worker to its internal state\\n mapping(address => WorkerState) private stateOf;\\n\\n function isAvailable(address workerAddress)\\n public\\n override\\n view\\n returns (bool)\\n {\\n return stateOf[workerAddress] == WorkerState.Available;\\n }\\n\\n function isPending(address workerAddress)\\n public\\n override\\n view\\n returns (bool)\\n {\\n return stateOf[workerAddress] == WorkerState.Pending;\\n }\\n\\n function getOwner(address _workerAddress)\\n public\\n override\\n view\\n returns (address)\\n {\\n return\\n stateOf[_workerAddress] == WorkerState.Owned\\n ? userOf[_workerAddress]\\n : address(0);\\n }\\n\\n function getUser(address _workerAddress)\\n public\\n override\\n view\\n returns (address)\\n {\\n return userOf[_workerAddress];\\n }\\n\\n function isOwned(address _workerAddress)\\n public\\n override\\n view\\n returns (bool)\\n {\\n return stateOf[_workerAddress] == WorkerState.Owned;\\n }\\n\\n function hire(address payable _workerAddress) public override payable {\\n require(isAvailable(_workerAddress), \\\"worker is not available\\\");\\n require(_workerAddress != address(0), \\\"worker address can not be 0x0\\\");\\n require(msg.value >= MINIMUM_FUNDING, \\\"funding below minimum\\\");\\n require(msg.value <= MAXIMUM_FUNDING, \\\"funding above maximum\\\");\\n\\n // set owner\\n userOf[_workerAddress] = payable(msg.sender);\\n\\n // change state\\n stateOf[_workerAddress] = WorkerState.Pending;\\n\\n // transfer ether to worker\\n _workerAddress.transfer(msg.value);\\n\\n // emit event\\n emit JobOffer(_workerAddress, msg.sender);\\n }\\n\\n function acceptJob() public override {\\n require(\\n userOf[msg.sender] != address(0),\\n \\\"worker does not have a job offer\\\"\\n );\\n require(\\n stateOf[msg.sender] == WorkerState.Pending,\\n \\\"worker not is not in pending state\\\"\\n );\\n\\n // change state\\n stateOf[msg.sender] = WorkerState.Owned;\\n // from now on getOwner will return the user\\n\\n // emit event\\n emit JobAccepted(msg.sender, userOf[msg.sender]);\\n }\\n\\n function rejectJob() public override payable {\\n require(\\n userOf[msg.sender] != address(0),\\n \\\"worker does not have a job offer\\\"\\n );\\n\\n address payable owner = userOf[msg.sender];\\n\\n // reset hirer back to null\\n userOf[msg.sender] = payable(address(0));\\n\\n // change state\\n stateOf[msg.sender] = WorkerState.Available;\\n\\n // return the money\\n owner.transfer(msg.value);\\n\\n // emit event\\n emit JobRejected(msg.sender, userOf[msg.sender]);\\n }\\n\\n function cancelHire(address _workerAddress) public override {\\n require(\\n userOf[_workerAddress] != address(0),\\n \\\"worker does not have a job offer\\\"\\n );\\n\\n require(\\n userOf[_workerAddress] == msg.sender,\\n \\\"only hirer can cancel the offer\\\"\\n );\\n\\n // change state\\n stateOf[_workerAddress] = WorkerState.Retired;\\n\\n // emit event\\n emit JobRejected(_workerAddress, msg.sender);\\n }\\n\\n function retire(address payable _workerAddress) public override {\\n require(\\n stateOf[_workerAddress] == WorkerState.Owned,\\n \\\"worker not owned\\\"\\n );\\n require(\\n userOf[_workerAddress] == msg.sender,\\n \\\"only owner can retire worker\\\"\\n );\\n\\n // change state\\n stateOf[_workerAddress] = WorkerState.Retired;\\n\\n // emit event\\n emit Retired(_workerAddress, msg.sender);\\n }\\n\\n function isRetired(address _workerAddress)\\n public\\n override\\n view\\n returns (bool)\\n {\\n return stateOf[_workerAddress] == WorkerState.Retired;\\n }\\n}\\n\",\"keccak256\":\"0xfba2d41f042ddd2bf64644ce13ea490cd7fbff17fe9316e34bc6e818721c363b\",\"license\":\"Apache-2.0\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506109ad806100206000396000f3fe60806040526004361061009c5760003560e01c80639e6371ba116100645780639e6371ba14610166578063a00745b614610186578063b64b3bed146101a6578063d9d6bd86146101c6578063f4dc754b146101d9578063fa544161146101f957600080fd5b806303d6e81e146100a15780632896f60b146100ab5780636d3c6275146100e05780636f77926b146101005780639b789b7e14610151575b600080fd5b6100a9610219565b005b3480156100b757600080fd5b506100cb6100c6366004610907565b610305565b60405190151581526020015b60405180910390f35b3480156100ec57600080fd5b506100cb6100fb366004610907565b61034b565b34801561010c57600080fd5b5061013961011b366004610907565b6001600160a01b039081166000908152602081905260409020541690565b6040516001600160a01b0390911681526020016100d7565b34801561015d57600080fd5b506100a9610354565b34801561017257600080fd5b506100a9610181366004610907565b61046e565b34801561019257600080fd5b506100cb6101a1366004610907565b6105a2565b3480156101b257600080fd5b506100a96101c1366004610907565b6105ab565b6100a96101d4366004610907565b610699565b3480156101e557600080fd5b506100cb6101f4366004610907565b610891565b34801561020557600080fd5b50610139610214366004610907565b61089a565b336000908152602081905260409020546001600160a01b03166102575760405162461bcd60e51b815260040161024e9061092a565b60405180910390fd5b3360009081526020818152604080832080546001600160a01b031981169091556001909252808320805460ff19169055516001600160a01b039091169182913480156108fc0292909190818181858888f193505050501580156102be573d6000803e3d6000fd5b50336000818152602081905260408082205490516001600160a01b0390911692917fac8bfc64efe7b663f325ca81c7468a291a868aacc74c8f91cdc5c8141c15e38a91a350565b6000805b6001600160a01b03831660009081526001602052604090205460ff16600381111561034457634e487b7160e01b600052602160045260246000fd5b1492915050565b60006003610309565b336000908152602081905260409020546001600160a01b03166103895760405162461bcd60e51b815260040161024e9061092a565b60013360009081526001602052604090205460ff1660038111156103bd57634e487b7160e01b600052602160045260246000fd5b146104155760405162461bcd60e51b815260206004820152602260248201527f776f726b6572206e6f74206973206e6f7420696e2070656e64696e6720737461604482015261746560f01b606482015260840161024e565b336000818152600160209081526040808320805460ff19166002179055908290528082205490516001600160a01b0390911692917f0cfa12ab8ee8dc6f9b68938d5e764dafed737d43dc5ec8443abf81e645276eb691a3565b60026001600160a01b03821660009081526001602052604090205460ff1660038111156104ab57634e487b7160e01b600052602160045260246000fd5b146104eb5760405162461bcd60e51b815260206004820152601060248201526f1ddbdc9ad95c881b9bdd081bdddb995960821b604482015260640161024e565b6001600160a01b038181166000908152602081905260409020541633146105545760405162461bcd60e51b815260206004820152601c60248201527f6f6e6c79206f776e65722063616e2072657469726520776f726b657200000000604482015260640161024e565b6001600160a01b038116600081815260016020526040808220805460ff19166003179055513392917f657b373e1262c26d1f1a83e8949f0af9067fe48026b308e47eec5ef6b40ff25d91a350565b60006001610309565b6001600160a01b03818116600090815260208190526040902054166105e25760405162461bcd60e51b815260040161024e9061092a565b6001600160a01b0381811660009081526020819052604090205416331461064b5760405162461bcd60e51b815260206004820152601f60248201527f6f6e6c792068697265722063616e2063616e63656c20746865206f6666657200604482015260640161024e565b6001600160a01b038116600081815260016020526040808220805460ff19166003179055513392917fac8bfc64efe7b663f325ca81c7468a291a868aacc74c8f91cdc5c8141c15e38a91a350565b6106a281610305565b6106ee5760405162461bcd60e51b815260206004820152601760248201527f776f726b6572206973206e6f7420617661696c61626c65000000000000000000604482015260640161024e565b6001600160a01b0381166107445760405162461bcd60e51b815260206004820152601d60248201527f776f726b657220616464726573732063616e206e6f7420626520307830000000604482015260640161024e565b66038d7ea4c680003410156107935760405162461bcd60e51b815260206004820152601560248201527466756e64696e672062656c6f77206d696e696d756d60581b604482015260640161024e565b6729a2241af62c00003411156107e35760405162461bcd60e51b815260206004820152601560248201527466756e64696e672061626f7665206d6178696d756d60581b604482015260640161024e565b6001600160a01b03811660009081526020818152604080832080546001600160a01b03191633179055600191829052909120805460ff1916828002179055506040516001600160a01b038216903480156108fc02916000818181858888f19350505050158015610857573d6000803e3d6000fd5b5060405133906001600160a01b038316907f2e0aa97ef0e6f4f76319861c90e91beec7a7a44a698cab856dfc1985a0c588f090600090a350565b60006002610309565b600060026001600160a01b03831660009081526001602052604090205460ff1660038111156108d957634e487b7160e01b600052602160045260246000fd5b146108e5576000610901565b6001600160a01b03808316600090815260208190526040902054165b92915050565b600060208284031215610918578081fd5b81356109238161095f565b9392505050565b6020808252818101527f776f726b657220646f6573206e6f7420686176652061206a6f62206f66666572604082015260600190565b6001600160a01b038116811461097457600080fd5b5056fea26469706673582212207ca4c0ec87984879cea9879055d35228da4eb729636f57ac544d7e38a5bcf13a64736f6c63430008040033", + "deployedBytecode": "0x60806040526004361061009c5760003560e01c80639e6371ba116100645780639e6371ba14610166578063a00745b614610186578063b64b3bed146101a6578063d9d6bd86146101c6578063f4dc754b146101d9578063fa544161146101f957600080fd5b806303d6e81e146100a15780632896f60b146100ab5780636d3c6275146100e05780636f77926b146101005780639b789b7e14610151575b600080fd5b6100a9610219565b005b3480156100b757600080fd5b506100cb6100c6366004610907565b610305565b60405190151581526020015b60405180910390f35b3480156100ec57600080fd5b506100cb6100fb366004610907565b61034b565b34801561010c57600080fd5b5061013961011b366004610907565b6001600160a01b039081166000908152602081905260409020541690565b6040516001600160a01b0390911681526020016100d7565b34801561015d57600080fd5b506100a9610354565b34801561017257600080fd5b506100a9610181366004610907565b61046e565b34801561019257600080fd5b506100cb6101a1366004610907565b6105a2565b3480156101b257600080fd5b506100a96101c1366004610907565b6105ab565b6100a96101d4366004610907565b610699565b3480156101e557600080fd5b506100cb6101f4366004610907565b610891565b34801561020557600080fd5b50610139610214366004610907565b61089a565b336000908152602081905260409020546001600160a01b03166102575760405162461bcd60e51b815260040161024e9061092a565b60405180910390fd5b3360009081526020818152604080832080546001600160a01b031981169091556001909252808320805460ff19169055516001600160a01b039091169182913480156108fc0292909190818181858888f193505050501580156102be573d6000803e3d6000fd5b50336000818152602081905260408082205490516001600160a01b0390911692917fac8bfc64efe7b663f325ca81c7468a291a868aacc74c8f91cdc5c8141c15e38a91a350565b6000805b6001600160a01b03831660009081526001602052604090205460ff16600381111561034457634e487b7160e01b600052602160045260246000fd5b1492915050565b60006003610309565b336000908152602081905260409020546001600160a01b03166103895760405162461bcd60e51b815260040161024e9061092a565b60013360009081526001602052604090205460ff1660038111156103bd57634e487b7160e01b600052602160045260246000fd5b146104155760405162461bcd60e51b815260206004820152602260248201527f776f726b6572206e6f74206973206e6f7420696e2070656e64696e6720737461604482015261746560f01b606482015260840161024e565b336000818152600160209081526040808320805460ff19166002179055908290528082205490516001600160a01b0390911692917f0cfa12ab8ee8dc6f9b68938d5e764dafed737d43dc5ec8443abf81e645276eb691a3565b60026001600160a01b03821660009081526001602052604090205460ff1660038111156104ab57634e487b7160e01b600052602160045260246000fd5b146104eb5760405162461bcd60e51b815260206004820152601060248201526f1ddbdc9ad95c881b9bdd081bdddb995960821b604482015260640161024e565b6001600160a01b038181166000908152602081905260409020541633146105545760405162461bcd60e51b815260206004820152601c60248201527f6f6e6c79206f776e65722063616e2072657469726520776f726b657200000000604482015260640161024e565b6001600160a01b038116600081815260016020526040808220805460ff19166003179055513392917f657b373e1262c26d1f1a83e8949f0af9067fe48026b308e47eec5ef6b40ff25d91a350565b60006001610309565b6001600160a01b03818116600090815260208190526040902054166105e25760405162461bcd60e51b815260040161024e9061092a565b6001600160a01b0381811660009081526020819052604090205416331461064b5760405162461bcd60e51b815260206004820152601f60248201527f6f6e6c792068697265722063616e2063616e63656c20746865206f6666657200604482015260640161024e565b6001600160a01b038116600081815260016020526040808220805460ff19166003179055513392917fac8bfc64efe7b663f325ca81c7468a291a868aacc74c8f91cdc5c8141c15e38a91a350565b6106a281610305565b6106ee5760405162461bcd60e51b815260206004820152601760248201527f776f726b6572206973206e6f7420617661696c61626c65000000000000000000604482015260640161024e565b6001600160a01b0381166107445760405162461bcd60e51b815260206004820152601d60248201527f776f726b657220616464726573732063616e206e6f7420626520307830000000604482015260640161024e565b66038d7ea4c680003410156107935760405162461bcd60e51b815260206004820152601560248201527466756e64696e672062656c6f77206d696e696d756d60581b604482015260640161024e565b6729a2241af62c00003411156107e35760405162461bcd60e51b815260206004820152601560248201527466756e64696e672061626f7665206d6178696d756d60581b604482015260640161024e565b6001600160a01b03811660009081526020818152604080832080546001600160a01b03191633179055600191829052909120805460ff1916828002179055506040516001600160a01b038216903480156108fc02916000818181858888f19350505050158015610857573d6000803e3d6000fd5b5060405133906001600160a01b038316907f2e0aa97ef0e6f4f76319861c90e91beec7a7a44a698cab856dfc1985a0c588f090600090a350565b60006002610309565b600060026001600160a01b03831660009081526001602052604090205460ff1660038111156108d957634e487b7160e01b600052602160045260246000fd5b146108e5576000610901565b6001600160a01b03808316600090815260208190526040902054165b92915050565b600060208284031215610918578081fd5b81356109238161095f565b9392505050565b6020808252818101527f776f726b657220646f6573206e6f7420686176652061206a6f62206f66666572604082015260600190565b6001600160a01b038116811461097457600080fd5b5056fea26469706673582212207ca4c0ec87984879cea9879055d35228da4eb729636f57ac544d7e38a5bcf13a64736f6c63430008040033", + "devdoc": { + "kind": "dev", + "methods": { + "isAvailable(address)": { + "params": { + "workerAddress": "address of the worker node" + } + }, + "isPending(address)": { + "params": { + "workerAddress": "address of the worker node" + } + } + }, + "stateVariables": { + "MAXIMUM_FUNDING": { + "details": "transfers bigger than maximum value should be done directly" + }, + "MINIMUM_FUNDING": { + "details": "user can only hire a worker if he sends more than minimum value" + }, + "stateOf": { + "details": "mapping from worker to its internal state" + }, + "userOf": { + "details": "mapping from worker to its user" + } + }, + "version": 1 + }, + "userdoc": { + "events": { + "JobOffer(address,address)": { + "notice": "Events signalling every state transition" + } + }, + "kind": "user", + "methods": { + "acceptJob()": { + "notice": "Called by the worker to accept the job" + }, + "isAvailable(address)": { + "notice": "Returns true if worker node is available" + }, + "isPending(address)": { + "notice": "Returns true if worker node is pending" + }, + "rejectJob()": { + "notice": "Called by the worker to reject a job offer" + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 903, + "contract": "contracts/WorkerManagerImpl.sol:WorkerManagerImpl", + "label": "userOf", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_address,t_address_payable)" + }, + { + "astId": 909, + "contract": "contracts/WorkerManagerImpl.sol:WorkerManagerImpl", + "label": "stateOf", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_address,t_enum(WorkerState)898)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_address_payable": { + "encoding": "inplace", + "label": "address payable", + "numberOfBytes": "20" + }, + "t_enum(WorkerState)898": { + "encoding": "inplace", + "label": "enum WorkerManagerImpl.WorkerState", + "numberOfBytes": "1" + }, + "t_mapping(t_address,t_address_payable)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => address payable)", + "numberOfBytes": "32", + "value": "t_address_payable" + }, + "t_mapping(t_address,t_enum(WorkerState)898)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => enum WorkerManagerImpl.WorkerState)", + "numberOfBytes": "32", + "value": "t_enum(WorkerState)898" + } + } + } +} \ No newline at end of file diff --git a/export/abi/ropsten.json b/export/abi/ropsten.json new file mode 100644 index 0000000..1a2c19c --- /dev/null +++ b/export/abi/ropsten.json @@ -0,0 +1,1201 @@ +{ + "name": "ropsten", + "chainId": "3", + "contracts": { + "BitsManipulation": { + "address": "0x2dC8b1A27F7Ccd071559b9B10077EfA6bE0AA7B8", + "abi": [ + { + "inputs": [ + { + "internalType": "int32", + "name": "number", + "type": "int32" + }, + { + "internalType": "uint32", + "name": "wordSize", + "type": "uint32" + } + ], + "name": "int32SignExtension", + "outputs": [ + { + "internalType": "int32", + "name": "", + "type": "int32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "num", + "type": "uint32" + } + ], + "name": "uint32SwapEndian", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "number", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "wordSize", + "type": "uint64" + } + ], + "name": "uint64SignExtension", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "num", + "type": "uint64" + } + ], + "name": "uint64SwapEndian", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "pure", + "type": "function" + } + ] + }, + "Bitmask": { + "address": "0x9fB2a46ca249b56E89F9956d8552E5Df1161E340", + "abi": [] + }, + "CartesiMath": { + "address": "0x598b68c8234F201aC984Bd33D7678D2E3aC8f179", + "abi": [ + { + "inputs": [ + { + "internalType": "uint256", + "name": "_num", + "type": "uint256" + } + ], + "name": "clz", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_num", + "type": "uint256" + } + ], + "name": "ctz", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_num", + "type": "uint256" + } + ], + "name": "getLog2Floor", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_num", + "type": "uint256" + } + ], + "name": "getLog2TableTimes1M", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_num", + "type": "uint256" + } + ], + "name": "isPowerOf2", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_num", + "type": "uint256" + } + ], + "name": "log2ApproxTimes1M", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + } + ] + }, + "Merkle": { + "address": "0x627bF4558cb62028fA3d398Aa6bBEF5B5AAFE2ad", + "abi": [ + { + "inputs": [ + { + "internalType": "bytes32[]", + "name": "hashes", + "type": "bytes32[]" + } + ], + "name": "calculateRootFromPowerOfTwo", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_index", + "type": "uint256" + } + ], + "name": "getEmptyTreeHashAtIndex", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "_wordIndex", + "type": "uint256" + } + ], + "name": "getHashOfWordAtIndex", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + }, + { + "internalType": "uint8", + "name": "_log2Size", + "type": "uint8" + } + ], + "name": "getMerkleRootFromBytes", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint8", + "name": "_log2Size", + "type": "uint8" + } + ], + "name": "getPristineHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "_position", + "type": "uint64" + }, + { + "internalType": "bytes8", + "name": "_value", + "type": "bytes8" + }, + { + "internalType": "bytes32[]", + "name": "proof", + "type": "bytes32[]" + } + ], + "name": "getRoot", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "_position", + "type": "uint64" + }, + { + "internalType": "uint8", + "name": "_logSizeOfReplacement", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "_logSizeOfFullDrive", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "_replacement", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "siblings", + "type": "bytes32[]" + } + ], + "name": "getRootAfterReplacementInDrive", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "_position", + "type": "uint64" + }, + { + "internalType": "uint8", + "name": "_logOfSize", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "_drive", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "siblings", + "type": "bytes32[]" + } + ], + "name": "getRootWithDrive", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + } + ] + }, + "WorkerManagerImpl": { + "address": "0x381e64Cb649A98E2B2FBb440E528A44D21B5B9c0", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "worker", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "JobAccepted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "worker", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "JobOffer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "worker", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "JobRejected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "worker", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "Retired", + "type": "event" + }, + { + "inputs": [], + "name": "acceptJob", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_workerAddress", + "type": "address" + } + ], + "name": "cancelHire", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_workerAddress", + "type": "address" + } + ], + "name": "getOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_workerAddress", + "type": "address" + } + ], + "name": "getUser", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_workerAddress", + "type": "address" + } + ], + "name": "hire", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "workerAddress", + "type": "address" + } + ], + "name": "isAvailable", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_workerAddress", + "type": "address" + } + ], + "name": "isOwned", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "workerAddress", + "type": "address" + } + ], + "name": "isPending", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_workerAddress", + "type": "address" + } + ], + "name": "isRetired", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rejectJob", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_workerAddress", + "type": "address" + } + ], + "name": "retire", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ] + }, + "WorkerAuthManagerImpl": { + "address": "0x82a2fac7211cE5b0D44B7BC63C09716e1c4fF3D6", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_workerManager", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "worker", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "dapp", + "type": "address" + } + ], + "name": "Authorization", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "worker", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "dapp", + "type": "address" + } + ], + "name": "Deauthorization", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_workerAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "_dappAddress", + "type": "address" + } + ], + "name": "authorize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_workerAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "_dappAddress", + "type": "address" + } + ], + "name": "deauthorize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_workerAddress", + "type": "address" + } + ], + "name": "getOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_workerAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "_dappAddress", + "type": "address" + } + ], + "name": "isAuthorized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } + ] + }, + "WorkerManagerAuthManagerImpl": { + "address": "0xFCf6ED0062c5Df801784c58503F893591466329D", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "worker", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "dapp", + "type": "address" + } + ], + "name": "Authorization", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "worker", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "dapp", + "type": "address" + } + ], + "name": "Deauthorization", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "worker", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "JobAccepted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "worker", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "JobOffer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "worker", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "JobRejected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "worker", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "Retired", + "type": "event" + }, + { + "inputs": [], + "name": "acceptJob", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_workerAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "_dappAddress", + "type": "address" + } + ], + "name": "authorize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_workerAddress", + "type": "address" + } + ], + "name": "cancelHire", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_workerAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "_dappAddress", + "type": "address" + } + ], + "name": "deauthorize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_workerAddress", + "type": "address" + } + ], + "name": "getOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_workerAddress", + "type": "address" + } + ], + "name": "getUser", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_workerAddress", + "type": "address" + } + ], + "name": "hire", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_workerAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "_dappAddress", + "type": "address" + } + ], + "name": "hireAndAuthorize", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_workerAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "_dappAddress", + "type": "address" + } + ], + "name": "isAuthorized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "workerAddress", + "type": "address" + } + ], + "name": "isAvailable", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_workerAddress", + "type": "address" + } + ], + "name": "isOwned", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "workerAddress", + "type": "address" + } + ], + "name": "isPending", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_workerAddress", + "type": "address" + } + ], + "name": "isRetired", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rejectJob", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_workerAddress", + "type": "address" + } + ], + "name": "retire", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ] + } + } +} \ No newline at end of file diff --git a/hardhat.config.ts b/hardhat.config.ts index e758294..fee6a00 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -41,6 +41,7 @@ const config: HardhatUserConfig = { url: "http://localhost:8545", accounts: mnemonic ? { mnemonic } : undefined, }, + ropsten: infuraNetwork("ropsten", 3, 6283185), rinkeby: infuraNetwork("rinkeby", 4, 6283185), kovan: infuraNetwork("kovan", 42, 6283185), goerli: infuraNetwork("goerli", 5, 6283185), diff --git a/package.json b/package.json index 4ea3996..cac0016 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@cartesi/util", - "version": "3.1.0", + "version": "3.1.1", "description": "Solidity Util Contracts", "scripts": { "build": "hardhat compile && tsc", @@ -15,7 +15,8 @@ "deploy:matic_testnet": "hardhat deploy --network matic_testnet --export export/abi/matic_testnet.json", "deploy:avax_testnet": "hardhat deploy --network avax_testnet --export export/abi/avax_testnet.json", "deploy:rinkeby": "hardhat deploy --network rinkeby --export export/abi/rinkeby.json", - "deploy:testnet": "run-s deploy:rinkeby deploy:kovan deploy:goerli deploy:matic_testnet deploy:bsc_testnet deploy:avax_testnet", + "deploy:ropsten": "hardhat deploy --network ropsten --export export/abi/ropsten.json", + "deploy:testnet": "run-s deploy:rinkeby deploy:ropsten deploy:kovan deploy:goerli deploy:matic_testnet deploy:bsc_testnet deploy:avax_testnet", "export": "hardhat export-artifacts export/artifacts", "info": "npm-scripts-info", "prepack": "run-s clean prepare", @@ -38,6 +39,7 @@ "deploy:matic_testnet": "Deploy contracts to matic_testnet.", "deploy:avax_testnet": "Deploy contracts to avax_testnet.", "deploy:rinkeby": "Deploy contracts to rinkeby. Requires two environment variables: PROJECT_ID and MNEMONIC.", + "deploy:ropsten": "Deploy contracts to ropsten. Requires two environment variables: PROJECT_ID and MNEMONIC.", "deploy:testnet": "Deploy contracts to all supported testnets. Requires two environment variables: PROJECT_ID and MNEMONIC.", "export": "Export artifacts in a simpler format", "info": "Displays information about the scripts.", @@ -48,31 +50,31 @@ "dependencies": {}, "devDependencies": { "@nomiclabs/hardhat-ethers": "^2.0.2", - "@nomiclabs/hardhat-etherscan": "^2.1.2", + "@nomiclabs/hardhat-etherscan": "^2.1.3", "@nomiclabs/hardhat-waffle": "^2.0.1", "@typechain/ethers-v5": "^7.0.1", - "@typechain/hardhat": "^2.0.2", - "@types/chai": "^4.2.18", + "@typechain/hardhat": "^2.1.0", + "@types/chai": "^4.2.19", "@types/keccak": "^3.0.1", "@types/mocha": "^8.2.2", - "@types/node": "^15.12.2", + "@types/node": "^15.12.5", "chai": "^4.3.4", "copyfiles": "^2.4.1", - "ethereum-waffle": "^3.3.0", - "ethers": "^5.3.1", - "hardhat": "^2.3.3", - "hardhat-deploy": "0.8.6", + "ethereum-waffle": "^3.4.0", + "ethers": "^5.4.0", + "hardhat": "^2.4.1", + "hardhat-deploy": "0.8.9", "npm-run-all": "^4.1.5", "npm-scripts-info": "^0.3.9", - "prettier": "^2.3.1", + "prettier": "^2.3.2", "prettier-plugin-solidity": "^1.0.0-beta.13", "rimraf": "^3.0.2", "solhint": "^3.3.6", "solhint-plugin-prettier": "^0.0.5", "ts-generator": "^0.1.1", "ts-node": "^10.0.0", - "typechain": "^5.0.0", - "typescript": "^4.3.2" + "typechain": "^5.1.1", + "typescript": "^4.3.4" }, "repository": { "type": "git", diff --git a/yarn.lock b/yarn.lock index 40678ce..5027555 100644 --- a/yarn.lock +++ b/yarn.lock @@ -39,18 +39,18 @@ resolved "https://registry.yarnpkg.com/@ensdomains/resolver/-/resolver-0.2.4.tgz#c10fe28bf5efbf49bff4666d909aed0265efbc89" integrity sha512-bvaTH34PMCbv6anRa9I/0zjLJgY4EuznbEMgbV77JBCQ9KNC46rzi0avuxpOfu+xDjPEtSFGqVEOr5GlUSGudA== -"@ethereum-waffle/chai@^3.3.0": - version "3.3.1" - resolved "https://registry.yarnpkg.com/@ethereum-waffle/chai/-/chai-3.3.1.tgz#3f20b810d0fa516f19af93c50c3be1091333fa8e" - integrity sha512-+vepCjttfOzCSnmiVEmd1bR8ctA2wYVrtWa8bDLhnTpj91BIIHotNDTwpeq7fyjrOCIBTN3Ai8ACfjNoatc4OA== +"@ethereum-waffle/chai@^3.4.0": + version "3.4.0" + resolved "https://registry.yarnpkg.com/@ethereum-waffle/chai/-/chai-3.4.0.tgz#2477877410a96bf370edd64df905b04fb9aba9d5" + integrity sha512-GVaFKuFbFUclMkhHtQTDnWBnBQMJc/pAbfbFj/nnIK237WPLsO3KDDslA7m+MNEyTAOFrcc0CyfruAGGXAQw3g== dependencies: - "@ethereum-waffle/provider" "^3.3.1" + "@ethereum-waffle/provider" "^3.4.0" ethers "^5.0.0" -"@ethereum-waffle/compiler@^3.3.0": - version "3.3.1" - resolved "https://registry.yarnpkg.com/@ethereum-waffle/compiler/-/compiler-3.3.1.tgz#946128fd565aa4347075fd716dbd0f3f38189280" - integrity sha512-X/TeQugt94AQwXEdCjIQxcXYGawNulVBYEBE7nloj4wE/RBxNolXwjoVNjcS4kuiMMbKkdO0JkL5sn6ixx8bDg== +"@ethereum-waffle/compiler@^3.4.0": + version "3.4.0" + resolved "https://registry.yarnpkg.com/@ethereum-waffle/compiler/-/compiler-3.4.0.tgz#68917321212563544913de33e408327745cb1284" + integrity sha512-a2wxGOoB9F1QFRE+Om7Cz2wn+pxM/o7a0a6cbwhaS2lECJgFzeN9xEkVrKahRkF4gEfXGcuORg4msP0Asxezlw== dependencies: "@resolver-engine/imports" "^0.3.3" "@resolver-engine/imports-fs" "^0.3.3" @@ -59,34 +59,34 @@ "@types/node-fetch" "^2.5.5" ethers "^5.0.1" mkdirp "^0.5.1" - node-fetch "^2.6.0" + node-fetch "^2.6.1" solc "^0.6.3" ts-generator "^0.1.1" typechain "^3.0.0" -"@ethereum-waffle/ens@^3.2.4": - version "3.2.4" - resolved "https://registry.yarnpkg.com/@ethereum-waffle/ens/-/ens-3.2.4.tgz#c486be4879ea7107e1ff01b24851a5e44f5946ce" - integrity sha512-lkRVPCEkk7KOwH9MqFMB+gL0X8cZNsm+MnKpP9CNbAyhFos2sCDGcY8t6BA12KBK6pdMuuRXPxYL9WfPl9bqSQ== +"@ethereum-waffle/ens@^3.3.0": + version "3.3.0" + resolved "https://registry.yarnpkg.com/@ethereum-waffle/ens/-/ens-3.3.0.tgz#d54f4c8e6b7bcafdc13ab294433f45416b2b2791" + integrity sha512-zVIH/5cQnIEgJPg1aV8+ehYicpcfuAisfrtzYh1pN3UbfeqPylFBeBaIZ7xj/xYzlJjkrek/h9VfULl6EX9Aqw== dependencies: "@ensdomains/ens" "^0.4.4" "@ensdomains/resolver" "^0.2.4" ethers "^5.0.1" -"@ethereum-waffle/mock-contract@^3.2.2": - version "3.2.2" - resolved "https://registry.yarnpkg.com/@ethereum-waffle/mock-contract/-/mock-contract-3.2.2.tgz#5749b03cbb4850150f81cf66151c4523eb7436f0" - integrity sha512-H60Cc5C7sYNU4LuPMSKDh8YIaN9/fkwEjznY78CEbOosO+lMlFYdA+5VZjeDGDuYKfsBqsocQdkj1CRyoi1KNw== +"@ethereum-waffle/mock-contract@^3.3.0": + version "3.3.0" + resolved "https://registry.yarnpkg.com/@ethereum-waffle/mock-contract/-/mock-contract-3.3.0.tgz#7b331f1c95c5d46ee9478f7a6be2869f707d307a" + integrity sha512-apwq0d+2nQxaNwsyLkE+BNMBhZ1MKGV28BtI9WjD3QD2Ztdt1q9II4sKA4VrLTUneYSmkYbJZJxw89f+OpJGyw== dependencies: "@ethersproject/abi" "^5.0.1" ethers "^5.0.1" -"@ethereum-waffle/provider@^3.3.0", "@ethereum-waffle/provider@^3.3.1": - version "3.3.2" - resolved "https://registry.yarnpkg.com/@ethereum-waffle/provider/-/provider-3.3.2.tgz#33677baf6af5cbb087c3072d84f38c152968ebb1" - integrity sha512-ilz6cXK0ylSKCmZktTMpY4gjo0CN6rb86JfN7+RZYk6tKtZA6sXoOe95skWEQkGf1fZk7G817fTzLb0CmFDp1g== +"@ethereum-waffle/provider@^3.4.0": + version "3.4.0" + resolved "https://registry.yarnpkg.com/@ethereum-waffle/provider/-/provider-3.4.0.tgz#a36a0890d4fbc230e807870c8d3b683594efef00" + integrity sha512-QgseGzpwlzmaHXhqfdzthCGu5a6P1SBF955jQHf/rBkK1Y7gGo2ukt3rXgxgfg/O5eHqRU+r8xw5MzVyVaBscQ== dependencies: - "@ethereum-waffle/ens" "^3.2.4" + "@ethereum-waffle/ens" "^3.3.0" ethers "^5.0.1" ganache-core "^2.13.2" patch-package "^6.2.2" @@ -233,7 +233,22 @@ "@ethersproject/properties" "^5.1.0" "@ethersproject/strings" "^5.1.0" -"@ethersproject/abi@5.3.1", "@ethersproject/abi@^5.3.0", "@ethersproject/abi@^5.3.1": +"@ethersproject/abi@5.4.0", "@ethersproject/abi@^5.1.2", "@ethersproject/abi@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.4.0.tgz#a6d63bdb3672f738398846d4279fa6b6c9818242" + integrity sha512-9gU2H+/yK1j2eVMdzm6xvHSnMxk8waIHQGYCZg5uvAyH0rsAzxkModzBSpbAkAuhKFEovC2S9hM4nPuLym8IZw== + dependencies: + "@ethersproject/address" "^5.4.0" + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/constants" "^5.4.0" + "@ethersproject/hash" "^5.4.0" + "@ethersproject/keccak256" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + "@ethersproject/strings" "^5.4.0" + +"@ethersproject/abi@^5.3.0", "@ethersproject/abi@^5.3.1": version "5.3.1" resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.3.1.tgz#69a1a496729d3a83521675a57cbe21f3cc27241c" integrity sha512-F98FWTJG7nWWAQ4DcV6R0cSlrj67MWK3ylahuFbzkumem5cLWg1p7fZ3vIdRoS1c7TEf55Lvyx0w7ICR47IImw== @@ -261,7 +276,20 @@ "@ethersproject/transactions" "^5.1.0" "@ethersproject/web" "^5.1.0" -"@ethersproject/abstract-provider@5.3.0", "@ethersproject/abstract-provider@^5.3.0": +"@ethersproject/abstract-provider@5.4.0", "@ethersproject/abstract-provider@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.4.0.tgz#415331031b0f678388971e1987305244edc04e1d" + integrity sha512-vPBR7HKUBY0lpdllIn7tLIzNN7DrVnhCLKSzY0l8WAwxz686m/aL7ASDzrVxV93GJtIub6N2t4dfZ29CkPOxgA== + dependencies: + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/networks" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + "@ethersproject/transactions" "^5.4.0" + "@ethersproject/web" "^5.4.0" + +"@ethersproject/abstract-provider@^5.3.0": version "5.3.0" resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.3.0.tgz#f4c0ae4a4cef9f204d7781de805fd44b72756c81" integrity sha512-1+MLhGP1GwxBDBNwMWVmhCsvKwh4gK7oIfOrmlmePNeskg1NhIrYssraJBieaFNHUYfKEd/1DjiVZMw8Qu5Cxw== @@ -285,7 +313,18 @@ "@ethersproject/logger" "^5.1.0" "@ethersproject/properties" "^5.1.0" -"@ethersproject/abstract-signer@5.3.0", "@ethersproject/abstract-signer@^5.3.0": +"@ethersproject/abstract-signer@5.4.0", "@ethersproject/abstract-signer@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.4.0.tgz#cd5f50b93141ee9f9f49feb4075a0b3eafb57d65" + integrity sha512-AieQAzt05HJZS2bMofpuxMEp81AHufA5D6M4ScKwtolj041nrfIbIi8ciNW7+F59VYxXq+V4c3d568Q6l2m8ew== + dependencies: + "@ethersproject/abstract-provider" "^5.4.0" + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + +"@ethersproject/abstract-signer@^5.3.0": version "5.3.0" resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.3.0.tgz#05172b653e15b535ed5854ef5f6a72f4b441052d" integrity sha512-w8IFwOYqiPrtvosPuArZ3+QPR2nmdVTRrVY8uJYL3NNfMmQfTy3V3l2wbzX47UUlNbPJY+gKvzJAyvK1onZxJg== @@ -307,7 +346,18 @@ "@ethersproject/logger" "^5.1.0" "@ethersproject/rlp" "^5.1.0" -"@ethersproject/address@5.3.0", "@ethersproject/address@^5.3.0": +"@ethersproject/address@5.4.0", "@ethersproject/address@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.4.0.tgz#ba2d00a0f8c4c0854933b963b9a3a9f6eb4a37a3" + integrity sha512-SD0VgOEkcACEG/C6xavlU1Hy3m5DGSXW3CUHkaaEHbAPPsgi0coP5oNPsxau8eTlZOk/bpa/hKeCNoK5IzVI2Q== + dependencies: + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/keccak256" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/rlp" "^5.4.0" + +"@ethersproject/address@^5.3.0": version "5.3.0" resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.3.0.tgz#e53b69eacebf332e8175de814c5e6507d6932518" integrity sha512-29TgjzEBK+gUEUAOfWCG7s9IxLNLCqvr+oDSk6L9TXD0VLvZJKhJV479tKQqheVA81OeGxfpdxYtUVH8hqlCvA== @@ -325,7 +375,14 @@ dependencies: "@ethersproject/bytes" "^5.1.0" -"@ethersproject/base64@5.3.0", "@ethersproject/base64@^5.3.0": +"@ethersproject/base64@5.4.0", "@ethersproject/base64@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.4.0.tgz#7252bf65295954c9048c7ca5f43e5c86441b2a9a" + integrity sha512-CjQw6E17QDSSC5jiM9YpF7N1aSCHmYGMt9bWD8PWv6YPMxjsys2/Q8xLrROKI3IWJ7sFfZ8B3flKDTM5wlWuZQ== + dependencies: + "@ethersproject/bytes" "^5.4.0" + +"@ethersproject/base64@^5.3.0": version "5.3.0" resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.3.0.tgz#b831fb35418b42ad24d943c557259062b8640824" integrity sha512-JIqgtOmgKcbc2sjGWTXyXktqUhvFUDte8fPVsAaOrcPiJf6YotNF+nsrOYGC9pbHBEGSuSBp3QR0varkO8JHEw== @@ -340,7 +397,15 @@ "@ethersproject/bytes" "^5.1.0" "@ethersproject/properties" "^5.1.0" -"@ethersproject/basex@5.3.0", "@ethersproject/basex@^5.3.0": +"@ethersproject/basex@5.4.0", "@ethersproject/basex@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.4.0.tgz#0a2da0f4e76c504a94f2b21d3161ed9438c7f8a6" + integrity sha512-J07+QCVJ7np2bcpxydFVf/CuYo9mZ7T73Pe7KQY4c1lRlrixMeblauMxHXD0MPwFmUHZIILDNViVkykFBZylbg== + dependencies: + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + +"@ethersproject/basex@^5.3.0": version "5.3.0" resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.3.0.tgz#02dea3ab8559ae625c6d548bc11773432255c916" integrity sha512-8J4nS6t/SOnoCgr3DF5WCSRLC5YwTKYpZWJqeyYQLX+86TwPhtzvHXacODzcDII9tWKhVg6g0Bka8JCBWXsCiQ== @@ -357,7 +422,16 @@ "@ethersproject/logger" "^5.1.0" bn.js "^4.4.0" -"@ethersproject/bignumber@5.3.0", "@ethersproject/bignumber@^5.3.0": +"@ethersproject/bignumber@5.4.0", "@ethersproject/bignumber@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.4.0.tgz#be8dea298c0ec71208ee60f0b245be0761217ad9" + integrity sha512-OXUu9f9hO3vGRIPxU40cignXZVaYyfx6j9NNMjebKdnaCL3anCLSSy8/b8d03vY6dh7duCC0kW72GEC4tZer2w== + dependencies: + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + bn.js "^4.11.9" + +"@ethersproject/bignumber@^5.3.0": version "5.3.0" resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.3.0.tgz#74ab2ec9c3bda4e344920565720a6ee9c794e9db" integrity sha512-5xguJ+Q1/zRMgHgDCaqAexx/8DwDVLRemw2i6uR8KyGjwGdXI8f32QZZ1cKGucBN6ekJvpUpHy6XAuQnTv0mPA== @@ -373,7 +447,14 @@ dependencies: "@ethersproject/logger" "^5.1.0" -"@ethersproject/bytes@5.3.0", "@ethersproject/bytes@^5.3.0": +"@ethersproject/bytes@5.4.0", "@ethersproject/bytes@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.4.0.tgz#56fa32ce3bf67153756dbaefda921d1d4774404e" + integrity sha512-H60ceqgTHbhzOj4uRc/83SCN9d+BSUnOkrr2intevqdtEMO1JFVZ1XL84OEZV+QjV36OaZYxtnt4lGmxcGsPfA== + dependencies: + "@ethersproject/logger" "^5.4.0" + +"@ethersproject/bytes@^5.3.0": version "5.3.0" resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.3.0.tgz#473e0da7f831d535b2002be05e6f4ca3729a1bc9" integrity sha512-rqLJjdVqCcn7glPer7Fxh87PRqlnRScVAoxcIP3PmOUNApMWJ6yRdOFfo2KvPAdO7Le3yEI1o0YW+Yvr7XCYvw== @@ -387,7 +468,14 @@ dependencies: "@ethersproject/bignumber" "^5.1.0" -"@ethersproject/constants@5.3.0", "@ethersproject/constants@^5.3.0": +"@ethersproject/constants@5.4.0", "@ethersproject/constants@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.4.0.tgz#ee0bdcb30bf1b532d2353c977bf2ef1ee117958a" + integrity sha512-tzjn6S7sj9+DIIeKTJLjK9WGN2Tj0P++Z8ONEIlZjyoTkBuODN+0VfhAyYksKi43l1Sx9tX2VlFfzjfmr5Wl3Q== + dependencies: + "@ethersproject/bignumber" "^5.4.0" + +"@ethersproject/constants@^5.3.0": version "5.3.0" resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.3.0.tgz#a5d6d86c0eec2c64c3024479609493b9afb3fc77" integrity sha512-4y1feNOwEpgjAfiCFWOHznvv6qUF/H6uI0UKp8xdhftb+H+FbKflXg1pOgH5qs4Sr7EYBL+zPyPb+YD5g1aEyw== @@ -410,7 +498,23 @@ "@ethersproject/properties" "^5.1.0" "@ethersproject/transactions" "^5.1.0" -"@ethersproject/contracts@5.3.0", "@ethersproject/contracts@^5.3.0": +"@ethersproject/contracts@5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.4.0.tgz#e05fe6bd33acc98741e27d553889ec5920078abb" + integrity sha512-hkO3L3IhS1Z3ZtHtaAG/T87nQ7KiPV+/qnvutag35I0IkiQ8G3ZpCQ9NNOpSCzn4pWSW4CfzmtE02FcqnLI+hw== + dependencies: + "@ethersproject/abi" "^5.4.0" + "@ethersproject/abstract-provider" "^5.4.0" + "@ethersproject/abstract-signer" "^5.4.0" + "@ethersproject/address" "^5.4.0" + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/constants" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + "@ethersproject/transactions" "^5.4.0" + +"@ethersproject/contracts@^5.3.0": version "5.3.0" resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.3.0.tgz#ad699a3abaae30bfb6422cf31813a663b2d4099c" integrity sha512-eDyQ8ltykvyQqnGZxb/c1e0OnEtzqXhNNC4BX8nhYBCaoBrYYuK/1fLmyEvc5+XUMoxNhwpYkoSSwvPLci7/Zg== @@ -440,7 +544,21 @@ "@ethersproject/properties" "^5.1.0" "@ethersproject/strings" "^5.1.0" -"@ethersproject/hash@5.3.0", "@ethersproject/hash@^5.3.0": +"@ethersproject/hash@5.4.0", "@ethersproject/hash@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.4.0.tgz#d18a8e927e828e22860a011f39e429d388344ae0" + integrity sha512-xymAM9tmikKgbktOCjW60Z5sdouiIIurkZUr9oW5NOex5uwxrbsYG09kb5bMcNjlVeJD3yPivTNzViIs1GCbqA== + dependencies: + "@ethersproject/abstract-signer" "^5.4.0" + "@ethersproject/address" "^5.4.0" + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/keccak256" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + "@ethersproject/strings" "^5.4.0" + +"@ethersproject/hash@^5.3.0": version "5.3.0" resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.3.0.tgz#f65e3bf3db3282df4da676db6cfa049535dd3643" integrity sha512-gAFZSjUPQ32CIfoKSMtMEQ+IO0kQxqhwz9fCIFt2DtAq2u4pWt8mL9Z5P0r6KkLcQU8LE9FmuPPyd+JvBzmr1w== @@ -472,7 +590,25 @@ "@ethersproject/transactions" "^5.1.0" "@ethersproject/wordlists" "^5.1.0" -"@ethersproject/hdnode@5.3.0", "@ethersproject/hdnode@^5.3.0": +"@ethersproject/hdnode@5.4.0", "@ethersproject/hdnode@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.4.0.tgz#4bc9999b9a12eb5ce80c5faa83114a57e4107cac" + integrity sha512-pKxdS0KAaeVGfZPp1KOiDLB0jba11tG6OP1u11QnYfb7pXn6IZx0xceqWRr6ygke8+Kw74IpOoSi7/DwANhy8Q== + dependencies: + "@ethersproject/abstract-signer" "^5.4.0" + "@ethersproject/basex" "^5.4.0" + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/pbkdf2" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + "@ethersproject/sha2" "^5.4.0" + "@ethersproject/signing-key" "^5.4.0" + "@ethersproject/strings" "^5.4.0" + "@ethersproject/transactions" "^5.4.0" + "@ethersproject/wordlists" "^5.4.0" + +"@ethersproject/hdnode@^5.3.0": version "5.3.0" resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.3.0.tgz#26fed65ffd5c25463fddff13f5fb4e5617553c94" integrity sha512-zLmmtLNoDMGoYRdjOab01Zqkvp+TmZyCGDAMQF1Bs3yZyBs/kzTNi1qJjR1jVUcPP5CWGtjFwY8iNG8oNV9J8g== @@ -509,7 +645,26 @@ aes-js "3.0.0" scrypt-js "3.0.1" -"@ethersproject/json-wallets@5.3.0", "@ethersproject/json-wallets@^5.3.0": +"@ethersproject/json-wallets@5.4.0", "@ethersproject/json-wallets@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.4.0.tgz#2583341cfe313fc9856642e8ace3080154145e95" + integrity sha512-igWcu3fx4aiczrzEHwG1xJZo9l1cFfQOWzTqwRw/xcvxTk58q4f9M7cjh51EKphMHvrJtcezJ1gf1q1AUOfEQQ== + dependencies: + "@ethersproject/abstract-signer" "^5.4.0" + "@ethersproject/address" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/hdnode" "^5.4.0" + "@ethersproject/keccak256" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/pbkdf2" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + "@ethersproject/random" "^5.4.0" + "@ethersproject/strings" "^5.4.0" + "@ethersproject/transactions" "^5.4.0" + aes-js "3.0.0" + scrypt-js "3.0.1" + +"@ethersproject/json-wallets@^5.3.0": version "5.3.0" resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.3.0.tgz#7b1a5ff500c12aa8597ae82c8939837b0449376e" integrity sha512-/xwbqaIb5grUIGNmeEaz8GdcpmDr++X8WT4Jqcclnxow8PXCUHFeDxjf3O+nSuoqOYG/Ds0+BI5xuQKbva6Xkw== @@ -536,7 +691,15 @@ "@ethersproject/bytes" "^5.1.0" js-sha3 "0.5.7" -"@ethersproject/keccak256@5.3.0", "@ethersproject/keccak256@^5.3.0": +"@ethersproject/keccak256@5.4.0", "@ethersproject/keccak256@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.4.0.tgz#7143b8eea4976080241d2bd92e3b1f1bf7025318" + integrity sha512-FBI1plWet+dPUvAzPAeHzRKiPpETQzqSUWR1wXJGHVWi4i8bOSrpC3NwpkPjgeXG7MnugVc1B42VbfnQikyC/A== + dependencies: + "@ethersproject/bytes" "^5.4.0" + js-sha3 "0.5.7" + +"@ethersproject/keccak256@^5.3.0": version "5.3.0" resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.3.0.tgz#fb5cd36bdfd6fa02e2ea84964078a9fc6bd731be" integrity sha512-Gv2YqgIUmRbYVNIibafT0qGaeGYLIA/EdWHJ7JcVxVSs2vyxafGxOJ5VpSBHWeOIsE6OOaCelYowhuuTicgdFQ== @@ -549,7 +712,12 @@ resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.1.0.tgz#4cdeeefac029373349d5818f39c31b82cc6d9bbf" integrity sha512-wtUaD1lBX10HBXjjKV9VHCBnTdUaKQnQ2XSET1ezglqLdPdllNOIlLfhyCRqXm5xwcjExVI5ETokOYfjPtaAlw== -"@ethersproject/logger@5.3.0", "@ethersproject/logger@^5.3.0": +"@ethersproject/logger@5.4.0", "@ethersproject/logger@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.4.0.tgz#f39adadf62ad610c420bcd156fd41270e91b3ca9" + integrity sha512-xYdWGGQ9P2cxBayt64d8LC8aPFJk6yWCawQi/4eJ4+oJdMMjEBMrIcIMZ9AxhwpPVmnBPrsB10PcXGmGAqgUEQ== + +"@ethersproject/logger@^5.3.0": version "5.3.0" resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.3.0.tgz#7a69fa1d4ca0d4b7138da1627eb152f763d84dd0" integrity sha512-8bwJ2gxJGkZZnpQSq5uSiZSJjyVTWmlGft4oH8vxHdvO1Asy4TwVepAhPgxIQIMxXZFUNMych1YjIV4oQ4I7dA== @@ -561,7 +729,14 @@ dependencies: "@ethersproject/logger" "^5.1.0" -"@ethersproject/networks@5.3.1", "@ethersproject/networks@^5.3.0": +"@ethersproject/networks@5.4.0", "@ethersproject/networks@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.4.0.tgz#71eecd3ef3755118b42c1a5d2a44a7e07202e10a" + integrity sha512-5fywtKRDcnaVeA5SjxXH3DOQqe/IbeD/plwydi94SdPps1fbDUrnO6SzDExaruBZXxpxJcO9upG9UComsei4bg== + dependencies: + "@ethersproject/logger" "^5.4.0" + +"@ethersproject/networks@^5.3.0": version "5.3.1" resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.3.1.tgz#78fe08324cee289ce239acf8c746121934b2ef61" integrity sha512-6uQKHkYChlsfeiZhQ8IHIqGE/sQsf25o9ZxAYpMxi15dLPzz3IxOEF5KiSD32aHwsjXVBKBSlo+teAXLlYJybw== @@ -576,7 +751,15 @@ "@ethersproject/bytes" "^5.1.0" "@ethersproject/sha2" "^5.1.0" -"@ethersproject/pbkdf2@5.3.0", "@ethersproject/pbkdf2@^5.3.0": +"@ethersproject/pbkdf2@5.4.0", "@ethersproject/pbkdf2@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.4.0.tgz#ed88782a67fda1594c22d60d0ca911a9d669641c" + integrity sha512-x94aIv6tiA04g6BnazZSLoRXqyusawRyZWlUhKip2jvoLpzJuLb//KtMM6PEovE47pMbW+Qe1uw+68ameJjB7g== + dependencies: + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/sha2" "^5.4.0" + +"@ethersproject/pbkdf2@^5.3.0": version "5.3.0" resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.3.0.tgz#8adbb41489c3c9f319cc44bc7d3e6095fd468dc8" integrity sha512-Q9ChVU6gBFiex0FSdtzo4b0SAKz3ZYcYVFLrEWHL0FnHvNk3J3WgAtRNtBQGQYn/T5wkoTdZttMbfBkFlaiWcA== @@ -591,7 +774,14 @@ dependencies: "@ethersproject/logger" "^5.1.0" -"@ethersproject/properties@5.3.0", "@ethersproject/properties@^5.3.0": +"@ethersproject/properties@5.4.0", "@ethersproject/properties@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.4.0.tgz#38ba20539b44dcc5d5f80c45ad902017dcdbefe7" + integrity sha512-7jczalGVRAJ+XSRvNA6D5sAwT4gavLq3OXPuV/74o3Rd2wuzSL035IMpIMgei4CYyBdialJMrTqkOnzccLHn4A== + dependencies: + "@ethersproject/logger" "^5.4.0" + +"@ethersproject/properties@^5.3.0": version "5.3.0" resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.3.0.tgz#feef4c4babeb7c10a6b3449575016f4ad2c092b2" integrity sha512-PaHxJyM5/bfusk6vr3yP//JMnm4UEojpzuWGTmtL5X4uNhNnFNvlYilZLyDr4I9cTkIbipCMsAuIcXWsmdRnEw== @@ -623,7 +813,32 @@ bech32 "1.1.4" ws "7.2.3" -"@ethersproject/providers@5.3.1", "@ethersproject/providers@^5.3.1": +"@ethersproject/providers@5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.4.0.tgz#1b9eeaf394d790a662ec66373d7219c82f4433f2" + integrity sha512-XRmI9syLnkNdLA8ikEeg0duxmwSWTTt9S+xabnTOyI51JPJyhQ0QUNT+wvmod218ebb7rLupHDPQ7UVe2/+Tjg== + dependencies: + "@ethersproject/abstract-provider" "^5.4.0" + "@ethersproject/abstract-signer" "^5.4.0" + "@ethersproject/address" "^5.4.0" + "@ethersproject/basex" "^5.4.0" + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/constants" "^5.4.0" + "@ethersproject/hash" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/networks" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + "@ethersproject/random" "^5.4.0" + "@ethersproject/rlp" "^5.4.0" + "@ethersproject/sha2" "^5.4.0" + "@ethersproject/strings" "^5.4.0" + "@ethersproject/transactions" "^5.4.0" + "@ethersproject/web" "^5.4.0" + bech32 "1.1.4" + ws "7.4.6" + +"@ethersproject/providers@^5.3.1": version "5.3.1" resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.3.1.tgz#a12c6370e8cbc0968c9744641b8ef90b0dd5ec2b" integrity sha512-HC63vENTrur6/JKEhcQbA8PRDj1FAesdpX98IW+xAAo3EAkf70ou5fMIA3KCGzJDLNTeYA4C2Bonz849tVLekg== @@ -656,7 +871,15 @@ "@ethersproject/bytes" "^5.1.0" "@ethersproject/logger" "^5.1.0" -"@ethersproject/random@5.3.0", "@ethersproject/random@^5.3.0": +"@ethersproject/random@5.4.0", "@ethersproject/random@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.4.0.tgz#9cdde60e160d024be39cc16f8de3b9ce39191e16" + integrity sha512-pnpWNQlf0VAZDEOVp1rsYQosmv2o0ITS/PecNw+mS2/btF8eYdspkN0vIXrCMtkX09EAh9bdk8GoXmFXM1eAKw== + dependencies: + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + +"@ethersproject/random@^5.3.0": version "5.3.0" resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.3.0.tgz#7c46bf36e50cb0d0550bc8c666af8e1d4496dc1a" integrity sha512-A5SL/4inutSwt3Fh2OD0x2gz+x6GHmuUnIPkR7zAiTidMD2N8F6tZdMF1hlQKWVCcVMWhEQg8mWijhEzm6BBYw== @@ -672,7 +895,15 @@ "@ethersproject/bytes" "^5.1.0" "@ethersproject/logger" "^5.1.0" -"@ethersproject/rlp@5.3.0", "@ethersproject/rlp@^5.3.0": +"@ethersproject/rlp@5.4.0", "@ethersproject/rlp@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.4.0.tgz#de61afda5ff979454e76d3b3310a6c32ad060931" + integrity sha512-0I7MZKfi+T5+G8atId9QaQKHRvvasM/kqLyAH4XxBCBchAooH2EX5rL9kYZWwcm3awYV+XC7VF6nLhfeQFKVPg== + dependencies: + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + +"@ethersproject/rlp@^5.3.0": version "5.3.0" resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.3.0.tgz#7cb93a7b5dfa69163894153c9d4b0d936f333188" integrity sha512-oI0joYpsRanl9guDubaW+1NbcpK0vJ3F/6Wpcanzcnqq+oaW9O5E98liwkEDPcb16BUTLIJ+ZF8GPIHYxJ/5Pw== @@ -689,7 +920,16 @@ "@ethersproject/logger" "^5.1.0" hash.js "1.1.3" -"@ethersproject/sha2@5.3.0", "@ethersproject/sha2@^5.3.0": +"@ethersproject/sha2@5.4.0", "@ethersproject/sha2@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.4.0.tgz#c9a8db1037014cbc4e9482bd662f86c090440371" + integrity sha512-siheo36r1WD7Cy+bDdE1BJ8y0bDtqXCOxRMzPa4bV1TGt/eTUUt03BHoJNB6reWJD8A30E/pdJ8WFkq+/uz4Gg== + dependencies: + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + hash.js "1.1.7" + +"@ethersproject/sha2@^5.3.0": version "5.3.0" resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.3.0.tgz#209f9a1649f7d2452dcd5e5b94af43b7f3f42366" integrity sha512-r5ftlwKcocYEuFz2JbeKOT5SAsCV4m1RJDsTOEfQ5L67ZC7NFDK5i7maPdn1bx4nPhylF9VAwxSrQ1esmwzylg== @@ -709,7 +949,19 @@ bn.js "^4.4.0" elliptic "6.5.4" -"@ethersproject/signing-key@5.3.0", "@ethersproject/signing-key@^5.3.0": +"@ethersproject/signing-key@5.4.0", "@ethersproject/signing-key@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.4.0.tgz#2f05120984e81cf89a3d5f6dec5c68ee0894fbec" + integrity sha512-q8POUeywx6AKg2/jX9qBYZIAmKSB4ubGXdQ88l40hmATj29JnG5pp331nAWwwxPn2Qao4JpWHNZsQN+bPiSW9A== + dependencies: + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + bn.js "^4.11.9" + elliptic "6.5.4" + hash.js "1.1.7" + +"@ethersproject/signing-key@^5.3.0": version "5.3.0" resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.3.0.tgz#a96c88f8173e1abedfa35de32d3e5db7c48e5259" integrity sha512-+DX/GwHAd0ok1bgedV1cKO0zfK7P/9aEyNoaYiRsGHpCecN7mhLqcdoUiUzE7Uz86LBsxm5ssK0qA1kBB47fbQ== @@ -732,7 +984,18 @@ "@ethersproject/sha2" "^5.1.0" "@ethersproject/strings" "^5.1.0" -"@ethersproject/solidity@5.3.0", "@ethersproject/solidity@^5.3.0": +"@ethersproject/solidity@5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.4.0.tgz#1305e058ea02dc4891df18b33232b11a14ece9ec" + integrity sha512-XFQTZ7wFSHOhHcV1DpcWj7VXECEiSrBuv7JErJvB9Uo+KfCdc3QtUZV+Vjh/AAaYgezUEKbCtE6Khjm44seevQ== + dependencies: + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/keccak256" "^5.4.0" + "@ethersproject/sha2" "^5.4.0" + "@ethersproject/strings" "^5.4.0" + +"@ethersproject/solidity@^5.3.0": version "5.3.0" resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.3.0.tgz#2a0b00b4aaaef99a080ddea13acab1fa35cd4a93" integrity sha512-uLRBaNUiISHbut94XKewJgQh6UmydWTBp71I7I21pkjVXfZO2dJ5EOo3jCnumJc01M4LOm79dlNNmF3oGIvweQ== @@ -752,7 +1015,16 @@ "@ethersproject/constants" "^5.1.0" "@ethersproject/logger" "^5.1.0" -"@ethersproject/strings@5.3.0", "@ethersproject/strings@^5.3.0": +"@ethersproject/strings@5.4.0", "@ethersproject/strings@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.4.0.tgz#fb12270132dd84b02906a8d895ae7e7fa3d07d9a" + integrity sha512-k/9DkH5UGDhv7aReXLluFG5ExurwtIpUfnDNhQA29w896Dw3i4uDTz01Quaptbks1Uj9kI8wo9tmW73wcIEaWA== + dependencies: + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/constants" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + +"@ethersproject/strings@^5.3.0": version "5.3.0" resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.3.0.tgz#a6b640aab56a18e0909f657da798eef890968ff0" integrity sha512-j/AzIGZ503cvhuF2ldRSjB0BrKzpsBMtCieDtn4TYMMZMQ9zScJn9wLzTQl/bRNvJbBE6TOspK0r8/Ngae/f2Q== @@ -776,7 +1048,22 @@ "@ethersproject/rlp" "^5.1.0" "@ethersproject/signing-key" "^5.1.0" -"@ethersproject/transactions@5.3.0", "@ethersproject/transactions@^5.3.0": +"@ethersproject/transactions@5.4.0", "@ethersproject/transactions@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.4.0.tgz#a159d035179334bd92f340ce0f77e83e9e1522e0" + integrity sha512-s3EjZZt7xa4BkLknJZ98QGoIza94rVjaEed0rzZ/jB9WrIuu/1+tjvYCWzVrystXtDswy7TPBeIepyXwSYa4WQ== + dependencies: + "@ethersproject/address" "^5.4.0" + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/constants" "^5.4.0" + "@ethersproject/keccak256" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + "@ethersproject/rlp" "^5.4.0" + "@ethersproject/signing-key" "^5.4.0" + +"@ethersproject/transactions@^5.3.0": version "5.3.0" resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.3.0.tgz#49b86f2bafa4d0bdf8e596578fc795ee47c50458" integrity sha512-cdfK8VVyW2oEBCXhURG0WQ6AICL/r6Gmjh0e4Bvbv6MCn/GBd8FeBH3rtl7ho+AW50csMKeGv3m3K1HSHB2jMQ== @@ -800,14 +1087,14 @@ "@ethersproject/constants" "^5.1.0" "@ethersproject/logger" "^5.1.0" -"@ethersproject/units@5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/units/-/units-5.3.0.tgz#c4d1493532ad3d4ddf6e2bc4f8c94a2db933a8f5" - integrity sha512-BkfccZGwfJ6Ob+AelpIrgAzuNhrN2VLp3AILnkqTOv+yBdsc83V4AYf25XC/u0rHnWl6f4POaietPwlMqP2vUg== +"@ethersproject/units@5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/units/-/units-5.4.0.tgz#d57477a4498b14b88b10396062c8cbbaf20c79fe" + integrity sha512-Z88krX40KCp+JqPCP5oPv5p750g+uU6gopDYRTBGcDvOASh6qhiEYCRatuM/suC4S2XW9Zz90QI35MfSrTIaFg== dependencies: - "@ethersproject/bignumber" "^5.3.0" - "@ethersproject/constants" "^5.3.0" - "@ethersproject/logger" "^5.3.0" + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/constants" "^5.4.0" + "@ethersproject/logger" "^5.4.0" "@ethersproject/wallet@5.1.0": version "5.1.0" @@ -830,7 +1117,28 @@ "@ethersproject/transactions" "^5.1.0" "@ethersproject/wordlists" "^5.1.0" -"@ethersproject/wallet@5.3.0", "@ethersproject/wallet@^5.3.0": +"@ethersproject/wallet@5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.4.0.tgz#fa5b59830b42e9be56eadd45a16a2e0933ad9353" + integrity sha512-wU29majLjM6AjCjpat21mPPviG+EpK7wY1+jzKD0fg3ui5fgedf2zEu1RDgpfIMsfn8fJHJuzM4zXZ2+hSHaSQ== + dependencies: + "@ethersproject/abstract-provider" "^5.4.0" + "@ethersproject/abstract-signer" "^5.4.0" + "@ethersproject/address" "^5.4.0" + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/hash" "^5.4.0" + "@ethersproject/hdnode" "^5.4.0" + "@ethersproject/json-wallets" "^5.4.0" + "@ethersproject/keccak256" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + "@ethersproject/random" "^5.4.0" + "@ethersproject/signing-key" "^5.4.0" + "@ethersproject/transactions" "^5.4.0" + "@ethersproject/wordlists" "^5.4.0" + +"@ethersproject/wallet@^5.3.0": version "5.3.0" resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.3.0.tgz#91946b470bd279e39ade58866f21f92749d062af" integrity sha512-boYBLydG6671p9QoG6EinNnNzbm7DNOjVT20eV8J6HQEq4aUaGiA2CytF2vK+2rOEWbzhZqoNDt6AlkE1LlsTg== @@ -862,7 +1170,18 @@ "@ethersproject/properties" "^5.1.0" "@ethersproject/strings" "^5.1.0" -"@ethersproject/web@5.3.0", "@ethersproject/web@^5.3.0": +"@ethersproject/web@5.4.0", "@ethersproject/web@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.4.0.tgz#49fac173b96992334ed36a175538ba07a7413d1f" + integrity sha512-1bUusGmcoRLYgMn6c1BLk1tOKUIFuTg8j+6N8lYlbMpDesnle+i3pGSagGNvwjaiLo4Y5gBibwctpPRmjrh4Og== + dependencies: + "@ethersproject/base64" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + "@ethersproject/strings" "^5.4.0" + +"@ethersproject/web@^5.3.0": version "5.3.0" resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.3.0.tgz#7959c403f6476c61515008d8f92da51c553a8ee1" integrity sha512-Ni6/DHnY6k/TD41LEkv0RQDx4jqWz5e/RZvrSecsxGYycF+MFy2z++T/yGc2peRunLOTIFwEksgEGGlbwfYmhQ== @@ -884,7 +1203,18 @@ "@ethersproject/properties" "^5.1.0" "@ethersproject/strings" "^5.1.0" -"@ethersproject/wordlists@5.3.0", "@ethersproject/wordlists@^5.3.0": +"@ethersproject/wordlists@5.4.0", "@ethersproject/wordlists@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.4.0.tgz#f34205ec3bbc9e2c49cadaee774cf0b07e7573d7" + integrity sha512-FemEkf6a+EBKEPxlzeVgUaVSodU7G0Na89jqKjmWMlDB0tomoU8RlEMgUvXyqtrg8N4cwpLh8nyRnm1Nay1isA== + dependencies: + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/hash" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + "@ethersproject/strings" "^5.4.0" + +"@ethersproject/wordlists@^5.3.0": version "5.3.0" resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.3.0.tgz#45a0205f5178c1de33d316cb2ab7ed5eac3c06c5" integrity sha512-JcwumCZcsUxgWpiFU/BRy6b4KlTRdOmYvOKZcAw/3sdF93/pZyPW5Od2hFkHS8oWp4xS06YQ+qHqQhdcxdHafQ== @@ -900,10 +1230,10 @@ resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-ethers/-/hardhat-ethers-2.0.2.tgz#c472abcba0c5185aaa4ad4070146e95213c68511" integrity sha512-6quxWe8wwS4X5v3Au8q1jOvXYEPkS1Fh+cME5u6AwNdnI4uERvPlVjlgRWzpnb+Rrt1l/cEqiNRH9GlsBMSDQg== -"@nomiclabs/hardhat-etherscan@^2.1.2": - version "2.1.2" - resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-etherscan/-/hardhat-etherscan-2.1.2.tgz#333b70a6116e922d16de2ef833dcb7191319afdd" - integrity sha512-SExzaBuHlnmHw0HKkElHITzdvhUQmlIRc2tlaywzgvPbh7WoI24nYqZ4N0CO+JXSDgRpFycvQNA8zRaCqjuqUg== +"@nomiclabs/hardhat-etherscan@^2.1.3": + version "2.1.3" + resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-etherscan/-/hardhat-etherscan-2.1.3.tgz#ba52e5cb526f6c477e5e97e07c72a42232773c92" + integrity sha512-0Ic5dLBWASeX3e8tR5cdfoSQw8fTp2Bw49RGUN1pSJuxKIQAOWq5MI9qC1Bd51xK/AsdRSnHDxoVYK1+FC1s1w== dependencies: "@ethersproject/abi" "^5.0.2" "@ethersproject/address" "^5.0.2" @@ -1096,10 +1426,10 @@ resolved "https://registry.yarnpkg.com/@typechain/ethers-v5/-/ethers-v5-7.0.1.tgz#f9ae60ae5bd9e8ea8a996f66244147e8e74034ae" integrity sha512-mXEJ7LG0pOYO+MRPkHtbf30Ey9X2KAsU0wkeoVvjQIn7iAY6tB3k3s+82bbmJAUMyENbQ04RDOZit36CgSG6Gg== -"@typechain/hardhat@^2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@typechain/hardhat/-/hardhat-2.0.2.tgz#5cc1e9aba565404f1ee21e430bcda63d9dc97c69" - integrity sha512-Bd+8dEdqUBJiQBtCIdzKd/Q7FMuHaggO7DI39aZwOGBo07CyWmdfiRpvfRqnX3SEIrzQsrJ/5YS5EoQjVR39BQ== +"@typechain/hardhat@^2.1.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@typechain/hardhat/-/hardhat-2.1.0.tgz#e6abe4b44172273f537121ea79afe0bbbbb0bff9" + integrity sha512-f9zv+yGA6P055U8cYruW9UnSH2lBdM2PSJx/oy8biMXdw5d+xVfY4GCet4w6ry32Vy1OjqGoDM98EZ9H0EAPrg== dependencies: fs-extra "^9.1.0" @@ -1127,10 +1457,10 @@ resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.2.16.tgz#f09cc36e18d28274f942e7201147cce34d97e8c8" integrity sha512-vI5iOAsez9+roLS3M3+Xx7w+WRuDtSmF8bQkrbcIJ2sC1PcDgVoA0WGpa+bIrJ+y8zqY2oi//fUctkxtIcXJCw== -"@types/chai@^4.2.18": - version "4.2.18" - resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.2.18.tgz#0c8e298dbff8205e2266606c1ea5fbdba29b46e4" - integrity sha512-rS27+EkB/RE1Iz3u0XtVL5q36MGDWbgYe7zWiodyKNUnthxY0rukK5V36eiUCtCisB7NN8zKYH6DO2M37qxFEQ== +"@types/chai@^4.2.19": + version "4.2.19" + resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.2.19.tgz#80f286b515897413c7a35bdda069cc80f2344233" + integrity sha512-jRJgpRBuY+7izT7/WNXP/LsMO9YonsstuL+xuvycDyESpoDoIAsMd7suwpB4h9oEWB+ZlPTqJJ8EHomzNhwTPQ== "@types/keccak@^3.0.1": version "3.0.1" @@ -1182,10 +1512,10 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.10.tgz#4dcb8a85a8f1211acafb88d72fafc7e3d2685583" integrity sha512-TxCmnSSppKBBOzYzPR2BR25YlX5Oay8z2XGwFBInuA/Co0V9xJhLlW4kjbxKtgeNo3NOMbQP1A5Rc03y+XecPw== -"@types/node@^15.12.2": - version "15.12.2" - resolved "https://registry.yarnpkg.com/@types/node/-/node-15.12.2.tgz#1f2b42c4be7156ff4a6f914b2fb03d05fa84e38d" - integrity sha512-zjQ69G564OCIWIOHSXyQEEDpdpGl+G348RAKY0XXy9Z5kU9Vzv1GMNnkar/ZJ8dzXB3COzD9Mo9NtRZ4xfgUww== +"@types/node@^15.12.5": + version "15.12.5" + resolved "https://registry.yarnpkg.com/@types/node/-/node-15.12.5.tgz#9a78318a45d75c9523d2396131bd3cca54b2d185" + integrity sha512-se3yX7UHv5Bscf8f1ERKvQOD6sTyycH3hdaoozvaLxgUiY5lIGEeH37AD0G0Qi9kPqihPn0HOfd2yaIEN9VwEg== "@types/pbkdf2@^3.0.0": version "3.1.0" @@ -3679,15 +4009,15 @@ ethereum-cryptography@^0.1.2, ethereum-cryptography@^0.1.3: secp256k1 "^4.0.1" setimmediate "^1.0.5" -ethereum-waffle@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/ethereum-waffle/-/ethereum-waffle-3.3.0.tgz#166a0cc1d3b2925f117b20ef0951b3fe72e38e79" - integrity sha512-4xm3RWAPCu5LlaVxYEg0tG3L7g5ovBw1GY/UebrzZ+OTx22vcPjI+bvelFlGBpkdnO5yOIFXjH2eK59tNAe9IA== +ethereum-waffle@^3.4.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/ethereum-waffle/-/ethereum-waffle-3.4.0.tgz#990b3c6c26db9c2dd943bf26750a496f60c04720" + integrity sha512-ADBqZCkoSA5Isk486ntKJVjFEawIiC+3HxNqpJqONvh3YXBTNiRfXvJtGuAFLXPG91QaqkGqILEHANAo7j/olQ== dependencies: - "@ethereum-waffle/chai" "^3.3.0" - "@ethereum-waffle/compiler" "^3.3.0" - "@ethereum-waffle/mock-contract" "^3.2.2" - "@ethereum-waffle/provider" "^3.3.0" + "@ethereum-waffle/chai" "^3.4.0" + "@ethereum-waffle/compiler" "^3.4.0" + "@ethereum-waffle/mock-contract" "^3.3.0" + "@ethereum-waffle/provider" "^3.4.0" ethers "^5.0.1" ethereumjs-abi@0.6.5: @@ -3933,41 +4263,41 @@ ethers@^5.0.0, ethers@^5.0.1, ethers@^5.0.2: "@ethersproject/web" "5.1.0" "@ethersproject/wordlists" "5.1.0" -ethers@^5.3.1: - version "5.3.1" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.3.1.tgz#1f018f0aeb651576cd84fd987a45f0b99646d761" - integrity sha512-xCKmC0gsZ9gks89ZfK3B1y6LlPdvX5fxDtu9SytnpdDJR1M7pmJI+4H0AxQPMgUYr7GtQdmECLR0gWdJQ+lZYw== - dependencies: - "@ethersproject/abi" "5.3.1" - "@ethersproject/abstract-provider" "5.3.0" - "@ethersproject/abstract-signer" "5.3.0" - "@ethersproject/address" "5.3.0" - "@ethersproject/base64" "5.3.0" - "@ethersproject/basex" "5.3.0" - "@ethersproject/bignumber" "5.3.0" - "@ethersproject/bytes" "5.3.0" - "@ethersproject/constants" "5.3.0" - "@ethersproject/contracts" "5.3.0" - "@ethersproject/hash" "5.3.0" - "@ethersproject/hdnode" "5.3.0" - "@ethersproject/json-wallets" "5.3.0" - "@ethersproject/keccak256" "5.3.0" - "@ethersproject/logger" "5.3.0" - "@ethersproject/networks" "5.3.1" - "@ethersproject/pbkdf2" "5.3.0" - "@ethersproject/properties" "5.3.0" - "@ethersproject/providers" "5.3.1" - "@ethersproject/random" "5.3.0" - "@ethersproject/rlp" "5.3.0" - "@ethersproject/sha2" "5.3.0" - "@ethersproject/signing-key" "5.3.0" - "@ethersproject/solidity" "5.3.0" - "@ethersproject/strings" "5.3.0" - "@ethersproject/transactions" "5.3.0" - "@ethersproject/units" "5.3.0" - "@ethersproject/wallet" "5.3.0" - "@ethersproject/web" "5.3.0" - "@ethersproject/wordlists" "5.3.0" +ethers@^5.4.0: + version "5.4.0" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.4.0.tgz#e9fe4b39350bcce5edd410c70bd57ba328ecf474" + integrity sha512-hqN1x0CV8VMpQ25WnNEjaMqtB3nA4DRAb2FSmmNaUbD1dF6kWbHs8YaXbVvD37FCg3GTEyc4rV9Pxafk1ByHKw== + dependencies: + "@ethersproject/abi" "5.4.0" + "@ethersproject/abstract-provider" "5.4.0" + "@ethersproject/abstract-signer" "5.4.0" + "@ethersproject/address" "5.4.0" + "@ethersproject/base64" "5.4.0" + "@ethersproject/basex" "5.4.0" + "@ethersproject/bignumber" "5.4.0" + "@ethersproject/bytes" "5.4.0" + "@ethersproject/constants" "5.4.0" + "@ethersproject/contracts" "5.4.0" + "@ethersproject/hash" "5.4.0" + "@ethersproject/hdnode" "5.4.0" + "@ethersproject/json-wallets" "5.4.0" + "@ethersproject/keccak256" "5.4.0" + "@ethersproject/logger" "5.4.0" + "@ethersproject/networks" "5.4.0" + "@ethersproject/pbkdf2" "5.4.0" + "@ethersproject/properties" "5.4.0" + "@ethersproject/providers" "5.4.0" + "@ethersproject/random" "5.4.0" + "@ethersproject/rlp" "5.4.0" + "@ethersproject/sha2" "5.4.0" + "@ethersproject/signing-key" "5.4.0" + "@ethersproject/solidity" "5.4.0" + "@ethersproject/strings" "5.4.0" + "@ethersproject/transactions" "5.4.0" + "@ethersproject/units" "5.4.0" + "@ethersproject/wallet" "5.4.0" + "@ethersproject/web" "5.4.0" + "@ethersproject/wordlists" "5.4.0" ethjs-unit@0.1.6: version "0.1.6" @@ -4647,10 +4977,10 @@ har-validator@~5.1.3: ajv "^6.12.3" har-schema "^2.0.0" -hardhat-deploy@0.8.6: - version "0.8.6" - resolved "https://registry.yarnpkg.com/hardhat-deploy/-/hardhat-deploy-0.8.6.tgz#6f0e8684a66f0a130670e448bbd072bc512255be" - integrity sha512-lw4k1SPVc3kG2jCSbxfnSqVxqh0E7xK9rB6HeJoWIvmy5Y6+Uuw0C3Lk0TObX02ewsTRF/5sWin7JHxbt6K8Mg== +hardhat-deploy@0.8.9: + version "0.8.9" + resolved "https://registry.yarnpkg.com/hardhat-deploy/-/hardhat-deploy-0.8.9.tgz#fa13f104a2aba85d6ce0043adbd683e0da026df9" + integrity sha512-hmn94K8b/ua7kTj/ECpCXaIqF/8Kfj1fI17ex1fxfvGS8RkZKvXaHaNU1ziX7vLaKZbcYHytKC9nL7PiRwXawQ== dependencies: "@ethersproject/abi" "^5.3.1" "@ethersproject/abstract-signer" "^5.3.0" @@ -4674,16 +5004,17 @@ hardhat-deploy@0.8.6: murmur-128 "^0.2.1" qs "^6.9.4" -hardhat@^2.3.3: - version "2.3.3" - resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.3.3.tgz#76d1db08a513bad926b90b74217e5a4ec00b1898" - integrity sha512-Y2icnIIzwkAvN23DaF4V9b5G8Gp4khPlHC2v6rbjH+IXK5OeDRe6gTePEziMmFiWLht5CEIC03+WRog+EIvr6g== +hardhat@^2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.4.1.tgz#2cd1e86ee6ca3a6a473eeb0f55bd3124c8c59250" + integrity sha512-vwllrFypukeE/Q+4ZfWj7j7nUo4ncUhRpsAYUM0Ruuuk6pQlKmRa0A6c0kxRSvvVgQsMud6j+/weYhbMX1wPmQ== dependencies: "@ethereumjs/block" "^3.3.0" "@ethereumjs/blockchain" "^5.3.0" "@ethereumjs/common" "^2.3.1" "@ethereumjs/tx" "^3.2.1" "@ethereumjs/vm" "^5.3.2" + "@ethersproject/abi" "^5.1.2" "@sentry/node" "^5.18.1" "@solidity-parser/parser" "^0.11.0" "@types/bn.js" "^5.1.0" @@ -4705,6 +5036,7 @@ hardhat@^2.3.3: fp-ts "1.19.3" fs-extra "^7.0.1" glob "^7.1.3" + https-proxy-agent "^5.0.0" immutable "^4.0.0-rc.12" io-ts "1.10.4" lodash "^4.17.11" @@ -4723,7 +5055,7 @@ hardhat@^2.3.3: "true-case-path" "^2.2.1" tsort "0.0.1" uuid "^3.3.2" - ws "^7.2.1" + ws "^7.4.6" has-ansi@^2.0.0: version "2.0.0" @@ -6408,7 +6740,7 @@ node-fetch@2.1.2: resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.1.2.tgz#ab884e8e7e57e38a944753cec706f788d1768bb5" integrity sha1-q4hOjn5X44qUR1POxwb3iNF2i7U= -node-fetch@^2.6.0: +node-fetch@^2.6.0, node-fetch@^2.6.1: version "2.6.1" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== @@ -6971,10 +7303,10 @@ prettier@^2.1.2: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5" integrity sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q== -prettier@^2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.1.tgz#76903c3f8c4449bc9ac597acefa24dc5ad4cbea6" - integrity sha512-p+vNbgpLjif/+D+DwAZAbndtRrR0md0MwfmOVN9N+2RgyACMT+7tfaRnT+WDPkqnuVwleyuBIG2XBxKDme3hPA== +prettier@^2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.2.tgz#ef280a05ec253712e486233db5c6f23441e7342d" + integrity sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ== printj@~1.1.0: version "1.1.2" @@ -8484,10 +8816,10 @@ typechain@^3.0.0: ts-essentials "^6.0.3" ts-generator "^0.1.1" -typechain@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/typechain/-/typechain-5.0.0.tgz#730e5fb4709964eed3db03be332b38ba6eaa1d9f" - integrity sha512-Ko2/8co0FUmPUkaXPcb8PC3ncWa5P72nvkiNMgcomd4OAInltJlITF0kcW2cZmI2sFkvmaHV5TZmCnOHgo+i5Q== +typechain@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/typechain/-/typechain-5.1.1.tgz#2e54bee69bb91d21096943deb400aa91638f698e" + integrity sha512-zN4ylCc3gSw2BXy5Zlpmw8q0lf5pQ+U8gYd5WCWRfDVuUkKyZBURz31VLjkPY/nfOr+P6EcwTC4Ae5VNVqrv/g== dependencies: "@types/prettier" "^2.1.1" command-line-args "^4.0.7" @@ -8496,6 +8828,7 @@ typechain@^5.0.0: glob "^7.1.6" js-sha3 "^0.8.0" lodash "^4.17.15" + mkdirp "^1.0.4" prettier "^2.1.2" ts-essentials "^7.0.1" @@ -8511,10 +8844,10 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@^4.3.2: - version "4.3.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.2.tgz#399ab18aac45802d6f2498de5054fcbbe716a805" - integrity sha512-zZ4hShnmnoVnAHpVHWpTcxdv7dWP60S2FsydQLV8V5PbS3FifjWFFRiHSWpDJahly88PRyV5teTSLoq4eG7mKw== +typescript@^4.3.4: + version "4.3.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.4.tgz#3f85b986945bcf31071decdd96cf8bfa65f9dcbc" + integrity sha512-uauPG7XZn9F/mo+7MrsRjyvbxFpzemRjKEZXS4AK83oP2KKOJPvb+9cO/gmnv8arWZvhnjVOXz7B49m1l0e9Ew== typewise-core@^1.2, typewise-core@^1.2.0: version "1.2.0" @@ -9142,10 +9475,10 @@ ws@^5.1.1: dependencies: async-limiter "~1.0.0" -ws@^7.2.1: - version "7.4.5" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.5.tgz#a484dd851e9beb6fdb420027e3885e8ce48986c1" - integrity sha512-xzyu3hFvomRfXKH8vOFMU3OguG6oOvhXMo3xsGy3xWExqaM2dxBbVxuD99O7m3ZUFMvvscsZDqxfgMaRr/Nr1g== +ws@^7.4.6: + version "7.5.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.0.tgz#0033bafea031fb9df041b2026fc72a571ca44691" + integrity sha512-6ezXvzOZupqKj4jUqbQ9tXuJNo+BR2gU8fFRk3XCP3e0G6WT414u5ELe6Y0vtp7kmSJ3F7YWObSNr1ESsgi4vw== xhr-request-promise@^0.1.2: version "0.1.3"