From eb8d9db5531f4ba768a32abf4c5f703a914fd3f2 Mon Sep 17 00:00:00 2001 From: Mike <41407352+hunjixin@users.noreply.github.com> Date: Tue, 2 Jul 2024 02:22:43 +0800 Subject: [PATCH] feat: add count function for miners and submissions (#216) Co-authored-by: hunjixin <16705420332lee@gmai.com> --- hardhat/.openzeppelin/unknown-412346.json | 243 ++++++++++++++++++++++ hardhat/contracts/LilypadPow.sol | 30 ++- pkg/web3/bindings/pow/pow.go | 66 +++++- 3 files changed, 329 insertions(+), 10 deletions(-) diff --git a/hardhat/.openzeppelin/unknown-412346.json b/hardhat/.openzeppelin/unknown-412346.json index 35a18819..75564c6d 100644 --- a/hardhat/.openzeppelin/unknown-412346.json +++ b/hardhat/.openzeppelin/unknown-412346.json @@ -264,6 +264,249 @@ }, "namespaces": {} } + }, + "2fd905ca8e6c89f7922d3c38962d4cf3205f6bee5797b13e6d5d9618bec33b4d": { + "address": "0x67d269191c92Caf3cD7723F116c85e6E9bf55933", + "txHash": "0xf69f1ee4c496366c981349e7563aa6d1396906bb3e51b4d69d128bd125c1f3ea", + "layout": { + "solcVersion": "0.8.21", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:63", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:68" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" + }, + { + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:94" + }, + { + "label": "targetDifficulty", + "offset": 0, + "slot": "101", + "type": "t_uint256", + "contract": "LilypadPow", + "src": "contracts/LilypadPow.sol:29" + }, + { + "label": "powSubmissions", + "offset": 0, + "slot": "102", + "type": "t_mapping(t_address,t_array(t_struct(POWSubmission)4860_storage)dyn_storage)", + "contract": "LilypadPow", + "src": "contracts/LilypadPow.sol:31" + }, + { + "label": "miners", + "offset": 0, + "slot": "103", + "type": "t_array(t_address)dyn_storage", + "contract": "LilypadPow", + "src": "contracts/LilypadPow.sol:32" + }, + { + "label": "lastChallenges", + "offset": 0, + "slot": "104", + "type": "t_mapping(t_address,t_struct(Challenge)4869_storage)", + "contract": "LilypadPow", + "src": "contracts/LilypadPow.sol:34" + }, + { + "label": "validProofs", + "offset": 0, + "slot": "105", + "type": "t_uint256", + "contract": "LilypadPow", + "src": "contracts/LilypadPow.sol:35" + }, + { + "label": "startTime", + "offset": 0, + "slot": "106", + "type": "t_uint256", + "contract": "LilypadPow", + "src": "contracts/LilypadPow.sol:36" + }, + { + "label": "window_start", + "offset": 0, + "slot": "107", + "type": "t_uint256", + "contract": "LilypadPow", + "src": "contracts/LilypadPow.sol:38" + }, + { + "label": "window_end", + "offset": 0, + "slot": "108", + "type": "t_uint256", + "contract": "LilypadPow", + "src": "contracts/LilypadPow.sol:39" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_address)dyn_storage": { + "label": "address[]", + "numberOfBytes": "32" + }, + "t_array(t_struct(POWSubmission)4860_storage)dyn_storage": { + "label": "struct LilypadPow.POWSubmission[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_array(t_struct(POWSubmission)4860_storage)dyn_storage)": { + "label": "mapping(address => struct LilypadPow.POWSubmission[])", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_struct(Challenge)4869_storage)": { + "label": "mapping(address => struct LilypadPow.Challenge)", + "numberOfBytes": "32" + }, + "t_string_storage": { + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(Challenge)4869_storage": { + "label": "struct LilypadPow.Challenge", + "members": [ + { + "label": "challenge", + "type": "t_bytes32", + "offset": 0, + "slot": "0" + }, + { + "label": "difficulty", + "type": "t_uint256", + "offset": 0, + "slot": "1" + }, + { + "label": "nodeId", + "type": "t_string_storage", + "offset": 0, + "slot": "2" + }, + { + "label": "timestamp", + "type": "t_uint256", + "offset": 0, + "slot": "3" + } + ], + "numberOfBytes": "128" + }, + "t_struct(POWSubmission)4860_storage": { + "label": "struct LilypadPow.POWSubmission", + "members": [ + { + "label": "walletAddress", + "type": "t_address", + "offset": 0, + "slot": "0" + }, + { + "label": "nodeId", + "type": "t_string_storage", + "offset": 0, + "slot": "1" + }, + { + "label": "nonce", + "type": "t_uint256", + "offset": 0, + "slot": "2" + }, + { + "label": "start_timestamp", + "type": "t_uint256", + "offset": 0, + "slot": "3" + }, + { + "label": "complete_timestamp", + "type": "t_uint256", + "offset": 0, + "slot": "4" + }, + { + "label": "challenge", + "type": "t_bytes32", + "offset": 0, + "slot": "5" + }, + { + "label": "difficulty", + "type": "t_uint256", + "offset": 0, + "slot": "6" + } + ], + "numberOfBytes": "224" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + }, + "namespaces": {} + } } } } diff --git a/hardhat/contracts/LilypadPow.sol b/hardhat/contracts/LilypadPow.sol index 4415dd46..0e8a6148 100644 --- a/hardhat/contracts/LilypadPow.sol +++ b/hardhat/contracts/LilypadPow.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.6; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; -contract LilypadPow is Initializable, OwnableUpgradeable { +contract LilypadPow is Initializable, OwnableUpgradeable { struct POWSubmission { address walletAddress; string nodeId; @@ -26,8 +26,8 @@ contract LilypadPow is Initializable, OwnableUpgradeable { // this difficulty was calculate with this tool https://github.com/hunjixin/pow-tool/tree/main/difficulty // Theoretically A machine with a hash rate of 8M has a probability of no more than 0.01% of not finding a nonce that meets the difficulty within 20 blocks. // However, this issue has not been well validated in practice. it can solve nonce within one minute most of the time. - uint256 public targetDifficulty;// = - //555460709263765739036470010701196062214039696708679004195670928130048; + uint256 public targetDifficulty; // = + //555460709263765739036470010701196062214039696708679004195670928130048; mapping(address => POWSubmission[]) public powSubmissions; address[] public miners; @@ -47,13 +47,25 @@ contract LilypadPow is Initializable, OwnableUpgradeable { targetDifficulty = 555460709263765739036470010701196062214039696708679004195670928130048; } + function getMinerCount() public view returns (uint256) { + return miners.length; + } + function getMiners() public view returns (address[] memory) { return miners; } - function getMinerPowSubmissions(address addr) public view returns (POWSubmission[] memory) { + function getMinerPowSubmissionCount( + address addr + ) public view returns (uint256) { + return powSubmissions[addr].length; + } + + function getMinerPowSubmissions( + address addr + ) public view returns (POWSubmission[] memory) { return powSubmissions[addr]; - } + } // generateChallenge gen a byte32 value as challenge value, Sc store this one for verify function generateChallenge(string calldata nodeId) external { @@ -74,7 +86,7 @@ contract LilypadPow is Initializable, OwnableUpgradeable { } function change_difficulty(uint256 difficulty) public onlyOwner { - targetDifficulty = difficulty; + targetDifficulty = difficulty; } function calculate_difficulty() public view returns (uint256) { @@ -109,7 +121,9 @@ contract LilypadPow is Initializable, OwnableUpgradeable { validProofs++; - POWSubmission[] storage onwMinerPowSubmissions = powSubmissions[msg.sender]; + POWSubmission[] storage onwMinerPowSubmissions = powSubmissions[ + msg.sender + ]; if (onwMinerPowSubmissions.length == 0) { miners.push(msg.sender); } @@ -159,4 +173,4 @@ contract LilypadPow is Initializable, OwnableUpgradeable { ); event GenerateChallenge(bytes32 challenge, uint256 difficulty); event NewPowRound(); -} \ No newline at end of file +} diff --git a/pkg/web3/bindings/pow/pow.go b/pkg/web3/bindings/pow/pow.go index ffe8e328..1aa86747 100644 --- a/pkg/web3/bindings/pow/pow.go +++ b/pkg/web3/bindings/pow/pow.go @@ -42,8 +42,8 @@ type LilypadPowPOWSubmission struct { // PowMetaData contains all meta data concerning the Pow contract. var PowMetaData = &bind.MetaData{ - ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"challenge\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"difficulty\",\"type\":\"uint256\"}],\"name\":\"GenerateChallenge\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"NewPowRound\",\"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\":\"walletAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"nodeId\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"start_timestamp\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"complete_timestamp\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"challenge\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"difficulty\",\"type\":\"uint256\"}],\"name\":\"ValidPOWSubmitted\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"calculate_difficulty\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"difficulty\",\"type\":\"uint256\"}],\"name\":\"change_difficulty\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"checkTimeWindow\",\"outputs\":[],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"nodeId\",\"type\":\"string\"}],\"name\":\"generateChallenge\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"getMinerPowSubmissions\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"walletAddress\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"nodeId\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"start_timestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"complete_timestamp\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"challenge\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"difficulty\",\"type\":\"uint256\"}],\"internalType\":\"structLilypadPow.POWSubmission[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getMiners\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"lastChallenges\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"challenge\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"difficulty\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"nodeId\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"miners\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"powSubmissions\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"walletAddress\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"nodeId\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"start_timestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"complete_timestamp\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"challenge\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"difficulty\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"startTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"nodeId\",\"type\":\"string\"}],\"name\":\"submitWork\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"targetDifficulty\",\"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\":\"triggerNewPowRound\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"validProofs\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"window_end\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"window_start\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", - Bin: "0x60806040527c149a6a3000000000000000000000000000000000000000000000000000600155348015610030575f80fd5b5061004d61004261005260201b60201c565b61005960201b60201c565b61011a565b5f33905090565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6122f180620001285f395ff3fe608060405234801561000f575f80fd5b506004361061012a575f3560e01c8063a738bf8f116100ab578063bfb660de1161006f578063bfb660de146102dd578063c2c434da146102e7578063da8accf914610317578063e0d152af14610333578063f2fde38b146103635761012a565b8063a738bf8f1461025f578063ab0989451461027d578063adf0047c14610299578063b28d87ea146102b5578063b681f2fd146102d35761012a565b8063715018a6116100f2578063715018a6146101f157806378e97925146101fb5780638129fc1c146102195780638b2db16e146102235780638da5cb5b146102415761012a565b80631633da6e1461012e5780632d68c3971461014c578063331bade11461016a5780634bbe05e4146101885780636189f3ac146101be575b5f80fd5b61013661037f565b604051610143919061133e565b60405180910390f35b61015461040a565b6040516101619190611376565b60405180910390f35b610172610447565b60405161017f9190611376565b60405180910390f35b6101a2600480360381019061019d91906113eb565b61044d565b6040516101b597969594939291906114da565b60405180910390f35b6101d860048036038101906101d3919061154e565b61054a565b6040516101e89493929190611579565b60405180910390f35b6101f96105fc565b005b61020361060f565b6040516102109190611376565b60405180910390f35b610221610615565b005b61022b61074a565b6040516102389190611376565b60405180910390f35b610249610750565b60405161025691906115c3565b60405180910390f35b610267610777565b6040516102749190611376565b60405180910390f35b6102976004803603810190610292919061163d565b61077d565b005b6102b360048036038101906102ae9190611688565b6108d9565b005b6102bd6108eb565b6040516102ca9190611376565b60405180910390f35b6102db6108f1565b005b6102e5610941565b005b61030160048036038101906102fc919061154e565b610987565b60405161030e919061186d565b60405180910390f35b610331600480360381019061032c919061188d565b610b36565b005b61034d60048036038101906103489190611688565b611032565b60405161035a91906115c3565b60405180910390f35b61037d6004803603810190610378919061154e565b61106d565b005b6060600380548060200260200160405190810160405280929190818152602001828054801561040057602002820191905f5260205f20905b815f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116103b7575b5050505050905090565b5f806015446104199190611917565b605a6104259190611974565b905060648160015461043791906119a7565b61044191906119e8565b91505090565b60075481565b6002602052815f5260405f208181548110610466575f80fd5b905f5260205f2090600702015f9150915050805f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010180546104ab90611a45565b80601f01602080910402602001604051908101604052809291908181526020018280546104d790611a45565b80156105225780601f106104f957610100808354040283529160200191610522565b820191905f5260205f20905b81548152906001019060200180831161050557829003601f168201915b5050505050908060020154908060030154908060040154908060050154908060060154905087565b6004602052805f5260405f205f91509050805f01549080600101549080600201805461057590611a45565b80601f01602080910402602001604051908101604052809291908181526020018280546105a190611a45565b80156105ec5780601f106105c3576101008083540402835291602001916105ec565b820191905f5260205f20905b8154815290600101906020018083116105cf57829003601f168201915b5050505050908060030154905084565b6106046110ef565b61060d5f61116d565b565b60065481565b5f8060159054906101000a900460ff16159050808015610646575060015f60149054906101000a900460ff1660ff16105b8061067457506106553061122e565b158015610673575060015f60149054906101000a900460ff1660ff16145b5b6106b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106aa90611ae5565b60405180910390fd5b60015f60146101000a81548160ff021916908360ff16021790555080156106ef5760015f60156101000a81548160ff0219169083151502179055505b8015610747575f8060156101000a81548160ff0219169083151502179055507f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498600160405161073e9190611b51565b60405180910390a15b50565b60015481565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60085481565b610785610941565b5f426007543385856040516020016107a1959493929190611c0b565b6040516020818303038152906040528051906020012090505f6107c261040a565b9050604051806080016040528083815260200182815260200185858080601f0160208091040260200160405190810160405280939291908181526020018383808284375f81840152601f19601f8201169050808301925050505050505081526020014281525060045f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f820151815f015560208201518160010155604082015181600201908161088c9190611e17565b50606082015181600301559050507f496186a9d930bac0744acdcd1d0c054b18283eecbe99d30bda98102d3d06b8ef82826040516108cb929190611ee6565b60405180910390a150505050565b6108e16110ef565b8060018190555050565b60055481565b6108f96110ef565b43600781905550601e4361090d9190611974565b6008819055507f10cc99616aca050d810fd487c95f968e516d0fa25318530ed50753153d060a1e60405160405180910390a1565b6008544310610985576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097c90611f57565b60405180910390fd5b565b606060025f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20805480602002602001604051908101604052809291908181526020015f905b82821015610b2b578382905f5260205f2090600702016040518060e00160405290815f82015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600182018054610a6a90611a45565b80601f0160208091040260200160405190810160405280929190818152602001828054610a9690611a45565b8015610ae15780601f10610ab857610100808354040283529160200191610ae1565b820191905f5260205f20905b815481529060010190602001808311610ac457829003601f168201915b5050505050815260200160028201548152602001600382015481526020016004820154815260200160058201548152602001600682015481525050815260200190600101906109e5565b505050509050919050565b610b3e610941565b5f60045f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f206040518060800160405290815f820154815260200160018201548152602001600282018054610baa90611a45565b80601f0160208091040260200160405190810160405280929190818152602001828054610bd690611a45565b8015610c215780601f10610bf857610100808354040283529160200191610c21565b820191905f5260205f20905b815481529060010190602001808311610c0457829003601f168201915b5050505050815260200160038201548152505090505f8160600151600754338686604051602001610c56959493929190611c0b565b60405160208183030381529060405280519060200120905080825f015114610cb3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610caa90611fe5565b60405180910390fd5b5f8186604051602001610cc7929190612023565b6040516020818303038152906040528051906020012090508260200151815f1c10610d27576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1e906120be565b60405180910390fd5b60055f815480929190610d39906120dc565b91905055505f60025f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2090505f818054905003610dea57600333908060018154018082558091505060019003905f5260205f20015f9091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b806040518060e001604052803373ffffffffffffffffffffffffffffffffffffffff16815260200188888080601f0160208091040260200160405190810160405280939291908181526020018383808284375f81840152601f19601f82011690508083019250505050505050815260200189815260200186606001518152602001428152602001865f015181526020018660200151815250908060018154018082558091505060019003905f5260205f2090600702015f909190919091505f820151815f015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001019081610f019190611e17565b5060408201518160020155606082015181600301556080820151816004015560a0820151816005015560c08201518160060155505060405180608001604052805f801b81526020015f815260200160405180602001604052805f81525081526020015f81525060045f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f820151815f0155602082015181600101556040820151816002019081610fcb9190611e17565b50606082015181600301559050507f172b7d59e60446d8dfc98985344fb883c871ef150b1db4d1592bcb67699037323387878a8860600151428a5f01518b6020015160405161102198979695949392919061214f565b60405180910390a150505050505050565b60038181548110611041575f80fd5b905f5260205f20015f915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6110756110ef565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036110e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110da90612235565b60405180910390fd5b6110ec8161116d565b50565b6110f7611250565b73ffffffffffffffffffffffffffffffffffffffff16611115610750565b73ffffffffffffffffffffffffffffffffffffffff161461116b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111629061229d565b60405180910390fd5b565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b5f33905090565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6112a982611280565b9050919050565b6112b98161129f565b82525050565b5f6112ca83836112b0565b60208301905092915050565b5f602082019050919050565b5f6112ec82611257565b6112f68185611261565b935061130183611271565b805f5b8381101561133157815161131888826112bf565b9750611323836112d6565b925050600181019050611304565b5085935050505092915050565b5f6020820190508181035f83015261135681846112e2565b905092915050565b5f819050919050565b6113708161135e565b82525050565b5f6020820190506113895f830184611367565b92915050565b5f80fd5b5f80fd5b6113a08161129f565b81146113aa575f80fd5b50565b5f813590506113bb81611397565b92915050565b6113ca8161135e565b81146113d4575f80fd5b50565b5f813590506113e5816113c1565b92915050565b5f80604083850312156114015761140061138f565b5b5f61140e858286016113ad565b925050602061141f858286016113d7565b9150509250929050565b6114328161129f565b82525050565b5f81519050919050565b5f82825260208201905092915050565b5f5b8381101561146f578082015181840152602081019050611454565b5f8484015250505050565b5f601f19601f8301169050919050565b5f61149482611438565b61149e8185611442565b93506114ae818560208601611452565b6114b78161147a565b840191505092915050565b5f819050919050565b6114d4816114c2565b82525050565b5f60e0820190506114ed5f83018a611429565b81810360208301526114ff818961148a565b905061150e6040830188611367565b61151b6060830187611367565b6115286080830186611367565b61153560a08301856114cb565b61154260c0830184611367565b98975050505050505050565b5f602082840312156115635761156261138f565b5b5f611570848285016113ad565b91505092915050565b5f60808201905061158c5f8301876114cb565b6115996020830186611367565b81810360408301526115ab818561148a565b90506115ba6060830184611367565b95945050505050565b5f6020820190506115d65f830184611429565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f8401126115fd576115fc6115dc565b5b8235905067ffffffffffffffff81111561161a576116196115e0565b5b602083019150836001820283011115611636576116356115e4565b5b9250929050565b5f80602083850312156116535761165261138f565b5b5f83013567ffffffffffffffff8111156116705761166f611393565b5b61167c858286016115e8565b92509250509250929050565b5f6020828403121561169d5761169c61138f565b5b5f6116aa848285016113d7565b91505092915050565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b5f82825260208201905092915050565b5f6116f682611438565b61170081856116dc565b9350611710818560208601611452565b6117198161147a565b840191505092915050565b61172d8161135e565b82525050565b61173c816114c2565b82525050565b5f60e083015f8301516117575f8601826112b0565b506020830151848203602086015261176f82826116ec565b91505060408301516117846040860182611724565b5060608301516117976060860182611724565b5060808301516117aa6080860182611724565b5060a08301516117bd60a0860182611733565b5060c08301516117d060c0860182611724565b508091505092915050565b5f6117e68383611742565b905092915050565b5f602082019050919050565b5f611804826116b3565b61180e81856116bd565b935083602082028501611820856116cd565b805f5b8581101561185b578484038952815161183c85826117db565b9450611847836117ee565b925060208a01995050600181019050611823565b50829750879550505050505092915050565b5f6020820190508181035f83015261188581846117fa565b905092915050565b5f805f604084860312156118a4576118a361138f565b5b5f6118b1868287016113d7565b935050602084013567ffffffffffffffff8111156118d2576118d1611393565b5b6118de868287016115e8565b92509250509250925092565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f6119218261135e565b915061192c8361135e565b92508261193c5761193b6118ea565b5b828206905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f61197e8261135e565b91506119898361135e565b92508282019050808211156119a1576119a0611947565b5b92915050565b5f6119b18261135e565b91506119bc8361135e565b92508282026119ca8161135e565b915082820484148315176119e1576119e0611947565b5b5092915050565b5f6119f28261135e565b91506119fd8361135e565b925082611a0d57611a0c6118ea565b5b828204905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f6002820490506001821680611a5c57607f821691505b602082108103611a6f57611a6e611a18565b5b50919050565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c7265615f8201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b5f611acf602e83611442565b9150611ada82611a75565b604082019050919050565b5f6020820190508181035f830152611afc81611ac3565b9050919050565b5f819050919050565b5f60ff82169050919050565b5f819050919050565b5f611b3b611b36611b3184611b03565b611b18565b611b0c565b9050919050565b611b4b81611b21565b82525050565b5f602082019050611b645f830184611b42565b92915050565b5f819050919050565b611b84611b7f8261135e565b611b6a565b82525050565b5f8160601b9050919050565b5f611ba082611b8a565b9050919050565b5f611bb182611b96565b9050919050565b611bc9611bc48261129f565b611ba7565b82525050565b5f81905092915050565b828183375f83830152505050565b5f611bf28385611bcf565b9350611bff838584611bd9565b82840190509392505050565b5f611c168288611b73565b602082019150611c268287611b73565b602082019150611c368286611bb8565b601482019150611c47828486611be7565b91508190509695505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f819050815f5260205f209050919050565b5f6020601f8301049050919050565b5f82821b905092915050565b5f60088302611cdf7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82611ca4565b611ce98683611ca4565b95508019841693508086168417925050509392505050565b5f611d1b611d16611d118461135e565b611b18565b61135e565b9050919050565b5f819050919050565b611d3483611d01565b611d48611d4082611d22565b848454611cb0565b825550505050565b5f90565b611d5c611d50565b611d67818484611d2b565b505050565b5b81811015611d8a57611d7f5f82611d54565b600181019050611d6d565b5050565b601f821115611dcf57611da081611c83565b611da984611c95565b81016020851015611db8578190505b611dcc611dc485611c95565b830182611d6c565b50505b505050565b5f82821c905092915050565b5f611def5f1984600802611dd4565b1980831691505092915050565b5f611e078383611de0565b9150826002028217905092915050565b611e2082611438565b67ffffffffffffffff811115611e3957611e38611c56565b5b611e438254611a45565b611e4e828285611d8e565b5f60209050601f831160018114611e7f575f8415611e6d578287015190505b611e778582611dfc565b865550611ede565b601f198416611e8d86611c83565b5f5b82811015611eb457848901518255600182019150602085019450602081019050611e8f565b86831015611ed15784890151611ecd601f891682611de0565b8355505b6001600288020188555050505b505050505050565b5f604082019050611ef95f8301856114cb565b611f066020830184611367565b9392505050565b7f70726f6f662077696e646f77732068617320636c6f73656400000000000000005f82015250565b5f611f41601883611442565b9150611f4c82611f0d565b602082019050919050565b5f6020820190508181035f830152611f6e81611f35565b9050919050565b7f576f726b207375626d6974206e6f7420636f6d70617461626c652077697468205f8201527f6368616c6c656e67650000000000000000000000000000000000000000000000602082015250565b5f611fcf602983611442565b9150611fda82611f75565b604082019050919050565b5f6020820190508181035f830152611ffc81611fc3565b9050919050565b5f819050919050565b61201d612018826114c2565b612003565b82525050565b5f61202e828561200c565b60208201915061203e8284611b73565b6020820191508190509392505050565b7f576f726b20646f6573206e6f74206d65657420646966666963756c74792074615f8201527f7267657400000000000000000000000000000000000000000000000000000000602082015250565b5f6120a8602483611442565b91506120b38261204e565b604082019050919050565b5f6020820190508181035f8301526120d58161209c565b9050919050565b5f6120e68261135e565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361211857612117611947565b5b600182019050919050565b5f61212e8385611442565b935061213b838584611bd9565b6121448361147a565b840190509392505050565b5f60e0820190506121625f83018b611429565b818103602083015261217581898b612123565b90506121846040830188611367565b6121916060830187611367565b61219e6080830186611367565b6121ab60a08301856114cb565b6121b860c0830184611367565b9998505050505050505050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f20615f8201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b5f61221f602683611442565b915061222a826121c5565b604082019050919050565b5f6020820190508181035f83015261224c81612213565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725f82015250565b5f612287602083611442565b915061229282612253565b602082019050919050565b5f6020820190508181035f8301526122b48161227b565b905091905056fea264697066735822122043c22cf8146e002cc56493763779d9e4564bb23db48463100d691913167b818a64736f6c63430008150033", + ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"challenge\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"difficulty\",\"type\":\"uint256\"}],\"name\":\"GenerateChallenge\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"NewPowRound\",\"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\":\"walletAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"nodeId\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"start_timestamp\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"complete_timestamp\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"challenge\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"difficulty\",\"type\":\"uint256\"}],\"name\":\"ValidPOWSubmitted\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"calculate_difficulty\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"difficulty\",\"type\":\"uint256\"}],\"name\":\"change_difficulty\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"checkTimeWindow\",\"outputs\":[],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"nodeId\",\"type\":\"string\"}],\"name\":\"generateChallenge\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getMinerCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"getMinerPowSubmissionCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"getMinerPowSubmissions\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"walletAddress\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"nodeId\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"start_timestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"complete_timestamp\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"challenge\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"difficulty\",\"type\":\"uint256\"}],\"internalType\":\"structLilypadPow.POWSubmission[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getMiners\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"lastChallenges\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"challenge\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"difficulty\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"nodeId\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"miners\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"powSubmissions\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"walletAddress\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"nodeId\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"start_timestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"complete_timestamp\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"challenge\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"difficulty\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"startTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"nodeId\",\"type\":\"string\"}],\"name\":\"submitWork\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"targetDifficulty\",\"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\":\"triggerNewPowRound\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"validProofs\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"window_end\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"window_start\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x608060405234801561000f575f80fd5b5061251a8061001d5f395ff3fe608060405234801561000f575f80fd5b5060043610610140575f3560e01c8063a738bf8f116100b6578063bb52c1371161007a578063bb52c13714610323578063bfb660de14610341578063c2c434da1461034b578063da8accf91461037b578063e0d152af14610397578063f2fde38b146103c757610140565b8063a738bf8f146102a5578063ab098945146102c3578063adf0047c146102df578063b28d87ea146102fb578063b681f2fd1461031957610140565b80636189f3ac116101085780636189f3ac14610204578063715018a61461023757806378e97925146102415780638129fc1c1461025f5780638b2db16e146102695780638da5cb5b1461028757610140565b80631633da6e146101445780631bb0d808146101625780632d68c39714610192578063331bade1146101b05780634bbe05e4146101ce575b5f80fd5b61014c6103e3565b60405161015991906114d9565b60405180910390f35b61017c6004803603810190610177919061152b565b61046e565b604051610189919061156e565b60405180910390f35b61019a6104b7565b6040516101a7919061156e565b60405180910390f35b6101b86104f4565b6040516101c5919061156e565b60405180910390f35b6101e860048036038101906101e391906115b1565b6104fa565b6040516101fb97969594939291906116a0565b60405180910390f35b61021e6004803603810190610219919061152b565b6105f7565b60405161022e9493929190611714565b60405180910390f35b61023f6106a9565b005b6102496106bc565b604051610256919061156e565b60405180910390f35b6102676106c2565b005b61027161081e565b60405161027e919061156e565b60405180910390f35b61028f610824565b60405161029c919061175e565b60405180910390f35b6102ad61084c565b6040516102ba919061156e565b60405180910390f35b6102dd60048036038101906102d891906117d8565b610852565b005b6102f960048036038101906102f49190611823565b6109ae565b005b6103036109c0565b604051610310919061156e565b60405180910390f35b6103216109c6565b005b61032b610a16565b604051610338919061156e565b60405180910390f35b610349610a22565b005b6103656004803603810190610360919061152b565b610a68565b6040516103729190611a08565b60405180910390f35b61039560048036038101906103909190611a28565b610c17565b005b6103b160048036038101906103ac9190611823565b611113565b6040516103be919061175e565b60405180910390f35b6103e160048036038101906103dc919061152b565b61114e565b005b6060606780548060200260200160405190810160405280929190818152602001828054801561046457602002820191905f5260205f20905b815f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001906001019080831161041b575b5050505050905090565b5f60665f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20805490509050919050565b5f806015446104c69190611ab2565b605a6104d29190611b0f565b90506064816065546104e49190611b42565b6104ee9190611b83565b91505090565b606b5481565b6066602052815f5260405f208181548110610513575f80fd5b905f5260205f2090600702015f9150915050805f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600101805461055890611be0565b80601f016020809104026020016040519081016040528092919081815260200182805461058490611be0565b80156105cf5780601f106105a6576101008083540402835291602001916105cf565b820191905f5260205f20905b8154815290600101906020018083116105b257829003601f168201915b5050505050908060020154908060030154908060040154908060050154908060060154905087565b6068602052805f5260405f205f91509050805f01549080600101549080600201805461062290611be0565b80601f016020809104026020016040519081016040528092919081815260200182805461064e90611be0565b80156106995780601f1061067057610100808354040283529160200191610699565b820191905f5260205f20905b81548152906001019060200180831161067c57829003601f168201915b5050505050908060030154905084565b6106b16111d0565b6106ba5f61124e565b565b606a5481565b5f8060019054906101000a900460ff161590508080156106f1575060015f8054906101000a900460ff1660ff16105b8061071d575061070030611311565b15801561071c575060015f8054906101000a900460ff1660ff16145b5b61075c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161075390611c80565b60405180910390fd5b60015f806101000a81548160ff021916908360ff16021790555080156107975760015f60016101000a81548160ff0219169083151502179055505b61079f611333565b7c149a6a3000000000000000000000000000000000000000000000000000606581905550801561081b575f8060016101000a81548160ff0219169083151502179055507f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249860016040516108129190611cec565b60405180910390a15b50565b60655481565b5f60335f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606c5481565b61085a610a22565b5f42606b54338585604051602001610876959493929190611da6565b6040516020818303038152906040528051906020012090505f6108976104b7565b9050604051806080016040528083815260200182815260200185858080601f0160208091040260200160405190810160405280939291908181526020018383808284375f81840152601f19601f8201169050808301925050505050505081526020014281525060685f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f820151815f01556020820151816001015560408201518160020190816109619190611fb2565b50606082015181600301559050507f496186a9d930bac0744acdcd1d0c054b18283eecbe99d30bda98102d3d06b8ef82826040516109a0929190612081565b60405180910390a150505050565b6109b66111d0565b8060658190555050565b60695481565b6109ce6111d0565b43606b81905550601e436109e29190611b0f565b606c819055507f10cc99616aca050d810fd487c95f968e516d0fa25318530ed50753153d060a1e60405160405180910390a1565b5f606780549050905090565b606c544310610a66576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a5d906120f2565b60405180910390fd5b565b606060665f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20805480602002602001604051908101604052809291908181526020015f905b82821015610c0c578382905f5260205f2090600702016040518060e00160405290815f82015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600182018054610b4b90611be0565b80601f0160208091040260200160405190810160405280929190818152602001828054610b7790611be0565b8015610bc25780601f10610b9957610100808354040283529160200191610bc2565b820191905f5260205f20905b815481529060010190602001808311610ba557829003601f168201915b505050505081526020016002820154815260200160038201548152602001600482015481526020016005820154815260200160068201548152505081526020019060010190610ac6565b505050509050919050565b610c1f610a22565b5f60685f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f206040518060800160405290815f820154815260200160018201548152602001600282018054610c8b90611be0565b80601f0160208091040260200160405190810160405280929190818152602001828054610cb790611be0565b8015610d025780601f10610cd957610100808354040283529160200191610d02565b820191905f5260205f20905b815481529060010190602001808311610ce557829003601f168201915b5050505050815260200160038201548152505090505f8160600151606b54338686604051602001610d37959493929190611da6565b60405160208183030381529060405280519060200120905080825f015114610d94576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d8b90612180565b60405180910390fd5b5f8186604051602001610da89291906121be565b6040516020818303038152906040528051906020012090508260200151815f1c10610e08576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dff90612259565b60405180910390fd5b60695f815480929190610e1a90612277565b91905055505f60665f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2090505f818054905003610ecb57606733908060018154018082558091505060019003905f5260205f20015f9091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b806040518060e001604052803373ffffffffffffffffffffffffffffffffffffffff16815260200188888080601f0160208091040260200160405190810160405280939291908181526020018383808284375f81840152601f19601f82011690508083019250505050505050815260200189815260200186606001518152602001428152602001865f015181526020018660200151815250908060018154018082558091505060019003905f5260205f2090600702015f909190919091505f820151815f015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001019081610fe29190611fb2565b5060408201518160020155606082015181600301556080820151816004015560a0820151816005015560c08201518160060155505060405180608001604052805f801b81526020015f815260200160405180602001604052805f81525081526020015f81525060685f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f820151815f01556020820151816001015560408201518160020190816110ac9190611fb2565b50606082015181600301559050507f172b7d59e60446d8dfc98985344fb883c871ef150b1db4d1592bcb67699037323387878a8860600151428a5f01518b602001516040516111029897969594939291906122ea565b60405180910390a150505050505050565b60678181548110611122575f80fd5b905f5260205f20015f915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6111566111d0565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036111c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111bb906123d0565b60405180910390fd5b6111cd8161124e565b50565b6111d861138b565b73ffffffffffffffffffffffffffffffffffffffff166111f6610824565b73ffffffffffffffffffffffffffffffffffffffff161461124c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161124390612438565b60405180910390fd5b565b5f60335f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508160335f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b5f60019054906101000a900460ff16611381576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611378906124c6565b60405180910390fd5b611389611392565b565b5f33905090565b5f60019054906101000a900460ff166113e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d7906124c6565b60405180910390fd5b6113f06113eb61138b565b61124e565b565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6114448261141b565b9050919050565b6114548161143a565b82525050565b5f611465838361144b565b60208301905092915050565b5f602082019050919050565b5f611487826113f2565b61149181856113fc565b935061149c8361140c565b805f5b838110156114cc5781516114b3888261145a565b97506114be83611471565b92505060018101905061149f565b5085935050505092915050565b5f6020820190508181035f8301526114f1818461147d565b905092915050565b5f80fd5b5f80fd5b61150a8161143a565b8114611514575f80fd5b50565b5f8135905061152581611501565b92915050565b5f602082840312156115405761153f6114f9565b5b5f61154d84828501611517565b91505092915050565b5f819050919050565b61156881611556565b82525050565b5f6020820190506115815f83018461155f565b92915050565b61159081611556565b811461159a575f80fd5b50565b5f813590506115ab81611587565b92915050565b5f80604083850312156115c7576115c66114f9565b5b5f6115d485828601611517565b92505060206115e58582860161159d565b9150509250929050565b6115f88161143a565b82525050565b5f81519050919050565b5f82825260208201905092915050565b5f5b8381101561163557808201518184015260208101905061161a565b5f8484015250505050565b5f601f19601f8301169050919050565b5f61165a826115fe565b6116648185611608565b9350611674818560208601611618565b61167d81611640565b840191505092915050565b5f819050919050565b61169a81611688565b82525050565b5f60e0820190506116b35f83018a6115ef565b81810360208301526116c58189611650565b90506116d4604083018861155f565b6116e1606083018761155f565b6116ee608083018661155f565b6116fb60a0830185611691565b61170860c083018461155f565b98975050505050505050565b5f6080820190506117275f830187611691565b611734602083018661155f565b81810360408301526117468185611650565b9050611755606083018461155f565b95945050505050565b5f6020820190506117715f8301846115ef565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f84011261179857611797611777565b5b8235905067ffffffffffffffff8111156117b5576117b461177b565b5b6020830191508360018202830111156117d1576117d061177f565b5b9250929050565b5f80602083850312156117ee576117ed6114f9565b5b5f83013567ffffffffffffffff81111561180b5761180a6114fd565b5b61181785828601611783565b92509250509250929050565b5f60208284031215611838576118376114f9565b5b5f6118458482850161159d565b91505092915050565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b5f82825260208201905092915050565b5f611891826115fe565b61189b8185611877565b93506118ab818560208601611618565b6118b481611640565b840191505092915050565b6118c881611556565b82525050565b6118d781611688565b82525050565b5f60e083015f8301516118f25f86018261144b565b506020830151848203602086015261190a8282611887565b915050604083015161191f60408601826118bf565b50606083015161193260608601826118bf565b50608083015161194560808601826118bf565b5060a083015161195860a08601826118ce565b5060c083015161196b60c08601826118bf565b508091505092915050565b5f61198183836118dd565b905092915050565b5f602082019050919050565b5f61199f8261184e565b6119a98185611858565b9350836020820285016119bb85611868565b805f5b858110156119f657848403895281516119d78582611976565b94506119e283611989565b925060208a019950506001810190506119be565b50829750879550505050505092915050565b5f6020820190508181035f830152611a208184611995565b905092915050565b5f805f60408486031215611a3f57611a3e6114f9565b5b5f611a4c8682870161159d565b935050602084013567ffffffffffffffff811115611a6d57611a6c6114fd565b5b611a7986828701611783565b92509250509250925092565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f611abc82611556565b9150611ac783611556565b925082611ad757611ad6611a85565b5b828206905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f611b1982611556565b9150611b2483611556565b9250828201905080821115611b3c57611b3b611ae2565b5b92915050565b5f611b4c82611556565b9150611b5783611556565b9250828202611b6581611556565b91508282048414831517611b7c57611b7b611ae2565b5b5092915050565b5f611b8d82611556565b9150611b9883611556565b925082611ba857611ba7611a85565b5b828204905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f6002820490506001821680611bf757607f821691505b602082108103611c0a57611c09611bb3565b5b50919050565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c7265615f8201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b5f611c6a602e83611608565b9150611c7582611c10565b604082019050919050565b5f6020820190508181035f830152611c9781611c5e565b9050919050565b5f819050919050565b5f60ff82169050919050565b5f819050919050565b5f611cd6611cd1611ccc84611c9e565b611cb3565b611ca7565b9050919050565b611ce681611cbc565b82525050565b5f602082019050611cff5f830184611cdd565b92915050565b5f819050919050565b611d1f611d1a82611556565b611d05565b82525050565b5f8160601b9050919050565b5f611d3b82611d25565b9050919050565b5f611d4c82611d31565b9050919050565b611d64611d5f8261143a565b611d42565b82525050565b5f81905092915050565b828183375f83830152505050565b5f611d8d8385611d6a565b9350611d9a838584611d74565b82840190509392505050565b5f611db18288611d0e565b602082019150611dc18287611d0e565b602082019150611dd18286611d53565b601482019150611de2828486611d82565b91508190509695505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f819050815f5260205f209050919050565b5f6020601f8301049050919050565b5f82821b905092915050565b5f60088302611e7a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82611e3f565b611e848683611e3f565b95508019841693508086168417925050509392505050565b5f611eb6611eb1611eac84611556565b611cb3565b611556565b9050919050565b5f819050919050565b611ecf83611e9c565b611ee3611edb82611ebd565b848454611e4b565b825550505050565b5f90565b611ef7611eeb565b611f02818484611ec6565b505050565b5b81811015611f2557611f1a5f82611eef565b600181019050611f08565b5050565b601f821115611f6a57611f3b81611e1e565b611f4484611e30565b81016020851015611f53578190505b611f67611f5f85611e30565b830182611f07565b50505b505050565b5f82821c905092915050565b5f611f8a5f1984600802611f6f565b1980831691505092915050565b5f611fa28383611f7b565b9150826002028217905092915050565b611fbb826115fe565b67ffffffffffffffff811115611fd457611fd3611df1565b5b611fde8254611be0565b611fe9828285611f29565b5f60209050601f83116001811461201a575f8415612008578287015190505b6120128582611f97565b865550612079565b601f19841661202886611e1e565b5f5b8281101561204f5784890151825560018201915060208501945060208101905061202a565b8683101561206c5784890151612068601f891682611f7b565b8355505b6001600288020188555050505b505050505050565b5f6040820190506120945f830185611691565b6120a1602083018461155f565b9392505050565b7f70726f6f662077696e646f77732068617320636c6f73656400000000000000005f82015250565b5f6120dc601883611608565b91506120e7826120a8565b602082019050919050565b5f6020820190508181035f830152612109816120d0565b9050919050565b7f576f726b207375626d6974206e6f7420636f6d70617461626c652077697468205f8201527f6368616c6c656e67650000000000000000000000000000000000000000000000602082015250565b5f61216a602983611608565b915061217582612110565b604082019050919050565b5f6020820190508181035f8301526121978161215e565b9050919050565b5f819050919050565b6121b86121b382611688565b61219e565b82525050565b5f6121c982856121a7565b6020820191506121d98284611d0e565b6020820191508190509392505050565b7f576f726b20646f6573206e6f74206d65657420646966666963756c74792074615f8201527f7267657400000000000000000000000000000000000000000000000000000000602082015250565b5f612243602483611608565b915061224e826121e9565b604082019050919050565b5f6020820190508181035f83015261227081612237565b9050919050565b5f61228182611556565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036122b3576122b2611ae2565b5b600182019050919050565b5f6122c98385611608565b93506122d6838584611d74565b6122df83611640565b840190509392505050565b5f60e0820190506122fd5f83018b6115ef565b818103602083015261231081898b6122be565b905061231f604083018861155f565b61232c606083018761155f565b612339608083018661155f565b61234660a0830185611691565b61235360c083018461155f565b9998505050505050505050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f20615f8201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b5f6123ba602683611608565b91506123c582612360565b604082019050919050565b5f6020820190508181035f8301526123e7816123ae565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725f82015250565b5f612422602083611608565b915061242d826123ee565b602082019050919050565b5f6020820190508181035f83015261244f81612416565b9050919050565b7f496e697469616c697a61626c653a20636f6e7472616374206973206e6f7420695f8201527f6e697469616c697a696e67000000000000000000000000000000000000000000602082015250565b5f6124b0602b83611608565b91506124bb82612456565b604082019050919050565b5f6020820190508181035f8301526124dd816124a4565b905091905056fea2646970667358221220efcf195df08be990f01e2b2c33e87946572b0fe6b2fb157815311b351363a39064736f6c63430008150033", } // PowABI is the input ABI used to generate the binding from. @@ -273,6 +273,68 @@ func (_Pow *PowCallerSession) CheckTimeWindow() error { return _Pow.Contract.CheckTimeWindow(&_Pow.CallOpts) } +// GetMinerCount is a free data retrieval call binding the contract method 0xbb52c137. +// +// Solidity: function getMinerCount() view returns(uint256) +func (_Pow *PowCaller) GetMinerCount(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _Pow.contract.Call(opts, &out, "getMinerCount") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetMinerCount is a free data retrieval call binding the contract method 0xbb52c137. +// +// Solidity: function getMinerCount() view returns(uint256) +func (_Pow *PowSession) GetMinerCount() (*big.Int, error) { + return _Pow.Contract.GetMinerCount(&_Pow.CallOpts) +} + +// GetMinerCount is a free data retrieval call binding the contract method 0xbb52c137. +// +// Solidity: function getMinerCount() view returns(uint256) +func (_Pow *PowCallerSession) GetMinerCount() (*big.Int, error) { + return _Pow.Contract.GetMinerCount(&_Pow.CallOpts) +} + +// GetMinerPowSubmissionCount is a free data retrieval call binding the contract method 0x1bb0d808. +// +// Solidity: function getMinerPowSubmissionCount(address addr) view returns(uint256) +func (_Pow *PowCaller) GetMinerPowSubmissionCount(opts *bind.CallOpts, addr common.Address) (*big.Int, error) { + var out []interface{} + err := _Pow.contract.Call(opts, &out, "getMinerPowSubmissionCount", addr) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetMinerPowSubmissionCount is a free data retrieval call binding the contract method 0x1bb0d808. +// +// Solidity: function getMinerPowSubmissionCount(address addr) view returns(uint256) +func (_Pow *PowSession) GetMinerPowSubmissionCount(addr common.Address) (*big.Int, error) { + return _Pow.Contract.GetMinerPowSubmissionCount(&_Pow.CallOpts, addr) +} + +// GetMinerPowSubmissionCount is a free data retrieval call binding the contract method 0x1bb0d808. +// +// Solidity: function getMinerPowSubmissionCount(address addr) view returns(uint256) +func (_Pow *PowCallerSession) GetMinerPowSubmissionCount(addr common.Address) (*big.Int, error) { + return _Pow.Contract.GetMinerPowSubmissionCount(&_Pow.CallOpts, addr) +} + // GetMinerPowSubmissions is a free data retrieval call binding the contract method 0xc2c434da. // // Solidity: function getMinerPowSubmissions(address addr) view returns((address,string,uint256,uint256,uint256,bytes32,uint256)[])