From c77da15ca60f5257212ab23700c1fbe40ec9a5a3 Mon Sep 17 00:00:00 2001 From: Sean Darcy Date: Wed, 29 May 2024 09:40:17 +1000 Subject: [PATCH] Backend communicating with ethereum contracts --- .gitignore | 1 + Makefile | 5 + abi_manager.py | 36 + abis/RewardRatePool.json | 402 ++++ abis/ServiceNodeContribution.json | 601 ++++++ abis/ServiceNodeContributionFactory.json | 132 ++ abis/ServiceNodeRewards.json | 1648 +++++++++++++++++ config_defaults.py | 7 + contracts/reward_rate_pool.py | 53 + contracts/service_node_contribution.py | 126 ++ .../service_node_contribution_factory.py | 59 + schema.sqlite | 9 + sent.py | 121 +- timer.py | 25 + 14 files changed, 3224 insertions(+), 1 deletion(-) create mode 100644 Makefile create mode 100644 abi_manager.py create mode 100644 abis/RewardRatePool.json create mode 100644 abis/ServiceNodeContribution.json create mode 100644 abis/ServiceNodeContributionFactory.json create mode 100644 abis/ServiceNodeRewards.json create mode 100644 contracts/reward_rate_pool.py create mode 100644 contracts/service_node_contribution.py create mode 100644 contracts/service_node_contribution_factory.py create mode 100644 timer.py diff --git a/.gitignore b/.gitignore index 4ee9928..1a702ee 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /config.py /__pycache__ /oxend/*.sock +*/__pycache__ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b4e2dae --- /dev/null +++ b/Makefile @@ -0,0 +1,5 @@ +uwsgi: + uwsgi --http 127.0.0.1:8000 --master -p 4 -w sent.py + +database: + sqlite3 sent-backend.db < schema.sqlite diff --git a/abi_manager.py b/abi_manager.py new file mode 100644 index 0000000..aa679a4 --- /dev/null +++ b/abi_manager.py @@ -0,0 +1,36 @@ +import json +import os + +class ABIManager: + def __init__(self, abi_dir='abis'): + """ + Initializes the ABIManager with the directory containing ABI JSON files. + + :param abi_dir: The directory where ABI files are stored. Default is 'abis'. + """ + self.abi_dir = abi_dir + + def load_abi(self, artifact_name): + """ + Loads the ABI from a specified artifact JSON file. + + :param artifact_name: The name of the artifact file (without .json extension). + :return: The ABI extracted from the specified artifact JSON file. + :raises FileNotFoundError: If the specified file does not exist. + :raises KeyError: If the 'abi' key is not found in the JSON data. + """ + file_path = os.path.join(self.abi_dir, f"{artifact_name}.json") + if not os.path.exists(file_path): + raise FileNotFoundError(f"No such file: {file_path}") + + with open(file_path, 'r') as file: + data = json.load(file) + if 'abi' not in data: + raise KeyError("Missing 'abi' key in the JSON file.") + return data['abi'] + +# Example usage: +# manager = ABIManager() +# abi = manager.load_abi('MyContract') +# This `abi` can now be used with Web3 library to interact with a smart contract. + diff --git a/abis/RewardRatePool.json b/abis/RewardRatePool.json new file mode 100644 index 0000000..41a1bb4 --- /dev/null +++ b/abis/RewardRatePool.json @@ -0,0 +1,402 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "RewardRatePool", + "sourceName": "contracts/RewardRatePool.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "AddressInsufficientBalance", + "type": "error" + }, + { + "inputs": [], + "name": "FailedInnerCall", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "SafeERC20FailedOperation", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newBeneficiary", + "type": "address" + } + ], + "name": "BeneficiaryUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "FundsReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [], + "name": "ANNUAL_INTEREST_RATE", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "BASIS_POINTS", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "SENT", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "beneficiary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "timeElapsed", + "type": "uint256" + } + ], + "name": "calculateInterestAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + } + ], + "name": "calculateReleasedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "calculateTotalDeposited", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_beneficiary", + "type": "address" + }, + { + "internalType": "address", + "name": "_sent", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lastPaidOutTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "payoutReleased", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + } + ], + "name": "rewardRate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newBeneficiary", + "type": "address" + } + ], + "name": "setBeneficiary", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "totalPaidOut", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b50610c7c806100206000396000f3fe608060405234801561001057600080fd5b50600436106101365760003560e01c8063ab5fcdc9116100b2578063cea0196211610081578063e30c397811610066578063e30c397814610249578063f2fde38b14610251578063f85bb0f01461026457600080fd5b8063cea019621461022d578063e1f1c4a71461024057600080fd5b8063ab5fcdc9146101e8578063b6783393146101f1578063bc135d7514610212578063ca5980871461022557600080fd5b806360e52ecb11610109578063715018a6116100ee578063715018a6146101d057806379ba5097146101d85780638da5cb5b146101e057600080fd5b806360e52ecb146101aa5780636cc8e783146101bd57600080fd5b80631357e1dc1461013b5780631c31f7101461015757806338af3eed1461016c578063485cc95514610197575b600080fd5b61014460025481565b6040519081526020015b60405180910390f35b61016a610165366004610adb565b61026c565b005b60015461017f906001600160a01b031681565b6040516001600160a01b03909116815260200161014e565b61016a6101a5366004610af6565b6102c8565b60005461017f906001600160a01b031681565b6101446101cb366004610b29565b610421565b61016a6104bf565b61016a6104d3565b61017f610520565b61014460035481565b6101f9609181565b60405167ffffffffffffffff909116815260200161014e565b610144610220366004610b42565b610555565b61014461059a565b61014461023b366004610b29565b61061c565b6101f96103e881565b61017f610652565b61016a61025f366004610adb565b61067b565b61016a610700565b61027461077d565b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527feee59a71c694e68368a1cb0d135c448051bbfb12289e6c2223b0ceb100c2321d9060200160405180910390a150565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000810460ff16159067ffffffffffffffff166000811580156103135750825b905060008267ffffffffffffffff1660011480156103305750303b155b90508115801561033e575080155b1561035c5760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561039057845468ff00000000000000001916680100000000000000001785555b600180546001600160a01b03808a166001600160a01b0319928316179092554260035560008054928916929091169190911790556103cd336107af565b831561041857845468ff000000000000000019168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50505050505050565b600080600354836104329190610b7a565b6000546040516370a0823160e01b81523060048201529192506104ab916001600160a01b03909116906370a0823190602401602060405180830381865afa158015610481573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104a59190610b8d565b82610555565b6002546104b89190610ba6565b9392505050565b6104c761077d565b6104d160006107c0565b565b33806104dd610652565b6001600160a01b0316146105145760405163118cdaa760e01b81526001600160a01b03821660048201526024015b60405180910390fd5b61051d816107c0565b50565b6000807f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005b546001600160a01b031692915050565b60006105676103e86301e13380610bb9565b67ffffffffffffffff168261057d609186610be5565b6105879190610be5565b6105919190610bfc565b90505b92915050565b600254600080546040516370a0823160e01b81523060048201529192916001600160a01b03909116906370a0823190602401602060405180830381865afa1580156105e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060d9190610b8d565b6106179190610ba6565b905090565b60008061062883610421565b9050600061063461059a565b905061064a6106438383610b7a565b6078610555565b949350505050565b6000807f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c00610545565b61068361077d565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b0319166001600160a01b03831690811782556106c7610520565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a35050565b600061070b42610421565b905060006002548261071d9190610b7a565b6002839055426003556040518181529091507f952b264c8e0a06cddb4bbaa6d6af1d565145329fd95bbe72cb2b53942b2dc9669060200160405180910390a1600154600054610779916001600160a01b039182169116836107f8565b5050565b33610786610520565b6001600160a01b0316146104d15760405163118cdaa760e01b815233600482015260240161050b565b6107b7610864565b61051d816108b2565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b0319168155610779826108e4565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1663a9059cbb60e01b17905261085f908490610955565b505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005468010000000000000000900460ff166104d157604051631afcd79f60e31b815260040160405180910390fd5b6108ba610864565b6001600160a01b03811661051457604051631e4fbdf760e01b81526000600482015260240161050b565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b600061096a6001600160a01b038416836109b8565b9050805160001415801561098f57508080602001905181019061098d9190610c1e565b155b1561085f57604051635274afe760e01b81526001600160a01b038416600482015260240161050b565b60606105918383600084600080856001600160a01b031684866040516109de9190610c40565b60006040518083038185875af1925050503d8060008114610a1b576040519150601f19603f3d011682016040523d82523d6000602084013e610a20565b606091505b5091509150610a30868383610a3a565b9695505050505050565b606082610a4f57610a4a82610a96565b6104b8565b8151158015610a6657506001600160a01b0384163b155b15610a8f57604051639996b31560e01b81526001600160a01b038516600482015260240161050b565b50806104b8565b805115610aa65780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b80356001600160a01b0381168114610ad657600080fd5b919050565b600060208284031215610aed57600080fd5b61059182610abf565b60008060408385031215610b0957600080fd5b610b1283610abf565b9150610b2060208401610abf565b90509250929050565b600060208284031215610b3b57600080fd5b5035919050565b60008060408385031215610b5557600080fd5b50508035926020909101359150565b634e487b7160e01b600052601160045260246000fd5b8181038181111561059457610594610b64565b600060208284031215610b9f57600080fd5b5051919050565b8082018082111561059457610594610b64565b67ffffffffffffffff818116838216028082169190828114610bdd57610bdd610b64565b505092915050565b808202811582820484141761059457610594610b64565b600082610c1957634e487b7160e01b600052601260045260246000fd5b500490565b600060208284031215610c3057600080fd5b815180151581146104b857600080fd5b6000825160005b81811015610c615760208186018101518583015201610c47565b50600092019182525091905056fea164736f6c6343000814000a", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101365760003560e01c8063ab5fcdc9116100b2578063cea0196211610081578063e30c397811610066578063e30c397814610249578063f2fde38b14610251578063f85bb0f01461026457600080fd5b8063cea019621461022d578063e1f1c4a71461024057600080fd5b8063ab5fcdc9146101e8578063b6783393146101f1578063bc135d7514610212578063ca5980871461022557600080fd5b806360e52ecb11610109578063715018a6116100ee578063715018a6146101d057806379ba5097146101d85780638da5cb5b146101e057600080fd5b806360e52ecb146101aa5780636cc8e783146101bd57600080fd5b80631357e1dc1461013b5780631c31f7101461015757806338af3eed1461016c578063485cc95514610197575b600080fd5b61014460025481565b6040519081526020015b60405180910390f35b61016a610165366004610adb565b61026c565b005b60015461017f906001600160a01b031681565b6040516001600160a01b03909116815260200161014e565b61016a6101a5366004610af6565b6102c8565b60005461017f906001600160a01b031681565b6101446101cb366004610b29565b610421565b61016a6104bf565b61016a6104d3565b61017f610520565b61014460035481565b6101f9609181565b60405167ffffffffffffffff909116815260200161014e565b610144610220366004610b42565b610555565b61014461059a565b61014461023b366004610b29565b61061c565b6101f96103e881565b61017f610652565b61016a61025f366004610adb565b61067b565b61016a610700565b61027461077d565b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527feee59a71c694e68368a1cb0d135c448051bbfb12289e6c2223b0ceb100c2321d9060200160405180910390a150565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000810460ff16159067ffffffffffffffff166000811580156103135750825b905060008267ffffffffffffffff1660011480156103305750303b155b90508115801561033e575080155b1561035c5760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561039057845468ff00000000000000001916680100000000000000001785555b600180546001600160a01b03808a166001600160a01b0319928316179092554260035560008054928916929091169190911790556103cd336107af565b831561041857845468ff000000000000000019168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50505050505050565b600080600354836104329190610b7a565b6000546040516370a0823160e01b81523060048201529192506104ab916001600160a01b03909116906370a0823190602401602060405180830381865afa158015610481573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104a59190610b8d565b82610555565b6002546104b89190610ba6565b9392505050565b6104c761077d565b6104d160006107c0565b565b33806104dd610652565b6001600160a01b0316146105145760405163118cdaa760e01b81526001600160a01b03821660048201526024015b60405180910390fd5b61051d816107c0565b50565b6000807f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005b546001600160a01b031692915050565b60006105676103e86301e13380610bb9565b67ffffffffffffffff168261057d609186610be5565b6105879190610be5565b6105919190610bfc565b90505b92915050565b600254600080546040516370a0823160e01b81523060048201529192916001600160a01b03909116906370a0823190602401602060405180830381865afa1580156105e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060d9190610b8d565b6106179190610ba6565b905090565b60008061062883610421565b9050600061063461059a565b905061064a6106438383610b7a565b6078610555565b949350505050565b6000807f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c00610545565b61068361077d565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b0319166001600160a01b03831690811782556106c7610520565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a35050565b600061070b42610421565b905060006002548261071d9190610b7a565b6002839055426003556040518181529091507f952b264c8e0a06cddb4bbaa6d6af1d565145329fd95bbe72cb2b53942b2dc9669060200160405180910390a1600154600054610779916001600160a01b039182169116836107f8565b5050565b33610786610520565b6001600160a01b0316146104d15760405163118cdaa760e01b815233600482015260240161050b565b6107b7610864565b61051d816108b2565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b0319168155610779826108e4565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1663a9059cbb60e01b17905261085f908490610955565b505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005468010000000000000000900460ff166104d157604051631afcd79f60e31b815260040160405180910390fd5b6108ba610864565b6001600160a01b03811661051457604051631e4fbdf760e01b81526000600482015260240161050b565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b600061096a6001600160a01b038416836109b8565b9050805160001415801561098f57508080602001905181019061098d9190610c1e565b155b1561085f57604051635274afe760e01b81526001600160a01b038416600482015260240161050b565b60606105918383600084600080856001600160a01b031684866040516109de9190610c40565b60006040518083038185875af1925050503d8060008114610a1b576040519150601f19603f3d011682016040523d82523d6000602084013e610a20565b606091505b5091509150610a30868383610a3a565b9695505050505050565b606082610a4f57610a4a82610a96565b6104b8565b8151158015610a6657506001600160a01b0384163b155b15610a8f57604051639996b31560e01b81526001600160a01b038516600482015260240161050b565b50806104b8565b805115610aa65780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b80356001600160a01b0381168114610ad657600080fd5b919050565b600060208284031215610aed57600080fd5b61059182610abf565b60008060408385031215610b0957600080fd5b610b1283610abf565b9150610b2060208401610abf565b90509250929050565b600060208284031215610b3b57600080fd5b5035919050565b60008060408385031215610b5557600080fd5b50508035926020909101359150565b634e487b7160e01b600052601160045260246000fd5b8181038181111561059457610594610b64565b600060208284031215610b9f57600080fd5b5051919050565b8082018082111561059457610594610b64565b67ffffffffffffffff818116838216028082169190828114610bdd57610bdd610b64565b505092915050565b808202811582820484141761059457610594610b64565b600082610c1957634e487b7160e01b600052601260045260246000fd5b500490565b600060208284031215610c3057600080fd5b815180151581146104b857600080fd5b6000825160005b81811015610c615760208186018101518583015201610c47565b50600092019182525091905056fea164736f6c6343000814000a", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/abis/ServiceNodeContribution.json b/abis/ServiceNodeContribution.json new file mode 100644 index 0000000..0891655 --- /dev/null +++ b/abis/ServiceNodeContribution.json @@ -0,0 +1,601 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "ServiceNodeContribution", + "sourceName": "contracts/ServiceNodeContribution.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_stakingRewardsContract", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_maxContributors", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "X", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "Y", + "type": "uint256" + } + ], + "internalType": "struct BN256G1.G1Point", + "name": "_blsPubkey", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "serviceNodePubkey", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "serviceNodeSignature1", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "serviceNodeSignature2", + "type": "uint256" + }, + { + "internalType": "uint16", + "name": "fee", + "type": "uint16" + } + ], + "internalType": "struct IServiceNodeRewards.ServiceNodeParams", + "name": "_serviceNodeParams", + "type": "tuple" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "AddressInsufficientBalance", + "type": "error" + }, + { + "inputs": [], + "name": "FailedInnerCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "SafeERC20FailedOperation", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "serviceNodePubkey", + "type": "uint256" + } + ], + "name": "Cancelled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "serviceNodePubkey", + "type": "uint256" + } + ], + "name": "Finalized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "contributor", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "NewContribution", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "contributor", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "WithdrawContribution", + "type": "event" + }, + { + "inputs": [], + "name": "SENT", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "WITHDRAWAL_DELAY", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "blsPubkey", + "outputs": [ + { + "internalType": "uint256", + "name": "X", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "Y", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "blsSignature", + "outputs": [ + { + "internalType": "uint256", + "name": "sigs0", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sigs1", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sigs2", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sigs3", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "contributionRemaining", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "numContributors", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxNumContributors", + "type": "uint256" + } + ], + "name": "calcMinimumContribution", + "outputs": [ + { + "internalType": "uint256", + "name": "result", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "cancelNode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "cancelled", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "contributeFunds", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "sigs0", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sigs1", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sigs2", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sigs3", + "type": "uint256" + } + ], + "internalType": "struct IServiceNodeRewards.BLSSignatureParams", + "name": "_blsSignature", + "type": "tuple" + } + ], + "name": "contributeOperatorFunds", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "contributionTimestamp", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "contributions", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "contributorAddresses", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "contributorAddressesLength", + "outputs": [ + { + "internalType": "uint256", + "name": "result", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "finalized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxContributors", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minimumContribution", + "outputs": [ + { + "internalType": "uint256", + "name": "result", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_stakingRequirement", + "type": "uint256" + } + ], + "name": "minimumOperatorContribution", + "outputs": [ + { + "internalType": "uint256", + "name": "result", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "operator", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "operatorContribution", + "outputs": [ + { + "internalType": "uint256", + "name": "result", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + } + ], + "name": "rescueERC20", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "resetContract", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "serviceNodeParams", + "outputs": [ + { + "internalType": "uint256", + "name": "serviceNodePubkey", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "serviceNodeSignature1", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "serviceNodeSignature2", + "type": "uint256" + }, + { + "internalType": "uint16", + "name": "fee", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "stakingRequirement", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "stakingRewardsContract", + "outputs": [ + { + "internalType": "contract IServiceNodeRewards", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalContribution", + "outputs": [ + { + "internalType": "uint256", + "name": "result", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "withdrawContribution", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x610120604052600d805461ffff191690553480156200001d57600080fd5b50604051620023b5380380620023b58339810160408190526200004091620002aa565b836001600160a01b0381166200009d5760405162461bcd60e51b815260206004820152601e60248201527f5368617265643a206164647265737320696e70757420697320656d707479000060448201526064015b60405180910390fd5b8380600003620000f05760405162461bcd60e51b815260206004820152601b60248201527f5368617265643a2075696e7420696e70757420697320656d7074790000000000604482015260640162000094565b6001600160a01b03861660a081905260408051630ada733d60e31b815290516356d399e8916004808201926020929091908290030181865afa1580156200013b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000161919062000369565b60c0818152505060a0516001600160a01b0316637c89d2f06040518163ffffffff1660e01b8152600401602060405180830381865afa158015620001a9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001cf919062000383565b6001600160a01b03166080525050610100929092523260e052805160005560209081015160015581516002558101516003556040810151600455606001516005805461ffff191661ffff90921691909117905550620003aa565b6001600160a01b03811681146200023f57600080fd5b50565b604080519081016001600160401b03811182821017156200027357634e487b7160e01b600052604160045260246000fd5b60405290565b604051608081016001600160401b03811182821017156200027357634e487b7160e01b600052604160045260246000fd5b600080600080848603610100811215620002c357600080fd5b8551620002d08162000229565b602087015190955093506040603f1982011215620002ed57600080fd5b620002f762000242565b604087015181526060870151602082015292506080607f19820112156200031d57600080fd5b506200032862000279565b6080860151815260a0860151602082015260c0860151604082015260e086015161ffff811681146200035957600080fd5b6060820152939692955090935050565b6000602082840312156200037c57600080fd5b5051919050565b6000602082840312156200039657600080fd5b8151620003a38162000229565b9392505050565b60805160a05160c05160e05161010051611f486200046d600039600081816103990152610e3f0152600081816103380152818161053f0152818161071001528181610b5801528181610eda01528181611057015281816112380152611462015260008181610311015281816108b801528181610b1601528181610e16015281816116ce015261195d01526000818161023e015281816119350152611a0801526000818161035f01528181610aec015281816115e801526119830152611f486000f3fe608060405234801561001057600080fd5b50600436106101ae5760003560e01c80638467f7cb116100ee5780639a82a09a11610097578063b436950c11610071578063b436950c14610433578063c28b1e791461043b578063ccec37161461044e578063e50d50d81461046157600080fd5b80639a82a09a146103f15780639ca002a614610413578063b3f05b971461042657600080fd5b80638dd08557116100c85780638dd08557146103ce578063937e09b1146103e157806396a608c0146103e957600080fd5b80638467f7cb1461038157806386fa5063146103945780638c7e7a31146103bb57600080fd5b80634564168b1161015b5780634e7320ce116101355780634e7320ce146102d657806356d399e81461030c578063570ca7351461033357806360e52ecb1461035a57600080fd5b80634564168b1461029857806348a05132146102bb5780634a387cdf146102ce57600080fd5b80632c7baaf31161018c5780632c7baaf3146101fb578063336237941461023957806342e94c901461027857600080fd5b80630d616d20146101b35780630dcf4b8f146101bd5780630ebb172a146101d8575b600080fd5b6101bb610481565b005b6101c5610694565b6040519081526020015b60405180910390f35b6101e26201518081565b60405167ffffffffffffffff90911681526020016101cf565b6002546003546004546005546102159392919061ffff1684565b6040805194855260208501939093529183015261ffff1660608201526080016101cf565b6102607f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101cf565b6101c5610286366004611c49565b600a6020526000908152604090205481565b6000546001546102a6919082565b604080519283526020830191909152016101cf565b6101bb6102c9366004611c72565b610706565b600c546101c5565b6006546007546008546009546102ec9392919084565b6040805194855260208501939093529183015260608201526080016101cf565b6101c57f000000000000000000000000000000000000000000000000000000000000000081565b6102607f000000000000000000000000000000000000000000000000000000000000000081565b6102607f000000000000000000000000000000000000000000000000000000000000000081565b6101bb61038f366004611c72565b610b4d565b6101c57f000000000000000000000000000000000000000000000000000000000000000081565b6101c56103c9366004611c8b565b610cf7565b6102606103dc366004611c72565b610dd9565b6101c5610e03565b6101c5610e68565b600d5461040390610100900460ff1681565b60405190151581526020016101cf565b6101c5610421366004611c72565b610eba565b600d546104039060ff1681565b6101bb610ecf565b6101bb610449366004611ccd565b61104c565b6101bb61045c366004611c49565b61122d565b6101c561046f366004611c49565b600b6020526000908152604090205481565b336000908152600a60205260409020546104e25760405162461bcd60e51b815260206004820152601960248201527f596f752068617665206e6f7420636f6e74726962757465642e0000000000000060448201526064015b60405180910390fd5b600d5460ff16156105355760405162461bcd60e51b815260206004820181905260248201527f4e6f64652068617320616c7265616479206265656e2066696e616c697a65642e60448201526064016104d9565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633036105ad5760405162461bcd60e51b815260206004820152601860248201527f4f70657261746f722063616e6e6f74207769746864726177000000000000000060448201526064016104d9565b600d54610100900460ff1661064e57336000908152600b602052604090205462015180906105db9042611d74565b1161064e5760405162461bcd60e51b815260206004820152603060248201527f5769746864726177616c20756e617661696c61626c653a20323420686f75727360448201527f2068617665206e6f74207061737365640000000000000000000000000000000060648201526084016104d9565b60006106593361148c565b60405181815290915033907f249a82fbe5056a1940b4e996665ba2a82c340ae9fa1e069fd1ababf5508f396e9060200160405180910390a250565b600c54600090815b81811015610701576000600c82815481106106b9576106b9611d87565b60009182526020808320909101546001600160a01b0316808352600a9091526040909120549091506106eb9085611d9d565b93505080806106f990611db0565b91505061069c565b505090565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633036107df57604080516080810182526006548152600754602082015260085491810191909152600954606082015261076890611615565b6107da5760405162461bcd60e51b815260206004820152603f60248201527f4f70657261746f72206d75737420696e697469616c6c7920636f6e747269627560448201527f7465207669612060636f6e7472696275744f70657261746f7246756e6473600060648201526084016104d9565b610839565b600c546108395760405162461bcd60e51b815260206004820152602260248201527f4f70657261746f7220686173206e6f7420636f6e74726962757465642066756e604482015261647360f01b60648201526084016104d9565b610841610e03565b8110156108b65760405162461bcd60e51b815260206004820152602e60248201527f436f6e747269627574696f6e2069732062656c6f7720746865206d696e696d7560448201527f6d20726571756972656d656e742e00000000000000000000000000000000000060648201526084016104d9565b7f0000000000000000000000000000000000000000000000000000000000000000816108e0610694565b6108ea9190611d9d565b111561095e5760405162461bcd60e51b815260206004820152602660248201527f436f6e747269627574696f6e2065786365656473207468652066756e64696e6760448201527f20676f616c2e000000000000000000000000000000000000000000000000000060648201526084016104d9565b600d5460ff16156109b15760405162461bcd60e51b815260206004820181905260248201527f4e6f64652068617320616c7265616479206265656e2066696e616c697a65642e60448201526064016104d9565b600d54610100900460ff1615610a095760405162461bcd60e51b815260206004820152601860248201527f4e6f646520686173206265656e2063616e63656c6c65642e000000000000000060448201526064016104d9565b336000908152600a60205260408120549003610a6f57600c80546001810182556000919091527fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c701805473ffffffffffffffffffffffffffffffffffffffff1916331790555b336000908152600a602052604081208054839290610a8e908490611d9d565b9091555050336000818152600b602052604090819020429055517fbdaa686eb6f59012d211a74523da260341c516896e9e5be954163d6ecf26ffa290610ad79084815260200190565b60405180910390a2610b146001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633308461164a565b7f0000000000000000000000000000000000000000000000000000000000000000610b3d610694565b03610b4a57610b4a6116cc565b50565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610bd85760405162461bcd60e51b815260206004820152602a60248201527f4f6e6c7920746865206f70657261746f722063616e20706572666f726d20746860448201526934b99030b1ba34b7b71760b11b60648201526084016104d9565b600d5460ff16610c505760405162461bcd60e51b815260206004820152603a60248201527f596f752063616e6e6f74207265736574206120636f6e7472616374207468617460448201527f206861736e2774206265656e2066696e616c697365642079657400000000000060648201526084016104d9565b600c5460005b81811015610ca8576000600c8281548110610c7357610c73611d87565b60009182526020808320909101546001600160a01b03168252600a905260408120555080610ca081611db0565b915050610c56565b50610cb5600c6000611c17565b600d805460ff191690556040805160808101825260065481526007546020820152600854918101919091526009546060820152610cf390839061104c565b5050565b6000828211610d6e5760405162461bcd60e51b815260206004820152603c60248201527f436f6e7472696275746f727320657863656564207065726d6974746564206d6160448201527f78696d756d206e756d626572206f6620636f6e7472696275746f72730000000060648201526084016104d9565b82600003610d9f576004610d83600186611d74565b610d8d9190611dc9565b610d98906001611d9d565b9050610dd2565b6000610dab8484611d74565b905080610db9600187611d74565b610dc39190611dc9565b610dce906001611d9d565b9150505b9392505050565b600c8181548110610de957600080fd5b6000918252602090912001546001600160a01b0316905081565b6000610e63610e10610694565b610e3a907f0000000000000000000000000000000000000000000000000000000000000000611d74565b600c547f0000000000000000000000000000000000000000000000000000000000000000610cf7565b905090565b600c54600090610e785750600090565b600a6000600c600081548110610e9057610e90611d87565b60009182526020808320909101546001600160a01b03168352820192909252604001902054905090565b6000610ec98260006001610cf7565b92915050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610f5a5760405162461bcd60e51b815260206004820152602a60248201527f4f6e6c7920746865206f70657261746f722063616e20706572666f726d20746860448201526934b99030b1ba34b7b71760b11b60648201526084016104d9565b600d5460ff1615610fad5760405162461bcd60e51b815260206004820152601f60248201527f43616e6e6f742063616e63656c20612066696e616c697a6564206e6f64652e0060448201526064016104d9565b600d54610100900460ff16156110055760405162461bcd60e51b815260206004820181905260248201527f4e6f64652068617320616c7265616479206265656e2063616e63656c6c65642e60448201526064016104d9565b600d805461ff00191661010017905561101d3361148c565b506002546040517fc41d93b8bfbf9fd7cf5bfe271fd649ab6a6fec0ea101c23b82a2a28eca2533a990600090a2565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146110d75760405162461bcd60e51b815260206004820152602a60248201527f4f6e6c7920746865206f70657261746f722063616e20706572666f726d20746860448201526934b99030b1ba34b7b71760b11b60648201526084016104d9565b600c54156111325760405162461bcd60e51b815260206004820152602260248201527f4f70657261746f7220616c726561647920636f6e74726962757465642066756e604482015261647360f01b60648201526084016104d9565b600d54610100900460ff161561118a5760405162461bcd60e51b815260206004820152601860248201527f4e6f646520686173206265656e2063616e63656c6c65642e000000000000000060448201526064016104d9565b611192610e03565b8210156112075760405162461bcd60e51b815260206004820152602960248201527f436f6e747269627574696f6e2069732062656c6f77206d696e696d756d20726560448201527f71756972656d656e74000000000000000000000000000000000000000000000060648201526084016104d9565b8051600655602081015160075560408101516008556060810151600955610cf382610706565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146112b85760405162461bcd60e51b815260206004820152602a60248201527f4f6e6c7920746865206f70657261746f722063616e20706572666f726d20746860448201526934b99030b1ba34b7b71760b11b60648201526084016104d9565b600d5460ff166113165760405162461bcd60e51b8152602060048201526024808201527f436f6e747261637420686173206e6f74206265656e2066696e616c697a6564206044820152633cb2ba1760e11b60648201526084016104d9565b600d54610100900460ff161561136e5760405162461bcd60e51b815260206004820152601c60248201527f436f6e747261637420686173206265656e2063616e63656c6c65642e0000000060448201526064016104d9565b6040516370a0823160e01b815230600482015281906000906001600160a01b038316906370a0823190602401602060405180830381865afa1580156113b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113db9190611deb565b9050600081116114535760405162461bcd60e51b815260206004820152602f60248201527f436f6e747261637420686173206e6f2062616c616e6365206f6620746865207360448201527f706563696669656420746f6b656e2e000000000000000000000000000000000060648201526084016104d9565b6114876001600160a01b0383167f000000000000000000000000000000000000000000000000000000000000000083611a7c565b505050565b6001600160a01b0381166000908152600a6020526040812054908190036114b257919050565b6001600160a01b0382166000908152600a60205260408120819055600c54905b818110156115da57600c81815481106114ed576114ed611d87565b6000918252602090912001546001600160a01b03908116908516036115c857600c611519600184611d74565b8154811061152957611529611d87565b600091825260209091200154600c80546001600160a01b03909216918390811061155557611555611d87565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550600c80548061159457611594611e04565b6000828152602090208101600019908101805473ffffffffffffffffffffffffffffffffffffffff191690550190556115da565b806115d281611db0565b9150506114d2565b5061160f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168484611a7c565b50919050565b805160009015158061162b575060008260200151115b8061163a575060008260400151115b80610ec957505060600151151590565b6040516001600160a01b0384811660248301528381166044830152606482018390526116c69186918216906323b872dd906084015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611aad565b50505050565b7f00000000000000000000000000000000000000000000000000000000000000006116f5610694565b146117425760405162461bcd60e51b815260206004820152601e60248201527f46756e64696e6720676f616c20686173206e6f74206265656e206d65742e000060448201526064016104d9565b600d5460ff16156117955760405162461bcd60e51b815260206004820181905260248201527f4e6f64652068617320616c7265616479206265656e2066696e616c697a65642e60448201526064016104d9565b600d54610100900460ff16156117ed5760405162461bcd60e51b815260206004820152601860248201527f4e6f646520686173206265656e2063616e63656c6c65642e000000000000000060448201526064016104d9565b600d805460ff191660011790556002546040517f839cf22e1ba87ce2f5b9bbf46cf0175a09eed52febdfaac8852478e68203c76390600090a2600c5460009067ffffffffffffffff81111561184457611844611cb7565b60405190808252806020026020018201604052801561188957816020015b60408051808201909152600080825260208201528152602001906001900390816118625790505b50600c5490915060005b8181101561191d576000600c82815481106118b0576118b0611d87565b60009182526020808320909101546040805180820182526001600160a01b03909216808352808552600a8452932054918101919091528551919250908590849081106118fe576118fe611d87565b602002602001018190525050808061191590611db0565b915050611893565b5060405163095ea7b360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660048301527f000000000000000000000000000000000000000000000000000000000000000060248301527f0000000000000000000000000000000000000000000000000000000000000000169063095ea7b3906044016020604051808303816000875af11580156119cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119f09190611e1a565b5060405163ab73513960e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ab73513990611a46906000906006906002908890600401611e8b565b600060405180830381600087803b158015611a6057600080fd5b505af1158015611a74573d6000803e3d6000fd5b505050505050565b6040516001600160a01b0383811660248301526044820183905261148791859182169063a9059cbb9060640161167f565b6000611ac26001600160a01b03841683611b10565b90508051600014158015611ae7575080806020019051810190611ae59190611e1a565b155b1561148757604051635274afe760e01b81526001600160a01b03841660048201526024016104d9565b6060610dd28383600084600080856001600160a01b03168486604051611b369190611f0c565b60006040518083038185875af1925050503d8060008114611b73576040519150601f19603f3d011682016040523d82523d6000602084013e611b78565b606091505b5091509150611b88868383611b92565b9695505050505050565b606082611ba757611ba282611bee565b610dd2565b8151158015611bbe57506001600160a01b0384163b155b15611be757604051639996b31560e01b81526001600160a01b03851660048201526024016104d9565b5080610dd2565b805115611bfe5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b5080546000825590600052602060002090810190610b4a91905b80821115611c455760008155600101611c31565b5090565b600060208284031215611c5b57600080fd5b81356001600160a01b0381168114610dd257600080fd5b600060208284031215611c8457600080fd5b5035919050565b600080600060608486031215611ca057600080fd5b505081359360208301359350604090920135919050565b634e487b7160e01b600052604160045260246000fd5b60008082840360a0811215611ce157600080fd5b833592506080601f1982011215611cf757600080fd5b506040516080810181811067ffffffffffffffff82111715611d2957634e487b7160e01b600052604160045260246000fd5b806040525060208401358152604084013560208201526060840135604082015260808401356060820152809150509250929050565b634e487b7160e01b600052601160045260246000fd5b81810381811115610ec957610ec9611d5e565b634e487b7160e01b600052603260045260246000fd5b80820180821115610ec957610ec9611d5e565b600060018201611dc257611dc2611d5e565b5060010190565b600082611de657634e487b7160e01b600052601260045260246000fd5b500490565b600060208284031215611dfd57600080fd5b5051919050565b634e487b7160e01b600052603160045260246000fd5b600060208284031215611e2c57600080fd5b81518015158114610dd257600080fd5b600081518084526020808501945080840160005b83811015611e8057815180516001600160a01b031688528301518388015260409096019590820190600101611e50565b509495945050505050565b60006101608654835260018701546020840152855460408401526001860154606084015260028601546080840152600386015460a0840152845460c0840152600185015460e0840152600285015461010084015261ffff60038601541661012084015280610140840152611f0181840185611e3c565b979650505050505050565b6000825160005b81811015611f2d5760208186018101518583015201611f13565b50600092019182525091905056fea164736f6c6343000814000a", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101ae5760003560e01c80638467f7cb116100ee5780639a82a09a11610097578063b436950c11610071578063b436950c14610433578063c28b1e791461043b578063ccec37161461044e578063e50d50d81461046157600080fd5b80639a82a09a146103f15780639ca002a614610413578063b3f05b971461042657600080fd5b80638dd08557116100c85780638dd08557146103ce578063937e09b1146103e157806396a608c0146103e957600080fd5b80638467f7cb1461038157806386fa5063146103945780638c7e7a31146103bb57600080fd5b80634564168b1161015b5780634e7320ce116101355780634e7320ce146102d657806356d399e81461030c578063570ca7351461033357806360e52ecb1461035a57600080fd5b80634564168b1461029857806348a05132146102bb5780634a387cdf146102ce57600080fd5b80632c7baaf31161018c5780632c7baaf3146101fb578063336237941461023957806342e94c901461027857600080fd5b80630d616d20146101b35780630dcf4b8f146101bd5780630ebb172a146101d8575b600080fd5b6101bb610481565b005b6101c5610694565b6040519081526020015b60405180910390f35b6101e26201518081565b60405167ffffffffffffffff90911681526020016101cf565b6002546003546004546005546102159392919061ffff1684565b6040805194855260208501939093529183015261ffff1660608201526080016101cf565b6102607f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101cf565b6101c5610286366004611c49565b600a6020526000908152604090205481565b6000546001546102a6919082565b604080519283526020830191909152016101cf565b6101bb6102c9366004611c72565b610706565b600c546101c5565b6006546007546008546009546102ec9392919084565b6040805194855260208501939093529183015260608201526080016101cf565b6101c57f000000000000000000000000000000000000000000000000000000000000000081565b6102607f000000000000000000000000000000000000000000000000000000000000000081565b6102607f000000000000000000000000000000000000000000000000000000000000000081565b6101bb61038f366004611c72565b610b4d565b6101c57f000000000000000000000000000000000000000000000000000000000000000081565b6101c56103c9366004611c8b565b610cf7565b6102606103dc366004611c72565b610dd9565b6101c5610e03565b6101c5610e68565b600d5461040390610100900460ff1681565b60405190151581526020016101cf565b6101c5610421366004611c72565b610eba565b600d546104039060ff1681565b6101bb610ecf565b6101bb610449366004611ccd565b61104c565b6101bb61045c366004611c49565b61122d565b6101c561046f366004611c49565b600b6020526000908152604090205481565b336000908152600a60205260409020546104e25760405162461bcd60e51b815260206004820152601960248201527f596f752068617665206e6f7420636f6e74726962757465642e0000000000000060448201526064015b60405180910390fd5b600d5460ff16156105355760405162461bcd60e51b815260206004820181905260248201527f4e6f64652068617320616c7265616479206265656e2066696e616c697a65642e60448201526064016104d9565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633036105ad5760405162461bcd60e51b815260206004820152601860248201527f4f70657261746f722063616e6e6f74207769746864726177000000000000000060448201526064016104d9565b600d54610100900460ff1661064e57336000908152600b602052604090205462015180906105db9042611d74565b1161064e5760405162461bcd60e51b815260206004820152603060248201527f5769746864726177616c20756e617661696c61626c653a20323420686f75727360448201527f2068617665206e6f74207061737365640000000000000000000000000000000060648201526084016104d9565b60006106593361148c565b60405181815290915033907f249a82fbe5056a1940b4e996665ba2a82c340ae9fa1e069fd1ababf5508f396e9060200160405180910390a250565b600c54600090815b81811015610701576000600c82815481106106b9576106b9611d87565b60009182526020808320909101546001600160a01b0316808352600a9091526040909120549091506106eb9085611d9d565b93505080806106f990611db0565b91505061069c565b505090565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633036107df57604080516080810182526006548152600754602082015260085491810191909152600954606082015261076890611615565b6107da5760405162461bcd60e51b815260206004820152603f60248201527f4f70657261746f72206d75737420696e697469616c6c7920636f6e747269627560448201527f7465207669612060636f6e7472696275744f70657261746f7246756e6473600060648201526084016104d9565b610839565b600c546108395760405162461bcd60e51b815260206004820152602260248201527f4f70657261746f7220686173206e6f7420636f6e74726962757465642066756e604482015261647360f01b60648201526084016104d9565b610841610e03565b8110156108b65760405162461bcd60e51b815260206004820152602e60248201527f436f6e747269627574696f6e2069732062656c6f7720746865206d696e696d7560448201527f6d20726571756972656d656e742e00000000000000000000000000000000000060648201526084016104d9565b7f0000000000000000000000000000000000000000000000000000000000000000816108e0610694565b6108ea9190611d9d565b111561095e5760405162461bcd60e51b815260206004820152602660248201527f436f6e747269627574696f6e2065786365656473207468652066756e64696e6760448201527f20676f616c2e000000000000000000000000000000000000000000000000000060648201526084016104d9565b600d5460ff16156109b15760405162461bcd60e51b815260206004820181905260248201527f4e6f64652068617320616c7265616479206265656e2066696e616c697a65642e60448201526064016104d9565b600d54610100900460ff1615610a095760405162461bcd60e51b815260206004820152601860248201527f4e6f646520686173206265656e2063616e63656c6c65642e000000000000000060448201526064016104d9565b336000908152600a60205260408120549003610a6f57600c80546001810182556000919091527fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c701805473ffffffffffffffffffffffffffffffffffffffff1916331790555b336000908152600a602052604081208054839290610a8e908490611d9d565b9091555050336000818152600b602052604090819020429055517fbdaa686eb6f59012d211a74523da260341c516896e9e5be954163d6ecf26ffa290610ad79084815260200190565b60405180910390a2610b146001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633308461164a565b7f0000000000000000000000000000000000000000000000000000000000000000610b3d610694565b03610b4a57610b4a6116cc565b50565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610bd85760405162461bcd60e51b815260206004820152602a60248201527f4f6e6c7920746865206f70657261746f722063616e20706572666f726d20746860448201526934b99030b1ba34b7b71760b11b60648201526084016104d9565b600d5460ff16610c505760405162461bcd60e51b815260206004820152603a60248201527f596f752063616e6e6f74207265736574206120636f6e7472616374207468617460448201527f206861736e2774206265656e2066696e616c697365642079657400000000000060648201526084016104d9565b600c5460005b81811015610ca8576000600c8281548110610c7357610c73611d87565b60009182526020808320909101546001600160a01b03168252600a905260408120555080610ca081611db0565b915050610c56565b50610cb5600c6000611c17565b600d805460ff191690556040805160808101825260065481526007546020820152600854918101919091526009546060820152610cf390839061104c565b5050565b6000828211610d6e5760405162461bcd60e51b815260206004820152603c60248201527f436f6e7472696275746f727320657863656564207065726d6974746564206d6160448201527f78696d756d206e756d626572206f6620636f6e7472696275746f72730000000060648201526084016104d9565b82600003610d9f576004610d83600186611d74565b610d8d9190611dc9565b610d98906001611d9d565b9050610dd2565b6000610dab8484611d74565b905080610db9600187611d74565b610dc39190611dc9565b610dce906001611d9d565b9150505b9392505050565b600c8181548110610de957600080fd5b6000918252602090912001546001600160a01b0316905081565b6000610e63610e10610694565b610e3a907f0000000000000000000000000000000000000000000000000000000000000000611d74565b600c547f0000000000000000000000000000000000000000000000000000000000000000610cf7565b905090565b600c54600090610e785750600090565b600a6000600c600081548110610e9057610e90611d87565b60009182526020808320909101546001600160a01b03168352820192909252604001902054905090565b6000610ec98260006001610cf7565b92915050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610f5a5760405162461bcd60e51b815260206004820152602a60248201527f4f6e6c7920746865206f70657261746f722063616e20706572666f726d20746860448201526934b99030b1ba34b7b71760b11b60648201526084016104d9565b600d5460ff1615610fad5760405162461bcd60e51b815260206004820152601f60248201527f43616e6e6f742063616e63656c20612066696e616c697a6564206e6f64652e0060448201526064016104d9565b600d54610100900460ff16156110055760405162461bcd60e51b815260206004820181905260248201527f4e6f64652068617320616c7265616479206265656e2063616e63656c6c65642e60448201526064016104d9565b600d805461ff00191661010017905561101d3361148c565b506002546040517fc41d93b8bfbf9fd7cf5bfe271fd649ab6a6fec0ea101c23b82a2a28eca2533a990600090a2565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146110d75760405162461bcd60e51b815260206004820152602a60248201527f4f6e6c7920746865206f70657261746f722063616e20706572666f726d20746860448201526934b99030b1ba34b7b71760b11b60648201526084016104d9565b600c54156111325760405162461bcd60e51b815260206004820152602260248201527f4f70657261746f7220616c726561647920636f6e74726962757465642066756e604482015261647360f01b60648201526084016104d9565b600d54610100900460ff161561118a5760405162461bcd60e51b815260206004820152601860248201527f4e6f646520686173206265656e2063616e63656c6c65642e000000000000000060448201526064016104d9565b611192610e03565b8210156112075760405162461bcd60e51b815260206004820152602960248201527f436f6e747269627574696f6e2069732062656c6f77206d696e696d756d20726560448201527f71756972656d656e74000000000000000000000000000000000000000000000060648201526084016104d9565b8051600655602081015160075560408101516008556060810151600955610cf382610706565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146112b85760405162461bcd60e51b815260206004820152602a60248201527f4f6e6c7920746865206f70657261746f722063616e20706572666f726d20746860448201526934b99030b1ba34b7b71760b11b60648201526084016104d9565b600d5460ff166113165760405162461bcd60e51b8152602060048201526024808201527f436f6e747261637420686173206e6f74206265656e2066696e616c697a6564206044820152633cb2ba1760e11b60648201526084016104d9565b600d54610100900460ff161561136e5760405162461bcd60e51b815260206004820152601c60248201527f436f6e747261637420686173206265656e2063616e63656c6c65642e0000000060448201526064016104d9565b6040516370a0823160e01b815230600482015281906000906001600160a01b038316906370a0823190602401602060405180830381865afa1580156113b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113db9190611deb565b9050600081116114535760405162461bcd60e51b815260206004820152602f60248201527f436f6e747261637420686173206e6f2062616c616e6365206f6620746865207360448201527f706563696669656420746f6b656e2e000000000000000000000000000000000060648201526084016104d9565b6114876001600160a01b0383167f000000000000000000000000000000000000000000000000000000000000000083611a7c565b505050565b6001600160a01b0381166000908152600a6020526040812054908190036114b257919050565b6001600160a01b0382166000908152600a60205260408120819055600c54905b818110156115da57600c81815481106114ed576114ed611d87565b6000918252602090912001546001600160a01b03908116908516036115c857600c611519600184611d74565b8154811061152957611529611d87565b600091825260209091200154600c80546001600160a01b03909216918390811061155557611555611d87565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550600c80548061159457611594611e04565b6000828152602090208101600019908101805473ffffffffffffffffffffffffffffffffffffffff191690550190556115da565b806115d281611db0565b9150506114d2565b5061160f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168484611a7c565b50919050565b805160009015158061162b575060008260200151115b8061163a575060008260400151115b80610ec957505060600151151590565b6040516001600160a01b0384811660248301528381166044830152606482018390526116c69186918216906323b872dd906084015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611aad565b50505050565b7f00000000000000000000000000000000000000000000000000000000000000006116f5610694565b146117425760405162461bcd60e51b815260206004820152601e60248201527f46756e64696e6720676f616c20686173206e6f74206265656e206d65742e000060448201526064016104d9565b600d5460ff16156117955760405162461bcd60e51b815260206004820181905260248201527f4e6f64652068617320616c7265616479206265656e2066696e616c697a65642e60448201526064016104d9565b600d54610100900460ff16156117ed5760405162461bcd60e51b815260206004820152601860248201527f4e6f646520686173206265656e2063616e63656c6c65642e000000000000000060448201526064016104d9565b600d805460ff191660011790556002546040517f839cf22e1ba87ce2f5b9bbf46cf0175a09eed52febdfaac8852478e68203c76390600090a2600c5460009067ffffffffffffffff81111561184457611844611cb7565b60405190808252806020026020018201604052801561188957816020015b60408051808201909152600080825260208201528152602001906001900390816118625790505b50600c5490915060005b8181101561191d576000600c82815481106118b0576118b0611d87565b60009182526020808320909101546040805180820182526001600160a01b03909216808352808552600a8452932054918101919091528551919250908590849081106118fe576118fe611d87565b602002602001018190525050808061191590611db0565b915050611893565b5060405163095ea7b360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660048301527f000000000000000000000000000000000000000000000000000000000000000060248301527f0000000000000000000000000000000000000000000000000000000000000000169063095ea7b3906044016020604051808303816000875af11580156119cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119f09190611e1a565b5060405163ab73513960e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ab73513990611a46906000906006906002908890600401611e8b565b600060405180830381600087803b158015611a6057600080fd5b505af1158015611a74573d6000803e3d6000fd5b505050505050565b6040516001600160a01b0383811660248301526044820183905261148791859182169063a9059cbb9060640161167f565b6000611ac26001600160a01b03841683611b10565b90508051600014158015611ae7575080806020019051810190611ae59190611e1a565b155b1561148757604051635274afe760e01b81526001600160a01b03841660048201526024016104d9565b6060610dd28383600084600080856001600160a01b03168486604051611b369190611f0c565b60006040518083038185875af1925050503d8060008114611b73576040519150601f19603f3d011682016040523d82523d6000602084013e611b78565b606091505b5091509150611b88868383611b92565b9695505050505050565b606082611ba757611ba282611bee565b610dd2565b8151158015611bbe57506001600160a01b0384163b155b15611be757604051639996b31560e01b81526001600160a01b03851660048201526024016104d9565b5080610dd2565b805115611bfe5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b5080546000825590600052602060002090810190610b4a91905b80821115611c455760008155600101611c31565b5090565b600060208284031215611c5b57600080fd5b81356001600160a01b0381168114610dd257600080fd5b600060208284031215611c8457600080fd5b5035919050565b600080600060608486031215611ca057600080fd5b505081359360208301359350604090920135919050565b634e487b7160e01b600052604160045260246000fd5b60008082840360a0811215611ce157600080fd5b833592506080601f1982011215611cf757600080fd5b506040516080810181811067ffffffffffffffff82111715611d2957634e487b7160e01b600052604160045260246000fd5b806040525060208401358152604084013560208201526060840135604082015260808401356060820152809150509250929050565b634e487b7160e01b600052601160045260246000fd5b81810381811115610ec957610ec9611d5e565b634e487b7160e01b600052603260045260246000fd5b80820180821115610ec957610ec9611d5e565b600060018201611dc257611dc2611d5e565b5060010190565b600082611de657634e487b7160e01b600052601260045260246000fd5b500490565b600060208284031215611dfd57600080fd5b5051919050565b634e487b7160e01b600052603160045260246000fd5b600060208284031215611e2c57600080fd5b81518015158114610dd257600080fd5b600081518084526020808501945080840160005b83811015611e8057815180516001600160a01b031688528301518388015260409096019590820190600101611e50565b509495945050505050565b60006101608654835260018701546020840152855460408401526001860154606084015260028601546080840152600386015460a0840152845460c0840152600185015460e0840152600285015461010084015261ffff60038601541661012084015280610140840152611f0181840185611e3c565b979650505050505050565b6000825160005b81811015611f2d5760208186018101518583015201611f13565b50600092019182525091905056fea164736f6c6343000814000a", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/abis/ServiceNodeContributionFactory.json b/abis/ServiceNodeContributionFactory.json new file mode 100644 index 0000000..a9c7c28 --- /dev/null +++ b/abis/ServiceNodeContributionFactory.json @@ -0,0 +1,132 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "ServiceNodeContributionFactory", + "sourceName": "contracts/ServiceNodeContributionFactory.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_stakingRewardsContract", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "contributorContract", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "serviceNodePubkey", + "type": "uint256" + } + ], + "name": "NewServiceNodeContributionContract", + "type": "event" + }, + { + "inputs": [], + "name": "SENT", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "X", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "Y", + "type": "uint256" + } + ], + "internalType": "struct BN256G1.G1Point", + "name": "blsPubkey", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "serviceNodePubkey", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "serviceNodeSignature1", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "serviceNodeSignature2", + "type": "uint256" + }, + { + "internalType": "uint16", + "name": "fee", + "type": "uint16" + } + ], + "internalType": "struct IServiceNodeRewards.ServiceNodeParams", + "name": "serviceNodeParams", + "type": "tuple" + } + ], + "name": "deployContributionContract", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "maxContributors", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "stakingRewardsContract", + "outputs": [ + { + "internalType": "contract IServiceNodeRewards", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "bytecode": "0x60e060405234801561001057600080fd5b506040516128be3803806128be83398101604081905261002f9161013b565b6001600160a01b03811660a0819052604080516307c89d2f60e41b81529051637c89d2f0916004808201926020929091908290030181865afa158015610079573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061009d919061013b565b6001600160a01b03166080816001600160a01b03168152505060a0516001600160a01b03166386fa50636040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061011a919061015f565b60c05250610178565b6001600160a01b038116811461013857600080fd5b50565b60006020828403121561014d57600080fd5b815161015881610123565b9392505050565b60006020828403121561017157600080fd5b5051919050565b60805160a05160c05161270c6101b26000396000818160ce0152610138015260008181605601526101170152600060a7015261270c6000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c8063336237941461005157806360e52ecb146100a257806386fa5063146100c9578063b336548d146100fe575b600080fd5b6100787f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100787f000000000000000000000000000000000000000000000000000000000000000081565b6100f07f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610099565b61011161010c3660046102b5565b610113565b005b60007f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000848460405161016590610240565b73ffffffffffffffffffffffffffffffffffffffff9094168452602080850193909352815160408086019190915291830151606080860191909152815160808601529281015160a08501529081015160c0840152015161ffff1660e082015261010001604051809103906000f0801580156101e4573d6000803e3d6000fd5b5090508073ffffffffffffffffffffffffffffffffffffffff167feac84630ba02e5ab324a651281c90ec45563a21f07fdf52b6f601f312e2de27a836000015160405161023391815260200190565b60405180910390a2505050565b6123b58061034b83390190565b6040805190810167ffffffffffffffff8111828210171561027e57634e487b7160e01b600052604160045260246000fd5b60405290565b6040516080810167ffffffffffffffff8111828210171561027e57634e487b7160e01b600052604160045260246000fd5b60008082840360c08112156102c957600080fd5b60408112156102d757600080fd5b6102df61024d565b843581526020808601359082015292506080603f198201121561030157600080fd5b5061030a610284565b60408401358152606084013560208201526080840135604082015260a084013561ffff8116811461033a57600080fd5b606082015291949193509091505056fe610120604052600d805461ffff191690553480156200001d57600080fd5b50604051620023b5380380620023b58339810160408190526200004091620002aa565b836001600160a01b0381166200009d5760405162461bcd60e51b815260206004820152601e60248201527f5368617265643a206164647265737320696e70757420697320656d707479000060448201526064015b60405180910390fd5b8380600003620000f05760405162461bcd60e51b815260206004820152601b60248201527f5368617265643a2075696e7420696e70757420697320656d7074790000000000604482015260640162000094565b6001600160a01b03861660a081905260408051630ada733d60e31b815290516356d399e8916004808201926020929091908290030181865afa1580156200013b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000161919062000369565b60c0818152505060a0516001600160a01b0316637c89d2f06040518163ffffffff1660e01b8152600401602060405180830381865afa158015620001a9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001cf919062000383565b6001600160a01b03166080525050610100929092523260e052805160005560209081015160015581516002558101516003556040810151600455606001516005805461ffff191661ffff90921691909117905550620003aa565b6001600160a01b03811681146200023f57600080fd5b50565b604080519081016001600160401b03811182821017156200027357634e487b7160e01b600052604160045260246000fd5b60405290565b604051608081016001600160401b03811182821017156200027357634e487b7160e01b600052604160045260246000fd5b600080600080848603610100811215620002c357600080fd5b8551620002d08162000229565b602087015190955093506040603f1982011215620002ed57600080fd5b620002f762000242565b604087015181526060870151602082015292506080607f19820112156200031d57600080fd5b506200032862000279565b6080860151815260a0860151602082015260c0860151604082015260e086015161ffff811681146200035957600080fd5b6060820152939692955090935050565b6000602082840312156200037c57600080fd5b5051919050565b6000602082840312156200039657600080fd5b8151620003a38162000229565b9392505050565b60805160a05160c05160e05161010051611f486200046d600039600081816103990152610e3f0152600081816103380152818161053f0152818161071001528181610b5801528181610eda01528181611057015281816112380152611462015260008181610311015281816108b801528181610b1601528181610e16015281816116ce015261195d01526000818161023e015281816119350152611a0801526000818161035f01528181610aec015281816115e801526119830152611f486000f3fe608060405234801561001057600080fd5b50600436106101ae5760003560e01c80638467f7cb116100ee5780639a82a09a11610097578063b436950c11610071578063b436950c14610433578063c28b1e791461043b578063ccec37161461044e578063e50d50d81461046157600080fd5b80639a82a09a146103f15780639ca002a614610413578063b3f05b971461042657600080fd5b80638dd08557116100c85780638dd08557146103ce578063937e09b1146103e157806396a608c0146103e957600080fd5b80638467f7cb1461038157806386fa5063146103945780638c7e7a31146103bb57600080fd5b80634564168b1161015b5780634e7320ce116101355780634e7320ce146102d657806356d399e81461030c578063570ca7351461033357806360e52ecb1461035a57600080fd5b80634564168b1461029857806348a05132146102bb5780634a387cdf146102ce57600080fd5b80632c7baaf31161018c5780632c7baaf3146101fb578063336237941461023957806342e94c901461027857600080fd5b80630d616d20146101b35780630dcf4b8f146101bd5780630ebb172a146101d8575b600080fd5b6101bb610481565b005b6101c5610694565b6040519081526020015b60405180910390f35b6101e26201518081565b60405167ffffffffffffffff90911681526020016101cf565b6002546003546004546005546102159392919061ffff1684565b6040805194855260208501939093529183015261ffff1660608201526080016101cf565b6102607f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101cf565b6101c5610286366004611c49565b600a6020526000908152604090205481565b6000546001546102a6919082565b604080519283526020830191909152016101cf565b6101bb6102c9366004611c72565b610706565b600c546101c5565b6006546007546008546009546102ec9392919084565b6040805194855260208501939093529183015260608201526080016101cf565b6101c57f000000000000000000000000000000000000000000000000000000000000000081565b6102607f000000000000000000000000000000000000000000000000000000000000000081565b6102607f000000000000000000000000000000000000000000000000000000000000000081565b6101bb61038f366004611c72565b610b4d565b6101c57f000000000000000000000000000000000000000000000000000000000000000081565b6101c56103c9366004611c8b565b610cf7565b6102606103dc366004611c72565b610dd9565b6101c5610e03565b6101c5610e68565b600d5461040390610100900460ff1681565b60405190151581526020016101cf565b6101c5610421366004611c72565b610eba565b600d546104039060ff1681565b6101bb610ecf565b6101bb610449366004611ccd565b61104c565b6101bb61045c366004611c49565b61122d565b6101c561046f366004611c49565b600b6020526000908152604090205481565b336000908152600a60205260409020546104e25760405162461bcd60e51b815260206004820152601960248201527f596f752068617665206e6f7420636f6e74726962757465642e0000000000000060448201526064015b60405180910390fd5b600d5460ff16156105355760405162461bcd60e51b815260206004820181905260248201527f4e6f64652068617320616c7265616479206265656e2066696e616c697a65642e60448201526064016104d9565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633036105ad5760405162461bcd60e51b815260206004820152601860248201527f4f70657261746f722063616e6e6f74207769746864726177000000000000000060448201526064016104d9565b600d54610100900460ff1661064e57336000908152600b602052604090205462015180906105db9042611d74565b1161064e5760405162461bcd60e51b815260206004820152603060248201527f5769746864726177616c20756e617661696c61626c653a20323420686f75727360448201527f2068617665206e6f74207061737365640000000000000000000000000000000060648201526084016104d9565b60006106593361148c565b60405181815290915033907f249a82fbe5056a1940b4e996665ba2a82c340ae9fa1e069fd1ababf5508f396e9060200160405180910390a250565b600c54600090815b81811015610701576000600c82815481106106b9576106b9611d87565b60009182526020808320909101546001600160a01b0316808352600a9091526040909120549091506106eb9085611d9d565b93505080806106f990611db0565b91505061069c565b505090565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633036107df57604080516080810182526006548152600754602082015260085491810191909152600954606082015261076890611615565b6107da5760405162461bcd60e51b815260206004820152603f60248201527f4f70657261746f72206d75737420696e697469616c6c7920636f6e747269627560448201527f7465207669612060636f6e7472696275744f70657261746f7246756e6473600060648201526084016104d9565b610839565b600c546108395760405162461bcd60e51b815260206004820152602260248201527f4f70657261746f7220686173206e6f7420636f6e74726962757465642066756e604482015261647360f01b60648201526084016104d9565b610841610e03565b8110156108b65760405162461bcd60e51b815260206004820152602e60248201527f436f6e747269627574696f6e2069732062656c6f7720746865206d696e696d7560448201527f6d20726571756972656d656e742e00000000000000000000000000000000000060648201526084016104d9565b7f0000000000000000000000000000000000000000000000000000000000000000816108e0610694565b6108ea9190611d9d565b111561095e5760405162461bcd60e51b815260206004820152602660248201527f436f6e747269627574696f6e2065786365656473207468652066756e64696e6760448201527f20676f616c2e000000000000000000000000000000000000000000000000000060648201526084016104d9565b600d5460ff16156109b15760405162461bcd60e51b815260206004820181905260248201527f4e6f64652068617320616c7265616479206265656e2066696e616c697a65642e60448201526064016104d9565b600d54610100900460ff1615610a095760405162461bcd60e51b815260206004820152601860248201527f4e6f646520686173206265656e2063616e63656c6c65642e000000000000000060448201526064016104d9565b336000908152600a60205260408120549003610a6f57600c80546001810182556000919091527fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c701805473ffffffffffffffffffffffffffffffffffffffff1916331790555b336000908152600a602052604081208054839290610a8e908490611d9d565b9091555050336000818152600b602052604090819020429055517fbdaa686eb6f59012d211a74523da260341c516896e9e5be954163d6ecf26ffa290610ad79084815260200190565b60405180910390a2610b146001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633308461164a565b7f0000000000000000000000000000000000000000000000000000000000000000610b3d610694565b03610b4a57610b4a6116cc565b50565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610bd85760405162461bcd60e51b815260206004820152602a60248201527f4f6e6c7920746865206f70657261746f722063616e20706572666f726d20746860448201526934b99030b1ba34b7b71760b11b60648201526084016104d9565b600d5460ff16610c505760405162461bcd60e51b815260206004820152603a60248201527f596f752063616e6e6f74207265736574206120636f6e7472616374207468617460448201527f206861736e2774206265656e2066696e616c697365642079657400000000000060648201526084016104d9565b600c5460005b81811015610ca8576000600c8281548110610c7357610c73611d87565b60009182526020808320909101546001600160a01b03168252600a905260408120555080610ca081611db0565b915050610c56565b50610cb5600c6000611c17565b600d805460ff191690556040805160808101825260065481526007546020820152600854918101919091526009546060820152610cf390839061104c565b5050565b6000828211610d6e5760405162461bcd60e51b815260206004820152603c60248201527f436f6e7472696275746f727320657863656564207065726d6974746564206d6160448201527f78696d756d206e756d626572206f6620636f6e7472696275746f72730000000060648201526084016104d9565b82600003610d9f576004610d83600186611d74565b610d8d9190611dc9565b610d98906001611d9d565b9050610dd2565b6000610dab8484611d74565b905080610db9600187611d74565b610dc39190611dc9565b610dce906001611d9d565b9150505b9392505050565b600c8181548110610de957600080fd5b6000918252602090912001546001600160a01b0316905081565b6000610e63610e10610694565b610e3a907f0000000000000000000000000000000000000000000000000000000000000000611d74565b600c547f0000000000000000000000000000000000000000000000000000000000000000610cf7565b905090565b600c54600090610e785750600090565b600a6000600c600081548110610e9057610e90611d87565b60009182526020808320909101546001600160a01b03168352820192909252604001902054905090565b6000610ec98260006001610cf7565b92915050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610f5a5760405162461bcd60e51b815260206004820152602a60248201527f4f6e6c7920746865206f70657261746f722063616e20706572666f726d20746860448201526934b99030b1ba34b7b71760b11b60648201526084016104d9565b600d5460ff1615610fad5760405162461bcd60e51b815260206004820152601f60248201527f43616e6e6f742063616e63656c20612066696e616c697a6564206e6f64652e0060448201526064016104d9565b600d54610100900460ff16156110055760405162461bcd60e51b815260206004820181905260248201527f4e6f64652068617320616c7265616479206265656e2063616e63656c6c65642e60448201526064016104d9565b600d805461ff00191661010017905561101d3361148c565b506002546040517fc41d93b8bfbf9fd7cf5bfe271fd649ab6a6fec0ea101c23b82a2a28eca2533a990600090a2565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146110d75760405162461bcd60e51b815260206004820152602a60248201527f4f6e6c7920746865206f70657261746f722063616e20706572666f726d20746860448201526934b99030b1ba34b7b71760b11b60648201526084016104d9565b600c54156111325760405162461bcd60e51b815260206004820152602260248201527f4f70657261746f7220616c726561647920636f6e74726962757465642066756e604482015261647360f01b60648201526084016104d9565b600d54610100900460ff161561118a5760405162461bcd60e51b815260206004820152601860248201527f4e6f646520686173206265656e2063616e63656c6c65642e000000000000000060448201526064016104d9565b611192610e03565b8210156112075760405162461bcd60e51b815260206004820152602960248201527f436f6e747269627574696f6e2069732062656c6f77206d696e696d756d20726560448201527f71756972656d656e74000000000000000000000000000000000000000000000060648201526084016104d9565b8051600655602081015160075560408101516008556060810151600955610cf382610706565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146112b85760405162461bcd60e51b815260206004820152602a60248201527f4f6e6c7920746865206f70657261746f722063616e20706572666f726d20746860448201526934b99030b1ba34b7b71760b11b60648201526084016104d9565b600d5460ff166113165760405162461bcd60e51b8152602060048201526024808201527f436f6e747261637420686173206e6f74206265656e2066696e616c697a6564206044820152633cb2ba1760e11b60648201526084016104d9565b600d54610100900460ff161561136e5760405162461bcd60e51b815260206004820152601c60248201527f436f6e747261637420686173206265656e2063616e63656c6c65642e0000000060448201526064016104d9565b6040516370a0823160e01b815230600482015281906000906001600160a01b038316906370a0823190602401602060405180830381865afa1580156113b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113db9190611deb565b9050600081116114535760405162461bcd60e51b815260206004820152602f60248201527f436f6e747261637420686173206e6f2062616c616e6365206f6620746865207360448201527f706563696669656420746f6b656e2e000000000000000000000000000000000060648201526084016104d9565b6114876001600160a01b0383167f000000000000000000000000000000000000000000000000000000000000000083611a7c565b505050565b6001600160a01b0381166000908152600a6020526040812054908190036114b257919050565b6001600160a01b0382166000908152600a60205260408120819055600c54905b818110156115da57600c81815481106114ed576114ed611d87565b6000918252602090912001546001600160a01b03908116908516036115c857600c611519600184611d74565b8154811061152957611529611d87565b600091825260209091200154600c80546001600160a01b03909216918390811061155557611555611d87565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550600c80548061159457611594611e04565b6000828152602090208101600019908101805473ffffffffffffffffffffffffffffffffffffffff191690550190556115da565b806115d281611db0565b9150506114d2565b5061160f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168484611a7c565b50919050565b805160009015158061162b575060008260200151115b8061163a575060008260400151115b80610ec957505060600151151590565b6040516001600160a01b0384811660248301528381166044830152606482018390526116c69186918216906323b872dd906084015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611aad565b50505050565b7f00000000000000000000000000000000000000000000000000000000000000006116f5610694565b146117425760405162461bcd60e51b815260206004820152601e60248201527f46756e64696e6720676f616c20686173206e6f74206265656e206d65742e000060448201526064016104d9565b600d5460ff16156117955760405162461bcd60e51b815260206004820181905260248201527f4e6f64652068617320616c7265616479206265656e2066696e616c697a65642e60448201526064016104d9565b600d54610100900460ff16156117ed5760405162461bcd60e51b815260206004820152601860248201527f4e6f646520686173206265656e2063616e63656c6c65642e000000000000000060448201526064016104d9565b600d805460ff191660011790556002546040517f839cf22e1ba87ce2f5b9bbf46cf0175a09eed52febdfaac8852478e68203c76390600090a2600c5460009067ffffffffffffffff81111561184457611844611cb7565b60405190808252806020026020018201604052801561188957816020015b60408051808201909152600080825260208201528152602001906001900390816118625790505b50600c5490915060005b8181101561191d576000600c82815481106118b0576118b0611d87565b60009182526020808320909101546040805180820182526001600160a01b03909216808352808552600a8452932054918101919091528551919250908590849081106118fe576118fe611d87565b602002602001018190525050808061191590611db0565b915050611893565b5060405163095ea7b360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660048301527f000000000000000000000000000000000000000000000000000000000000000060248301527f0000000000000000000000000000000000000000000000000000000000000000169063095ea7b3906044016020604051808303816000875af11580156119cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119f09190611e1a565b5060405163ab73513960e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ab73513990611a46906000906006906002908890600401611e8b565b600060405180830381600087803b158015611a6057600080fd5b505af1158015611a74573d6000803e3d6000fd5b505050505050565b6040516001600160a01b0383811660248301526044820183905261148791859182169063a9059cbb9060640161167f565b6000611ac26001600160a01b03841683611b10565b90508051600014158015611ae7575080806020019051810190611ae59190611e1a565b155b1561148757604051635274afe760e01b81526001600160a01b03841660048201526024016104d9565b6060610dd28383600084600080856001600160a01b03168486604051611b369190611f0c565b60006040518083038185875af1925050503d8060008114611b73576040519150601f19603f3d011682016040523d82523d6000602084013e611b78565b606091505b5091509150611b88868383611b92565b9695505050505050565b606082611ba757611ba282611bee565b610dd2565b8151158015611bbe57506001600160a01b0384163b155b15611be757604051639996b31560e01b81526001600160a01b03851660048201526024016104d9565b5080610dd2565b805115611bfe5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b5080546000825590600052602060002090810190610b4a91905b80821115611c455760008155600101611c31565b5090565b600060208284031215611c5b57600080fd5b81356001600160a01b0381168114610dd257600080fd5b600060208284031215611c8457600080fd5b5035919050565b600080600060608486031215611ca057600080fd5b505081359360208301359350604090920135919050565b634e487b7160e01b600052604160045260246000fd5b60008082840360a0811215611ce157600080fd5b833592506080601f1982011215611cf757600080fd5b506040516080810181811067ffffffffffffffff82111715611d2957634e487b7160e01b600052604160045260246000fd5b806040525060208401358152604084013560208201526060840135604082015260808401356060820152809150509250929050565b634e487b7160e01b600052601160045260246000fd5b81810381811115610ec957610ec9611d5e565b634e487b7160e01b600052603260045260246000fd5b80820180821115610ec957610ec9611d5e565b600060018201611dc257611dc2611d5e565b5060010190565b600082611de657634e487b7160e01b600052601260045260246000fd5b500490565b600060208284031215611dfd57600080fd5b5051919050565b634e487b7160e01b600052603160045260246000fd5b600060208284031215611e2c57600080fd5b81518015158114610dd257600080fd5b600081518084526020808501945080840160005b83811015611e8057815180516001600160a01b031688528301518388015260409096019590820190600101611e50565b509495945050505050565b60006101608654835260018701546020840152855460408401526001860154606084015260028601546080840152600386015460a0840152845460c0840152600185015460e0840152600285015461010084015261ffff60038601541661012084015280610140840152611f0181840185611e3c565b979650505050505050565b6000825160005b81811015611f2d5760208186018101518583015201611f13565b50600092019182525091905056fea164736f6c6343000814000aa164736f6c6343000814000a", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c8063336237941461005157806360e52ecb146100a257806386fa5063146100c9578063b336548d146100fe575b600080fd5b6100787f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100787f000000000000000000000000000000000000000000000000000000000000000081565b6100f07f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610099565b61011161010c3660046102b5565b610113565b005b60007f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000848460405161016590610240565b73ffffffffffffffffffffffffffffffffffffffff9094168452602080850193909352815160408086019190915291830151606080860191909152815160808601529281015160a08501529081015160c0840152015161ffff1660e082015261010001604051809103906000f0801580156101e4573d6000803e3d6000fd5b5090508073ffffffffffffffffffffffffffffffffffffffff167feac84630ba02e5ab324a651281c90ec45563a21f07fdf52b6f601f312e2de27a836000015160405161023391815260200190565b60405180910390a2505050565b6123b58061034b83390190565b6040805190810167ffffffffffffffff8111828210171561027e57634e487b7160e01b600052604160045260246000fd5b60405290565b6040516080810167ffffffffffffffff8111828210171561027e57634e487b7160e01b600052604160045260246000fd5b60008082840360c08112156102c957600080fd5b60408112156102d757600080fd5b6102df61024d565b843581526020808601359082015292506080603f198201121561030157600080fd5b5061030a610284565b60408401358152606084013560208201526080840135604082015260a084013561ffff8116811461033a57600080fd5b606082015291949193509091505056fe610120604052600d805461ffff191690553480156200001d57600080fd5b50604051620023b5380380620023b58339810160408190526200004091620002aa565b836001600160a01b0381166200009d5760405162461bcd60e51b815260206004820152601e60248201527f5368617265643a206164647265737320696e70757420697320656d707479000060448201526064015b60405180910390fd5b8380600003620000f05760405162461bcd60e51b815260206004820152601b60248201527f5368617265643a2075696e7420696e70757420697320656d7074790000000000604482015260640162000094565b6001600160a01b03861660a081905260408051630ada733d60e31b815290516356d399e8916004808201926020929091908290030181865afa1580156200013b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000161919062000369565b60c0818152505060a0516001600160a01b0316637c89d2f06040518163ffffffff1660e01b8152600401602060405180830381865afa158015620001a9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001cf919062000383565b6001600160a01b03166080525050610100929092523260e052805160005560209081015160015581516002558101516003556040810151600455606001516005805461ffff191661ffff90921691909117905550620003aa565b6001600160a01b03811681146200023f57600080fd5b50565b604080519081016001600160401b03811182821017156200027357634e487b7160e01b600052604160045260246000fd5b60405290565b604051608081016001600160401b03811182821017156200027357634e487b7160e01b600052604160045260246000fd5b600080600080848603610100811215620002c357600080fd5b8551620002d08162000229565b602087015190955093506040603f1982011215620002ed57600080fd5b620002f762000242565b604087015181526060870151602082015292506080607f19820112156200031d57600080fd5b506200032862000279565b6080860151815260a0860151602082015260c0860151604082015260e086015161ffff811681146200035957600080fd5b6060820152939692955090935050565b6000602082840312156200037c57600080fd5b5051919050565b6000602082840312156200039657600080fd5b8151620003a38162000229565b9392505050565b60805160a05160c05160e05161010051611f486200046d600039600081816103990152610e3f0152600081816103380152818161053f0152818161071001528181610b5801528181610eda01528181611057015281816112380152611462015260008181610311015281816108b801528181610b1601528181610e16015281816116ce015261195d01526000818161023e015281816119350152611a0801526000818161035f01528181610aec015281816115e801526119830152611f486000f3fe608060405234801561001057600080fd5b50600436106101ae5760003560e01c80638467f7cb116100ee5780639a82a09a11610097578063b436950c11610071578063b436950c14610433578063c28b1e791461043b578063ccec37161461044e578063e50d50d81461046157600080fd5b80639a82a09a146103f15780639ca002a614610413578063b3f05b971461042657600080fd5b80638dd08557116100c85780638dd08557146103ce578063937e09b1146103e157806396a608c0146103e957600080fd5b80638467f7cb1461038157806386fa5063146103945780638c7e7a31146103bb57600080fd5b80634564168b1161015b5780634e7320ce116101355780634e7320ce146102d657806356d399e81461030c578063570ca7351461033357806360e52ecb1461035a57600080fd5b80634564168b1461029857806348a05132146102bb5780634a387cdf146102ce57600080fd5b80632c7baaf31161018c5780632c7baaf3146101fb578063336237941461023957806342e94c901461027857600080fd5b80630d616d20146101b35780630dcf4b8f146101bd5780630ebb172a146101d8575b600080fd5b6101bb610481565b005b6101c5610694565b6040519081526020015b60405180910390f35b6101e26201518081565b60405167ffffffffffffffff90911681526020016101cf565b6002546003546004546005546102159392919061ffff1684565b6040805194855260208501939093529183015261ffff1660608201526080016101cf565b6102607f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101cf565b6101c5610286366004611c49565b600a6020526000908152604090205481565b6000546001546102a6919082565b604080519283526020830191909152016101cf565b6101bb6102c9366004611c72565b610706565b600c546101c5565b6006546007546008546009546102ec9392919084565b6040805194855260208501939093529183015260608201526080016101cf565b6101c57f000000000000000000000000000000000000000000000000000000000000000081565b6102607f000000000000000000000000000000000000000000000000000000000000000081565b6102607f000000000000000000000000000000000000000000000000000000000000000081565b6101bb61038f366004611c72565b610b4d565b6101c57f000000000000000000000000000000000000000000000000000000000000000081565b6101c56103c9366004611c8b565b610cf7565b6102606103dc366004611c72565b610dd9565b6101c5610e03565b6101c5610e68565b600d5461040390610100900460ff1681565b60405190151581526020016101cf565b6101c5610421366004611c72565b610eba565b600d546104039060ff1681565b6101bb610ecf565b6101bb610449366004611ccd565b61104c565b6101bb61045c366004611c49565b61122d565b6101c561046f366004611c49565b600b6020526000908152604090205481565b336000908152600a60205260409020546104e25760405162461bcd60e51b815260206004820152601960248201527f596f752068617665206e6f7420636f6e74726962757465642e0000000000000060448201526064015b60405180910390fd5b600d5460ff16156105355760405162461bcd60e51b815260206004820181905260248201527f4e6f64652068617320616c7265616479206265656e2066696e616c697a65642e60448201526064016104d9565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633036105ad5760405162461bcd60e51b815260206004820152601860248201527f4f70657261746f722063616e6e6f74207769746864726177000000000000000060448201526064016104d9565b600d54610100900460ff1661064e57336000908152600b602052604090205462015180906105db9042611d74565b1161064e5760405162461bcd60e51b815260206004820152603060248201527f5769746864726177616c20756e617661696c61626c653a20323420686f75727360448201527f2068617665206e6f74207061737365640000000000000000000000000000000060648201526084016104d9565b60006106593361148c565b60405181815290915033907f249a82fbe5056a1940b4e996665ba2a82c340ae9fa1e069fd1ababf5508f396e9060200160405180910390a250565b600c54600090815b81811015610701576000600c82815481106106b9576106b9611d87565b60009182526020808320909101546001600160a01b0316808352600a9091526040909120549091506106eb9085611d9d565b93505080806106f990611db0565b91505061069c565b505090565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633036107df57604080516080810182526006548152600754602082015260085491810191909152600954606082015261076890611615565b6107da5760405162461bcd60e51b815260206004820152603f60248201527f4f70657261746f72206d75737420696e697469616c6c7920636f6e747269627560448201527f7465207669612060636f6e7472696275744f70657261746f7246756e6473600060648201526084016104d9565b610839565b600c546108395760405162461bcd60e51b815260206004820152602260248201527f4f70657261746f7220686173206e6f7420636f6e74726962757465642066756e604482015261647360f01b60648201526084016104d9565b610841610e03565b8110156108b65760405162461bcd60e51b815260206004820152602e60248201527f436f6e747269627574696f6e2069732062656c6f7720746865206d696e696d7560448201527f6d20726571756972656d656e742e00000000000000000000000000000000000060648201526084016104d9565b7f0000000000000000000000000000000000000000000000000000000000000000816108e0610694565b6108ea9190611d9d565b111561095e5760405162461bcd60e51b815260206004820152602660248201527f436f6e747269627574696f6e2065786365656473207468652066756e64696e6760448201527f20676f616c2e000000000000000000000000000000000000000000000000000060648201526084016104d9565b600d5460ff16156109b15760405162461bcd60e51b815260206004820181905260248201527f4e6f64652068617320616c7265616479206265656e2066696e616c697a65642e60448201526064016104d9565b600d54610100900460ff1615610a095760405162461bcd60e51b815260206004820152601860248201527f4e6f646520686173206265656e2063616e63656c6c65642e000000000000000060448201526064016104d9565b336000908152600a60205260408120549003610a6f57600c80546001810182556000919091527fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c701805473ffffffffffffffffffffffffffffffffffffffff1916331790555b336000908152600a602052604081208054839290610a8e908490611d9d565b9091555050336000818152600b602052604090819020429055517fbdaa686eb6f59012d211a74523da260341c516896e9e5be954163d6ecf26ffa290610ad79084815260200190565b60405180910390a2610b146001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633308461164a565b7f0000000000000000000000000000000000000000000000000000000000000000610b3d610694565b03610b4a57610b4a6116cc565b50565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610bd85760405162461bcd60e51b815260206004820152602a60248201527f4f6e6c7920746865206f70657261746f722063616e20706572666f726d20746860448201526934b99030b1ba34b7b71760b11b60648201526084016104d9565b600d5460ff16610c505760405162461bcd60e51b815260206004820152603a60248201527f596f752063616e6e6f74207265736574206120636f6e7472616374207468617460448201527f206861736e2774206265656e2066696e616c697365642079657400000000000060648201526084016104d9565b600c5460005b81811015610ca8576000600c8281548110610c7357610c73611d87565b60009182526020808320909101546001600160a01b03168252600a905260408120555080610ca081611db0565b915050610c56565b50610cb5600c6000611c17565b600d805460ff191690556040805160808101825260065481526007546020820152600854918101919091526009546060820152610cf390839061104c565b5050565b6000828211610d6e5760405162461bcd60e51b815260206004820152603c60248201527f436f6e7472696275746f727320657863656564207065726d6974746564206d6160448201527f78696d756d206e756d626572206f6620636f6e7472696275746f72730000000060648201526084016104d9565b82600003610d9f576004610d83600186611d74565b610d8d9190611dc9565b610d98906001611d9d565b9050610dd2565b6000610dab8484611d74565b905080610db9600187611d74565b610dc39190611dc9565b610dce906001611d9d565b9150505b9392505050565b600c8181548110610de957600080fd5b6000918252602090912001546001600160a01b0316905081565b6000610e63610e10610694565b610e3a907f0000000000000000000000000000000000000000000000000000000000000000611d74565b600c547f0000000000000000000000000000000000000000000000000000000000000000610cf7565b905090565b600c54600090610e785750600090565b600a6000600c600081548110610e9057610e90611d87565b60009182526020808320909101546001600160a01b03168352820192909252604001902054905090565b6000610ec98260006001610cf7565b92915050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610f5a5760405162461bcd60e51b815260206004820152602a60248201527f4f6e6c7920746865206f70657261746f722063616e20706572666f726d20746860448201526934b99030b1ba34b7b71760b11b60648201526084016104d9565b600d5460ff1615610fad5760405162461bcd60e51b815260206004820152601f60248201527f43616e6e6f742063616e63656c20612066696e616c697a6564206e6f64652e0060448201526064016104d9565b600d54610100900460ff16156110055760405162461bcd60e51b815260206004820181905260248201527f4e6f64652068617320616c7265616479206265656e2063616e63656c6c65642e60448201526064016104d9565b600d805461ff00191661010017905561101d3361148c565b506002546040517fc41d93b8bfbf9fd7cf5bfe271fd649ab6a6fec0ea101c23b82a2a28eca2533a990600090a2565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146110d75760405162461bcd60e51b815260206004820152602a60248201527f4f6e6c7920746865206f70657261746f722063616e20706572666f726d20746860448201526934b99030b1ba34b7b71760b11b60648201526084016104d9565b600c54156111325760405162461bcd60e51b815260206004820152602260248201527f4f70657261746f7220616c726561647920636f6e74726962757465642066756e604482015261647360f01b60648201526084016104d9565b600d54610100900460ff161561118a5760405162461bcd60e51b815260206004820152601860248201527f4e6f646520686173206265656e2063616e63656c6c65642e000000000000000060448201526064016104d9565b611192610e03565b8210156112075760405162461bcd60e51b815260206004820152602960248201527f436f6e747269627574696f6e2069732062656c6f77206d696e696d756d20726560448201527f71756972656d656e74000000000000000000000000000000000000000000000060648201526084016104d9565b8051600655602081015160075560408101516008556060810151600955610cf382610706565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146112b85760405162461bcd60e51b815260206004820152602a60248201527f4f6e6c7920746865206f70657261746f722063616e20706572666f726d20746860448201526934b99030b1ba34b7b71760b11b60648201526084016104d9565b600d5460ff166113165760405162461bcd60e51b8152602060048201526024808201527f436f6e747261637420686173206e6f74206265656e2066696e616c697a6564206044820152633cb2ba1760e11b60648201526084016104d9565b600d54610100900460ff161561136e5760405162461bcd60e51b815260206004820152601c60248201527f436f6e747261637420686173206265656e2063616e63656c6c65642e0000000060448201526064016104d9565b6040516370a0823160e01b815230600482015281906000906001600160a01b038316906370a0823190602401602060405180830381865afa1580156113b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113db9190611deb565b9050600081116114535760405162461bcd60e51b815260206004820152602f60248201527f436f6e747261637420686173206e6f2062616c616e6365206f6620746865207360448201527f706563696669656420746f6b656e2e000000000000000000000000000000000060648201526084016104d9565b6114876001600160a01b0383167f000000000000000000000000000000000000000000000000000000000000000083611a7c565b505050565b6001600160a01b0381166000908152600a6020526040812054908190036114b257919050565b6001600160a01b0382166000908152600a60205260408120819055600c54905b818110156115da57600c81815481106114ed576114ed611d87565b6000918252602090912001546001600160a01b03908116908516036115c857600c611519600184611d74565b8154811061152957611529611d87565b600091825260209091200154600c80546001600160a01b03909216918390811061155557611555611d87565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550600c80548061159457611594611e04565b6000828152602090208101600019908101805473ffffffffffffffffffffffffffffffffffffffff191690550190556115da565b806115d281611db0565b9150506114d2565b5061160f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168484611a7c565b50919050565b805160009015158061162b575060008260200151115b8061163a575060008260400151115b80610ec957505060600151151590565b6040516001600160a01b0384811660248301528381166044830152606482018390526116c69186918216906323b872dd906084015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611aad565b50505050565b7f00000000000000000000000000000000000000000000000000000000000000006116f5610694565b146117425760405162461bcd60e51b815260206004820152601e60248201527f46756e64696e6720676f616c20686173206e6f74206265656e206d65742e000060448201526064016104d9565b600d5460ff16156117955760405162461bcd60e51b815260206004820181905260248201527f4e6f64652068617320616c7265616479206265656e2066696e616c697a65642e60448201526064016104d9565b600d54610100900460ff16156117ed5760405162461bcd60e51b815260206004820152601860248201527f4e6f646520686173206265656e2063616e63656c6c65642e000000000000000060448201526064016104d9565b600d805460ff191660011790556002546040517f839cf22e1ba87ce2f5b9bbf46cf0175a09eed52febdfaac8852478e68203c76390600090a2600c5460009067ffffffffffffffff81111561184457611844611cb7565b60405190808252806020026020018201604052801561188957816020015b60408051808201909152600080825260208201528152602001906001900390816118625790505b50600c5490915060005b8181101561191d576000600c82815481106118b0576118b0611d87565b60009182526020808320909101546040805180820182526001600160a01b03909216808352808552600a8452932054918101919091528551919250908590849081106118fe576118fe611d87565b602002602001018190525050808061191590611db0565b915050611893565b5060405163095ea7b360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660048301527f000000000000000000000000000000000000000000000000000000000000000060248301527f0000000000000000000000000000000000000000000000000000000000000000169063095ea7b3906044016020604051808303816000875af11580156119cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119f09190611e1a565b5060405163ab73513960e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ab73513990611a46906000906006906002908890600401611e8b565b600060405180830381600087803b158015611a6057600080fd5b505af1158015611a74573d6000803e3d6000fd5b505050505050565b6040516001600160a01b0383811660248301526044820183905261148791859182169063a9059cbb9060640161167f565b6000611ac26001600160a01b03841683611b10565b90508051600014158015611ae7575080806020019051810190611ae59190611e1a565b155b1561148757604051635274afe760e01b81526001600160a01b03841660048201526024016104d9565b6060610dd28383600084600080856001600160a01b03168486604051611b369190611f0c565b60006040518083038185875af1925050503d8060008114611b73576040519150601f19603f3d011682016040523d82523d6000602084013e611b78565b606091505b5091509150611b88868383611b92565b9695505050505050565b606082611ba757611ba282611bee565b610dd2565b8151158015611bbe57506001600160a01b0384163b155b15611be757604051639996b31560e01b81526001600160a01b03851660048201526024016104d9565b5080610dd2565b805115611bfe5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b5080546000825590600052602060002090810190610b4a91905b80821115611c455760008155600101611c31565b5090565b600060208284031215611c5b57600080fd5b81356001600160a01b0381168114610dd257600080fd5b600060208284031215611c8457600080fd5b5035919050565b600080600060608486031215611ca057600080fd5b505081359360208301359350604090920135919050565b634e487b7160e01b600052604160045260246000fd5b60008082840360a0811215611ce157600080fd5b833592506080601f1982011215611cf757600080fd5b506040516080810181811067ffffffffffffffff82111715611d2957634e487b7160e01b600052604160045260246000fd5b806040525060208401358152604084013560208201526060840135604082015260808401356060820152809150509250929050565b634e487b7160e01b600052601160045260246000fd5b81810381811115610ec957610ec9611d5e565b634e487b7160e01b600052603260045260246000fd5b80820180821115610ec957610ec9611d5e565b600060018201611dc257611dc2611d5e565b5060010190565b600082611de657634e487b7160e01b600052601260045260246000fd5b500490565b600060208284031215611dfd57600080fd5b5051919050565b634e487b7160e01b600052603160045260246000fd5b600060208284031215611e2c57600080fd5b81518015158114610dd257600080fd5b600081518084526020808501945080840160005b83811015611e8057815180516001600160a01b031688528301518388015260409096019590820190600101611e50565b509495945050505050565b60006101608654835260018701546020840152855460408401526001860154606084015260028601546080840152600386015460a0840152845460c0840152600185015460e0840152600285015461010084015261ffff60038601541661012084015280610140840152611f0181840185611e3c565b979650505050505050565b6000825160005b81811015611f2d5760208186018101518583015201611f13565b50600092019182525091905056fea164736f6c6343000814000aa164736f6c6343000814000a", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/abis/ServiceNodeRewards.json b/abis/ServiceNodeRewards.json new file mode 100644 index 0000000..a8cd12d --- /dev/null +++ b/abis/ServiceNodeRewards.json @@ -0,0 +1,1648 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "ServiceNodeRewards", + "sourceName": "contracts/ServiceNodeRewards.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "AddressInsufficientBalance", + "type": "error" + }, + { + "inputs": [], + "name": "ArrayLengthMismatch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "serviceNodeID", + "type": "uint64" + } + ], + "name": "BLSPubkeyAlreadyExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "serviceNodeID", + "type": "uint64" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "X", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "Y", + "type": "uint256" + } + ], + "internalType": "struct BN256G1.G1Point", + "name": "pubkey", + "type": "tuple" + } + ], + "name": "BLSPubkeyDoesNotMatch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "serviceNodeID", + "type": "uint64" + }, + { + "internalType": "address", + "name": "contributor", + "type": "address" + } + ], + "name": "CallerNotContributor", + "type": "error" + }, + { + "inputs": [], + "name": "ContractAlreadyStarted", + "type": "error" + }, + { + "inputs": [], + "name": "ContractNotStarted", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "required", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "provided", + "type": "uint256" + } + ], + "name": "ContributionTotalMismatch", + "type": "error" + }, + { + "inputs": [], + "name": "DeleteSentinelNodeNotAllowed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "serviceNodeID", + "type": "uint64" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "EarlierLeaveRequestMade", + "type": "error" + }, + { + "inputs": [], + "name": "EnforcedPause", + "type": "error" + }, + { + "inputs": [], + "name": "ExpectedPause", + "type": "error" + }, + { + "inputs": [], + "name": "FailedInnerCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "address", + "name": "contributor", + "type": "address" + } + ], + "name": "FirstContributorMismatch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "numSigners", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "requiredSigners", + "type": "uint256" + } + ], + "name": "InsufficientBLSSignatures", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidBLSProofOfPossession", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidBLSSignature", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "serviceNodeID", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "currenttime", + "type": "uint256" + } + ], + "name": "LeaveRequestTooEarly", + "type": "error" + }, + { + "inputs": [], + "name": "MaxContributorsExceeded", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "NullRecipient", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "expectedRecipient", + "type": "address" + }, + { + "internalType": "address", + "name": "providedRecipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "serviceNodeID", + "type": "uint256" + } + ], + "name": "RecipientAddressDoesNotMatch", + "type": "error" + }, + { + "inputs": [], + "name": "RecipientRewardsTooLow", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "SafeERC20FailedOperation", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "serviceNodeID", + "type": "uint64" + } + ], + "name": "ServiceNodeDoesntExist", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "serviceNodeID", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "currenttime", + "type": "uint256" + } + ], + "name": "SignatureExpired", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "newMax", + "type": "uint256" + } + ], + "name": "BLSNonSignerThresholdMaxUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint64", + "name": "serviceNodeID", + "type": "uint64" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "X", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "Y", + "type": "uint256" + } + ], + "indexed": false, + "internalType": "struct BN256G1.G1Point", + "name": "pubkey", + "type": "tuple" + } + ], + "name": "NewSeededServiceNode", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint64", + "name": "serviceNodeID", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "X", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "Y", + "type": "uint256" + } + ], + "indexed": false, + "internalType": "struct BN256G1.G1Point", + "name": "pubkey", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "serviceNodePubkey", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "serviceNodeSignature1", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "serviceNodeSignature2", + "type": "uint256" + }, + { + "internalType": "uint16", + "name": "fee", + "type": "uint16" + } + ], + "indexed": false, + "internalType": "struct IServiceNodeRewards.ServiceNodeParams", + "name": "serviceNode", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "uint256", + "name": "stakedAmount", + "type": "uint256" + } + ], + "indexed": false, + "internalType": "struct IServiceNodeRewards.Contributor[]", + "name": "contributors", + "type": "tuple[]" + } + ], + "name": "NewServiceNode", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "recipientAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "previousBalance", + "type": "uint256" + } + ], + "name": "RewardsBalanceUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "recipientAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "RewardsClaimed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint64", + "name": "serviceNodeID", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "X", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "Y", + "type": "uint256" + } + ], + "indexed": false, + "internalType": "struct BN256G1.G1Point", + "name": "pubkey", + "type": "tuple" + } + ], + "name": "ServiceNodeLiquidated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint64", + "name": "serviceNodeID", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "returnedAmount", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "X", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "Y", + "type": "uint256" + } + ], + "indexed": false, + "internalType": "struct BN256G1.G1Point", + "name": "pubkey", + "type": "tuple" + } + ], + "name": "ServiceNodeRemoval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint64", + "name": "serviceNodeID", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "X", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "Y", + "type": "uint256" + } + ], + "indexed": false, + "internalType": "struct BN256G1.G1Point", + "name": "pubkey", + "type": "tuple" + } + ], + "name": "ServiceNodeRemovalRequest", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "newExpiry", + "type": "uint256" + } + ], + "name": "SignatureExpiryUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "newRequirement", + "type": "uint256" + } + ], + "name": "StakingRequirementUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "inputs": [], + "name": "LIST_SENTINEL", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_SERVICE_NODE_REMOVAL_WAIT_TIME", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "_aggregatePubkey", + "outputs": [ + { + "internalType": "uint256", + "name": "X", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "Y", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "X", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "Y", + "type": "uint256" + } + ], + "internalType": "struct BN256G1.G1Point", + "name": "blsPubkey", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "sigs0", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sigs1", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sigs2", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sigs3", + "type": "uint256" + } + ], + "internalType": "struct IServiceNodeRewards.BLSSignatureParams", + "name": "blsSignature", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "serviceNodePubkey", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "serviceNodeSignature1", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "serviceNodeSignature2", + "type": "uint256" + }, + { + "internalType": "uint16", + "name": "fee", + "type": "uint16" + } + ], + "internalType": "struct IServiceNodeRewards.ServiceNodeParams", + "name": "serviceNodeParams", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "uint256", + "name": "stakedAmount", + "type": "uint256" + } + ], + "internalType": "struct IServiceNodeRewards.Contributor[]", + "name": "contributors", + "type": "tuple[]" + } + ], + "name": "addBLSPublicKey", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "aggregatePubkey", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "X", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "Y", + "type": "uint256" + } + ], + "internalType": "struct BN256G1.G1Point", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "blsNonSignerThreshold", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "blsNonSignerThresholdMax", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "claimRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "designatedToken", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "foundationPool", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token_", + "type": "address" + }, + { + "internalType": "address", + "name": "foundationPool_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "stakingRequirement_", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxContributors_", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidatorRewardRatio_", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "poolShareOfLiquidationRatio_", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "recipientRatio_", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "serviceNodeID", + "type": "uint64" + } + ], + "name": "initiateRemoveBLSPublicKey", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isStarted", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "X", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "Y", + "type": "uint256" + } + ], + "internalType": "struct BN256G1.G1Point", + "name": "blsPubkey", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "sigs0", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sigs1", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sigs2", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sigs3", + "type": "uint256" + } + ], + "internalType": "struct IServiceNodeRewards.BLSSignatureParams", + "name": "blsSignature", + "type": "tuple" + }, + { + "internalType": "uint64[]", + "name": "ids", + "type": "uint64[]" + } + ], + "name": "liquidateBLSPublicKeyWithSignature", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "liquidateTag", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "liquidatorRewardRatio", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxContributors", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "nextServiceNodeID", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "poolShareOfLiquidationRatio", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proofOfPossessionTag", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "recipientRatio", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "recipients", + "outputs": [ + { + "internalType": "uint256", + "name": "rewards", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "claimed", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "removalTag", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "serviceNodeID", + "type": "uint64" + } + ], + "name": "removeBLSPublicKeyAfterWaitTime", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "X", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "Y", + "type": "uint256" + } + ], + "internalType": "struct BN256G1.G1Point", + "name": "blsPubkey", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "sigs0", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sigs1", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sigs2", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sigs3", + "type": "uint256" + } + ], + "internalType": "struct IServiceNodeRewards.BLSSignatureParams", + "name": "blsSignature", + "type": "tuple" + }, + { + "internalType": "uint64[]", + "name": "ids", + "type": "uint64[]" + } + ], + "name": "removeBLSPublicKeyWithSignature", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "rewardTag", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[]", + "name": "pkX", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "pkY", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "name": "seedPublicKeyList", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "blsPublicKey", + "type": "bytes" + } + ], + "name": "serviceNodeIDs", + "outputs": [ + { + "internalType": "uint64", + "name": "serviceNodeID", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "serviceNodeID", + "type": "uint64" + } + ], + "name": "serviceNodes", + "outputs": [ + { + "components": [ + { + "internalType": "uint64", + "name": "next", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "prev", + "type": "uint64" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "X", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "Y", + "type": "uint256" + } + ], + "internalType": "struct BN256G1.G1Point", + "name": "pubkey", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "leaveRequestTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deposit", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "uint256", + "name": "stakedAmount", + "type": "uint256" + } + ], + "internalType": "struct IServiceNodeRewards.Contributor[]", + "name": "contributors", + "type": "tuple[]" + } + ], + "internalType": "struct IServiceNodeRewards.ServiceNode", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "serviceNodesLength", + "outputs": [ + { + "internalType": "uint256", + "name": "count", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newMax", + "type": "uint256" + } + ], + "name": "setBLSNonSignerThresholdMax", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newExpiry", + "type": "uint256" + } + ], + "name": "setSignatureExpiry", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newRequirement", + "type": "uint256" + } + ], + "name": "setStakingRequirement", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "signatureExpiry", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "stakingRequirement", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "start", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "totalNodes", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipientAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "recipientRewards", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "sigs0", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sigs1", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sigs2", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sigs3", + "type": "uint256" + } + ], + "internalType": "struct IServiceNodeRewards.BLSSignatureParams", + "name": "blsSignature", + "type": "tuple" + }, + { + "internalType": "uint64[]", + "name": "ids", + "type": "uint64[]" + } + ], + "name": "updateRewardsBalance", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "updateServiceNodesLength", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b50614d57806100206000396000f3fe608060405234801561001057600080fd5b50600436106103155760003560e01c806386e76685116101a7578063be9a6555116100ee578063e30c397811610097578063f2fde38b11610071578063f2fde38b1461063b578063f88d658b1461064e578063f907f5fc1461066157600080fd5b8063e30c3978146105f9578063eb82031214610601578063edbf4ac21461062857600080fd5b8063d0a9be59116100c8578063d0a9be59146105ba578063d5a81254146105cd578063dacc554a146105d657600080fd5b8063be9a655514610597578063c4f56d9a1461059f578063d080e1c5146105b257600080fd5b80639592d42411610150578063a80eded11161012a578063a80eded114610573578063ab7351391461057b578063ae6c60631461058e57600080fd5b80639592d424146105595780639c80ebee146105625780639e3b372d1461056a57600080fd5b80638a2209e6116101815780638a2209e6146105135780638a399481146105485780638da5cb5b1461055157600080fd5b806386e76685146104ef57806386fa5063146104f857806387bd7a701461050057600080fd5b806356d399e81161026b57806379ba5097116102145780638328b610116101ee5780638328b610146104c15780638456cb59146104d457806384e8fce9146104dc57600080fd5b806379ba5097146104765780637a6d40651461047e5780637c89d2f01461049157600080fd5b806365ca819d1161024557806365ca819d1461042757806366d521f51461045b578063715018a61461046e57600080fd5b806356d399e8146103ed57806358e93308146103f55780635c975abb146103fd57600080fd5b806317f33a7d116102cd57806343039d90116102a757806343039d90146103b4578063538d2709146103c7578063544736e6146103d057600080fd5b806317f33a7d14610370578063372500ab146103a25780633f4ba83a146103ac57600080fd5b8063095f1404116102fe578063095f1404146103575780630bd1b4191461035f578063119b12651461036757600080fd5b806301a628b91461031a578063040f985314610337575b600080fd5b61032462278d0081565b6040519081526020015b60405180910390f35b61034a6103453660046143e4565b610674565b60405161032e91906143ff565b600c54610324565b600e54610324565b61032460085481565b60015461038a90600160a01b90046001600160401b031681565b6040516001600160401b03909116815260200161032e565b6103aa6107b6565b005b6103aa6107c1565b6103aa6103c23660046144ce565b6107d1565b61032460075481565b6000546103dd9060ff1681565b604051901515815260200161032e565b600a54610324565b600d54610324565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033005460ff166103dd565b61038a610435366004614555565b80516020818301810180516011825292820191909301209152546001600160401b031681565b6103aa610469366004614688565b610890565b6103aa610aa7565b6103aa610ab9565b6103aa61048c366004614709565b610b01565b6000546104a99061010090046001600160a01b031681565b6040516001600160a01b03909116815260200161032e565b6103aa6104cf3660046144ce565b610c68565b6103aa610d00565b6103aa6104ea36600461479d565b610d10565b61032460045481565b600b54610324565b6103aa61050e3660046143e4565b610e52565b6040805180820182526000808252602091820152815180830190925260125482526013549082015260405161032e9190614836565b61032460035481565b6104a9610f47565b61032460025481565b61038a600081565b61032460095481565b6103aa610f7c565b6103aa61058936600461484d565b610f89565b61032460065481565b6103aa610ff7565b6103aa6105ad366004614688565b61100e565b6103246113c2565b6103aa6105c83660046143e4565b61143c565b61032460055481565b6012546013546105e4919082565b6040805192835260208301919091520161032e565b6104a961144e565b6105e461060f3660046148f6565b6010602052600090815260409020805460019091015482565b6103aa610636366004614911565b611477565b6103aa6106493660046148f6565b6117b4565b6103aa61065c3660046144ce565b611839565b6001546104a9906001600160a01b031681565b6106c36040805160e08101825260008082526020808301829052828401829052835180850190945281845283015290606082019081526020016000815260200160008152602001606081525090565b6001600160401b038083166000908152600f60209081526040808320815160e08101835281548087168252600160401b90049095168584015260018101546001600160a01b0316858301528151808301835260028201548152600382015481850152606086015260048101546080860152600581015460a0860152600681018054835181860281018601909452808452919460c087019491929184015b828210156107a8576000848152602090819020604080518082019091526002850290910180546001600160a01b03168252600190810154828401529083529092019101610760565b505050915250909392505050565b6107bf336118d0565b565b6107c9611979565b6107bf6119ab565b6107d9611979565b600081116108545760405162461bcd60e51b815260206004820152603160248201527f546865206e657720424c53206e6f6e2d7369676e6572207468726573686f6c6460448201527f206d757374206265206e6f6e2d7a65726f00000000000000000000000000000060648201526084015b60405180910390fd5b60048190556040518181527f0ac8ee09138dfaf5e3ebe4cb4fd42dd1a0695535a530171223fb5066f52e0e3b906020015b60405180910390a150565b610898611a17565b60005460ff166108bb5760405163348b55eb60e21b815260040160405180910390fd5b805160035481111561090c5760006108d16113c2565b90506108dd8282614985565b6003546108ea9083614985565b604051635eee4a3560e01b81526004810192909252602482015260440161084b565b600061092561092036889003880188614998565b611a5a565b9050600060118260405161093991906149ee565b908152604051908190036020019020546001600160401b0316905061095d86611a83565b15610993576040516337030b8b60e01b81526001600160401b03821660048201526024810187905242604482015260640161084b565b6001600160401b0381166000908152600f602052604090206002015487351415806109df57506001600160401b0381166000908152600f60209081526040909120600301549088013514155b15610a0157808760405163c43283b560e01b815260040161084b929190614a0a565b600854604051600091610a36918a35906020808d0135918c910193845260208401929092526040830152606082015260800190565b60405160208183030381529060405290506000610a5a610a5583611a9b565b611ac3565b9050610a7586610a6f368a90038a018a614a31565b83611b7f565b50506001600160401b0381166000908152600f6020526040902060050154610a9e908290611ce1565b50505050505050565b610aaf611979565b6107bf6000611d84565b3380610ac361144e565b6001600160a01b031614610af55760405163118cdaa760e01b81526001600160a01b038216600482015260240161084b565b610afe81611d84565b50565b610b09611a17565b60005460ff16610b2c5760405163348b55eb60e21b815260040160405180910390fd5b8051600354811115610b425760006108d16113c2565b6001600160a01b038516610b69576040516337e6495760e21b815260040160405180910390fd5b6001600160a01b0385166000908152601060205260409020548411610ba1576040516333938e6360e01b815260040160405180910390fd5b600754604080516020810192909252606087901b6bffffffffffffffffffffffff191682820152605480830187905281518084039091018152607490920190526000610bef610a5583611a9b565b9050610c0484610a6f36889003880188614a31565b50506001600160a01b038516600081815260106020908152604091829020805490889055825188815291820181905292917f95390641529563dbfb446535fa996c5ac3be00f90f5705b3abda59a4467b797f910160405180910390a2505050505050565b610c70611979565b60008111610ccc5760405162461bcd60e51b8152602060048201526024808201527f5374616b696e6720726571756972656d656e74206d75737420626520706f73696044820152637469766560e01b606482015260840161084b565b600a8190556040518181527e6b7a1ea14ff2794527a64af37d55a2040e351f8b4c1adcdc9aea80d64e042990602001610885565b610d08611979565b6107bf611dc0565b610d18611979565b8483141580610d275750848114155b15610d455760405163512509d360e11b815260040160405180910390fd5b60005b85811015610e415760006040518060400160405280898985818110610d6f57610d6f614a96565b905060200201358152602001878785818110610d8d57610d8d614a96565b9050602002013581525090506000610da482611e1b565b9050848484818110610db857610db8614a96565b90506020020135600f6000836001600160401b03166001600160401b0316815260200190815260200160002060050181905550806001600160401b03167fb23f87884bac26db67afa2897833a3af009f90285781411a30f84c02999b397e83604051610e249190614836565b60405180910390a250508080610e3990614aac565b915050610d48565b50610e4a612059565b505050505050565b610e5a611a17565b60005460ff16610e7d5760405163348b55eb60e21b815260040160405180910390fd5b6001600160401b0381166000908152600f602052604081206004015490819003610ed257604051637a54a45360e11b81526001600160401b03831660048201526024810182905242604482015260640161084b565b6000610ee162278d0083614ac5565b9050804211610f1b57604051637a54a45360e11b81526001600160401b03841660048201526024810182905242604482015260640161084b565b6001600160401b0383166000908152600f6020526040902060050154610f42908490611ce1565b505050565b6000807f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005b546001600160a01b031692915050565b610f846113c2565b600255565b610f91611a17565b610ff0858533868686808060200260200160405190810160405280939291908181526020016000905b82821015610fe657610fd760408302860136819003810190614ad8565b81526020019060010190610fba565b5050505050612085565b5050505050565b610fff611979565b6000805460ff19166001179055565b611016611a17565b60005460ff166110395760405163348b55eb60e21b815260040160405180910390fd5b805160035481111561104f5760006108d16113c2565b600061106361092036889003880188614998565b9050600060118260405161107791906149ee565b908152604051908190036020019020546001600160401b0316905061109b86611a83565b156110d1576040516337030b8b60e01b81526001600160401b03821660048201526024810187905242604482015260640161084b565b6001600160401b038082166000908152600f60209081526040808320815160e08101835281548087168252600160401b90049095168584015260018101546001600160a01b0316858301528151808301835260028201548152600382015481850152606086015260048101546080860152600581015460a0860152600681018054835181860281018601909452808452949594919360c08601939290879084015b828210156111ba576000848152602090819020604080518082019091526002850290910180546001600160a01b03168252600190810154828401529083529092019101611172565b5050509152505060608101515190915088351415806111e55750806060015160200151886020013514155b1561120757818860405163c43283b560e01b815260040161084b929190614a0a565b60095460405160009161123c918b35906020808e0135918d910193845260208401929092526040830152606082015260800190565b6040516020818303038152906040529050600061125b610a5583611a9b565b905061127087610a6f368b90038b018b614a31565b5050816001600160401b03167f0bfb12191b00293af29126b1c5489f8daeb4a4af82db2960b7f8353c3105cd7c826040015183606001516040516112b5929190614b11565b60405180910390a26000600e54600c54600d546112d29190614ac5565b6112dc9190614ac5565b905060008260a001519050600082600c54836112f89190614b38565b6113029190614b65565b90506000600d54836113149190614b38565b1561134357836001600d546113299190614985565b6113339190614b65565b61133e906001614ac5565b611346565b60005b905061136686826113578587614985565b6113619190614985565b611ce1565b600c541561138a5760005461138a9061010090046001600160a01b031633846123f8565b600d54156113b4576000546001546113b4916001600160a01b0361010090910481169116836123f8565b505050505050505050505050565b6000808052600f6020527ff4803e074bd026baaf6ed2e288c9515f68c72fb7216eebdd7cae1718a53ec375546001600160401b03165b6001600160401b03811615611438578161141181614aac565b6001600160401b039283166000908152600f602052604090205490935090911690506113f8565b5090565b611444611a17565b610afe813361246c565b6000807f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c00610f6c565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff1615906001600160401b03166000811580156114bc5750825b90506000826001600160401b031660011480156114d85750303b155b9050811580156114e6575080155b156115045760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561153357845468ff00000000000000001916600160401b1785555b6001861015611555576040516333938e6360e01b815260040160405180910390fd5b6000805460ff19168155600281905560035561012c60045560408051808201909152601b81527f424c535f5349475f545259414e44494e4352454d454e545f504f50000000000060208201526115aa90612634565b60065560408051808201909152601e81527f424c535f5349475f545259414e44494e4352454d454e545f524557415244000060208201526115ea90612634565b60075560408051808201909152601e81527f424c535f5349475f545259414e44494e4352454d454e545f52454d4f56450000602082015261162a90612634565b600881905550611651604051806060016040528060218152602001614d2a60219139612634565b600955610258600555600080547fffffffffffffffffffffff0000000000000000000000000000000000000000ff166101006001600160a01b038f811691909102919091178255600180546001600160a01b031916918e16919091178155600a8c9055600b8b9055600c8a9055600d899055600e8890556116d29190614b79565b600180546001600160401b0392909216600160a01b027fffffffff0000000000000000ffffffffffffffffffffffffffffffffffffffff90921691909117905560008052600f6020527ff4803e074bd026baaf6ed2e288c9515f68c72fb7216eebdd7cae1718a53ec37580546fffffffffffffffffffffffffffffffff1916905561175c33612668565b83156113b457845468ff000000000000000019168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a1505050505050505050505050565b6117bc611979565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b0319166001600160a01b0383169081178255611800610f47565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a35050565b611841611979565b6000811161189b5760405162461bcd60e51b815260206004820152602160248201527f7369676e617475726520657870697279206d75737420626520706f73697469766044820152606560f81b606482015260840161084b565b60058190556040518181527ffbbc3d0a51e101ce4a7fda20e6e4eb0e230bf7de27ee2e3683fc8539e376639590602001610885565b6001600160a01b03811660009081526010602052604081206001810154905490916118fb8383614985565b6001600160a01b0385166000818152601060205260409081902060010185905551919250907ffc30cddea38e2bf4d6ea7d3f9ed3b6ad7f176419f4963bd81318067a4aee73fe9061194f9084815260200190565b60405180910390a26000546119739061010090046001600160a01b031685836123f8565b50505050565b33611982610f47565b6001600160a01b0316146107bf5760405163118cdaa760e01b815233600482015260240161084b565b6119b3612679565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300805460ff191681557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b039091168152602001610885565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033005460ff16156107bf5760405163d93c066560e01b815260040160405180910390fd5b606081604051602001611a6d9190614836565b6040516020818303038152906040529050919050565b600060055482611a939190614ac5565b421192915050565b6000611abd611ab8611ab384805190602001206126bb565b612733565b61277d565b92915050565b611acb6142e4565b6000611ad6836127ce565b9050600080600080611b438560000151600160028110611af857611af8614a96565b60200201518651600060200201518760200151600160028110611b1d57611b1d614a96565b60200201518860200151600060028110611b3957611b39614a96565b602002015161289a565b60408051608081018252808201948552606081019590955292845282518084019093528252602082810191909152820152979650505050505050565b6040805180820190915260008082526020820152835160005b81811015611c24576000868281518110611bb457611bb4614a96565b60200260200101519050611c0e84600f6000846001600160401b03166001600160401b031681526020019081526020016000206002016040518060400160405290816000820154815260200160018201548152505061292a565b9350508080611c1c90614aac565b915050611b98565b506040805180820190915260125481526013546020820152611c4e90611c49846129f3565b61292a565b6040805160808101825260208781015182840190815288516060808501919091529083528351808501855290890151815288840151818301528183015282518084018452600080825290820152825180840190935260018352600290830152919350611cc49082611cbe866129f3565b87612a89565b610e4a5760405163ab1b236b60e01b815260040160405180910390fd5b6001600160401b0382166000908152600f60209081526040918290206001810154835180850190945260028201548452600390910154918301919091526001600160a01b031690611d3184612b96565b611d39612059565b836001600160401b03167f130a7be04ef1f87b2b436f68f389bf863ee179b95399a3a8444196fab7a4e54c838584604051611d7693929190614b99565b60405180910390a250505050565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b0319168155611dbc82612e2f565b5050565b611dc8611a17565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300805460ff191660011781557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258336119ff565b600080611e2783611a5a565b905060006001600160401b0316601182604051611e4491906149ee565b908152604051908190036020019020546001600160401b031614611ea257601181604051611e7291906149ee565b9081526040519081900360200181205463459c639360e01b82526001600160401b0316600482015260240161084b565b60018054600160a01b90046001600160401b03169250806014611ec58286614b79565b92506101000a8154816001600160401b0302191690836001600160401b03160217905550600160026000828254611efc9190614ac5565b90915550506001600160401b038281166000818152600f60209081526040808320805467ffffffffffffffff1980821683557ff4803e074bd026baaf6ed2e288c9515f68c72fb7216eebdd7cae1718a53ec375546fffffffffffffffffffffffffffffffff19909216600160401b928390048916830290811784558816865283862080546fffffffffffffffff000000000000000019168389021790558254919091049096168452818420805490961685179095559290915285516002840155850151600390920191909155518290601190611fd99084906149ee565b90815260405190819003602001902080546001600160401b039290921667ffffffffffffffff199092169190911790556002546001036120255782516012556020830151601355612053565b6040805180820190915260125481526013546020820152612046908461292a565b8051601255602001516013555b50919050565b6000600360025461206a9190614b65565b9050600454811161207b578061207f565b6004545b60035550565b60005460ff166120a85760405163348b55eb60e21b815260040160405180910390fd5b600b54815111156120cc5760405163226c2d8360e21b815260040160405180910390fd5b805115612154576000805b825181101561211d578281815181106120f2576120f2614a96565b602002602001015160200151826121099190614ac5565b91508061211581614aac565b9150506120d7565b50600a54811461214e57600a546040516367d22bd960e01b815260048101919091526024810182905260440161084b565b506121d1565b60408051600180825281830190925290816020015b60408051808201909152600080825260208201528152602001906001900390816121695790505090506040518060400160405280846001600160a01b03168152602001600a54815250816000815181106121c5576121c5614a96565b60200260200101819052505b600060116121e761092036899003890189614998565b6040516121f491906149ee565b908152604051908190036020019020546001600160401b0316905080156122395760405163459c639360e01b81526001600160401b038216600482015260240161084b565b61225461224b36889003880188614998565b86868635612ea0565b600061226d61226836899003890189614998565b611e1b565b90508260008151811061228257612282614a96565b602090810291909101810151516001600160401b0383166000908152600f9092526040822060010180546001600160a01b0319166001600160a01b039092169190911790555b835181101561236657600f6000836001600160401b03166001600160401b0316815260200190815260200160002060060184828151811061230b5761230b614a96565b602090810291909101810151825460018082018555600094855293839020825160029092020180546001600160a01b0319166001600160a01b039092169190911781559101519101558061235e81614aac565b9150506122c8565b50600a546001600160401b0382166000908152600f602052604090206005015561238e612059565b806001600160401b03167fe82ed1bfc15e6602fba1a19273171c8a63c1d40b0e0117be4598167b8655498f868987876040516123cd9493929190614bc5565b60405180910390a2610a9e600060019054906101000a90046001600160a01b03168630600a54612fa8565b6040516001600160a01b03838116602483015260448201839052610f4291859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612fe1565b60005460ff1661248f5760405163348b55eb60e21b815260040160405180910390fd5b6000805b6001600160401b0384166000908152600f6020526040902060060154811015612529576001600160401b0384166000908152600f6020526040902060060180546001600160a01b0385169190839081106124ef576124ef614a96565b60009182526020909120600290910201546001600160a01b0316036125175760019150612529565b8061252181614aac565b915050612493565b508061256257604051635bf2837760e11b81526001600160401b03841660048201526001600160a01b038316602482015260440161084b565b6001600160401b0383166000908152600f6020526040902060040154156125b557604051620c87d960ec1b81526001600160401b03841660048201526001600160a01b038316602482015260440161084b565b6001600160401b0383166000818152600f60205260409081902042600482015590517f89477e9f4ddcb5eb9f30353ab22c31ef9a91ab33fd1ffef09aadb3458be7775d91612627918691600201906001600160a01b039290921682528054602083015260010154604082015260600190565b60405180910390a2505050565b600081463060405160200161264b93929190614c84565b604051602081830303815290604052805190602001209050919050565b612670613044565b610afe8161308d565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033005460ff166107bf57604051638dfc202b60e01b815260040160405180910390fd5b60008060005b602081101561272c5760008482602081106126de576126de614a96565b1a60f81b90506126ef826008614b38565b7fff00000000000000000000000000000000000000000000000000000000000000909116901c91909117908061272481614aac565b9150506126c1565b5092915050565b60008061274360c0600019614985565b9050600080516020614d0a83398151915261275f82851661277d565b106127745761277160e0600019614985565b90505b91909116919050565b600080805b602081101561272c576000612798826008614b38565b85901c60ff1690506127ab826008614b38565b6127b69060f8614985565b1b9190911790806127c681614aac565b915050612782565b6127d66142e4565b8160008080805b80612862576000806127ef87876130bf565b915091506000806128008484613146565b915091508160001415801561281457508015155b1561284b5781965080955061282b898989896132e7565b156128395760019450612859565b61284460018a614ac5565b9850612859565b61285660018a614ac5565b98505b505050506127dd565b506040805160808101825280820194855260608101959095529284528251808401909352825260208281019190915282015292915050565b6000806000806128ac888888886132fe565b6128b8576128b8614cbd565b6040805160c081018252898152602081018990529081018790526060810186905260016080820152600060a08201526128f0816133b3565b8051602082015160408301516060840151608085015160a086015195965061291795613565565b929c919b50995090975095505050505050565b6040805180820190915260008082526020820152612946614309565b8351815260208085015181830152835160408301528301516060808301919091526000908360c08460066107d05a03fa9050806129eb5760405162461bcd60e51b815260206004820152602b60248201527f43616c6c20746f20707265636f6d70696c656420636f6e747261637420666f7260448201527f20616464206661696c6564000000000000000000000000000000000000000000606482015260840161084b565b505092915050565b60408051808201909152600080825260208201528151158015612a1857506020820151155b15612a36575050604080518082019091526000808252602082015290565b604051806040016040528083600001518152602001600080516020614d0a8339815191528460200151612a699190614cd3565b612a8190600080516020614d0a833981519152614985565b905292915050565b60408051600280825260608201909252600091829190816020015b6040805180820190915260008082526020820152815260200190600190039081612aa45750506040805160028082526060820190925291925060009190602082015b612aee6142e4565b815260200190600190039081612ae65790505090508682600081518110612b1757612b17614a96565b60200260200101819052508482600181518110612b3657612b36614a96565b60200260200101819052508581600081518110612b5557612b55614a96565b60200260200101819052508381600181518110612b7457612b74614a96565b6020026020010181905250612b8982826135af565b925050505b949350505050565b600060025411612ba557600080fd5b6001600160401b038116612bcc57604051631d58f8cb60e11b815260040160405180910390fd5b6001600160401b038082166000908152600f60209081526040808320815160e08101835281548087168252600160401b90049095168584015260018101546001600160a01b0316858301528151808301835260028201548152600382015481850152606086015260048101546080860152600581015460a0860152600681018054835181860281018601909452808452949594919360c08601939290879084015b82821015612cb5576000848152602090819020604080518082019091526002850290910180546001600160a01b03168252600190810154828401529083529092019101612c6d565b505050915250506020818101805183516001600160401b039081166000908152600f8552604080822080546fffffffffffffffff00000000000000001916600160401b95851695909502949094179093558551935182168152829020805467ffffffffffffffff1916939091169290921790915580518082019091526012548152601354918101919091526060820151919250612d5591611c49906129f3565b8051601255602001516013556060810151600090612d7290611a5a565b6001600160401b0384166000908152600f6020526040812080546fffffffffffffffffffffffffffffffff191681556001810180546001600160a01b031916905560028101829055600381018290556004810182905560058101829055919250612ddf6006830182614327565b5050601181604051612df191906149ee565b908152604051908190036020019020805467ffffffffffffffff191690556002805460019190600090612e25908490614985565b9091555050505050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b6000600654856000015186602001518585604051602001612ef695949392919094855260208501939093526040840191909152606090811b6bffffffffffffffffffffffff191690830152607482015260940190565b60405160208183030381529060405290506000612f15610a5583611a9b565b60408051608081018252602088810135828401908152893560608085019190915290835283518085018552908a0135815289840135818301528183015282518084018452600080825290820152825180840190935260018352600290830152919250612f8b9082612f858a6129f3565b85612a89565b610a9e5760405163cf006ab760e01b815260040160405180910390fd5b6040516001600160a01b0384811660248301528381166044830152606482018390526119739186918216906323b872dd90608401612425565b6000612ff66001600160a01b038416836138f1565b9050805160001415801561301b5750808060200190518101906130199190614ce7565b155b15610f4257604051635274afe760e01b81526001600160a01b038416600482015260240161084b565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff166107bf57604051631afcd79f60e31b815260040160405180910390fd5b613095613044565b6001600160a01b038116610af557604051631e4fbdf760e01b81526000600482015260240161084b565b6000806000806000806130d488888a8a613906565b90925090506130e582828a8a613906565b909250905061313582827f2b149d40ceb8aaae81be18991be06ac3b5b4c5e559dbefa33267e6dc24a138e57e9713b03af0fed4cd2cafadeed8fdf4a74fa084e52d1852e4a2bd0685c315d2613977565b9096509450505050505b9250929050565b6000806000806000856000036131ba5761315f876139ab565b90935090508015613179578260009450945050505061313f565b61319961319488600080516020614d0a833981519152614985565b6139ab565b9093509050806131ab576131ab614cbd565b6000839450945050505061313f565b600080516020614d0a8339815191528788099250600080516020614d0a8339815191528687099150600080516020614d0a83398151915282840892506131ff836139ab565b909350905080613218576000809450945050505061313f565b600080516020614d0a833981519152838808915061323582613a42565b91506000613242836139ab565b9250905081613293576132648885600080516020614d0a833981519152613a9a565b925061326f83613a42565b925061327a836139ab565b925090508161329357600080955095505050505061313f565b80600080516020614d0a83398151915282830893506132c084600080516020614d0a833981519152613abe565b93506000600080516020614d0a833981519152858a09919a91995090975050505050505050565b60006132f5858585856132fe565b95945050505050565b600080600080600061331287878989613906565b909450925061332389898181613906565b909250905061333482828b8b613906565b909250905061334584848484613b08565b909450925061339584847f2b149d40ceb8aaae81be18991be06ac3b5b4c5e559dbefa33267e6dc24a138e57e9713b03af0fed4cd2cafadeed8fdf4a74fa084e52d1852e4a2bd0685c315d2613b08565b9094509250831580156133a6575082155b9998505050505050505050565b6133bb614348565b6133c3614348565b6133cb614348565b6133d3614348565b8451602086015160408701516060880151608089015161340b946744e992b44a6909f1949093909290918b60055b6020020151613b4a565b805160208201516040830151606084015160808501519497506134379460029493929190896005613401565b91506134a38360005b602002015184600160200201518560026020020151866003602002015187600460200201518860056020020151886000602002015189600160200201518a600260200201518b600360200201518c600460200201518d60055b6020020151613bcd565b91506134ae82613e56565b91506134b983613e56565b90506134c481613e56565b90506134d1836000613440565b92506135378360005b6020020151846001602002015185600260200201518660036020020151876004602002015188600560200201518760006020020151886001602002015189600260200201518a600360200201518b600460200201518c6005613499565b925061354285613e56565b905061354d81613e56565b905061355881613e56565b90506132f58360006134da565b6000806000806000806135788888613f6e565b90925090506135898c8c8484613906565b909650945061359a8a8a8484613906565b969d959c509a50949850929650505050505050565b600081518351146135bf57600080fd5b825160006135ce826006614b38565b90506000816001600160401b038111156135ea576135ea6144e7565b604051908082528060200260200182016040528015613613578160200160208202803683370190505b50905060005b8381101561384e5786818151811061363357613633614a96565b6020026020010151600001518282600661364d9190614b38565b613658906000614ac5565b8151811061366857613668614a96565b60200260200101818152505086818151811061368657613686614a96565b602002602001015160200151828260066136a09190614b38565b6136ab906001614ac5565b815181106136bb576136bb614a96565b6020026020010181815250508581815181106136d9576136d9614a96565b60209081029190910101515151826136f2836006614b38565b6136fd906002614ac5565b8151811061370d5761370d614a96565b60200260200101818152505085818151811061372b5761372b614a96565b60209081029190910181015151015182613746836006614b38565b613751906003614ac5565b8151811061376157613761614a96565b60200260200101818152505085818151811061377f5761377f614a96565b60200260200101516020015160006002811061379d5761379d614a96565b6020020151826137ae836006614b38565b6137b9906004614ac5565b815181106137c9576137c9614a96565b6020026020010181815250508581815181106137e7576137e7614a96565b60200260200101516020015160016002811061380557613805614a96565b602002015182613816836006614b38565b613821906005614ac5565b8151811061383157613831614a96565b60209081029190910101528061384681614aac565b915050613619565b50613857614366565b60006020826020860260208601600060086107d05a03f19050806138e35760405162461bcd60e51b815260206004820152602f60248201527f43616c6c20746f20707265636f6d70696c656420636f6e747261637420666f7260448201527f2070616972696e67206661696c65640000000000000000000000000000000000606482015260840161084b565b505115159695505050505050565b60606138ff83836000613ff9565b9392505050565b600080613944600080516020614d0a833981519152858809600080516020614d0a833981519152858809600080516020614d0a833981519152613a9a565b600080516020614d0a83398151915280868809600080516020614d0a833981519152868a09089150915094509492505050565b600080600080516020614d0a833981519152848708600080516020614d0a8339815191528487089150915094509492505050565b600080600060405160208152602080820152602060408201528460608201527f0c19139cb84c680a6e14116da060561765e05aa45a1c72a34f082305b61f3f526080820152600080516020614d0a83398151915260a082015260208160c08360056107d05a03fa905193509050600080516020614d0a8339815191528380098414915080613a3c5760009250600091505b50915091565b6000600182161515613a55600284614b65565b9150801561205357600080516020614d0a8339815191526002613a87600080516020614d0a8339815191526001614ac5565b613a919190614b65565b83089392505050565b60008180613aaa57613aaa614b4f565b613ab48484614985565b8508949350505050565b60008060405160208152602080820152602060408201528460608201526002840360808201528360a082015260208160c08360056107d05a03fa9051925090508061272c57600080fd5b600080613b248685600080516020614d0a833981519152613a9a565b613b3d8685600080516020614d0a833981519152613a9a565b9150915094509492505050565b613b52614348565b8715613bc2576001881615613b93578051602082015160408301516060840151608085015160a0860151613b909594939291908d8d8d8d8d8d613bcd565b90505b613ba1878787878787614096565b949b50929950909750955093509150613bbb600289614b65565b9750613b52565b979650505050505050565b613bd5614348565b88158015613be1575087155b15613c23578686868686868660005b60a08901929092526080880192909252606087019290925260408601929092526020858101939093529091020152613e46565b82158015613c2f575081155b15613c42578c8c8c8c8c8c866000613bf0565b613c4e85858b8b613906565b9095509350613c5f8b8b8585613906565b60608301526040820152613c7587878b8b613906565b9097509550613c868d8d8585613906565b60a08301526080820181905287148015613ca3575060a081015186145b15613ce857604081015185148015613cbe5750606081015184145b15613cd957613cd18d8d8d8d8d8d614096565b866000613bf0565b60016000818180808681613bf0565b613cf489898585613906565b9093509150613d14858583600260200201518460035b6020020151613b08565b909d509b50613d2e87878360046020020151846005613d0a565b909b509950613d3f8b8b8181613906565b9099509750613d5f898983600460200201518460055b6020020151613906565b9095509350613d7089898d8d613906565b9099509750613d8189898585613906565b60a08301526080820152613d978d8d8181613906565b9097509550613da887878585613906565b9097509550613db987878b8b613b08565b9097509550613dca85856002614205565b9093509150613ddb87878585613b08565b9097509550613dec8b8b8989613906565b60208301528152613dff85858989613b08565b909b509950613e108d8d8d8d613906565b909b509950613e2a89898360026020020151846003613d55565b909d509b50613e3b8b8b8f8f613b08565b606083015260408201525b9c9b505050505050505050505050565b613e5e614348565b8151613e72908360015b6020020151614238565b602083015281526040820151613e8a90836003613e68565b606083015260408201526080820151613ea590836005613e68565b60a0830152608082015280516020820151613f0291907f2fb347984f7911f74c0bec3cf559b143b78cc310c2c3330c99e39557176f553d7f16c9e55061ebae204ba4cc8bd75a079432ae2a1d0b7c9dce1665d51c640fcba2613906565b6020830152815260408101516060820151613f5f91907f063cf305489af5dcdc5ec698b6e2f9b9dbaae0eda9c95998dc54014671a0135a7f07c03cbcac41049a0704b5a7ec796f2b21807dc98fa25bd282d37f632623b0e3613906565b60608301526040820152919050565b60008080613faf600080516020614d0a83398151915280878809600080516020614d0a83398151915287880908600080516020614d0a833981519152613abe565b9050600080516020614d0a833981519152818609600080516020614d0a833981519152828609613fed90600080516020614d0a833981519152614985565b92509250509250929050565b60608147101561401e5760405163cd78605960e01b815230600482015260240161084b565b600080856001600160a01b0316848660405161403a91906149ee565b60006040518083038185875af1925050503d8060008114614077576040519150601f19603f3d011682016040523d82523d6000602084013e61407c565b606091505b509150915061408c86838361425f565b9695505050505050565b6000806000806000806140ab8c8c6003614205565b90965094506140bc86868e8e613906565b90965094506140cd8a8a8a8a613906565b90985096506140de8c8c8c8c613906565b90945092506140ef84848a8a613906565b909450925061410086868181613906565b909c509a5061411184846008614205565b90925090506141228c8c8484613b08565b909c509a5061413388888181613906565b909250905061414484846004614205565b909450925061415584848e8e613b08565b909450925061416684848888613906565b90945092506141778a8a6008614205565b909650945061418886868c8c613906565b909650945061419986868484613906565b90965094506141aa84848888613b08565b90945092506141bb8c8c6002614205565b90965094506141cc86868a8a613906565b90965094506141dd88888484613906565b90925090506141ee82826008614205565b809250819350505096509650965096509650969050565b600080600080516020614d0a833981519152838609600080516020614d0a83398151915284860991509150935093915050565b6000808361425484600080516020614d0a833981519152614985565b915091509250929050565b6060826142745761426f826142bb565b6138ff565b815115801561428b57506001600160a01b0384163b155b156142b457604051639996b31560e01b81526001600160a01b038516600482015260240161084b565b50806138ff565b8051156142cb5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b60405180604001604052806142f7614384565b8152602001614304614384565b905290565b60405180608001604052806004906020820280368337509192915050565b5080546000825560020290600052602060002090810190610afe91906143a2565b6040518060c001604052806006906020820280368337509192915050565b60405180602001604052806001906020820280368337509192915050565b60405180604001604052806002906020820280368337509192915050565b5b808211156114385780546001600160a01b0319168155600060018201556002016143a3565b80356001600160401b03811681146143df57600080fd5b919050565b6000602082840312156143f657600080fd5b6138ff826143c8565b6000602080835261012083016001600160401b0380865116838601528083870151166040860152506001600160a01b0360408601511660608501526060850151614456608086018280518252602090810151910152565b50608085015160c08581019190915260a086015160e0860152850151610100808601528051918290528201906000906101408601905b808310156144c357835180516001600160a01b0316835260209081015190830152604082019150848401935060018301925061448c565b509695505050505050565b6000602082840312156144e057600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b038111828210171561451f5761451f6144e7565b60405290565b604051601f8201601f191681016001600160401b038111828210171561454d5761454d6144e7565b604052919050565b6000602080838503121561456857600080fd5b82356001600160401b038082111561457f57600080fd5b818501915085601f83011261459357600080fd5b8135818111156145a5576145a56144e7565b6145b7601f8201601f19168501614525565b915080825286848285010111156145cd57600080fd5b8084840185840137600090820190930192909252509392505050565b60006040828403121561205357600080fd5b60006080828403121561205357600080fd5b600082601f83011261461e57600080fd5b813560206001600160401b03821115614639576146396144e7565b8160051b614648828201614525565b928352848101820192828101908785111561466257600080fd5b83870192505b84831015613bc257614679836143c8565b82529183019190830190614668565b600080600080610100858703121561469f57600080fd5b6146a986866145e9565b9350604085013592506146bf86606087016145fb565b915060e08501356001600160401b038111156146da57600080fd5b6146e68782880161460d565b91505092959194509250565b80356001600160a01b03811681146143df57600080fd5b60008060008060e0858703121561471f57600080fd5b614728856146f2565b93506020850135925061473e86604087016145fb565b915060c08501356001600160401b038111156146da57600080fd5b60008083601f84011261476b57600080fd5b5081356001600160401b0381111561478257600080fd5b6020830191508360208260051b850101111561313f57600080fd5b600080600080600080606087890312156147b657600080fd5b86356001600160401b03808211156147cd57600080fd5b6147d98a838b01614759565b909850965060208901359150808211156147f257600080fd5b6147fe8a838b01614759565b9096509450604089013591508082111561481757600080fd5b5061482489828a01614759565b979a9699509497509295939492505050565b815181526020808301519082015260408101611abd565b6000806000806000610160868803121561486657600080fd5b61487087876145e9565b945061487f87604088016145fb565b935061488e8760c088016145fb565b92506101408601356001600160401b03808211156148ab57600080fd5b818801915088601f8301126148bf57600080fd5b8135818111156148ce57600080fd5b8960208260061b85010111156148e357600080fd5b9699959850939650602001949392505050565b60006020828403121561490857600080fd5b6138ff826146f2565b600080600080600080600060e0888a03121561492c57600080fd5b614935886146f2565b9650614943602089016146f2565b96999698505050506040850135946060810135946080820135945060a0820135935060c0909101359150565b634e487b7160e01b600052601160045260246000fd5b81810381811115611abd57611abd61496f565b6000604082840312156149aa57600080fd5b6149b26144fd565b82358152602083013560208201528091505092915050565b60005b838110156149e55781810151838201526020016149cd565b50506000910152565b60008251614a008184602087016149ca565b9190910192915050565b6001600160401b0383168152606081016138ff602083018480358252602090810135910152565b600060808284031215614a4357600080fd5b604051608081018181106001600160401b0382111715614a6557614a656144e7565b8060405250823581526020830135602082015260408301356040820152606083013560608201528091505092915050565b634e487b7160e01b600052603260045260246000fd5b600060018201614abe57614abe61496f565b5060010190565b80820180821115611abd57611abd61496f565b600060408284031215614aea57600080fd5b614af26144fd565b614afb836146f2565b8152602083013560208201528091505092915050565b6001600160a01b0383168152606081016138ff602083018480518252602090810151910152565b8082028115828204841417611abd57611abd61496f565b634e487b7160e01b600052601260045260246000fd5b600082614b7457614b74614b4f565b500490565b6001600160401b0381811683821601908082111561272c5761272c61496f565b6001600160a01b0384168152602080820184905282516040830152820151606082015260808101612b8e565b60006101008083016001600160a01b03881684526020614bf18186018980358252602090810135910152565b86356060860152808701356080860152604087013560a0860152606087013561ffff8116808214614c2157600080fd5b60c08701525060e08501929092528451908190526101208401918086019160005b81811015614c7557835180516001600160a01b031686526020908101519086015260408501945092820192600101614c42565b50929998505050505050505050565b60008451614c968184602089016149ca565b919091019283525060601b6bffffffffffffffffffffffff19166020820152603401919050565b634e487b7160e01b600052600160045260246000fd5b600082614ce257614ce2614b4f565b500690565b600060208284031215614cf957600080fd5b815180151581146138ff57600080fdfe30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47424c535f5349475f545259414e44494e4352454d454e545f4c4951554944415445a164736f6c6343000814000a", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106103155760003560e01c806386e76685116101a7578063be9a6555116100ee578063e30c397811610097578063f2fde38b11610071578063f2fde38b1461063b578063f88d658b1461064e578063f907f5fc1461066157600080fd5b8063e30c3978146105f9578063eb82031214610601578063edbf4ac21461062857600080fd5b8063d0a9be59116100c8578063d0a9be59146105ba578063d5a81254146105cd578063dacc554a146105d657600080fd5b8063be9a655514610597578063c4f56d9a1461059f578063d080e1c5146105b257600080fd5b80639592d42411610150578063a80eded11161012a578063a80eded114610573578063ab7351391461057b578063ae6c60631461058e57600080fd5b80639592d424146105595780639c80ebee146105625780639e3b372d1461056a57600080fd5b80638a2209e6116101815780638a2209e6146105135780638a399481146105485780638da5cb5b1461055157600080fd5b806386e76685146104ef57806386fa5063146104f857806387bd7a701461050057600080fd5b806356d399e81161026b57806379ba5097116102145780638328b610116101ee5780638328b610146104c15780638456cb59146104d457806384e8fce9146104dc57600080fd5b806379ba5097146104765780637a6d40651461047e5780637c89d2f01461049157600080fd5b806365ca819d1161024557806365ca819d1461042757806366d521f51461045b578063715018a61461046e57600080fd5b806356d399e8146103ed57806358e93308146103f55780635c975abb146103fd57600080fd5b806317f33a7d116102cd57806343039d90116102a757806343039d90146103b4578063538d2709146103c7578063544736e6146103d057600080fd5b806317f33a7d14610370578063372500ab146103a25780633f4ba83a146103ac57600080fd5b8063095f1404116102fe578063095f1404146103575780630bd1b4191461035f578063119b12651461036757600080fd5b806301a628b91461031a578063040f985314610337575b600080fd5b61032462278d0081565b6040519081526020015b60405180910390f35b61034a6103453660046143e4565b610674565b60405161032e91906143ff565b600c54610324565b600e54610324565b61032460085481565b60015461038a90600160a01b90046001600160401b031681565b6040516001600160401b03909116815260200161032e565b6103aa6107b6565b005b6103aa6107c1565b6103aa6103c23660046144ce565b6107d1565b61032460075481565b6000546103dd9060ff1681565b604051901515815260200161032e565b600a54610324565b600d54610324565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033005460ff166103dd565b61038a610435366004614555565b80516020818301810180516011825292820191909301209152546001600160401b031681565b6103aa610469366004614688565b610890565b6103aa610aa7565b6103aa610ab9565b6103aa61048c366004614709565b610b01565b6000546104a99061010090046001600160a01b031681565b6040516001600160a01b03909116815260200161032e565b6103aa6104cf3660046144ce565b610c68565b6103aa610d00565b6103aa6104ea36600461479d565b610d10565b61032460045481565b600b54610324565b6103aa61050e3660046143e4565b610e52565b6040805180820182526000808252602091820152815180830190925260125482526013549082015260405161032e9190614836565b61032460035481565b6104a9610f47565b61032460025481565b61038a600081565b61032460095481565b6103aa610f7c565b6103aa61058936600461484d565b610f89565b61032460065481565b6103aa610ff7565b6103aa6105ad366004614688565b61100e565b6103246113c2565b6103aa6105c83660046143e4565b61143c565b61032460055481565b6012546013546105e4919082565b6040805192835260208301919091520161032e565b6104a961144e565b6105e461060f3660046148f6565b6010602052600090815260409020805460019091015482565b6103aa610636366004614911565b611477565b6103aa6106493660046148f6565b6117b4565b6103aa61065c3660046144ce565b611839565b6001546104a9906001600160a01b031681565b6106c36040805160e08101825260008082526020808301829052828401829052835180850190945281845283015290606082019081526020016000815260200160008152602001606081525090565b6001600160401b038083166000908152600f60209081526040808320815160e08101835281548087168252600160401b90049095168584015260018101546001600160a01b0316858301528151808301835260028201548152600382015481850152606086015260048101546080860152600581015460a0860152600681018054835181860281018601909452808452919460c087019491929184015b828210156107a8576000848152602090819020604080518082019091526002850290910180546001600160a01b03168252600190810154828401529083529092019101610760565b505050915250909392505050565b6107bf336118d0565b565b6107c9611979565b6107bf6119ab565b6107d9611979565b600081116108545760405162461bcd60e51b815260206004820152603160248201527f546865206e657720424c53206e6f6e2d7369676e6572207468726573686f6c6460448201527f206d757374206265206e6f6e2d7a65726f00000000000000000000000000000060648201526084015b60405180910390fd5b60048190556040518181527f0ac8ee09138dfaf5e3ebe4cb4fd42dd1a0695535a530171223fb5066f52e0e3b906020015b60405180910390a150565b610898611a17565b60005460ff166108bb5760405163348b55eb60e21b815260040160405180910390fd5b805160035481111561090c5760006108d16113c2565b90506108dd8282614985565b6003546108ea9083614985565b604051635eee4a3560e01b81526004810192909252602482015260440161084b565b600061092561092036889003880188614998565b611a5a565b9050600060118260405161093991906149ee565b908152604051908190036020019020546001600160401b0316905061095d86611a83565b15610993576040516337030b8b60e01b81526001600160401b03821660048201526024810187905242604482015260640161084b565b6001600160401b0381166000908152600f602052604090206002015487351415806109df57506001600160401b0381166000908152600f60209081526040909120600301549088013514155b15610a0157808760405163c43283b560e01b815260040161084b929190614a0a565b600854604051600091610a36918a35906020808d0135918c910193845260208401929092526040830152606082015260800190565b60405160208183030381529060405290506000610a5a610a5583611a9b565b611ac3565b9050610a7586610a6f368a90038a018a614a31565b83611b7f565b50506001600160401b0381166000908152600f6020526040902060050154610a9e908290611ce1565b50505050505050565b610aaf611979565b6107bf6000611d84565b3380610ac361144e565b6001600160a01b031614610af55760405163118cdaa760e01b81526001600160a01b038216600482015260240161084b565b610afe81611d84565b50565b610b09611a17565b60005460ff16610b2c5760405163348b55eb60e21b815260040160405180910390fd5b8051600354811115610b425760006108d16113c2565b6001600160a01b038516610b69576040516337e6495760e21b815260040160405180910390fd5b6001600160a01b0385166000908152601060205260409020548411610ba1576040516333938e6360e01b815260040160405180910390fd5b600754604080516020810192909252606087901b6bffffffffffffffffffffffff191682820152605480830187905281518084039091018152607490920190526000610bef610a5583611a9b565b9050610c0484610a6f36889003880188614a31565b50506001600160a01b038516600081815260106020908152604091829020805490889055825188815291820181905292917f95390641529563dbfb446535fa996c5ac3be00f90f5705b3abda59a4467b797f910160405180910390a2505050505050565b610c70611979565b60008111610ccc5760405162461bcd60e51b8152602060048201526024808201527f5374616b696e6720726571756972656d656e74206d75737420626520706f73696044820152637469766560e01b606482015260840161084b565b600a8190556040518181527e6b7a1ea14ff2794527a64af37d55a2040e351f8b4c1adcdc9aea80d64e042990602001610885565b610d08611979565b6107bf611dc0565b610d18611979565b8483141580610d275750848114155b15610d455760405163512509d360e11b815260040160405180910390fd5b60005b85811015610e415760006040518060400160405280898985818110610d6f57610d6f614a96565b905060200201358152602001878785818110610d8d57610d8d614a96565b9050602002013581525090506000610da482611e1b565b9050848484818110610db857610db8614a96565b90506020020135600f6000836001600160401b03166001600160401b0316815260200190815260200160002060050181905550806001600160401b03167fb23f87884bac26db67afa2897833a3af009f90285781411a30f84c02999b397e83604051610e249190614836565b60405180910390a250508080610e3990614aac565b915050610d48565b50610e4a612059565b505050505050565b610e5a611a17565b60005460ff16610e7d5760405163348b55eb60e21b815260040160405180910390fd5b6001600160401b0381166000908152600f602052604081206004015490819003610ed257604051637a54a45360e11b81526001600160401b03831660048201526024810182905242604482015260640161084b565b6000610ee162278d0083614ac5565b9050804211610f1b57604051637a54a45360e11b81526001600160401b03841660048201526024810182905242604482015260640161084b565b6001600160401b0383166000908152600f6020526040902060050154610f42908490611ce1565b505050565b6000807f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005b546001600160a01b031692915050565b610f846113c2565b600255565b610f91611a17565b610ff0858533868686808060200260200160405190810160405280939291908181526020016000905b82821015610fe657610fd760408302860136819003810190614ad8565b81526020019060010190610fba565b5050505050612085565b5050505050565b610fff611979565b6000805460ff19166001179055565b611016611a17565b60005460ff166110395760405163348b55eb60e21b815260040160405180910390fd5b805160035481111561104f5760006108d16113c2565b600061106361092036889003880188614998565b9050600060118260405161107791906149ee565b908152604051908190036020019020546001600160401b0316905061109b86611a83565b156110d1576040516337030b8b60e01b81526001600160401b03821660048201526024810187905242604482015260640161084b565b6001600160401b038082166000908152600f60209081526040808320815160e08101835281548087168252600160401b90049095168584015260018101546001600160a01b0316858301528151808301835260028201548152600382015481850152606086015260048101546080860152600581015460a0860152600681018054835181860281018601909452808452949594919360c08601939290879084015b828210156111ba576000848152602090819020604080518082019091526002850290910180546001600160a01b03168252600190810154828401529083529092019101611172565b5050509152505060608101515190915088351415806111e55750806060015160200151886020013514155b1561120757818860405163c43283b560e01b815260040161084b929190614a0a565b60095460405160009161123c918b35906020808e0135918d910193845260208401929092526040830152606082015260800190565b6040516020818303038152906040529050600061125b610a5583611a9b565b905061127087610a6f368b90038b018b614a31565b5050816001600160401b03167f0bfb12191b00293af29126b1c5489f8daeb4a4af82db2960b7f8353c3105cd7c826040015183606001516040516112b5929190614b11565b60405180910390a26000600e54600c54600d546112d29190614ac5565b6112dc9190614ac5565b905060008260a001519050600082600c54836112f89190614b38565b6113029190614b65565b90506000600d54836113149190614b38565b1561134357836001600d546113299190614985565b6113339190614b65565b61133e906001614ac5565b611346565b60005b905061136686826113578587614985565b6113619190614985565b611ce1565b600c541561138a5760005461138a9061010090046001600160a01b031633846123f8565b600d54156113b4576000546001546113b4916001600160a01b0361010090910481169116836123f8565b505050505050505050505050565b6000808052600f6020527ff4803e074bd026baaf6ed2e288c9515f68c72fb7216eebdd7cae1718a53ec375546001600160401b03165b6001600160401b03811615611438578161141181614aac565b6001600160401b039283166000908152600f602052604090205490935090911690506113f8565b5090565b611444611a17565b610afe813361246c565b6000807f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c00610f6c565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff1615906001600160401b03166000811580156114bc5750825b90506000826001600160401b031660011480156114d85750303b155b9050811580156114e6575080155b156115045760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561153357845468ff00000000000000001916600160401b1785555b6001861015611555576040516333938e6360e01b815260040160405180910390fd5b6000805460ff19168155600281905560035561012c60045560408051808201909152601b81527f424c535f5349475f545259414e44494e4352454d454e545f504f50000000000060208201526115aa90612634565b60065560408051808201909152601e81527f424c535f5349475f545259414e44494e4352454d454e545f524557415244000060208201526115ea90612634565b60075560408051808201909152601e81527f424c535f5349475f545259414e44494e4352454d454e545f52454d4f56450000602082015261162a90612634565b600881905550611651604051806060016040528060218152602001614d2a60219139612634565b600955610258600555600080547fffffffffffffffffffffff0000000000000000000000000000000000000000ff166101006001600160a01b038f811691909102919091178255600180546001600160a01b031916918e16919091178155600a8c9055600b8b9055600c8a9055600d899055600e8890556116d29190614b79565b600180546001600160401b0392909216600160a01b027fffffffff0000000000000000ffffffffffffffffffffffffffffffffffffffff90921691909117905560008052600f6020527ff4803e074bd026baaf6ed2e288c9515f68c72fb7216eebdd7cae1718a53ec37580546fffffffffffffffffffffffffffffffff1916905561175c33612668565b83156113b457845468ff000000000000000019168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a1505050505050505050505050565b6117bc611979565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b0319166001600160a01b0383169081178255611800610f47565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a35050565b611841611979565b6000811161189b5760405162461bcd60e51b815260206004820152602160248201527f7369676e617475726520657870697279206d75737420626520706f73697469766044820152606560f81b606482015260840161084b565b60058190556040518181527ffbbc3d0a51e101ce4a7fda20e6e4eb0e230bf7de27ee2e3683fc8539e376639590602001610885565b6001600160a01b03811660009081526010602052604081206001810154905490916118fb8383614985565b6001600160a01b0385166000818152601060205260409081902060010185905551919250907ffc30cddea38e2bf4d6ea7d3f9ed3b6ad7f176419f4963bd81318067a4aee73fe9061194f9084815260200190565b60405180910390a26000546119739061010090046001600160a01b031685836123f8565b50505050565b33611982610f47565b6001600160a01b0316146107bf5760405163118cdaa760e01b815233600482015260240161084b565b6119b3612679565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300805460ff191681557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b039091168152602001610885565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033005460ff16156107bf5760405163d93c066560e01b815260040160405180910390fd5b606081604051602001611a6d9190614836565b6040516020818303038152906040529050919050565b600060055482611a939190614ac5565b421192915050565b6000611abd611ab8611ab384805190602001206126bb565b612733565b61277d565b92915050565b611acb6142e4565b6000611ad6836127ce565b9050600080600080611b438560000151600160028110611af857611af8614a96565b60200201518651600060200201518760200151600160028110611b1d57611b1d614a96565b60200201518860200151600060028110611b3957611b39614a96565b602002015161289a565b60408051608081018252808201948552606081019590955292845282518084019093528252602082810191909152820152979650505050505050565b6040805180820190915260008082526020820152835160005b81811015611c24576000868281518110611bb457611bb4614a96565b60200260200101519050611c0e84600f6000846001600160401b03166001600160401b031681526020019081526020016000206002016040518060400160405290816000820154815260200160018201548152505061292a565b9350508080611c1c90614aac565b915050611b98565b506040805180820190915260125481526013546020820152611c4e90611c49846129f3565b61292a565b6040805160808101825260208781015182840190815288516060808501919091529083528351808501855290890151815288840151818301528183015282518084018452600080825290820152825180840190935260018352600290830152919350611cc49082611cbe866129f3565b87612a89565b610e4a5760405163ab1b236b60e01b815260040160405180910390fd5b6001600160401b0382166000908152600f60209081526040918290206001810154835180850190945260028201548452600390910154918301919091526001600160a01b031690611d3184612b96565b611d39612059565b836001600160401b03167f130a7be04ef1f87b2b436f68f389bf863ee179b95399a3a8444196fab7a4e54c838584604051611d7693929190614b99565b60405180910390a250505050565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b0319168155611dbc82612e2f565b5050565b611dc8611a17565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300805460ff191660011781557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258336119ff565b600080611e2783611a5a565b905060006001600160401b0316601182604051611e4491906149ee565b908152604051908190036020019020546001600160401b031614611ea257601181604051611e7291906149ee565b9081526040519081900360200181205463459c639360e01b82526001600160401b0316600482015260240161084b565b60018054600160a01b90046001600160401b03169250806014611ec58286614b79565b92506101000a8154816001600160401b0302191690836001600160401b03160217905550600160026000828254611efc9190614ac5565b90915550506001600160401b038281166000818152600f60209081526040808320805467ffffffffffffffff1980821683557ff4803e074bd026baaf6ed2e288c9515f68c72fb7216eebdd7cae1718a53ec375546fffffffffffffffffffffffffffffffff19909216600160401b928390048916830290811784558816865283862080546fffffffffffffffff000000000000000019168389021790558254919091049096168452818420805490961685179095559290915285516002840155850151600390920191909155518290601190611fd99084906149ee565b90815260405190819003602001902080546001600160401b039290921667ffffffffffffffff199092169190911790556002546001036120255782516012556020830151601355612053565b6040805180820190915260125481526013546020820152612046908461292a565b8051601255602001516013555b50919050565b6000600360025461206a9190614b65565b9050600454811161207b578061207f565b6004545b60035550565b60005460ff166120a85760405163348b55eb60e21b815260040160405180910390fd5b600b54815111156120cc5760405163226c2d8360e21b815260040160405180910390fd5b805115612154576000805b825181101561211d578281815181106120f2576120f2614a96565b602002602001015160200151826121099190614ac5565b91508061211581614aac565b9150506120d7565b50600a54811461214e57600a546040516367d22bd960e01b815260048101919091526024810182905260440161084b565b506121d1565b60408051600180825281830190925290816020015b60408051808201909152600080825260208201528152602001906001900390816121695790505090506040518060400160405280846001600160a01b03168152602001600a54815250816000815181106121c5576121c5614a96565b60200260200101819052505b600060116121e761092036899003890189614998565b6040516121f491906149ee565b908152604051908190036020019020546001600160401b0316905080156122395760405163459c639360e01b81526001600160401b038216600482015260240161084b565b61225461224b36889003880188614998565b86868635612ea0565b600061226d61226836899003890189614998565b611e1b565b90508260008151811061228257612282614a96565b602090810291909101810151516001600160401b0383166000908152600f9092526040822060010180546001600160a01b0319166001600160a01b039092169190911790555b835181101561236657600f6000836001600160401b03166001600160401b0316815260200190815260200160002060060184828151811061230b5761230b614a96565b602090810291909101810151825460018082018555600094855293839020825160029092020180546001600160a01b0319166001600160a01b039092169190911781559101519101558061235e81614aac565b9150506122c8565b50600a546001600160401b0382166000908152600f602052604090206005015561238e612059565b806001600160401b03167fe82ed1bfc15e6602fba1a19273171c8a63c1d40b0e0117be4598167b8655498f868987876040516123cd9493929190614bc5565b60405180910390a2610a9e600060019054906101000a90046001600160a01b03168630600a54612fa8565b6040516001600160a01b03838116602483015260448201839052610f4291859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612fe1565b60005460ff1661248f5760405163348b55eb60e21b815260040160405180910390fd5b6000805b6001600160401b0384166000908152600f6020526040902060060154811015612529576001600160401b0384166000908152600f6020526040902060060180546001600160a01b0385169190839081106124ef576124ef614a96565b60009182526020909120600290910201546001600160a01b0316036125175760019150612529565b8061252181614aac565b915050612493565b508061256257604051635bf2837760e11b81526001600160401b03841660048201526001600160a01b038316602482015260440161084b565b6001600160401b0383166000908152600f6020526040902060040154156125b557604051620c87d960ec1b81526001600160401b03841660048201526001600160a01b038316602482015260440161084b565b6001600160401b0383166000818152600f60205260409081902042600482015590517f89477e9f4ddcb5eb9f30353ab22c31ef9a91ab33fd1ffef09aadb3458be7775d91612627918691600201906001600160a01b039290921682528054602083015260010154604082015260600190565b60405180910390a2505050565b600081463060405160200161264b93929190614c84565b604051602081830303815290604052805190602001209050919050565b612670613044565b610afe8161308d565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033005460ff166107bf57604051638dfc202b60e01b815260040160405180910390fd5b60008060005b602081101561272c5760008482602081106126de576126de614a96565b1a60f81b90506126ef826008614b38565b7fff00000000000000000000000000000000000000000000000000000000000000909116901c91909117908061272481614aac565b9150506126c1565b5092915050565b60008061274360c0600019614985565b9050600080516020614d0a83398151915261275f82851661277d565b106127745761277160e0600019614985565b90505b91909116919050565b600080805b602081101561272c576000612798826008614b38565b85901c60ff1690506127ab826008614b38565b6127b69060f8614985565b1b9190911790806127c681614aac565b915050612782565b6127d66142e4565b8160008080805b80612862576000806127ef87876130bf565b915091506000806128008484613146565b915091508160001415801561281457508015155b1561284b5781965080955061282b898989896132e7565b156128395760019450612859565b61284460018a614ac5565b9850612859565b61285660018a614ac5565b98505b505050506127dd565b506040805160808101825280820194855260608101959095529284528251808401909352825260208281019190915282015292915050565b6000806000806128ac888888886132fe565b6128b8576128b8614cbd565b6040805160c081018252898152602081018990529081018790526060810186905260016080820152600060a08201526128f0816133b3565b8051602082015160408301516060840151608085015160a086015195965061291795613565565b929c919b50995090975095505050505050565b6040805180820190915260008082526020820152612946614309565b8351815260208085015181830152835160408301528301516060808301919091526000908360c08460066107d05a03fa9050806129eb5760405162461bcd60e51b815260206004820152602b60248201527f43616c6c20746f20707265636f6d70696c656420636f6e747261637420666f7260448201527f20616464206661696c6564000000000000000000000000000000000000000000606482015260840161084b565b505092915050565b60408051808201909152600080825260208201528151158015612a1857506020820151155b15612a36575050604080518082019091526000808252602082015290565b604051806040016040528083600001518152602001600080516020614d0a8339815191528460200151612a699190614cd3565b612a8190600080516020614d0a833981519152614985565b905292915050565b60408051600280825260608201909252600091829190816020015b6040805180820190915260008082526020820152815260200190600190039081612aa45750506040805160028082526060820190925291925060009190602082015b612aee6142e4565b815260200190600190039081612ae65790505090508682600081518110612b1757612b17614a96565b60200260200101819052508482600181518110612b3657612b36614a96565b60200260200101819052508581600081518110612b5557612b55614a96565b60200260200101819052508381600181518110612b7457612b74614a96565b6020026020010181905250612b8982826135af565b925050505b949350505050565b600060025411612ba557600080fd5b6001600160401b038116612bcc57604051631d58f8cb60e11b815260040160405180910390fd5b6001600160401b038082166000908152600f60209081526040808320815160e08101835281548087168252600160401b90049095168584015260018101546001600160a01b0316858301528151808301835260028201548152600382015481850152606086015260048101546080860152600581015460a0860152600681018054835181860281018601909452808452949594919360c08601939290879084015b82821015612cb5576000848152602090819020604080518082019091526002850290910180546001600160a01b03168252600190810154828401529083529092019101612c6d565b505050915250506020818101805183516001600160401b039081166000908152600f8552604080822080546fffffffffffffffff00000000000000001916600160401b95851695909502949094179093558551935182168152829020805467ffffffffffffffff1916939091169290921790915580518082019091526012548152601354918101919091526060820151919250612d5591611c49906129f3565b8051601255602001516013556060810151600090612d7290611a5a565b6001600160401b0384166000908152600f6020526040812080546fffffffffffffffffffffffffffffffff191681556001810180546001600160a01b031916905560028101829055600381018290556004810182905560058101829055919250612ddf6006830182614327565b5050601181604051612df191906149ee565b908152604051908190036020019020805467ffffffffffffffff191690556002805460019190600090612e25908490614985565b9091555050505050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b6000600654856000015186602001518585604051602001612ef695949392919094855260208501939093526040840191909152606090811b6bffffffffffffffffffffffff191690830152607482015260940190565b60405160208183030381529060405290506000612f15610a5583611a9b565b60408051608081018252602088810135828401908152893560608085019190915290835283518085018552908a0135815289840135818301528183015282518084018452600080825290820152825180840190935260018352600290830152919250612f8b9082612f858a6129f3565b85612a89565b610a9e5760405163cf006ab760e01b815260040160405180910390fd5b6040516001600160a01b0384811660248301528381166044830152606482018390526119739186918216906323b872dd90608401612425565b6000612ff66001600160a01b038416836138f1565b9050805160001415801561301b5750808060200190518101906130199190614ce7565b155b15610f4257604051635274afe760e01b81526001600160a01b038416600482015260240161084b565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff166107bf57604051631afcd79f60e31b815260040160405180910390fd5b613095613044565b6001600160a01b038116610af557604051631e4fbdf760e01b81526000600482015260240161084b565b6000806000806000806130d488888a8a613906565b90925090506130e582828a8a613906565b909250905061313582827f2b149d40ceb8aaae81be18991be06ac3b5b4c5e559dbefa33267e6dc24a138e57e9713b03af0fed4cd2cafadeed8fdf4a74fa084e52d1852e4a2bd0685c315d2613977565b9096509450505050505b9250929050565b6000806000806000856000036131ba5761315f876139ab565b90935090508015613179578260009450945050505061313f565b61319961319488600080516020614d0a833981519152614985565b6139ab565b9093509050806131ab576131ab614cbd565b6000839450945050505061313f565b600080516020614d0a8339815191528788099250600080516020614d0a8339815191528687099150600080516020614d0a83398151915282840892506131ff836139ab565b909350905080613218576000809450945050505061313f565b600080516020614d0a833981519152838808915061323582613a42565b91506000613242836139ab565b9250905081613293576132648885600080516020614d0a833981519152613a9a565b925061326f83613a42565b925061327a836139ab565b925090508161329357600080955095505050505061313f565b80600080516020614d0a83398151915282830893506132c084600080516020614d0a833981519152613abe565b93506000600080516020614d0a833981519152858a09919a91995090975050505050505050565b60006132f5858585856132fe565b95945050505050565b600080600080600061331287878989613906565b909450925061332389898181613906565b909250905061333482828b8b613906565b909250905061334584848484613b08565b909450925061339584847f2b149d40ceb8aaae81be18991be06ac3b5b4c5e559dbefa33267e6dc24a138e57e9713b03af0fed4cd2cafadeed8fdf4a74fa084e52d1852e4a2bd0685c315d2613b08565b9094509250831580156133a6575082155b9998505050505050505050565b6133bb614348565b6133c3614348565b6133cb614348565b6133d3614348565b8451602086015160408701516060880151608089015161340b946744e992b44a6909f1949093909290918b60055b6020020151613b4a565b805160208201516040830151606084015160808501519497506134379460029493929190896005613401565b91506134a38360005b602002015184600160200201518560026020020151866003602002015187600460200201518860056020020151886000602002015189600160200201518a600260200201518b600360200201518c600460200201518d60055b6020020151613bcd565b91506134ae82613e56565b91506134b983613e56565b90506134c481613e56565b90506134d1836000613440565b92506135378360005b6020020151846001602002015185600260200201518660036020020151876004602002015188600560200201518760006020020151886001602002015189600260200201518a600360200201518b600460200201518c6005613499565b925061354285613e56565b905061354d81613e56565b905061355881613e56565b90506132f58360006134da565b6000806000806000806135788888613f6e565b90925090506135898c8c8484613906565b909650945061359a8a8a8484613906565b969d959c509a50949850929650505050505050565b600081518351146135bf57600080fd5b825160006135ce826006614b38565b90506000816001600160401b038111156135ea576135ea6144e7565b604051908082528060200260200182016040528015613613578160200160208202803683370190505b50905060005b8381101561384e5786818151811061363357613633614a96565b6020026020010151600001518282600661364d9190614b38565b613658906000614ac5565b8151811061366857613668614a96565b60200260200101818152505086818151811061368657613686614a96565b602002602001015160200151828260066136a09190614b38565b6136ab906001614ac5565b815181106136bb576136bb614a96565b6020026020010181815250508581815181106136d9576136d9614a96565b60209081029190910101515151826136f2836006614b38565b6136fd906002614ac5565b8151811061370d5761370d614a96565b60200260200101818152505085818151811061372b5761372b614a96565b60209081029190910181015151015182613746836006614b38565b613751906003614ac5565b8151811061376157613761614a96565b60200260200101818152505085818151811061377f5761377f614a96565b60200260200101516020015160006002811061379d5761379d614a96565b6020020151826137ae836006614b38565b6137b9906004614ac5565b815181106137c9576137c9614a96565b6020026020010181815250508581815181106137e7576137e7614a96565b60200260200101516020015160016002811061380557613805614a96565b602002015182613816836006614b38565b613821906005614ac5565b8151811061383157613831614a96565b60209081029190910101528061384681614aac565b915050613619565b50613857614366565b60006020826020860260208601600060086107d05a03f19050806138e35760405162461bcd60e51b815260206004820152602f60248201527f43616c6c20746f20707265636f6d70696c656420636f6e747261637420666f7260448201527f2070616972696e67206661696c65640000000000000000000000000000000000606482015260840161084b565b505115159695505050505050565b60606138ff83836000613ff9565b9392505050565b600080613944600080516020614d0a833981519152858809600080516020614d0a833981519152858809600080516020614d0a833981519152613a9a565b600080516020614d0a83398151915280868809600080516020614d0a833981519152868a09089150915094509492505050565b600080600080516020614d0a833981519152848708600080516020614d0a8339815191528487089150915094509492505050565b600080600060405160208152602080820152602060408201528460608201527f0c19139cb84c680a6e14116da060561765e05aa45a1c72a34f082305b61f3f526080820152600080516020614d0a83398151915260a082015260208160c08360056107d05a03fa905193509050600080516020614d0a8339815191528380098414915080613a3c5760009250600091505b50915091565b6000600182161515613a55600284614b65565b9150801561205357600080516020614d0a8339815191526002613a87600080516020614d0a8339815191526001614ac5565b613a919190614b65565b83089392505050565b60008180613aaa57613aaa614b4f565b613ab48484614985565b8508949350505050565b60008060405160208152602080820152602060408201528460608201526002840360808201528360a082015260208160c08360056107d05a03fa9051925090508061272c57600080fd5b600080613b248685600080516020614d0a833981519152613a9a565b613b3d8685600080516020614d0a833981519152613a9a565b9150915094509492505050565b613b52614348565b8715613bc2576001881615613b93578051602082015160408301516060840151608085015160a0860151613b909594939291908d8d8d8d8d8d613bcd565b90505b613ba1878787878787614096565b949b50929950909750955093509150613bbb600289614b65565b9750613b52565b979650505050505050565b613bd5614348565b88158015613be1575087155b15613c23578686868686868660005b60a08901929092526080880192909252606087019290925260408601929092526020858101939093529091020152613e46565b82158015613c2f575081155b15613c42578c8c8c8c8c8c866000613bf0565b613c4e85858b8b613906565b9095509350613c5f8b8b8585613906565b60608301526040820152613c7587878b8b613906565b9097509550613c868d8d8585613906565b60a08301526080820181905287148015613ca3575060a081015186145b15613ce857604081015185148015613cbe5750606081015184145b15613cd957613cd18d8d8d8d8d8d614096565b866000613bf0565b60016000818180808681613bf0565b613cf489898585613906565b9093509150613d14858583600260200201518460035b6020020151613b08565b909d509b50613d2e87878360046020020151846005613d0a565b909b509950613d3f8b8b8181613906565b9099509750613d5f898983600460200201518460055b6020020151613906565b9095509350613d7089898d8d613906565b9099509750613d8189898585613906565b60a08301526080820152613d978d8d8181613906565b9097509550613da887878585613906565b9097509550613db987878b8b613b08565b9097509550613dca85856002614205565b9093509150613ddb87878585613b08565b9097509550613dec8b8b8989613906565b60208301528152613dff85858989613b08565b909b509950613e108d8d8d8d613906565b909b509950613e2a89898360026020020151846003613d55565b909d509b50613e3b8b8b8f8f613b08565b606083015260408201525b9c9b505050505050505050505050565b613e5e614348565b8151613e72908360015b6020020151614238565b602083015281526040820151613e8a90836003613e68565b606083015260408201526080820151613ea590836005613e68565b60a0830152608082015280516020820151613f0291907f2fb347984f7911f74c0bec3cf559b143b78cc310c2c3330c99e39557176f553d7f16c9e55061ebae204ba4cc8bd75a079432ae2a1d0b7c9dce1665d51c640fcba2613906565b6020830152815260408101516060820151613f5f91907f063cf305489af5dcdc5ec698b6e2f9b9dbaae0eda9c95998dc54014671a0135a7f07c03cbcac41049a0704b5a7ec796f2b21807dc98fa25bd282d37f632623b0e3613906565b60608301526040820152919050565b60008080613faf600080516020614d0a83398151915280878809600080516020614d0a83398151915287880908600080516020614d0a833981519152613abe565b9050600080516020614d0a833981519152818609600080516020614d0a833981519152828609613fed90600080516020614d0a833981519152614985565b92509250509250929050565b60608147101561401e5760405163cd78605960e01b815230600482015260240161084b565b600080856001600160a01b0316848660405161403a91906149ee565b60006040518083038185875af1925050503d8060008114614077576040519150601f19603f3d011682016040523d82523d6000602084013e61407c565b606091505b509150915061408c86838361425f565b9695505050505050565b6000806000806000806140ab8c8c6003614205565b90965094506140bc86868e8e613906565b90965094506140cd8a8a8a8a613906565b90985096506140de8c8c8c8c613906565b90945092506140ef84848a8a613906565b909450925061410086868181613906565b909c509a5061411184846008614205565b90925090506141228c8c8484613b08565b909c509a5061413388888181613906565b909250905061414484846004614205565b909450925061415584848e8e613b08565b909450925061416684848888613906565b90945092506141778a8a6008614205565b909650945061418886868c8c613906565b909650945061419986868484613906565b90965094506141aa84848888613b08565b90945092506141bb8c8c6002614205565b90965094506141cc86868a8a613906565b90965094506141dd88888484613906565b90925090506141ee82826008614205565b809250819350505096509650965096509650969050565b600080600080516020614d0a833981519152838609600080516020614d0a83398151915284860991509150935093915050565b6000808361425484600080516020614d0a833981519152614985565b915091509250929050565b6060826142745761426f826142bb565b6138ff565b815115801561428b57506001600160a01b0384163b155b156142b457604051639996b31560e01b81526001600160a01b038516600482015260240161084b565b50806138ff565b8051156142cb5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b60405180604001604052806142f7614384565b8152602001614304614384565b905290565b60405180608001604052806004906020820280368337509192915050565b5080546000825560020290600052602060002090810190610afe91906143a2565b6040518060c001604052806006906020820280368337509192915050565b60405180602001604052806001906020820280368337509192915050565b60405180604001604052806002906020820280368337509192915050565b5b808211156114385780546001600160a01b0319168155600060018201556002016143a3565b80356001600160401b03811681146143df57600080fd5b919050565b6000602082840312156143f657600080fd5b6138ff826143c8565b6000602080835261012083016001600160401b0380865116838601528083870151166040860152506001600160a01b0360408601511660608501526060850151614456608086018280518252602090810151910152565b50608085015160c08581019190915260a086015160e0860152850151610100808601528051918290528201906000906101408601905b808310156144c357835180516001600160a01b0316835260209081015190830152604082019150848401935060018301925061448c565b509695505050505050565b6000602082840312156144e057600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b038111828210171561451f5761451f6144e7565b60405290565b604051601f8201601f191681016001600160401b038111828210171561454d5761454d6144e7565b604052919050565b6000602080838503121561456857600080fd5b82356001600160401b038082111561457f57600080fd5b818501915085601f83011261459357600080fd5b8135818111156145a5576145a56144e7565b6145b7601f8201601f19168501614525565b915080825286848285010111156145cd57600080fd5b8084840185840137600090820190930192909252509392505050565b60006040828403121561205357600080fd5b60006080828403121561205357600080fd5b600082601f83011261461e57600080fd5b813560206001600160401b03821115614639576146396144e7565b8160051b614648828201614525565b928352848101820192828101908785111561466257600080fd5b83870192505b84831015613bc257614679836143c8565b82529183019190830190614668565b600080600080610100858703121561469f57600080fd5b6146a986866145e9565b9350604085013592506146bf86606087016145fb565b915060e08501356001600160401b038111156146da57600080fd5b6146e68782880161460d565b91505092959194509250565b80356001600160a01b03811681146143df57600080fd5b60008060008060e0858703121561471f57600080fd5b614728856146f2565b93506020850135925061473e86604087016145fb565b915060c08501356001600160401b038111156146da57600080fd5b60008083601f84011261476b57600080fd5b5081356001600160401b0381111561478257600080fd5b6020830191508360208260051b850101111561313f57600080fd5b600080600080600080606087890312156147b657600080fd5b86356001600160401b03808211156147cd57600080fd5b6147d98a838b01614759565b909850965060208901359150808211156147f257600080fd5b6147fe8a838b01614759565b9096509450604089013591508082111561481757600080fd5b5061482489828a01614759565b979a9699509497509295939492505050565b815181526020808301519082015260408101611abd565b6000806000806000610160868803121561486657600080fd5b61487087876145e9565b945061487f87604088016145fb565b935061488e8760c088016145fb565b92506101408601356001600160401b03808211156148ab57600080fd5b818801915088601f8301126148bf57600080fd5b8135818111156148ce57600080fd5b8960208260061b85010111156148e357600080fd5b9699959850939650602001949392505050565b60006020828403121561490857600080fd5b6138ff826146f2565b600080600080600080600060e0888a03121561492c57600080fd5b614935886146f2565b9650614943602089016146f2565b96999698505050506040850135946060810135946080820135945060a0820135935060c0909101359150565b634e487b7160e01b600052601160045260246000fd5b81810381811115611abd57611abd61496f565b6000604082840312156149aa57600080fd5b6149b26144fd565b82358152602083013560208201528091505092915050565b60005b838110156149e55781810151838201526020016149cd565b50506000910152565b60008251614a008184602087016149ca565b9190910192915050565b6001600160401b0383168152606081016138ff602083018480358252602090810135910152565b600060808284031215614a4357600080fd5b604051608081018181106001600160401b0382111715614a6557614a656144e7565b8060405250823581526020830135602082015260408301356040820152606083013560608201528091505092915050565b634e487b7160e01b600052603260045260246000fd5b600060018201614abe57614abe61496f565b5060010190565b80820180821115611abd57611abd61496f565b600060408284031215614aea57600080fd5b614af26144fd565b614afb836146f2565b8152602083013560208201528091505092915050565b6001600160a01b0383168152606081016138ff602083018480518252602090810151910152565b8082028115828204841417611abd57611abd61496f565b634e487b7160e01b600052601260045260246000fd5b600082614b7457614b74614b4f565b500490565b6001600160401b0381811683821601908082111561272c5761272c61496f565b6001600160a01b0384168152602080820184905282516040830152820151606082015260808101612b8e565b60006101008083016001600160a01b03881684526020614bf18186018980358252602090810135910152565b86356060860152808701356080860152604087013560a0860152606087013561ffff8116808214614c2157600080fd5b60c08701525060e08501929092528451908190526101208401918086019160005b81811015614c7557835180516001600160a01b031686526020908101519086015260408501945092820192600101614c42565b50929998505050505050505050565b60008451614c968184602089016149ca565b919091019283525060601b6bffffffffffffffffffffffff19166020820152603401919050565b634e487b7160e01b600052600160045260246000fd5b600082614ce257614ce2614b4f565b500690565b600060208284031215614cf957600080fd5b815180151581146138ff57600080fdfe30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47424c535f5349475f545259414e44494e4352454d454e545f4c4951554944415445a164736f6c6343000814000a", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/config_defaults.py b/config_defaults.py index b5f715a..4ea577c 100644 --- a/config_defaults.py +++ b/config_defaults.py @@ -19,3 +19,10 @@ testnet = False devnet = False + +REWARD_RATE_POOL_ADDRESS = '0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0' +SERVICE_NODE_CONTRIBUTION_FACTORY_ADDRESS = '0x06b8F568F9ed3E2f0393892b374437D253b733E7' +SERVICE_NODE_REWARDS_ADDRESS = '0x5FC8d32690cc91D4c39d9d3abcBD16989F875707' +SENT_TOKEN_ADDRESS = '0x5FbDB2315678afecb367f032d93F642f64180aa3' + +PROVIDER_ENDPOINT = 'https://sepolia-rollup.arbitrum.io/rpc' diff --git a/contracts/reward_rate_pool.py b/contracts/reward_rate_pool.py new file mode 100644 index 0000000..0899702 --- /dev/null +++ b/contracts/reward_rate_pool.py @@ -0,0 +1,53 @@ +from web3 import Web3 +from abi_manager import ABIManager + +class RewardRatePoolInterface: + def __init__(self, provider_url, contract_address): + """ + Initialize the connection to the Ethereum provider and set up the contract. + :param provider_url: URL of the Ethereum node to connect to. + :param contract_address: Address of the RewardRatePool smart contract. + """ + self.web3 = Web3(Web3.HTTPProvider(provider_url)) + manager = ABIManager() + abi = manager.load_abi('RewardRatePool') + self.contract = self.web3.eth.contract(address=Web3.to_checksum_address(contract_address), abi=abi) + + def calculate_total_deposited(self): + """ + Calculates the total amount of SENT tokens deposited in the contract. + """ + return self.contract.functions.calculateTotalDeposited().call() + + def calculate_released_amount(self, timestamp): + """ + Calculates the amount of SENT tokens released up to a specific timestamp. + :param timestamp: The timestamp until which to calculate the released amount. + """ + return self.contract.functions.calculateReleasedAmount(timestamp).call() + + def calculate_interest_amount(self, balance, time_elapsed): + """ + Calculates 14.5% annual interest for a given balance and time period. + :param balance: The principal balance. + :param time_elapsed: The time period in seconds. + """ + return self.contract.functions.calculateInterestAmount(balance, time_elapsed).call() + + def reward_rate(self, timestamp): + """ + Calculates the reward rate for a given timestamp. + :param timestamp: The timestamp for which to calculate the reward rate. + """ + return self.contract.functions.rewardRate(timestamp).call() + +# Example usage: +# provider_url = 'http://127.0.0.1:8545' +# contract_address = '0x...' + +# reward_rate_pool = RewardRatePoolInterface(provider_url, contract_address) +# total_deposited = reward_rate_pool.calculate_total_deposited() +# print("Total Deposited:", total_deposited) +# reward_rate = reward_rate_pool.reward_rate(Web3.toInt(text="latest")) +# print("Reward Rate at Latest:", reward_rate) + diff --git a/contracts/service_node_contribution.py b/contracts/service_node_contribution.py new file mode 100644 index 0000000..894216c --- /dev/null +++ b/contracts/service_node_contribution.py @@ -0,0 +1,126 @@ +from web3 import Web3 +from abi_manager import ABIManager + +class ContributorContractInterface: + """ Parent class to handle Web3 connection and load ABI for contracts. """ + + def __init__(self, provider_url): + """ + Initialize the connection to the Ethereum provider. + :param provider_url: URL of the Ethereum node to connect to. + """ + self.web3 = Web3(Web3.HTTPProvider(provider_url)) + manager = ABIManager() + self.abi = manager.load_abi('ServiceNodeContribution') + + def get_contract_instance(self, contract_address): + """ + Create an instance of a contract at a given address. + :param contract_address: Address of the contract to interact with. + :return: Web3 Contract object. + """ + contract = self.web3.eth.contract(address=Web3.toChecksumAddress(contract_address), abi=self.abi) + return ServiceNodeContribution(contract) + +class ServiceNodeContribution: + """ Child class to interact with specific Service Node Contribution contracts. """ + + def __init__(self, contract): + """ + Initialize the contract interaction class with the contract. + :param contract: Web3 Contract object. + """ + self.contract = contract + + def get_contributor_contribution(self, contributor_address): + """ + Get the contribution amount of a specific contributor. + :param contributor_address: Address of the contributor. + :return: Contribution amount of the specified contributor. + """ + return self.contract.functions.contributions(Web3.toChecksumAddress(contributor_address)).call() + + def is_finalized(self): + """ + Check if the service node is finalized. + :return: True if the service node is finalized, otherwise False. + """ + return self.contract.functions.finalized().call() + + def is_cancelled(self): + """ + Check if the service node has been cancelled. + :return: True if the service node has been cancelled, otherwise False. + """ + return self.contract.functions.cancelled().call() + + def total_contribution(self): + """ + Get the total amount of contributions received. + :return: Total contributions amount. + """ + return self.contract.functions.totalContribution().call() + + def contributor_count(self): + """ + Get the number of contributors. + :return: Number of contributors. + """ + return len(self.contract.functions.contributorAddresses().call()) + + def minimum_contribution(self): + """ + Get the minimum contribution required. + :return: Minimum contribution amount. + """ + return self.contract.functions.minimumContribution().call() + + def get_bls_pubkey(self): + """ + Get the BLS public key. + :return: Tuple of BLS public key coordinates. + """ + return self.contract.functions.blsPubkey().call() + + def get_service_node_params(self): + """ + Get the parameters of the service node. + :return: Dictionary containing service node parameters. + """ + params = self.contract.functions.serviceNodeParams().call() + return { + 'serviceNodePubkey': params[0], + 'serviceNodeSignature': params[1] + params[2], + 'fee': params[3] + } + + def get_contributor_addresses(self): + """ + Get the list of contributor addresses. + :return: List of addresses of contributors. + """ + return self.contract.functions.contributorAddresses().call() + + def get_individual_contributions(self): + """ + Retrieve contributions for each contributor. + :return: Dictionary mapping contributor addresses to their contributions. + """ + contributor_addresses = self.get_contributor_addresses() + contributions = { + address: self.get_contributor_contribution(address) for address in contributor_addresses + } + return contributions + +# Example usage: +# provider_url = 'http://127.0.0.1:8545' +# contract_address = '0x...' + +# contract_interface = ContributorContractInterface(provider_url) +# service_node = contract_interface.get_contract_instance(contract_address) + +# Fetch and display data from the contract +# print("Total Contribution:", service_node.total_contribution()) +# print("Is Finalized:", service_node.is_finalized()) +# print("Is Cancelled:", service_node.is_cancelled()) +# print("Minimum Contribution Required:", service_node.minimum_contribution()) diff --git a/contracts/service_node_contribution_factory.py b/contracts/service_node_contribution_factory.py new file mode 100644 index 0000000..6b7dd4e --- /dev/null +++ b/contracts/service_node_contribution_factory.py @@ -0,0 +1,59 @@ +from web3 import Web3 +from abi_manager import ABIManager + +class ServiceNodeContributionFactory: + def __init__(self, provider_url, contract_address): + """ + Initialize the connection to the ServiceNodeContributionFactory contract. + + :param provider_url: URL of the Ethereum node to connect to. + :param contract_address: Address of the deployed ServiceNodeContributionFactory contract. + """ + self.web3 = Web3(Web3.HTTPProvider(provider_url)) + self.contract_address = Web3.to_checksum_address(contract_address) + manager = ABIManager() + abi = manager.load_abi('ServiceNodeContributionFactory') + self.contract = self.web3.eth.contract(address=self.contract_address, abi=abi) + self.last_contribution_event_height = 0 + + def max_contributors(self): + """ + Calls the view function to get the maximum number of contributors. + + :return: Maximum number of contributors as integer. + """ + return self.contract.functions.maxContributors().call() + + def designated_token(self): + """ + Calls the view function to get the designated token address. + + :return: Address of the designated token as string. + """ + return self.contract.functions.SENT().call() + + def get_new_contribution_contract_events(self, from_block='latest'): + """ + Retrieves the events of new contribution contracts deployed. + + :param from_block: The block number to start looking for events. + :return: List of events. + """ + return self.contract.events.NewServiceNodeContributionContract.get_logs(fromBlock=from_block) + + def get_latest_contribution_contract_events(self): + """ + Retrieves the latest events of new contribution contracts deployed. keeping track of when last called + + :return: List of events. + """ + events = self.get_new_contribution_contract_events(self.last_contribution_event_height) + self.last_contribution_event_height = self.web3.eth.block_number + return events + +# Example usage: +# factory_interface = ServiceNodeContributionFactory('http://127.0.0.1:8545', '0x...') +# max_contributors = factory_interface.max_contributors() +# designated_token = factory_interface.designated_token() +# new_contribution_contracts = factory_interface.get_new_contribution_contract_events() + diff --git a/schema.sqlite b/schema.sqlite index 839e091..bbb0f22 100644 --- a/schema.sqlite +++ b/schema.sqlite @@ -20,3 +20,12 @@ CREATE TABLE registrations ( ); CREATE INDEX registrations_operator_idx ON registrations(operator); CREATE UNIQUE INDEX registration_pk_multi_idx ON registrations(pubkey_ed25519, contract IS NULL); + +CREATE TABLE contribution_contracts ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + contract_address TEXT NOT NULL, + status INTEGER DEFAULT 1, + timestamp FLOAT NOT NULL DEFAULT ((julianday('now') - 2440587.5)*86400.0), /* unix epoch */ + + CHECK(length(contract_address) == 42) -- Assuming Ethereum addresses +); diff --git a/sent.py b/sent.py index 23968da..4e5358f 100644 --- a/sent.py +++ b/sent.py @@ -28,6 +28,12 @@ from io import BytesIO import config from omq import FutureJSON, omq_connection +from timer import timer + +from contracts.reward_rate_pool import RewardRatePoolInterface +from contracts.service_node_contribution import ContributorContractInterface +from contracts.service_node_contribution_factory import ServiceNodeContributionFactory + # Make a dict of config.* to pass to templating conf = {x: getattr(config, x) for x in dir(config) if not x.startswith("__")} @@ -40,8 +46,15 @@ else: git_rev = "(unknown)" -app = flask.Flask(__name__) +def create_app(): + app = flask.Flask(__name__) + app.reward_rate_pool = RewardRatePoolInterface(config.PROVIDER_ENDPOINT, config.REWARD_RATE_POOL_ADDRESS) + app.service_node_contribution_factory = ServiceNodeContributionFactory(config.PROVIDER_ENDPOINT, config.SERVICE_NODE_CONTRIBUTION_FACTORY_ADDRESS) + app.service_node_contribution = ContributorContractInterface(config.PROVIDER_ENDPOINT) + return app + +app = create_app() def get_sql(): if "db" not in flask.g: @@ -111,6 +124,7 @@ def get_sns_future(omq, oxend): "service_node_pubkey", "requested_unlock_height", "active", + "bls_key", "funded", "earned_downtime_blocks", "service_node_version", @@ -124,6 +138,8 @@ def get_sns_future(omq, oxend): "last_uptime_proof", "state_height", "swarm_id", + "is_removable", + "is_liquidatable", ) }, }, @@ -211,6 +227,68 @@ def json_response(vals): return flask.jsonify({**vals, "network": get_info(), "t": time.time()}) +@timer(60, target="worker1") +def fetch_contribution_contracts(signum): + with app.app_context(), get_sql() as sql: + cursor = sql.cursor() + app.logger.info("Fetching new contribution contract events") + + new_contracts = app.service_node_contribution_factory.get_latest_contribution_contract_events() + + for event in new_contracts: + contract_address = event['args']['contractAddress'] + cursor.execute( + """ + INSERT INTO contribution_contracts (contract_address) + SELECT ? WHERE NOT EXISTS ( + SELECT 1 FROM contribution_contracts WHERE contract_address = ? + ) + """, + (contract_address, contract_address) + ) + sql.commit() + + app.logger.info(f"Processed {len(new_contracts)} new contracts") + +@timer(60) +def update_contract_statuses(signum): + with app.app_context(), get_sql() as sql: + cursor = sql.cursor() + cursor.execute("SELECT contract_address FROM contribution_contracts") + contract_addresses = cursor.fetchall() + + app.logger.info("Updating contract statuses") + + for (contract_address,) in contract_addresses: + contract_interface = app.service_node_contributor.get_contract_instance(contract_address) + + # Fetch statuses and other details + is_finalized = contract_interface.is_finalized() + is_cancelled = contract_interface.is_cancelled() + bls_pubkey = contract_interface.get_bls_pubkey() + service_node_params = contract_interface.get_service_node_params() + contributor_addresses = contract_interface.get_contributor_addresses() + total_contributions = contract_interface.total_contribution() + + # Store the details in a dictionary in the app context + if not hasattr(app, 'contracts'): + app.contracts = {} + + app.contracts[contract_address] = { + 'finalized': is_finalized, + 'cancelled': is_cancelled, + 'bls_pubkey': bls_pubkey, + 'service_node_params': service_node_params, + 'contributor_addresses': contributor_addresses, + 'total_contributions': total_contributions + } + + app.logger.info(f"Updated statuses for {len(contract_addresses)} contracts") + +@timer(60) +def update_service_nodes(signum): + omq, oxend = omq_connection() + app.nodes = {"nodes": get_sns_future(omq, oxend).get()} @app.route("/info") def network_info(): @@ -235,6 +313,47 @@ def get_nodes_for_wallet(oxen_wal=None, eth_wal=None): if wallet in (c["address"] for c in sn["contributors"]) ] + contracts = [] + if hasattr(app, 'contracts') and eth_wal: + for address, details in app.contracts.items(): + if wallet in (addr.lower() for addr in details['contributor_addresses']): + contributor_contracts.append({ + 'contract_address': address, + 'details': details + }) + + return json_response({"nodes": sns, "contracts": contracts}) + +@app.route("/nodes/liquidatable") +def get_liquidatable_nodes(): + omq, oxend = omq_connection() + sns = [ + sn + for sn in get_sns_future(omq, oxend).get()["service_node_states"] + if sn["is_liquidatable"] + ] + + return json_response({"nodes": sns}) + +@app.route("/nodes/removeable") +def get_removable_nodes(): + omq, oxend = omq_connection() + sns = [ + sn + for sn in get_sns_future(omq, oxend).get()["service_node_states"] + if sn["is_removeable"] + ] + + return json_response({"nodes": sns}) + +@app.route("/nodes/open") +def get_contributable_contracts(): + sns = [ + sn + for sn in app.contracts + if not sn.is_finalized and not sn.is_cancelled + ] + return json_response({"nodes": sns}) diff --git a/timer.py b/timer.py new file mode 100644 index 0000000..2d5f949 --- /dev/null +++ b/timer.py @@ -0,0 +1,25 @@ +import logging + +try: + import uwsgi # noqa: F401 +except ModuleNotFoundError: + logging.error( + """ +WARNING: Failed to load uwsgidecorators; we probably aren't running under uwsgi. +""" + ) + + class timer: + """Do-nothing stub""" + + def __init__(self, secs, **kwargs): + pass + + def __call__(self, f): + pass + + +else: + import uwsgidecorators + + timer = uwsgidecorators.timer