From c1ab6437df1e14d083a757e3b510aedf3bc99011 Mon Sep 17 00:00:00 2001 From: hunjixin <1084400399@qq.com> Date: Thu, 6 Jun 2024 02:43:13 +0000 Subject: [PATCH 01/14] feat: power implementation --- cmd/lilypad/pow_signal.go | 51 + cmd/lilypad/root.go | 1 + go.mod | 5 +- go.sum | 6 +- hardhat/contracts/LilypadController.sol | 15 +- hardhat/contracts/LilypadPow.sol | 149 ++ hardhat/deploy/007_deploy_pow.ts | 28 + ...controller.ts => 008_deploy_controller.ts} | 4 +- hardhat/scripts/print-contract-env.ts | 7 +- hardhat/utils/web3.ts | 14 + pkg/executor/bacalhau/bacalhau.go | 24 + pkg/executor/noop/noop.go | 7 + pkg/executor/types.go | 1 + pkg/options/pow_signal.go | 25 + pkg/options/resource-provider.go | 20 + pkg/options/utils.go | 11 + pkg/options/web3.go | 5 + pkg/resourceprovider/cpuminer.go | 149 ++ pkg/resourceprovider/powsignal/powsignal.go | 86 + pkg/resourceprovider/resourceprovider.go | 63 + pkg/resourceprovider/worker.go | 174 ++ pkg/resourceprovider/worker_test.go | 66 + pkg/web3/api.go | 61 +- pkg/web3/bindings/controller/controller.go | 80 +- pkg/web3/bindings/pow/pow.go | 1497 +++++++++++++++++ pkg/web3/events.go | 4 + pkg/web3/events_pow.go | 78 + pkg/web3/sdk.go | 31 +- pkg/web3/types.go | 2 +- stack | 1 + 30 files changed, 2636 insertions(+), 29 deletions(-) create mode 100644 cmd/lilypad/pow_signal.go create mode 100644 hardhat/contracts/LilypadPow.sol create mode 100644 hardhat/deploy/007_deploy_pow.ts rename hardhat/deploy/{007_deploy_controller.ts => 008_deploy_controller.ts} (93%) create mode 100644 pkg/options/pow_signal.go create mode 100644 pkg/resourceprovider/cpuminer.go create mode 100644 pkg/resourceprovider/powsignal/powsignal.go create mode 100644 pkg/resourceprovider/worker.go create mode 100644 pkg/resourceprovider/worker_test.go create mode 100644 pkg/web3/bindings/pow/pow.go create mode 100644 pkg/web3/events_pow.go diff --git a/cmd/lilypad/pow_signal.go b/cmd/lilypad/pow_signal.go new file mode 100644 index 00000000..1ac15049 --- /dev/null +++ b/cmd/lilypad/pow_signal.go @@ -0,0 +1,51 @@ +package lilypad + +import ( + optionsfactory "github.com/lilypad-tech/lilypad/pkg/options" + "github.com/lilypad-tech/lilypad/pkg/resourceprovider/powsignal" + "github.com/lilypad-tech/lilypad/pkg/system" + "github.com/lilypad-tech/lilypad/pkg/web3" + "github.com/rs/zerolog/log" + "github.com/spf13/cobra" +) + +func newPowSignalCmd() *cobra.Command { + options := optionsfactory.NewPowSignalOptions() + + powSignalCmd := &cobra.Command{ + Use: "pow-signal", + Short: "Send a pow signal to smart contract.", + Long: "Send a pow signal to smart contract.", + Example: "", + RunE: func(cmd *cobra.Command, _ []string) error { + network, _ := cmd.Flags().GetString("network") + + options, err := optionsfactory.ProcessPowSignalrOptions(options, network) + if err != nil { + return err + } + return runPowSignal(cmd, options) + }, + } + + optionsfactory.AddPowSignalCliFlags(powSignalCmd, &options) + + return powSignalCmd +} + +func runPowSignal(cmd *cobra.Command, options powsignal.PowSignalOptions) error { + commandCtx := system.NewCommandContext(cmd) + defer commandCtx.Cleanup() + + web3SDK, err := web3.NewContractSDK(options.Web3) + if err != nil { + return err + } + + _, err = powsignal.SendPowSignal(commandCtx.Ctx, web3SDK, options) + if err != nil { + return err + } + log.Info().Msgf("send pow signal successful.") + return nil +} diff --git a/cmd/lilypad/root.go b/cmd/lilypad/root.go index 35a5d856..0605cee6 100644 --- a/cmd/lilypad/root.go +++ b/cmd/lilypad/root.go @@ -27,6 +27,7 @@ func NewRootCmd() *cobra.Command { RootCmd.AddCommand(newSolverCmd()) RootCmd.AddCommand(newResourceProviderCmd()) + RootCmd.AddCommand(newPowSignalCmd()) RootCmd.AddCommand(newRunCmd()) RootCmd.AddCommand(newMediatorCmd()) RootCmd.AddCommand(newJobCreatorCmd()) diff --git a/go.mod b/go.mod index 904b5bc9..545ff148 100644 --- a/go.mod +++ b/go.mod @@ -8,9 +8,12 @@ require ( github.com/ethereum/go-ethereum v1.13.4 github.com/fatih/color v1.15.0 github.com/go-git/go-git/v5 v5.10.0 + github.com/google/uuid v1.3.0 github.com/gorilla/mux v1.8.0 github.com/gorilla/websocket v1.5.0 github.com/hashicorp/go-retryablehttp v0.7.4 + github.com/hashicorp/golang-lru/v2 v2.0.7 + github.com/holiman/uint256 v1.2.4 github.com/ipfs/go-merkledag v0.11.0 github.com/rs/zerolog v1.31.0 github.com/spf13/cobra v1.7.0 @@ -45,10 +48,8 @@ require ( github.com/go-stack/stack v1.8.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/google/uuid v1.3.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/golang-lru v0.5.4 // indirect - github.com/holiman/uint256 v1.2.3 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/ipfs/bbloom v0.0.4 // indirect github.com/ipfs/go-block-format v0.0.3 // indirect diff --git a/go.sum b/go.sum index de368998..3b083a1d 100644 --- a/go.sum +++ b/go.sum @@ -122,10 +122,12 @@ github.com/hashicorp/go-retryablehttp v0.7.4 h1:ZQgVdpTdAL7WpMIwLzCfbalOcSUdkDZn github.com/hashicorp/go-retryablehttp v0.7.4/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/holiman/billy v0.0.0-20230718173358-1c7e68d277a7 h1:3JQNjnMRil1yD0IfZKHF9GxxWKDJGj8I0IqOUol//sw= github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= -github.com/holiman/uint256 v1.2.3 h1:K8UWO1HUJpRMXBxbmaY1Y8IAMZC/RsKB+ArEnnK4l5o= -github.com/holiman/uint256 v1.2.3/go.mod h1:SC8Ryt4n+UBbPbIBKaG9zbbDlp4jOru9xFZmPzLUTxw= +github.com/holiman/uint256 v1.2.4 h1:jUc4Nk8fm9jZabQuqr2JzednajVmBpC+oiTiXZJEApU= +github.com/holiman/uint256 v1.2.4/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E= github.com/huin/goupnp v1.3.0 h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= diff --git a/hardhat/contracts/LilypadController.sol b/hardhat/contracts/LilypadController.sol index e7196dc4..d52c5541 100644 --- a/hardhat/contracts/LilypadController.sol +++ b/hardhat/contracts/LilypadController.sol @@ -20,6 +20,7 @@ contract LilypadController is ILilypadController, Ownable, Initializable { address private paymentsAddress; address private mediationAddress; address private jobCreatorAddress; + address private powAddress; ILilypadStorage private storageContract; ILilypadPayments private paymentsContract; @@ -35,13 +36,15 @@ contract LilypadController is ILilypadController, Ownable, Initializable { address _usersAddress, address _paymentsAddress, address _mediationAddress, - address _jobCreatorAddress + address _jobCreatorAddress, + address _powAddress ) public initializer { setStorageAddress(_storageAddress); setUsersAddress(_usersAddress); setPaymentsAddress(_paymentsAddress); setMediationAddress(_mediationAddress); setJobCreatorAddress(_jobCreatorAddress); + setPowAddress(_powAddress); } function setStorageAddress(address _storageAddress) public onlyOwner { @@ -92,6 +95,16 @@ contract LilypadController is ILilypadController, Ownable, Initializable { return jobCreatorAddress; } + function setPowAddress(address _powAddress) public onlyOwner { + require(_powAddress != address(0), "Users address"); + powAddress = _powAddress; + } + + function getPowAddress() public view returns(address) { + return powAddress; + } + + /** * Agreements */ diff --git a/hardhat/contracts/LilypadPow.sol b/hardhat/contracts/LilypadPow.sol new file mode 100644 index 00000000..4a53c0c7 --- /dev/null +++ b/hardhat/contracts/LilypadPow.sol @@ -0,0 +1,149 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.6; + +import "@openzeppelin/contracts/access/Ownable.sol"; +import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; + +contract LilypadPow is Ownable, Initializable { + struct POWSubmission { + address walletAddress; + string nodeId; + uint256 nonce; + uint256 start_timestap; + uint256 complete_timestap; //used to estimate hashrate of this submission + bytes32 challenge; //record this to provent user never change challenge + uint256 difficulty; + } + + struct Challenge { + bytes32 challenge; + uint256 difficulty; + string nodeId; + uint256 timestamp; + } + + uint256 public immutable TARGET_DIFFICULTY = + 2221842798488549893930113429797694032668256326301844165995655665287168; + mapping(address => POWSubmission[]) public powSubmissions; + mapping(address => uint256) public minerSubmissionCount; //used for loop powsubmission + address[] public miners; + + mapping(address => Challenge) public lastChallenges; + uint256 public validProofs; + uint256 public startTime; + + uint256 public window_start; + uint256 public window_end; + /** + * Init + */ + + // https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable + function initialize() public initializer {} + + function getMiners() external view returns (address[] memory) { + return miners; + } + + // generateChallenge gen a byte32 value as challenge value, Sc store this one for verify + function generateChallenge(string calldata nodeId) external { + checkTimeWindow(); + + bytes32 challenge = keccak256( + abi.encodePacked(block.timestamp, window_start, msg.sender, nodeId) + ); + + uint256 difficulty = calculate_difficulty(); + lastChallenges[msg.sender] = Challenge( + challenge, + difficulty, + nodeId, + block.timestamp + ); + emit GenerateChallenge(challenge, difficulty); + } + + function calculate_difficulty() public view returns (uint256) { + uint256 percentChange = 90 + (block.prevrandao % 21); + return (TARGET_DIFFICULTY * percentChange) / 100; + } + + // submitWork miner submint a nonce value, sc check the difficulty and emit a valid pow event when success + function submitWork(uint256 nonce, string calldata nodeId) external { + checkTimeWindow(); + + Challenge memory lastChallenge = lastChallenges[msg.sender]; + bytes32 challenge = keccak256( + abi.encodePacked( + lastChallenge.timestamp, + window_start, + msg.sender, + nodeId + ) + ); + + require( + lastChallenge.challenge == challenge, + "Work submit not compatable with challenge" + ); + + bytes32 hash = keccak256(abi.encodePacked(challenge, nonce)); + require( + uint256(hash) < lastChallenge.difficulty, + "Work does not meet difficulty target" + ); + + validProofs++; + + if (minerSubmissionCount[msg.sender] == 0) { + //first submit, append to miners + miners.push(msg.sender); + } + + minerSubmissionCount[msg.sender]++; //increase miner's valid proofs + POWSubmission[] storage posSubmissions = powSubmissions[msg.sender]; + posSubmissions.push( + POWSubmission( + msg.sender, + nodeId, + nonce, + lastChallenge.timestamp, + block.timestamp, + lastChallenge.challenge, + lastChallenge.difficulty + ) + ); + + //clean last challenge to submit the same proof + lastChallenges[msg.sender] = Challenge(0, 0, "", 0); + emit ValidPOWSubmitted( + msg.sender, + nodeId, + nonce, + block.timestamp, + lastChallenge.challenge, + lastChallenge.difficulty + ); + } + + function triggerNewPowRound() external onlyOwner { + window_start = block.number; + window_end = block.number + 30; //todo arbitary value , need to discuss + emit NewPowRound(); + } + + function checkTimeWindow() public view { + require(block.number < window_end, "proof windows has closed"); + } + + event ValidPOWSubmitted( + address indexed walletAddress, + string nodeId, + uint256 nonce, + uint256 timestamp, + bytes32 challenge, + uint256 difficulty + ); + event GenerateChallenge(bytes32 challenge, uint256 difficulty); + event NewPowRound(); +} diff --git a/hardhat/deploy/007_deploy_pow.ts b/hardhat/deploy/007_deploy_pow.ts new file mode 100644 index 00000000..7203e458 --- /dev/null +++ b/hardhat/deploy/007_deploy_pow.ts @@ -0,0 +1,28 @@ +import { HardhatRuntimeEnvironment } from 'hardhat/types' +import { DeployFunction } from 'hardhat-deploy/types' + +const deployUsers: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { deployments, getNamedAccounts } = hre + const { deploy, execute } = deployments + const { + admin, + } = await getNamedAccounts() + await deploy("LilypadPow", { + from: admin, + args: [], + log: true, + }) + await execute( + 'LilypadPow', + { + from: admin, + log: true, + }, + 'initialize' + ) + return true +} + +deployUsers.id = 'deployPow' + +export default deployUsers diff --git a/hardhat/deploy/007_deploy_controller.ts b/hardhat/deploy/008_deploy_controller.ts similarity index 93% rename from hardhat/deploy/007_deploy_controller.ts rename to hardhat/deploy/008_deploy_controller.ts index 1849f0b1..e3d2c2b2 100644 --- a/hardhat/deploy/007_deploy_controller.ts +++ b/hardhat/deploy/008_deploy_controller.ts @@ -19,6 +19,7 @@ const deployController: DeployFunction = async function (hre: HardhatRuntimeEnvi const mediationContract = await deployments.get('LilypadMediationRandom') const paymentsContract = await deployments.get('LilypadPayments') const jobCreatorContract = await deployments.get('LilypadOnChainJobCreator') + const powContract = await deployments.get('LilypadPow') await execute( 'LilypadController', @@ -31,7 +32,8 @@ const deployController: DeployFunction = async function (hre: HardhatRuntimeEnvi usersContract.address, paymentsContract.address, mediationContract.address, - jobCreatorContract.address + jobCreatorContract.address, + powContract.address ) await execute( diff --git a/hardhat/scripts/print-contract-env.ts b/hardhat/scripts/print-contract-env.ts index 165f966f..66c6550a 100644 --- a/hardhat/scripts/print-contract-env.ts +++ b/hardhat/scripts/print-contract-env.ts @@ -5,7 +5,8 @@ import { getJobManagerAddress, getPaymentsAddress, getStorageAddress, - getUsersAddress + getUsersAddress, + getPoWAddress } from '../utils/web3' async function main() { @@ -16,7 +17,8 @@ async function main() { const paymentsAddress = await getPaymentsAddress() const storageAddress = await getStorageAddress() const usersAddress = await getUsersAddress() - + const powAddress = await getPoWAddress() + console.log(`export WEB3_RPC_URL=ws://localhost:8546`) console.log(`export WEB3_CONTROLLER_ADDRESS=${controllerAddress}`) console.log(`export WEB3_TOKEN_ADDRESS=${tokenAddress}`) @@ -25,6 +27,7 @@ async function main() { console.log(`export WEB3_PAYMENTS_ADDRESS=${paymentsAddress}`) console.log(`export WEB3_STORAGE_ADDRESS=${storageAddress}`) console.log(`export WEB3_USERS_ADDRESS=${usersAddress}`) + console.log(`export WEB3_POW_ADDRESS=${powAddress}`) } main().catch((error) => { diff --git a/hardhat/utils/web3.ts b/hardhat/utils/web3.ts index f10e8ecd..92f214f0 100644 --- a/hardhat/utils/web3.ts +++ b/hardhat/utils/web3.ts @@ -19,6 +19,7 @@ import { LilypadOnChainJobCreator, LilypadUsers, ExampleClient, + LilypadPow, } from '../typechain-types' /* @@ -247,3 +248,16 @@ export async function connectController() { export async function getControllerAddress() { return getContractAddress('LilypadController') } + +/* + + pow + +*/ +export async function connectPow() { + return connectContract('LilypadPow') +} + +export async function getPoWAddress() { + return getContractAddress('LilypadPow') +} diff --git a/pkg/executor/bacalhau/bacalhau.go b/pkg/executor/bacalhau/bacalhau.go index 77811f51..b11f2694 100644 --- a/pkg/executor/bacalhau/bacalhau.go +++ b/pkg/executor/bacalhau/bacalhau.go @@ -38,6 +38,30 @@ func NewBacalhauExecutor(options BacalhauExecutorOptions) (*BacalhauExecutor, er }, nil } +func (executor *BacalhauExecutor) Id() (string, error) { + nodeIdCmd := exec.Command( + "bacalhau", + "id", + ) + nodeIdCmd.Env = executor.bacalhauEnv + + output, err := nodeIdCmd.CombinedOutput() + if err != nil { + return "", fmt.Errorf("error calling get id results %s", err.Error()) + } + + var idResult struct { + ID string + ClientID string + } + err = json.Unmarshal(output, &idResult) + if err != nil { + return "", fmt.Errorf("error unmarshalling job JSON %s", err.Error()) + } + + return idResult.ID, nil +} + func (executor *BacalhauExecutor) RunJob( deal data.DealContainer, module data.Module, diff --git a/pkg/executor/noop/noop.go b/pkg/executor/noop/noop.go index 3b9d0b93..63a5af19 100644 --- a/pkg/executor/noop/noop.go +++ b/pkg/executor/noop/noop.go @@ -4,6 +4,7 @@ import ( "fmt" "path/filepath" + "github.com/google/uuid" "github.com/lilypad-tech/lilypad/pkg/data" executorlib "github.com/lilypad-tech/lilypad/pkg/executor" "github.com/lilypad-tech/lilypad/pkg/system" @@ -12,6 +13,7 @@ import ( const RESULTS_DIR = "noop-results" type NoopExecutorOptions struct { + Id string BadActor bool ResultsCID string Stdout string @@ -26,6 +28,7 @@ type NoopExecutor struct { func NewNoopExecutorOptions() NoopExecutorOptions { return NoopExecutorOptions{ + Id: uuid.NewString(), BadActor: false, ResultsCID: "123", Stdout: "Hello World!", @@ -41,6 +44,10 @@ func NewNoopExecutor(options NoopExecutorOptions) (*NoopExecutor, error) { }, nil } +func (executor *NoopExecutor) Id() (string, error) { + return executor.Options.Id, nil +} + func (executor *NoopExecutor) RunJob( deal data.DealContainer, module data.Module, diff --git a/pkg/executor/types.go b/pkg/executor/types.go index 2c45d561..80add949 100644 --- a/pkg/executor/types.go +++ b/pkg/executor/types.go @@ -11,6 +11,7 @@ type ExecutorResults struct { } type Executor interface { + Id() (string, error) // run the given job and return a local folder // that contains the results RunJob( diff --git a/pkg/options/pow_signal.go b/pkg/options/pow_signal.go new file mode 100644 index 00000000..4095f7bf --- /dev/null +++ b/pkg/options/pow_signal.go @@ -0,0 +1,25 @@ +package options + +import ( + "github.com/lilypad-tech/lilypad/pkg/resourceprovider/powsignal" +) + +func NewPowSignalOptions() powsignal.PowSignalOptions { + options := powsignal.PowSignalOptions{ + Web3: GetDefaultWeb3Options(), + } + return options +} + +func ProcessPowSignalrOptions(options powsignal.PowSignalOptions, network string) (powsignal.PowSignalOptions, error) { + newWeb3Options, err := ProcessWeb3Options(options.Web3, network) + if err != nil { + return options, err + } + options.Web3 = newWeb3Options + return options, CheckPowSignalOptions(options) +} + +func CheckPowSignalOptions(options powsignal.PowSignalOptions) error { + return CheckWeb3Options(options.Web3) +} diff --git a/pkg/options/resource-provider.go b/pkg/options/resource-provider.go index d82d091f..a1a28e30 100644 --- a/pkg/options/resource-provider.go +++ b/pkg/options/resource-provider.go @@ -5,6 +5,7 @@ import ( "github.com/lilypad-tech/lilypad/pkg/data" "github.com/lilypad-tech/lilypad/pkg/resourceprovider" + "github.com/lilypad-tech/lilypad/pkg/resourceprovider/powsignal" "github.com/lilypad-tech/lilypad/pkg/system" "github.com/spf13/cobra" ) @@ -14,11 +15,18 @@ func NewResourceProviderOptions() resourceprovider.ResourceProviderOptions { Bacalhau: GetDefaultBacalhauOptions(), Offers: GetDefaultResourceProviderOfferOptions(), Web3: GetDefaultWeb3Options(), + Pow: GetDefaultResourceProviderPowOptions(), } options.Web3.Service = system.ResourceProviderService return options } +func GetDefaultResourceProviderPowOptions() resourceprovider.ResourceProviderPowOptions { + return resourceprovider.ResourceProviderPowOptions{ + EnablePow: GetDefaultServeOptionBool("ENABLE_POW", false), + } +} + func GetDefaultResourceProviderOfferOptions() resourceprovider.ResourceProviderOfferOptions { return resourceprovider.ResourceProviderOfferOptions{ // by default let's offer 1 CPU, 0 GPU and 1GB RAM @@ -72,10 +80,22 @@ func AddResourceProviderOfferCliFlags(cmd *cobra.Command, offerOptions *resource AddServicesCliFlags(cmd, &offerOptions.Services) } +func AddResourceProviderPowCliFlags(cmd *cobra.Command, options *resourceprovider.ResourceProviderPowOptions) { + cmd.PersistentFlags().BoolVar( + &options.EnablePow, "enable-pow", options.EnablePow, + `Start pow mining (ENABLE_POW)`, + ) +} + func AddResourceProviderCliFlags(cmd *cobra.Command, options *resourceprovider.ResourceProviderOptions) { AddBacalhauCliFlags(cmd, &options.Bacalhau) AddWeb3CliFlags(cmd, &options.Web3) AddResourceProviderOfferCliFlags(cmd, &options.Offers) + AddResourceProviderPowCliFlags(cmd, &options.Pow) +} + +func AddPowSignalCliFlags(cmd *cobra.Command, options *powsignal.PowSignalOptions) { + AddWeb3CliFlags(cmd, &options.Web3) } func CheckResourceProviderOfferOptions(options resourceprovider.ResourceProviderOfferOptions) error { diff --git a/pkg/options/utils.go b/pkg/options/utils.go index 60584e8b..27f1a6d3 100644 --- a/pkg/options/utils.go +++ b/pkg/options/utils.go @@ -45,3 +45,14 @@ func GetDefaultServeOptionInt(envName string, defaultValue int) int { } return defaultValue } + +func GetDefaultServeOptionBool(envName string, defaultValue bool) bool { + envValue := os.Getenv(envName) + if envValue != "" { + i, err := strconv.ParseBool(envValue) + if err == nil { + return i + } + } + return defaultValue +} diff --git a/pkg/options/web3.go b/pkg/options/web3.go index 78d38048..eb79f94a 100644 --- a/pkg/options/web3.go +++ b/pkg/options/web3.go @@ -25,6 +25,7 @@ func GetDefaultWeb3Options() web3.Web3Options { TokenAddress: GetDefaultServeOptionString("WEB3_TOKEN_ADDRESS", ""), MediationAddress: GetDefaultServeOptionString("WEB3_MEDIATION_ADDRESS", ""), JobCreatorAddress: GetDefaultServeOptionString("WEB3_JOBCREATOR_ADDRESS", ""), + PowAddress: GetDefaultServeOptionString("WEB3_POW_ADDRESS", ""), // misc Service: system.DefaultService, @@ -67,6 +68,10 @@ func AddWeb3CliFlags(cmd *cobra.Command, web3Options *web3.Web3Options) { &web3Options.TokenAddress, "web3-token-address", web3Options.TokenAddress, `The address of the token contract (WEB3_TOKEN_ADDRESS).`, ) + cmd.PersistentFlags().StringVar( + &web3Options.PowAddress, "web3-pow-address", web3Options.PowAddress, + `The address of the pow contract (WEB3_POW_ADDRESS).`, + ) } func CheckWeb3Options(options web3.Web3Options) error { diff --git a/pkg/resourceprovider/cpuminer.go b/pkg/resourceprovider/cpuminer.go new file mode 100644 index 00000000..e55c1425 --- /dev/null +++ b/pkg/resourceprovider/cpuminer.go @@ -0,0 +1,149 @@ +package resourceprovider + +import ( + "context" + "math/big" + "time" + + "github.com/google/uuid" + lru "github.com/hashicorp/golang-lru/v2" + "github.com/holiman/uint256" + "github.com/rs/zerolog/log" +) + +const ( + // hpsUpdateSecs is the number of seconds to wait in between each + // update to the hashes per second monitor. + hpsUpdateSecs = 10 + + // hashUpdateSec is the number of seconds each worker waits in between + // notifying the speed monitor with how many hashes have been completed + // while they are actively searching for a solution. This is done to + // reduce the amount of syncs between the workers that must be done to + // keep track of the hashes per second. + hashUpdateSecs = 15 +) + +type SubmitWork func(nonce *big.Int) + +type CPUMiner struct { + submit SubmitWork + + runningWorkers []*Worker + + numWorkers int + + task chan Task + + updateHashes chan uint64 +} + +func NewCpuMiner(nodeId string, numWorkers int, task chan Task, submit SubmitWork) *CPUMiner { + return &CPUMiner{ + numWorkers: numWorkers, + task: task, + updateHashes: make(chan uint64), + submit: submit, + } +} + +func (m *CPUMiner) Start(ctx context.Context) { + go m.miningWorkerController(ctx) + go m.speedMonitor(ctx) +} + +// speedMonitor handles tracking the number of hashes per second the mining +// process is performing. It must be run as a goroutine. +func (m *CPUMiner) speedMonitor(ctx context.Context) { + log.Debug().Msg("CPU miner speed monitor started") + var hashesPerSec float64 + var totalHashes uint64 + ticker := time.NewTicker(time.Second * hpsUpdateSecs) + defer ticker.Stop() + +out: + for { + select { + // Periodic updates from the workers with how many hashes they + // have performed. + case numHashes := <-m.updateHashes: + totalHashes += numHashes + + // Time to update the hashes per second. + case <-ticker.C: + curHashesPerSec := float64(totalHashes) / hpsUpdateSecs + if hashesPerSec == 0 { + hashesPerSec = curHashesPerSec + } + hashesPerSec = (hashesPerSec + curHashesPerSec) / 2 + if totalHashes != 0 && hashesPerSec != 0 { + log.Info().Msgf("Hash speed: %6.0f kilohashes/s", + hashesPerSec/1000) + } + totalHashes = 0 + case <-ctx.Done(): + break out + } + } + + log.Debug().Msgf("CPU miner speed monitor done") +} + +func (m *CPUMiner) miningWorkerController(ctx context.Context) { + resultCh := make(chan TaskResult) + launchWorkers := func(numWorkers int) { + for i := 0; i < numWorkers; i++ { + w := NewWorker(i, m.updateHashes, resultCh) + m.runningWorkers = append(m.runningWorkers, w) + } + } + + maxUint256 := new(uint256.Int).Sub(uint256.NewInt(0), uint256.NewInt(1)) + noncePerWorker := new(uint256.Int).Div(maxUint256, uint256.NewInt(uint64(m.numWorkers))) + + // Launch the current number of workers by default. + launchWorkers(m.numWorkers) + + stopWrokers := func() { + for _, w := range m.runningWorkers { + w.Stop() + } + } + + spawNewWork := func(allTask *Task) { + for i, w := range m.runningWorkers { + w.Stop() + from := new(uint256.Int).Mul(noncePerWorker, uint256.NewInt(uint64(i))) + end := new(uint256.Int).Mul(noncePerWorker, uint256.NewInt(uint64(i+1))) + go w.Solve(ctx, &Task{ + Id: allTask.Id, + Challenge: allTask.Challenge, + Difficulty: allTask.Difficulty, + From: from, + End: end, + }) + } + } + + cache, _ := lru.New[uuid.UUID, *uint256.Int](2048) //prevent submint multiple times, consider power multiple cpu, use a little bigger value +out: + for { + select { + case <-ctx.Done(): + stopWrokers() + break out + case result := <-resultCh: + _, ok := cache.Get(result.Id) + if ok { + log.Warn().Msg("This work has been submit before") + continue + } + m.submit(result.Nonce.ToBig()) + stopWrokers() + cache.Add(result.Id, new(uint256.Int)) + case allTask := <-m.task: + stopWrokers() + spawNewWork(&allTask) + } + } +} diff --git a/pkg/resourceprovider/powsignal/powsignal.go b/pkg/resourceprovider/powsignal/powsignal.go new file mode 100644 index 00000000..403f44ed --- /dev/null +++ b/pkg/resourceprovider/powsignal/powsignal.go @@ -0,0 +1,86 @@ +package powsignal + +import ( + "context" + "fmt" + "math/big" + + "github.com/ethereum/go-ethereum/common" + "github.com/lilypad-tech/lilypad/pkg/web3" + "github.com/lilypad-tech/lilypad/pkg/web3/bindings/pow" +) + +type PowSignalOptions struct { + Web3 web3.Web3Options +} + +type ResourceProvider struct { + web3SDK *web3.Web3SDK + options PowSignalOptions +} + +func SendPowSignal(ctx context.Context, web3SDK *web3.Web3SDK, options PowSignalOptions) (*pow.PowNewPowRound, error) { + tx, err := web3SDK.Contracts.Pow.TriggerNewPowRound(web3SDK.TransactOpts) + if err != nil { + return nil, err + } + + receipt, err := web3SDK.WaitTx(ctx, tx) + if err != nil { + return nil, fmt.Errorf("wait new pow siganl tx(%s) %w", tx.Hash(), err) + } + + if receipt.Status == 0 { + return nil, fmt.Errorf("send new pow signal successfully but execute fail status(%d) tx(%s)", receipt.Status, tx.Hash()) + } + + newPowRoundEvent, err := web3SDK.Contracts.Pow.ParseNewPowRound(*receipt.Logs[0]) + if err != nil { + return nil, fmt.Errorf("parse new pow round event fail tx(%s) %w", tx.Hash(), err) + } + return newPowRoundEvent, nil +} + +type PowValidPOWSubmission struct { + WalletAddress common.Address + NodeId string + Nonce *big.Int + StartTimestap *big.Int + CompleteTimestap *big.Int + Challenge [32]byte + Difficulty *big.Int +} + +func GetPowSubmission(ctx context.Context, web3SDK *web3.Web3SDK) (map[common.Address][]PowValidPOWSubmission, error) { + miners, err := web3SDK.Contracts.Pow.GetMiners(web3SDK.CallOpts) + if err != nil { + return nil, err + } + + results := make(map[common.Address][]PowValidPOWSubmission) + for _, minerAddr := range miners { + validProofCount, err := web3SDK.Contracts.Pow.MinerSubmissionCount(web3SDK.CallOpts, minerAddr) + if err != nil { + return nil, err + } + + var powSubmissions []PowValidPOWSubmission + for i := uint64(0); i < validProofCount.Uint64(); i++ { //enough large + submission, err := web3SDK.Contracts.Pow.PowSubmissions(web3SDK.CallOpts, minerAddr, new(big.Int).SetUint64(i)) + if err != nil { + return nil, err + } + powSubmissions = append(powSubmissions, PowValidPOWSubmission{ + WalletAddress: submission.WalletAddress, + NodeId: submission.NodeId, + Nonce: submission.Nonce, + StartTimestap: submission.StartTimestap, + CompleteTimestap: submission.CompleteTimestap, + Challenge: submission.Challenge, + Difficulty: submission.Difficulty, + }) + } + results[minerAddr] = powSubmissions + } + return results, nil +} diff --git a/pkg/resourceprovider/resourceprovider.go b/pkg/resourceprovider/resourceprovider.go index ce583217..1b25d049 100644 --- a/pkg/resourceprovider/resourceprovider.go +++ b/pkg/resourceprovider/resourceprovider.go @@ -2,12 +2,19 @@ package resourceprovider import ( "context" + "encoding/hex" + "math/big" + "runtime" + "github.com/google/uuid" + "github.com/holiman/uint256" "github.com/lilypad-tech/lilypad/pkg/data" "github.com/lilypad-tech/lilypad/pkg/executor" "github.com/lilypad-tech/lilypad/pkg/executor/bacalhau" "github.com/lilypad-tech/lilypad/pkg/system" "github.com/lilypad-tech/lilypad/pkg/web3" + "github.com/lilypad-tech/lilypad/pkg/web3/bindings/pow" + "github.com/rs/zerolog/log" ) // this configures the resource offers we will keep track of @@ -43,10 +50,16 @@ type ResourceProviderOfferOptions struct { Services data.ServiceConfig } +// this configures the pow we will keep track of +type ResourceProviderPowOptions struct { + EnablePow bool +} + type ResourceProviderOptions struct { Bacalhau bacalhau.BacalhauExecutorOptions Offers ResourceProviderOfferOptions Web3 web3.Web3Options + Pow ResourceProviderPowOptions } type ResourceProvider struct { @@ -73,5 +86,55 @@ func NewResourceProvider( } func (resourceProvider *ResourceProvider) Start(ctx context.Context, cm *system.CleanupManager) chan error { + if resourceProvider.options.Pow.EnablePow { + go resourceProvider.StartMineLoop(ctx) + } return resourceProvider.controller.Start(ctx, cm) } + +func (resourceProvider *ResourceProvider) StartMineLoop(ctx context.Context) error { + walletAddress := resourceProvider.web3SDK.GetAddress() + nodeId, err := resourceProvider.controller.executor.Id() + if err != nil { + return err + } + log.Info().Msgf("Wallet %s node id %s is ready for mine", walletAddress, nodeId) + + taskCh := make(chan Task) + resourceProvider.controller.web3Events.Pow.SubscribenewPowRound(func(newPowRound pow.PowNewPowRound) { + _, challenge, err := resourceProvider.web3SDK.GetGenerateChallenge(ctx, nodeId) + if err != nil { + log.Err(err).Msgf("Unable to fetch challenge") + return + } + + log.Info().Msgf("Receive a new pow signal challenge hex %s, difficulty %s", "0x"+hex.EncodeToString(challenge.Challenge[:]), challenge.Difficulty.String()) + + difficulty, _ := uint256.FromBig(challenge.Difficulty) + taskCh <- Task{ + Id: uuid.New(), + Challenge: challenge.Challenge, + Difficulty: difficulty, + } + }) + + numWorkers := runtime.NumCPU() * 2 + log.Info().Msgf("Listen to new pow round signal, %d workers read to work", numWorkers) + + submitWork := func(nonce *big.Int) { + txId, submission, err := resourceProvider.web3SDK.SubmitWork(ctx, nonce, nodeId) + if err != nil { + log.Err(err).Msgf("Submit work fail") + return + } + log.Info().Str("address", submission.WalletAddress.String()). + Str("nodeid", submission.NodeId). + Str("Nonce", submission.Nonce.String()). + Str("txid", txId.String()). + Msgf("Mine and submit successfully") + } + + miner := NewCpuMiner(nodeId, numWorkers, taskCh, submitWork) + go miner.Start(ctx) + return nil +} diff --git a/pkg/resourceprovider/worker.go b/pkg/resourceprovider/worker.go new file mode 100644 index 00000000..04770759 --- /dev/null +++ b/pkg/resourceprovider/worker.go @@ -0,0 +1,174 @@ +package resourceprovider + +import ( + "context" + "fmt" + "math/big" + "sync/atomic" + "time" + + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + "github.com/google/uuid" + "github.com/holiman/uint256" + "github.com/lilypad-tech/lilypad/pkg/web3" + "github.com/rs/zerolog/log" +) + +var ( + bigOne = uint256.NewInt(1) +) + +type Task struct { + Id uuid.UUID + Challenge [32]byte + Difficulty *uint256.Int + From *uint256.Int + End *uint256.Int +} + +type TaskResult struct { + Id uuid.UUID + Nonce *uint256.Int +} + +type Worker struct { + id int + state atomic.Int32 + + updateHashes chan uint64 + + resultCh chan TaskResult + quit chan chan struct{} +} + +func NewWorker(id int, updateHashes chan uint64, resultCh chan TaskResult) *Worker { + return &Worker{ + id: id, + updateHashes: updateHashes, + resultCh: resultCh, + quit: make(chan chan struct{}, 1), + } +} +func (w *Worker) Stop() { + if w.state.Load() == 0 { + return + } + + //cancel previous task + waitChan := make(chan struct{}) + select { + case w.quit <- waitChan: // may already exit + <-waitChan + default: + } +} + +func (w *Worker) Solve(ctx context.Context, task *Task) { + w.state.Store(1) + defer w.state.Store(0) + + nonce := task.From.Clone() + startTime := time.Now() + + hashesCompleted := uint64(0) + ticker := time.NewTicker(time.Second * hashUpdateSecs) + defer ticker.Stop() + +OUT: + for { + select { + case <-ctx.Done(): + break OUT + case respCh := <-w.quit: + respCh <- struct{}{} + return + case <-ticker.C: + w.updateHashes <- hashesCompleted + hashesCompleted = 0 + default: + // Non-blocking select to fall through + } + + if nonce.Cmp(task.End) >= 0 { + return + } + hashNumber, err := calculateHashNumber(task.Challenge, nonce.ToBig()) + if err != nil { + log.Err(err).Msg("Calculate hash number") + return + } + hashesCompleted += 1 + + // Check if the hash is below the target difficulty + if hashNumber.Cmp(task.Difficulty) == -1 { + log.Info().Str("Elapsed Time", time.Since(startTime).String()). + Str("challenge", new(big.Int).SetBytes(task.Challenge[:]).String()). + Str("Nonce", nonce.String()). + Str("HashNumber", hashNumber.String()). + Msg("Success!") + w.resultCh <- TaskResult{ + Id: task.Id, + Nonce: nonce.Clone(), + } + } + + nonce.Add(nonce, bigOne) + } +} + +func calculateHashNumber(challenge [32]byte, nonce *big.Int) (*uint256.Int, error) { + data, err := formatMinerArgs(challenge, nonce) + if err != nil { + return nil, err + } + + // Calculate Keccak-256 hash + hashResult := crypto.Keccak256(data) + + return new(uint256.Int).SetBytes(hashResult), nil +} + +func formatMinerArgs(challenge [32]byte, nonce *big.Int) ([]byte, error) { + //todo use nonce in replace instead of building from scratch for better performance + // keccak256(abi.encodePacked(lastChallenge, msg.sender, nodeId)); + bytes32Ty, _ := abi.NewType("bytes32", "", nil) + uint256Ty, _ := abi.NewType("uint256", "", nil) + + arguments := abi.Arguments{ + { + Type: bytes32Ty, + }, + { + Type: uint256Ty, + }, + } + + bytes, err := arguments.Pack( + challenge, + nonce, + ) + if err != nil { + return nil, err + } + + return bytes, nil +} + +func TriggerNewPowRound(ctx context.Context, web3SDK *web3.Web3SDK) (common.Hash, error) { + tx, err := web3SDK.Contracts.Pow.TriggerNewPowRound(web3SDK.TransactOpts) + if err != nil { + return common.Hash{}, err + } + + receipt, err := web3SDK.WaitTx(ctx, tx) + if err != nil { + return common.Hash{}, err + } + + if receipt.Status != 1 { + return tx.Hash(), fmt.Errorf("trigger new pow round") + } + return tx.Hash(), nil +} diff --git a/pkg/resourceprovider/worker_test.go b/pkg/resourceprovider/worker_test.go new file mode 100644 index 00000000..5589fb3f --- /dev/null +++ b/pkg/resourceprovider/worker_test.go @@ -0,0 +1,66 @@ +package resourceprovider + +import ( + "encoding/hex" + "math/big" + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_calculateHashNumber(t *testing.T) { + + tests := []struct { + challenge string + nonce string + result string + }{ + { + challenge: "fee0189632650f971536773d9a1b206be28e51d05ba0cb69822a510c51fb6fd3", + nonce: "72370055773322622139731865630429942408293740416025352524660990004945723953319", + result: "443192418834346142200278491975317489603423531200023451519802250835435", + }, + { + challenge: "2e4ca2481a7be8a4eb273f51f6a0c2fdd087b6b8c454f8b01ef0a3363a2af5b1", + nonce: "43422033463993573283839119378257965444976244249615211514796594002967424872419", + result: "966523245404442851743534066101454470539015745906990078402535205323382", + }, + { + challenge: "cdcb7ff1ccb65cdd1661b2a6b5fa1ffdacf19a54a27f4952cb6644886067f17c", + nonce: "43422033463993573283839119378257965444976244249615211514796594002967433208574", + result: "1225814827806205369719164951622401381020286900751508648540622349987995", + }, + { + challenge: "41d8a811d0fac25ae964f2a66b72a75ef56e380193b4b9315c95e9f376b3520c", + nonce: "14474011154664524427946373126085988481658748083205070504932198000989144913512", + result: "1245769273639839946721104142883832711130622692430288604267098849208328", + }, + { + challenge: "c80b5f6fa9238340755ab73bc582fbfa7f2c0bac7ba0c9a6b3a5aa3deac654b7", + nonce: "86844066927987146567678238756515930889952488499230423029593188005934847872312", + result: "1238685072653949948997777229152894470424591172536960512507902649468771", + }, + { + challenge: "11a6a01d551d3b67ff379de86cc8925d7263699e1ef1d8d354d8cce4afbc5a8e", + nonce: "43422033463993573283839119378257965444976244249615211514796594002967425219662", + result: "307594137868831890037396147605669724284685912141686536312861196068997", + }, + { + challenge: "b6967add4ca8b402608442711c099f600fc28b76ab52f9ba8893227609b398a7", + nonce: "72370055773322622139731865630429942408293740416025352524660990004945710021932", + result: "943810406337730927560330742607005762315190954137845505028145584660526", + }, + } + for _, tt := range tests { + + challenge := [32]byte{} + _, err := hex.Decode(challenge[:], []byte(tt.challenge)) + assert.Nil(t, err) + + nonce, ok := new(big.Int).SetString(tt.nonce, 10) + assert.True(t, ok) + got, err := calculateHashNumber(challenge, nonce) + assert.Nil(t, err) + assert.Equal(t, tt.result, got.String()) + } +} diff --git a/pkg/web3/api.go b/pkg/web3/api.go index 502ca034..ae695378 100644 --- a/pkg/web3/api.go +++ b/pkg/web3/api.go @@ -5,10 +5,11 @@ import ( "fmt" "math/big" + "github.com/ethereum/go-ethereum/common" "github.com/lilypad-tech/lilypad/pkg/data" "github.com/lilypad-tech/lilypad/pkg/system" + "github.com/lilypad-tech/lilypad/pkg/web3/bindings/pow" "github.com/lilypad-tech/lilypad/pkg/web3/bindings/users" - "github.com/ethereum/go-ethereum/common" "github.com/rs/zerolog/log" ) @@ -238,3 +239,61 @@ func (sdk *Web3SDK) MediationRejectResult( } return tx.Hash().String(), nil } + +func (sdk *Web3SDK) GetGenerateChallenge( + ctx context.Context, + nodeId string, +) (string, *pow.PowGenerateChallenge, error) { + tx, err := sdk.Contracts.Pow.GenerateChallenge( + sdk.TransactOpts, + nodeId, + ) + if err != nil { + system.Error(sdk.Options.Service, "error submitting pow.GenerateChallenge", err) + return "", nil, err + } else { + system.Debug(sdk.Options.Service, "submitted pow.GenerateChallenge", tx.Hash().String()) + system.DumpObjectDebug(tx) + } + receipt, err := sdk.WaitTx(context.Background(), tx) + if err != nil { + return "", nil, err + } + + if receipt.Status == 0 { + return tx.Hash().String(), nil, fmt.Errorf("execute challenge fail") + } + + challenge, err := sdk.Contracts.Pow.ParseGenerateChallenge(*receipt.Logs[0]) + if err != nil { + return "", nil, err + } + return tx.Hash().String(), challenge, nil +} + +func (sdk *Web3SDK) SubmitWork( + ctx context.Context, + nonce *big.Int, + nodeId string, +) (common.Hash, *pow.PowValidPOWSubmitted, error) { + tx, err := sdk.Contracts.Pow.SubmitWork(sdk.TransactOpts, nonce, nodeId) + if err != nil { + return common.Hash{}, nil, err + } + + receipt, err := sdk.WaitTx(ctx, tx) + if err != nil { + return common.Hash{}, nil, err + } + + if receipt.Status == 0 { + return tx.Hash(), nil, fmt.Errorf("excute transaction fail") + } + + validPosSubmission, err := sdk.Contracts.Pow.ParseValidPOWSubmitted(*receipt.Logs[0]) // todo need to check this result + if err != nil { + return common.Hash{}, nil, err + } + + return tx.Hash(), validPosSubmission, nil +} diff --git a/pkg/web3/bindings/controller/controller.go b/pkg/web3/bindings/controller/controller.go index f3c4080d..374cb35b 100644 --- a/pkg/web3/bindings/controller/controller.go +++ b/pkg/web3/bindings/controller/controller.go @@ -79,8 +79,8 @@ type SharedStructsDealTimeouts struct { // ControllerMetaData contains all meta data concerning the Controller contract. var ControllerMetaData = &bind.MetaData{ - ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"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\":[{\"internalType\":\"string\",\"name\":\"dealId\",\"type\":\"string\"}],\"name\":\"acceptResult\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"dealId\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"resultsId\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"dataId\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"instructionCount\",\"type\":\"uint256\"}],\"name\":\"addResult\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"dealId\",\"type\":\"string\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"solver\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"jobCreator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"resourceProvider\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"mediators\",\"type\":\"address[]\"}],\"internalType\":\"structSharedStructs.DealMembers\",\"name\":\"members\",\"type\":\"tuple\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"timeout\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collateral\",\"type\":\"uint256\"}],\"internalType\":\"structSharedStructs.DealTimeout\",\"name\":\"agree\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"timeout\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collateral\",\"type\":\"uint256\"}],\"internalType\":\"structSharedStructs.DealTimeout\",\"name\":\"submitResults\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"timeout\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collateral\",\"type\":\"uint256\"}],\"internalType\":\"structSharedStructs.DealTimeout\",\"name\":\"judgeResults\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"timeout\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collateral\",\"type\":\"uint256\"}],\"internalType\":\"structSharedStructs.DealTimeout\",\"name\":\"mediateResults\",\"type\":\"tuple\"}],\"internalType\":\"structSharedStructs.DealTimeouts\",\"name\":\"timeouts\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"instructionPrice\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"paymentCollateral\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"resultsCollateralMultiple\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"mediationFee\",\"type\":\"uint256\"}],\"internalType\":\"structSharedStructs.DealPricing\",\"name\":\"pricing\",\"type\":\"tuple\"}],\"name\":\"agree\",\"outputs\":[{\"components\":[{\"internalType\":\"enumSharedStructs.AgreementState\",\"name\":\"state\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"resourceProviderAgreedAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"jobCreatorAgreedAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"dealCreatedAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"dealAgreedAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"resultsSubmittedAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"resultsAcceptedAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"resultsCheckedAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"mediationAcceptedAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"mediationRejectedAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"timeoutAgreeAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"timeoutSubmitResultsAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"timeoutJudgeResultsAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"timeoutMediateResultsAt\",\"type\":\"uint256\"}],\"internalType\":\"structSharedStructs.Agreement\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"dealId\",\"type\":\"string\"}],\"name\":\"checkResult\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getJobCreatorAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getMediationAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getPaymentsAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStorageAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getUsersAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_storageAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_usersAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_paymentsAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_mediationAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_jobCreatorAddress\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"dealId\",\"type\":\"string\"}],\"name\":\"mediationAcceptResult\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"dealId\",\"type\":\"string\"}],\"name\":\"mediationRejectResult\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_jobCreatorAddress\",\"type\":\"address\"}],\"name\":\"setJobCreatorAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_mediationAddress\",\"type\":\"address\"}],\"name\":\"setMediationAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_paymentsAddress\",\"type\":\"address\"}],\"name\":\"setPaymentsAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_storageAddress\",\"type\":\"address\"}],\"name\":\"setStorageAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_usersAddress\",\"type\":\"address\"}],\"name\":\"setUsersAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"dealId\",\"type\":\"string\"}],\"name\":\"timeoutAgree\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"dealId\",\"type\":\"string\"}],\"name\":\"timeoutJudgeResult\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"dealId\",\"type\":\"string\"}],\"name\":\"timeoutMediateResult\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"dealId\",\"type\":\"string\"}],\"name\":\"timeoutSubmitResult\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x608060405234801562000010575f80fd5b5062000031620000256200003760201b60201c565b6200003e60201b60201c565b620000ff565b5f33905090565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b615788806200010d5f395ff3fe608060405234801561000f575f80fd5b5060043610610156575f3560e01c8063795f9abf116100c1578063bbfff47d1161007a578063bbfff47d1461034a578063d48b108414610366578063e7b957d114610384578063e850be37146103a0578063f2fde38b146103bc578063f583b125146103d857610156565b8063795f9abf1461029e57806380ffdfe0146102ba578063824518aa146102d65780638da5cb5b146102f257806393dbed3e14610310578063b4031e541461032e57610156565b806343391cca1161011357806343391cca1461020857806346834d1e14610224578063511a9f681461024057806359b910d61461025c578063640e570f14610278578063715018a61461029457610156565b80630aca35ce1461015a5780631459457a14610178578063155329ea14610194578063297f9e55146101b2578063393a4d34146101ce5780633955548e146101ec575b5f80fd5b610162610408565b60405161016f91906137a3565b60405180910390f35b610192600480360381019061018d91906137f7565b610430565b005b61019c610597565b6040516101a991906137a3565b60405180910390f35b6101cc60048036038101906101c791906139aa565b6105bf565b005b6101d6610a2f565b6040516101e391906137a3565b60405180910390f35b61020660048036038101906102019190613a24565b610a57565b005b610222600480360381019061021d9190613adc565b610e33565b005b61023e600480360381019061023991906139aa565b610f2c565b005b61025a600480360381019061025591906139aa565b6112d9565b005b61027660048036038101906102719190613adc565b611692565b005b610292600480360381019061028d9190613adc565b6117ac565b005b61029c6118a5565b005b6102b860048036038101906102b391906139aa565b6118b8565b005b6102d460048036038101906102cf91906139aa565b611d61565b005b6102f060048036038101906102eb91906139aa565b6120b9565b005b6102fa6124b1565b60405161030791906137a3565b60405180910390f35b6103186124d8565b60405161032591906137a3565b60405180910390f35b61034860048036038101906103439190613adc565b612500565b005b610364600480360381019061035f9190613adc565b6125b9565b005b61036e612672565b60405161037b91906137a3565b60405180910390f35b61039e600480360381019061039991906139aa565b61269a565b005b6103ba60048036038101906103b591906139aa565b612b2d565b005b6103d660048036038101906103d19190613adc565b612f7c565b005b6103f260048036038101906103ed9190613d9c565b612ffe565b6040516103ff9190613fda565b60405180910390f35b5f60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b5f8060159054906101000a900460ff16159050808015610461575060015f60149054906101000a900460ff1660ff16105b8061048f5750610470306134a3565b15801561048e575060015f60149054906101000a900460ff1660ff16145b5b6104ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104c590614074565b60405180910390fd5b60015f60146101000a81548160ff021916908360ff160217905550801561050a5760015f60156101000a81548160ff0219169083151502179055505b61051386611692565b61051c856125b9565b610525846117ac565b61052e83610e33565b61053782612500565b801561058f575f8060156101000a81548160ff0219169083151502179055507f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498600160405161058691906140e0565b60405180910390a15b505050505050565b5f60045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b050e74b8260026040518363ffffffff1660e01b815260040161061c929190614172565b6020604051808303815f875af1158015610638573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061065c91906141d5565b61069b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106929061424a565b60405180910390fd5b5f60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e7079180836040518263ffffffff1660e01b81526004016106f69190614268565b5f604051808303815f875af1158015610711573d5f803e3d5ffd5b505050506040513d5f823e3d601f19601f82011682018060405250810190610739919061462b565b90503273ffffffffffffffffffffffffffffffffffffffff1681602001516020015173ffffffffffffffffffffffffffffffffffffffff16146107b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107a8906146bc565b60405180910390fd5b5f60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166373db5c6a846040518263ffffffff1660e01b815260040161080c9190614268565b6020604051808303815f875af1158015610828573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061084c91906146da565b90505f60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638224ce5f856040518263ffffffff1660e01b81526004016108a99190614268565b6020604051808303815f875af11580156108c5573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108e991906146da565b905060065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663297f9e55856040518263ffffffff1660e01b81526004016109459190614268565b5f604051808303815f87803b15801561095c575f80fd5b505af115801561096e573d5f803e3d5ffd5b5050505060075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b13567148585602001516040015186602001516020015186886060015160200151878a6040015160400151602001516040518863ffffffff1660e01b81526004016109fc9796959493929190614714565b5f604051808303815f87803b158015610a13575f80fd5b505af1158015610a25573d5f803e3d5ffd5b5050505050505050565b5f60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b050e74b8560016040518363ffffffff1660e01b8152600401610ab4929190614172565b6020604051808303815f875af1158015610ad0573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610af491906141d5565b610b33576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b2a906147d2565b60405180910390fd5b5f60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e7079180866040518263ffffffff1660e01b8152600401610b8e9190614268565b5f604051808303815f875af1158015610ba9573d5f803e3d5ffd5b505050506040513d5f823e3d601f19601f82011682018060405250810190610bd1919061462b565b90503273ffffffffffffffffffffffffffffffffffffffff1681602001516040015173ffffffffffffffffffffffffffffffffffffffff1614610c49576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c409061483a565b60405180910390fd5b60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633955548e868686866040518563ffffffff1660e01b8152600401610ca99493929190614858565b5f604051808303815f875af1158015610cc4573d5f803e3d5ffd5b505050506040513d5f823e3d601f19601f82011682018060405250810190610cec9190614979565b505f60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638224ce5f876040518263ffffffff1660e01b8152600401610d489190614268565b6020604051808303815f875af1158015610d64573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610d8891906146da565b905060075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166309cab5108784602001516040015184866040015160200151602001516040518563ffffffff1660e01b8152600401610dfe94939291906149c0565b5f604051808303815f87803b158015610e15575f80fd5b505af1158015610e27573d5f803e3d5ffd5b50505050505050505050565b610e3b6134c5565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610ea9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ea090614a54565b60405180910390fd5b8060045f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508060085f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b050e74b8260026040518363ffffffff1660e01b8152600401610f89929190614172565b6020604051808303815f875af1158015610fa5573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610fc991906141d5565b611008576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fff9061424a565b60405180910390fd5b5f60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e7079180836040518263ffffffff1660e01b81526004016110639190614268565b5f604051808303815f875af115801561107e573d5f803e3d5ffd5b505050506040513d5f823e3d601f19601f820116820180604052508101906110a6919061462b565b90503273ffffffffffffffffffffffffffffffffffffffff1681602001516020015173ffffffffffffffffffffffffffffffffffffffff161461111e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611115906146bc565b60405180910390fd5b60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166346834d1e836040518263ffffffff1660e01b81526004016111789190614268565b5f604051808303815f87803b15801561118f575f80fd5b505af11580156111a1573d5f803e3d5ffd5b5050505060075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663aea3825183836020015160200151846040015160400151602001518560600151606001516040518563ffffffff1660e01b815260040161122194939291906149c0565b5f604051808303815f87803b158015611238575f80fd5b505af115801561124a573d5f803e3d5ffd5b5050505060085f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370bea207826040518263ffffffff1660e01b81526004016112a89190614d0e565b5f604051808303815f87803b1580156112bf575f80fd5b505af11580156112d1573d5f803e3d5ffd5b505050505050565b5f60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e7079180836040518263ffffffff1660e01b81526004016113349190614268565b5f604051808303815f875af115801561134f573d5f803e3d5ffd5b505050506040513d5f823e3d601f19601f82011682018060405250810190611377919061462b565b90505f60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cdd82d1d846040518263ffffffff1660e01b81526004016113d49190614268565b6101c0604051808303815f875af11580156113f1573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906114159190614e9c565b90503273ffffffffffffffffffffffffffffffffffffffff1682602001516020015173ffffffffffffffffffffffffffffffffffffffff161461148d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611484906146bc565b60405180910390fd5b6001600a8111156114a1576114a0613e3a565b5b815f0151600a8111156114b7576114b6613e3a565b5b146114f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ee90614f12565b60405180910390fd5b8160400151602001515f015181608001516115129190614f5d565b4211611553576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154a90614fda565b60405180910390fd5b60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663511a9f68846040518263ffffffff1660e01b81526004016115ad9190614268565b5f604051808303815f87803b1580156115c4575f80fd5b505af11580156115d6573d5f803e3d5ffd5b5050505060075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633d31a11584846020015160400151856020015160200151866060015160200151876040015160200151602001516040518663ffffffff1660e01b8152600401611660959493929190614ff8565b5f604051808303815f87803b158015611677575f80fd5b505af1158015611689573d5f803e3d5ffd5b50505050505050565b61169a6134c5565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611708576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ff9061509a565b60405180910390fd5b8060015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660065f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6117b46134c5565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611822576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181990615102565b60405180910390fd5b8060035f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508060075f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6118ad6134c5565b6118b65f613543565b565b5f60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e7079180836040518263ffffffff1660e01b81526004016119139190614268565b5f604051808303815f875af115801561192e573d5f803e3d5ffd5b505050506040513d5f823e3d601f19601f82011682018060405250810190611956919061462b565b90505f60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cdd82d1d846040518263ffffffff1660e01b81526004016119b39190614268565b6101c0604051808303815f875af11580156119d0573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906119f49190614e9c565b90503273ffffffffffffffffffffffffffffffffffffffff1682602001516020015173ffffffffffffffffffffffffffffffffffffffff161480611a6b57503273ffffffffffffffffffffffffffffffffffffffff1682602001516040015173ffffffffffffffffffffffffffffffffffffffff16145b611aaa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aa19061516a565b60405180910390fd5b5f600a811115611abd57611abc613e3a565b5b815f0151600a811115611ad357611ad2613e3a565b5b14611b13576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b0a90614f12565b60405180910390fd5b81604001515f01515f01518160600151611b2d9190614f5d565b4211611b6e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b6590614fda565b60405180910390fd5b60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663795f9abf846040518263ffffffff1660e01b8152600401611bc89190614268565b5f604051808303815f87803b158015611bdf575f80fd5b505af1158015611bf1573d5f803e3d5ffd5b505050505f81602001511115611ca55760075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630ef0d89e84846020015160400151856040015160200151602001516040518463ffffffff1660e01b8152600401611c7393929190615188565b5f604051808303815f87803b158015611c8a575f80fd5b505af1158015611c9c573d5f803e3d5ffd5b50505050611d5c565b5f81604001511115611d5b5760075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663afe1dff784846020015160200151856060015160200151866040015160200151602001516040518563ffffffff1660e01b8152600401611d2d94939291906149c0565b5f604051808303815f87803b158015611d44575f80fd5b505af1158015611d56573d5f803e3d5ffd5b505050505b5b505050565b611d69613604565b73ffffffffffffffffffffffffffffffffffffffff1660045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611df7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dee9061520e565b60405180910390fd5b611e008161360b565b611e3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e3690615276565b60405180910390fd5b5f60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e7079180836040518263ffffffff1660e01b8152600401611e9a9190614268565b5f604051808303815f875af1158015611eb5573d5f803e3d5ffd5b505050506040513d5f823e3d601f19601f82011682018060405250810190611edd919061462b565b90505f60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638224ce5f846040518263ffffffff1660e01b8152600401611f3a9190614268565b6020604051808303815f875af1158015611f56573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611f7a91906146da565b905060065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166380ffdfe0846040518263ffffffff1660e01b8152600401611fd69190614268565b5f604051808303815f87803b158015611fed575f80fd5b505af1158015611fff573d5f803e3d5ffd5b5050505060075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d2485cce84846020015160400151856020015160200151866060015160200151868860600151606001516040518763ffffffff1660e01b815260040161208796959493929190615294565b5f604051808303815f87803b15801561209e575f80fd5b505af11580156120b0573d5f803e3d5ffd5b50505050505050565b6120c1613604565b73ffffffffffffffffffffffffffffffffffffffff1660045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461214f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121469061520e565b60405180910390fd5b6121588161360b565b612197576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161218e90615276565b60405180910390fd5b5f60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e7079180836040518263ffffffff1660e01b81526004016121f29190614268565b5f604051808303815f875af115801561220d573d5f803e3d5ffd5b505050506040513d5f823e3d601f19601f82011682018060405250810190612235919061462b565b90505f60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166373db5c6a846040518263ffffffff1660e01b81526004016122929190614268565b6020604051808303815f875af11580156122ae573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906122d291906146da565b90505f60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638224ce5f856040518263ffffffff1660e01b815260040161232f9190614268565b6020604051808303815f875af115801561234b573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061236f91906146da565b905060065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663824518aa856040518263ffffffff1660e01b81526004016123cb9190614268565b5f604051808303815f87803b1580156123e2575f80fd5b505af11580156123f4573d5f803e3d5ffd5b5050505060075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632a1f90728585602001516040015186602001516020015186886060015160200151878a60600151606001516040518863ffffffff1660e01b815260040161247e9796959493929190614714565b5f604051808303815f87803b158015612495575f80fd5b505af11580156124a7573d5f803e3d5ffd5b5050505050505050565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b5f60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6125086134c5565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603612576576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161256d90615344565b60405180910390fd5b8060055f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6125c16134c5565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361262f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612626906153ac565b60405180910390fd5b8060025f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b5f60035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b5f60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e7079180836040518263ffffffff1660e01b81526004016126f59190614268565b5f604051808303815f875af1158015612710573d5f803e3d5ffd5b505050506040513d5f823e3d601f19601f82011682018060405250810190612738919061462b565b90505f60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cdd82d1d846040518263ffffffff1660e01b81526004016127959190614268565b6101c0604051808303815f875af11580156127b2573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906127d69190614e9c565b90503273ffffffffffffffffffffffffffffffffffffffff1682602001516040015173ffffffffffffffffffffffffffffffffffffffff16148061284d57503273ffffffffffffffffffffffffffffffffffffffff1682602001516020015173ffffffffffffffffffffffffffffffffffffffff16145b61288c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161288390615414565b60405180910390fd5b6004600a8111156128a05761289f613e3a565b5b815f0151600a8111156128b6576128b5613e3a565b5b146128f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128ed90614f12565b60405180910390fd5b8160400151604001515f01518160a001516129119190614f5d565b4211612952576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161294990614fda565b60405180910390fd5b5f60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638224ce5f856040518263ffffffff1660e01b81526004016129ad9190614268565b6020604051808303815f875af11580156129c9573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906129ed91906146da565b905060065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e7b957d1856040518263ffffffff1660e01b8152600401612a499190614268565b5f604051808303815f87803b158015612a60575f80fd5b505af1158015612a72573d5f803e3d5ffd5b5050505060075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663823f3de185856020015160400151866020015160200151876060015160200151868960600151606001516040518763ffffffff1660e01b8152600401612afa96959493929190615294565b5f604051808303815f87803b158015612b11575f80fd5b505af1158015612b23573d5f803e3d5ffd5b5050505050505050565b5f60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e7079180836040518263ffffffff1660e01b8152600401612b889190614268565b5f604051808303815f875af1158015612ba3573d5f803e3d5ffd5b505050506040513d5f823e3d601f19601f82011682018060405250810190612bcb919061462b565b90505f60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cdd82d1d846040518263ffffffff1660e01b8152600401612c289190614268565b6101c0604051808303815f875af1158015612c45573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612c699190614e9c565b90503273ffffffffffffffffffffffffffffffffffffffff1682602001516040015173ffffffffffffffffffffffffffffffffffffffff1614612ce1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612cd89061483a565b60405180910390fd5b6002600a811115612cf557612cf4613e3a565b5b815f0151600a811115612d0b57612d0a613e3a565b5b14612d4b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d4290614f12565b60405180910390fd5b8160400151604001515f01518160a00151612d669190614f5d565b4211612da7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d9e90614fda565b60405180910390fd5b5f60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638224ce5f856040518263ffffffff1660e01b8152600401612e029190614268565b6020604051808303815f875af1158015612e1e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612e4291906146da565b905060065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e850be37856040518263ffffffff1660e01b8152600401612e9e9190614268565b5f604051808303815f87803b158015612eb5575f80fd5b505af1158015612ec7573d5f803e3d5ffd5b5050505060075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637a6726b58585602001516040015186602001516020015185886040015160400151602001516040518663ffffffff1660e01b8152600401612f49959493929190614ff8565b5f604051808303815f87803b158015612f60575f80fd5b505af1158015612f72573d5f803e3d5ffd5b5050505050505050565b612f846134c5565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603612ff2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612fe9906154a2565b60405180910390fd5b612ffb81613543565b50565b6130066136f1565b5f60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a6370b0e878787876040518563ffffffff1660e01b815260040161306794939291906155c7565b5f604051808303815f875af1158015613082573d5f803e3d5ffd5b505050506040513d5f823e3d601f19601f820116820180604052508101906130aa919061462b565b90505f81602001516040015173ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff161490505f82602001516020015173ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614905081806131295750805b613168576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161315f90615664565b60405180910390fd5b81156132ae5760065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ec95b967896040518263ffffffff1660e01b81526004016131c89190614268565b6101c0604051808303815f875af11580156131e5573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906132099190614e9c565b5060075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639e3868dc89856020015160400151866040015160200151602001516040518463ffffffff1660e01b815260040161327c93929190615188565b5f604051808303815f87803b158015613293575f80fd5b505af11580156132a5573d5f803e3d5ffd5b505050506133fb565b80156133fa5760065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633c4135da896040518263ffffffff1660e01b815260040161330e9190614268565b6101c0604051808303815f875af115801561332b573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061334f9190614e9c565b5060075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b918803589856020015160200151866060015160200151876040015160400151602001516040518563ffffffff1660e01b81526004016133cc94939291906149c0565b5f604051808303815f87803b1580156133e3575f80fd5b505af11580156133f5573d5f803e3d5ffd5b505050505b5b60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cdd82d1d896040518263ffffffff1660e01b81526004016134559190614268565b6101c0604051808303815f875af1158015613472573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906134969190614e9c565b9350505050949350505050565b5f808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b6134cd613604565b73ffffffffffffffffffffffffffffffffffffffff166134eb6124b1565b73ffffffffffffffffffffffffffffffffffffffff1614613541576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613538906156cc565b60405180910390fd5b565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f33905090565b5f60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b050e74b8360046040518363ffffffff1660e01b8152600401613669929190614172565b6020604051808303815f875af1158015613685573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906136a991906141d5565b6136e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016136df90615734565b60405180910390fd5b60019050919050565b604051806101c001604052805f600a8111156137105761370f613e3a565b5b81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81525090565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61378d82613764565b9050919050565b61379d81613783565b82525050565b5f6020820190506137b65f830184613794565b92915050565b5f604051905090565b5f80fd5b5f80fd5b6137d681613783565b81146137e0575f80fd5b50565b5f813590506137f1816137cd565b92915050565b5f805f805f60a086880312156138105761380f6137c5565b5b5f61381d888289016137e3565b955050602061382e888289016137e3565b945050604061383f888289016137e3565b9350506060613850888289016137e3565b9250506080613861888289016137e3565b9150509295509295909350565b5f80fd5b5f80fd5b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6138bc82613876565b810181811067ffffffffffffffff821117156138db576138da613886565b5b80604052505050565b5f6138ed6137bc565b90506138f982826138b3565b919050565b5f67ffffffffffffffff82111561391857613917613886565b5b61392182613876565b9050602081019050919050565b828183375f83830152505050565b5f61394e613949846138fe565b6138e4565b90508281526020810184848401111561396a57613969613872565b5b61397584828561392e565b509392505050565b5f82601f8301126139915761399061386e565b5b81356139a184826020860161393c565b91505092915050565b5f602082840312156139bf576139be6137c5565b5b5f82013567ffffffffffffffff8111156139dc576139db6137c9565b5b6139e88482850161397d565b91505092915050565b5f819050919050565b613a03816139f1565b8114613a0d575f80fd5b50565b5f81359050613a1e816139fa565b92915050565b5f805f8060808587031215613a3c57613a3b6137c5565b5b5f85013567ffffffffffffffff811115613a5957613a586137c9565b5b613a658782880161397d565b945050602085013567ffffffffffffffff811115613a8657613a856137c9565b5b613a928782880161397d565b935050604085013567ffffffffffffffff811115613ab357613ab26137c9565b5b613abf8782880161397d565b9250506060613ad087828801613a10565b91505092959194509250565b5f60208284031215613af157613af06137c5565b5b5f613afe848285016137e3565b91505092915050565b5f80fd5b5f80fd5b5f67ffffffffffffffff821115613b2957613b28613886565b5b602082029050602081019050919050565b5f80fd5b5f613b50613b4b84613b0f565b6138e4565b90508083825260208201905060208402830185811115613b7357613b72613b3a565b5b835b81811015613b9c5780613b8888826137e3565b845260208401935050602081019050613b75565b5050509392505050565b5f82601f830112613bba57613bb961386e565b5b8135613bca848260208601613b3e565b91505092915050565b5f60808284031215613be857613be7613b07565b5b613bf260806138e4565b90505f613c01848285016137e3565b5f830152506020613c14848285016137e3565b6020830152506040613c28848285016137e3565b604083015250606082013567ffffffffffffffff811115613c4c57613c4b613b0b565b5b613c5884828501613ba6565b60608301525092915050565b5f60408284031215613c7957613c78613b07565b5b613c8360406138e4565b90505f613c9284828501613a10565b5f830152506020613ca584828501613a10565b60208301525092915050565b5f6101008284031215613cc757613cc6613b07565b5b613cd160806138e4565b90505f613ce084828501613c64565b5f830152506040613cf384828501613c64565b6020830152506080613d0784828501613c64565b60408301525060c0613d1b84828501613c64565b60608301525092915050565b5f60808284031215613d3c57613d3b613b07565b5b613d4660806138e4565b90505f613d5584828501613a10565b5f830152506020613d6884828501613a10565b6020830152506040613d7c84828501613a10565b6040830152506060613d9084828501613a10565b60608301525092915050565b5f805f806101c08587031215613db557613db46137c5565b5b5f85013567ffffffffffffffff811115613dd257613dd16137c9565b5b613dde8782880161397d565b945050602085013567ffffffffffffffff811115613dff57613dfe6137c9565b5b613e0b87828801613bd3565b9350506040613e1c87828801613cb1565b925050610140613e2e87828801613d27565b91505092959194509250565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b600b8110613e7857613e77613e3a565b5b50565b5f819050613e8882613e67565b919050565b5f613e9782613e7b565b9050919050565b613ea781613e8d565b82525050565b613eb6816139f1565b82525050565b6101c082015f820151613ed15f850182613e9e565b506020820151613ee46020850182613ead565b506040820151613ef76040850182613ead565b506060820151613f0a6060850182613ead565b506080820151613f1d6080850182613ead565b5060a0820151613f3060a0850182613ead565b5060c0820151613f4360c0850182613ead565b5060e0820151613f5660e0850182613ead565b50610100820151613f6b610100850182613ead565b50610120820151613f80610120850182613ead565b50610140820151613f95610140850182613ead565b50610160820151613faa610160850182613ead565b50610180820151613fbf610180850182613ead565b506101a0820151613fd46101a0850182613ead565b50505050565b5f6101c082019050613fee5f830184613ebc565b92915050565b5f82825260208201905092915050565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c7265615f8201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b5f61405e602e83613ff4565b915061406982614004565b604082019050919050565b5f6020820190508181035f83015261408b81614052565b9050919050565b5f819050919050565b5f60ff82169050919050565b5f819050919050565b5f6140ca6140c56140c084614092565b6140a7565b61409b565b9050919050565b6140da816140b0565b82525050565b5f6020820190506140f35f8301846140d1565b92915050565b5f81519050919050565b5f5b83811015614120578082015181840152602081019050614105565b5f8484015250505050565b5f614135826140f9565b61413f8185613ff4565b935061414f818560208601614103565b61415881613876565b840191505092915050565b61416c81613e8d565b82525050565b5f6040820190508181035f83015261418a818561412b565b90506141996020830184614163565b9392505050565b5f8115159050919050565b6141b4816141a0565b81146141be575f80fd5b50565b5f815190506141cf816141ab565b92915050565b5f602082840312156141ea576141e96137c5565b5b5f6141f7848285016141c1565b91505092915050565b7f526573756c74735375626d6974746564000000000000000000000000000000005f82015250565b5f614234601083613ff4565b915061423f82614200565b602082019050919050565b5f6020820190508181035f83015261426181614228565b9050919050565b5f6020820190508181035f830152614280818461412b565b905092915050565b5f61429a614295846138fe565b6138e4565b9050828152602081018484840111156142b6576142b5613872565b5b6142c1848285614103565b509392505050565b5f82601f8301126142dd576142dc61386e565b5b81516142ed848260208601614288565b91505092915050565b5f81519050614304816137cd565b92915050565b5f61431c61431784613b0f565b6138e4565b9050808382526020820190506020840283018581111561433f5761433e613b3a565b5b835b81811015614368578061435488826142f6565b845260208401935050602081019050614341565b5050509392505050565b5f82601f8301126143865761438561386e565b5b815161439684826020860161430a565b91505092915050565b5f608082840312156143b4576143b3613b07565b5b6143be60806138e4565b90505f6143cd848285016142f6565b5f8301525060206143e0848285016142f6565b60208301525060406143f4848285016142f6565b604083015250606082015167ffffffffffffffff81111561441857614417613b0b565b5b61442484828501614372565b60608301525092915050565b5f8151905061443e816139fa565b92915050565b5f6040828403121561445957614458613b07565b5b61446360406138e4565b90505f61447284828501614430565b5f83015250602061448584828501614430565b60208301525092915050565b5f61010082840312156144a7576144a6613b07565b5b6144b160806138e4565b90505f6144c084828501614444565b5f8301525060406144d384828501614444565b60208301525060806144e784828501614444565b60408301525060c06144fb84828501614444565b60608301525092915050565b5f6080828403121561451c5761451b613b07565b5b61452660806138e4565b90505f61453584828501614430565b5f83015250602061454884828501614430565b602083015250604061455c84828501614430565b604083015250606061457084828501614430565b60608301525092915050565b5f6101c0828403121561459257614591613b07565b5b61459c60806138e4565b90505f82015167ffffffffffffffff8111156145bb576145ba613b0b565b5b6145c7848285016142c9565b5f83015250602082015167ffffffffffffffff8111156145ea576145e9613b0b565b5b6145f68482850161439f565b602083015250604061460a84828501614491565b60408301525061014061461f84828501614507565b60608301525092915050565b5f602082840312156146405761463f6137c5565b5b5f82015167ffffffffffffffff81111561465d5761465c6137c9565b5b6146698482850161457c565b91505092915050565b7f4f6e6c79204a43000000000000000000000000000000000000000000000000005f82015250565b5f6146a6600783613ff4565b91506146b182614672565b602082019050919050565b5f6020820190508181035f8301526146d38161469a565b9050919050565b5f602082840312156146ef576146ee6137c5565b5b5f6146fc84828501614430565b91505092915050565b61470e816139f1565b82525050565b5f60e0820190508181035f83015261472c818a61412b565b905061473b6020830189613794565b6147486040830188613794565b6147556060830187614705565b6147626080830186614705565b61476f60a0830185614705565b61477c60c0830184614705565b98975050505050505050565b7f4465616c416772656564000000000000000000000000000000000000000000005f82015250565b5f6147bc600a83613ff4565b91506147c782614788565b602082019050919050565b5f6020820190508181035f8301526147e9816147b0565b9050919050565b7f4f6e6c79205250000000000000000000000000000000000000000000000000005f82015250565b5f614824600783613ff4565b915061482f826147f0565b602082019050919050565b5f6020820190508181035f83015261485181614818565b9050919050565b5f6080820190508181035f830152614870818761412b565b90508181036020830152614884818661412b565b90508181036040830152614898818561412b565b90506148a76060830184614705565b95945050505050565b5f608082840312156148c5576148c4613b07565b5b6148cf60806138e4565b90505f82015167ffffffffffffffff8111156148ee576148ed613b0b565b5b6148fa848285016142c9565b5f83015250602082015167ffffffffffffffff81111561491d5761491c613b0b565b5b614929848285016142c9565b602083015250604082015167ffffffffffffffff81111561494d5761494c613b0b565b5b614959848285016142c9565b604083015250606061496d84828501614430565b60608301525092915050565b5f6020828403121561498e5761498d6137c5565b5b5f82015167ffffffffffffffff8111156149ab576149aa6137c9565b5b6149b7848285016148b0565b91505092915050565b5f6080820190508181035f8301526149d8818761412b565b90506149e76020830186613794565b6149f46040830185614705565b614a016060830184614705565b95945050505050565b7f4d6564696174696f6e20616464726573730000000000000000000000000000005f82015250565b5f614a3e601183613ff4565b9150614a4982614a0a565b602082019050919050565b5f6020820190508181035f830152614a6b81614a32565b9050919050565b5f82825260208201905092915050565b5f614a8c826140f9565b614a968185614a72565b9350614aa6818560208601614103565b614aaf81613876565b840191505092915050565b614ac381613783565b82525050565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b5f614afd8383614aba565b60208301905092915050565b5f602082019050919050565b5f614b1f82614ac9565b614b298185614ad3565b9350614b3483614ae3565b805f5b83811015614b64578151614b4b8882614af2565b9750614b5683614b09565b925050600181019050614b37565b5085935050505092915050565b5f608083015f830151614b865f860182614aba565b506020830151614b996020860182614aba565b506040830151614bac6040860182614aba565b5060608301518482036060860152614bc48282614b15565b9150508091505092915050565b604082015f820151614be55f850182613ead565b506020820151614bf86020850182613ead565b50505050565b61010082015f820151614c135f850182614bd1565b506020820151614c266040850182614bd1565b506040820151614c396080850182614bd1565b506060820151614c4c60c0850182614bd1565b50505050565b608082015f820151614c665f850182613ead565b506020820151614c796020850182613ead565b506040820151614c8c6040850182613ead565b506060820151614c9f6060850182613ead565b50505050565b5f6101c083015f8301518482035f860152614cc08282614a82565b91505060208301518482036020860152614cda8282614b71565b9150506040830151614cef6040860182614bfe565b506060830151614d03610140860182614c52565b508091505092915050565b5f6020820190508181035f830152614d268184614ca5565b905092915050565b600b8110614d3a575f80fd5b50565b5f81519050614d4b81614d2e565b92915050565b5f6101c08284031215614d6757614d66613b07565b5b614d726101c06138e4565b90505f614d8184828501614d3d565b5f830152506020614d9484828501614430565b6020830152506040614da884828501614430565b6040830152506060614dbc84828501614430565b6060830152506080614dd084828501614430565b60808301525060a0614de484828501614430565b60a08301525060c0614df884828501614430565b60c08301525060e0614e0c84828501614430565b60e083015250610100614e2184828501614430565b61010083015250610120614e3784828501614430565b61012083015250610140614e4d84828501614430565b61014083015250610160614e6384828501614430565b61016083015250610180614e7984828501614430565b610180830152506101a0614e8f84828501614430565b6101a08301525092915050565b5f6101c08284031215614eb257614eb16137c5565b5b5f614ebf84828501614d51565b91505092915050565b7f4e6f7420636f72726563742073746174650000000000000000000000000000005f82015250565b5f614efc601183613ff4565b9150614f0782614ec8565b602082019050919050565b5f6020820190508181035f830152614f2981614ef0565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f614f67826139f1565b9150614f72836139f1565b9250828201905080821115614f8a57614f89614f30565b5b92915050565b7f4e6f742074696d6564206f7574000000000000000000000000000000000000005f82015250565b5f614fc4600d83613ff4565b9150614fcf82614f90565b602082019050919050565b5f6020820190508181035f830152614ff181614fb8565b9050919050565b5f60a0820190508181035f830152615010818861412b565b905061501f6020830187613794565b61502c6040830186613794565b6150396060830185614705565b6150466080830184614705565b9695505050505050565b7f53746f72616765206164647265737300000000000000000000000000000000005f82015250565b5f615084600f83613ff4565b915061508f82615050565b602082019050919050565b5f6020820190508181035f8301526150b181615078565b9050919050565b7f5061796d656e74732061646472657373000000000000000000000000000000005f82015250565b5f6150ec601083613ff4565b91506150f7826150b8565b602082019050919050565b5f6020820190508181035f830152615119816150e0565b9050919050565b7f4f6e6c79204a43206f72205250000000000000000000000000000000000000005f82015250565b5f615154600d83613ff4565b915061515f82615120565b602082019050919050565b5f6020820190508181035f83015261518181615148565b9050919050565b5f6060820190508181035f8301526151a0818661412b565b90506151af6020830185613794565b6151bc6040830184614705565b949350505050565b7f4f6e6c79206d6564696174696f6e0000000000000000000000000000000000005f82015250565b5f6151f8600e83613ff4565b9150615203826151c4565b602082019050919050565b5f6020820190508181035f830152615225816151ec565b9050919050565b7f43616e6e6f74206d6564696174650000000000000000000000000000000000005f82015250565b5f615260600e83613ff4565b915061526b8261522c565b602082019050919050565b5f6020820190508181035f83015261528d81615254565b9050919050565b5f60c0820190508181035f8301526152ac818961412b565b90506152bb6020830188613794565b6152c86040830187613794565b6152d56060830186614705565b6152e26080830185614705565b6152ef60a0830184614705565b979650505050505050565b7f4a6f6243726561746f72206164647265737300000000000000000000000000005f82015250565b5f61532e601283613ff4565b9150615339826152fa565b602082019050919050565b5f6020820190508181035f83015261535b81615322565b9050919050565b7f55736572732061646472657373000000000000000000000000000000000000005f82015250565b5f615396600d83613ff4565b91506153a182615362565b602082019050919050565b5f6020820190508181035f8301526153c38161538a565b9050919050565b7f4f6e6c79205250206f72204a43000000000000000000000000000000000000005f82015250565b5f6153fe600d83613ff4565b9150615409826153ca565b602082019050919050565b5f6020820190508181035f83015261542b816153f2565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f20615f8201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b5f61548c602683613ff4565b915061549782615432565b604082019050919050565b5f6020820190508181035f8301526154b981615480565b9050919050565b5f608083015f8301516154d55f860182614aba565b5060208301516154e86020860182614aba565b5060408301516154fb6040860182614aba565b50606083015184820360608601526155138282614b15565b9150508091505092915050565b61010082015f8201516155355f850182614bd1565b5060208201516155486040850182614bd1565b50604082015161555b6080850182614bd1565b50606082015161556e60c0850182614bd1565b50505050565b608082015f8201516155885f850182613ead565b50602082015161559b6020850182613ead565b5060408201516155ae6040850182613ead565b5060608201516155c16060850182613ead565b50505050565b5f6101c0820190508181035f8301526155e0818761412b565b905081810360208301526155f481866154c0565b90506156036040830185615520565b615611610140830184615574565b95945050505050565b7f4f6e6c79205250202f204a4300000000000000000000000000000000000000005f82015250565b5f61564e600c83613ff4565b91506156598261561a565b602082019050919050565b5f6020820190508181035f83015261567b81615642565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725f82015250565b5f6156b6602083613ff4565b91506156c182615682565b602082019050919050565b5f6020820190508181035f8301526156e3816156aa565b9050919050565b7f526573756c7473436865636b65640000000000000000000000000000000000005f82015250565b5f61571e600e83613ff4565b9150615729826156ea565b602082019050919050565b5f6020820190508181035f83015261574b81615712565b905091905056fea26469706673582212208a18870ef661c5827e4600bb15f14e761beb5f5522a98082c007f3eb3b6e7b4264736f6c63430008150033", + ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"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\":[{\"internalType\":\"string\",\"name\":\"dealId\",\"type\":\"string\"}],\"name\":\"acceptResult\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"dealId\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"resultsId\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"dataId\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"instructionCount\",\"type\":\"uint256\"}],\"name\":\"addResult\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"dealId\",\"type\":\"string\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"solver\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"jobCreator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"resourceProvider\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"mediators\",\"type\":\"address[]\"}],\"internalType\":\"structSharedStructs.DealMembers\",\"name\":\"members\",\"type\":\"tuple\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"timeout\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collateral\",\"type\":\"uint256\"}],\"internalType\":\"structSharedStructs.DealTimeout\",\"name\":\"agree\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"timeout\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collateral\",\"type\":\"uint256\"}],\"internalType\":\"structSharedStructs.DealTimeout\",\"name\":\"submitResults\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"timeout\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collateral\",\"type\":\"uint256\"}],\"internalType\":\"structSharedStructs.DealTimeout\",\"name\":\"judgeResults\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"timeout\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collateral\",\"type\":\"uint256\"}],\"internalType\":\"structSharedStructs.DealTimeout\",\"name\":\"mediateResults\",\"type\":\"tuple\"}],\"internalType\":\"structSharedStructs.DealTimeouts\",\"name\":\"timeouts\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"instructionPrice\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"paymentCollateral\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"resultsCollateralMultiple\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"mediationFee\",\"type\":\"uint256\"}],\"internalType\":\"structSharedStructs.DealPricing\",\"name\":\"pricing\",\"type\":\"tuple\"}],\"name\":\"agree\",\"outputs\":[{\"components\":[{\"internalType\":\"enumSharedStructs.AgreementState\",\"name\":\"state\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"resourceProviderAgreedAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"jobCreatorAgreedAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"dealCreatedAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"dealAgreedAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"resultsSubmittedAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"resultsAcceptedAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"resultsCheckedAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"mediationAcceptedAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"mediationRejectedAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"timeoutAgreeAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"timeoutSubmitResultsAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"timeoutJudgeResultsAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"timeoutMediateResultsAt\",\"type\":\"uint256\"}],\"internalType\":\"structSharedStructs.Agreement\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"dealId\",\"type\":\"string\"}],\"name\":\"checkResult\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getJobCreatorAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getMediationAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getPaymentsAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getPowAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStorageAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getUsersAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_storageAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_usersAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_paymentsAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_mediationAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_jobCreatorAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_powAddress\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"dealId\",\"type\":\"string\"}],\"name\":\"mediationAcceptResult\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"dealId\",\"type\":\"string\"}],\"name\":\"mediationRejectResult\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_jobCreatorAddress\",\"type\":\"address\"}],\"name\":\"setJobCreatorAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_mediationAddress\",\"type\":\"address\"}],\"name\":\"setMediationAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_paymentsAddress\",\"type\":\"address\"}],\"name\":\"setPaymentsAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_powAddress\",\"type\":\"address\"}],\"name\":\"setPowAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_storageAddress\",\"type\":\"address\"}],\"name\":\"setStorageAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_usersAddress\",\"type\":\"address\"}],\"name\":\"setUsersAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"dealId\",\"type\":\"string\"}],\"name\":\"timeoutAgree\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"dealId\",\"type\":\"string\"}],\"name\":\"timeoutJudgeResult\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"dealId\",\"type\":\"string\"}],\"name\":\"timeoutMediateResult\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"dealId\",\"type\":\"string\"}],\"name\":\"timeoutSubmitResult\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x608060405234801562000010575f80fd5b5062000031620000256200003760201b60201c565b6200003e60201b60201c565b620000ff565b5f33905090565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6158f5806200010d5f395ff3fe608060405234801561000f575f80fd5b506004361061018c575f3560e01c806380ffdfe0116100dc578063cc2a9a5b11610095578063e7b957d11161006f578063e7b957d1146103f4578063e850be3714610410578063f2fde38b1461042c578063f583b125146104485761018c565b8063cc2a9a5b1461039c578063d48b1084146103b8578063d882a252146103d65761018c565b806380ffdfe0146102f0578063824518aa1461030c5780638da5cb5b1461032857806393dbed3e14610346578063b4031e5414610364578063bbfff47d146103805761018c565b806346834d1e1161014957806359b910d61161012357806359b910d614610292578063640e570f146102ae578063715018a6146102ca578063795f9abf146102d45761018c565b806346834d1e1461023e5780634ef168a61461025a578063511a9f68146102765761018c565b80630aca35ce14610190578063155329ea146101ae578063297f9e55146101cc578063393a4d34146101e85780633955548e1461020657806343391cca14610222575b5f80fd5b610198610478565b6040516101a591906138fe565b60405180910390f35b6101b66104a0565b6040516101c391906138fe565b60405180910390f35b6101e660048036038101906101e19190613a64565b6104c8565b005b6101f0610938565b6040516101fd91906138fe565b60405180910390f35b610220600480360381019061021b9190613ade565b610960565b005b61023c60048036038101906102379190613bc0565b610d3c565b005b61025860048036038101906102539190613a64565b610e35565b005b610274600480360381019061026f9190613bc0565b6111e2565b005b610290600480360381019061028b9190613a64565b61129b565b005b6102ac60048036038101906102a79190613bc0565b611654565b005b6102c860048036038101906102c39190613bc0565b61176e565b005b6102d2611867565b005b6102ee60048036038101906102e99190613a64565b61187a565b005b61030a60048036038101906103059190613a64565b611d23565b005b61032660048036038101906103219190613a64565b61207b565b005b610330612473565b60405161033d91906138fe565b60405180910390f35b61034e61249a565b60405161035b91906138fe565b60405180910390f35b61037e60048036038101906103799190613bc0565b6124c2565b005b61039a60048036038101906103959190613bc0565b61257b565b005b6103b660048036038101906103b19190613beb565b612634565b005b6103c06127a5565b6040516103cd91906138fe565b60405180910390f35b6103de6127cd565b6040516103eb91906138fe565b60405180910390f35b61040e60048036038101906104099190613a64565b6127f5565b005b61042a60048036038101906104259190613a64565b612c88565b005b61044660048036038101906104419190613bc0565b6130d7565b005b610462600480360381019061045d9190613f09565b613159565b60405161046f9190614147565b60405180910390f35b5f60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b5f60045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b050e74b8260026040518363ffffffff1660e01b81526004016105259291906141ea565b6020604051808303815f875af1158015610541573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610565919061424d565b6105a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161059b906142c2565b60405180910390fd5b5f60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e7079180836040518263ffffffff1660e01b81526004016105ff91906142e0565b5f604051808303815f875af115801561061a573d5f803e3d5ffd5b505050506040513d5f823e3d601f19601f8201168201806040525081019061064291906146a3565b90503273ffffffffffffffffffffffffffffffffffffffff1681602001516020015173ffffffffffffffffffffffffffffffffffffffff16146106ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106b190614734565b60405180910390fd5b5f60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166373db5c6a846040518263ffffffff1660e01b815260040161071591906142e0565b6020604051808303815f875af1158015610731573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107559190614752565b90505f60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638224ce5f856040518263ffffffff1660e01b81526004016107b291906142e0565b6020604051808303815f875af11580156107ce573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107f29190614752565b905060075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663297f9e55856040518263ffffffff1660e01b815260040161084e91906142e0565b5f604051808303815f87803b158015610865575f80fd5b505af1158015610877573d5f803e3d5ffd5b5050505060085f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b13567148585602001516040015186602001516020015186886060015160200151878a6040015160400151602001516040518863ffffffff1660e01b8152600401610905979695949392919061478c565b5f604051808303815f87803b15801561091c575f80fd5b505af115801561092e573d5f803e3d5ffd5b5050505050505050565b5f60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b050e74b8560016040518363ffffffff1660e01b81526004016109bd9291906141ea565b6020604051808303815f875af11580156109d9573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109fd919061424d565b610a3c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a339061484a565b60405180910390fd5b5f60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e7079180866040518263ffffffff1660e01b8152600401610a9791906142e0565b5f604051808303815f875af1158015610ab2573d5f803e3d5ffd5b505050506040513d5f823e3d601f19601f82011682018060405250810190610ada91906146a3565b90503273ffffffffffffffffffffffffffffffffffffffff1681602001516040015173ffffffffffffffffffffffffffffffffffffffff1614610b52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b49906148b2565b60405180910390fd5b60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633955548e868686866040518563ffffffff1660e01b8152600401610bb294939291906148d0565b5f604051808303815f875af1158015610bcd573d5f803e3d5ffd5b505050506040513d5f823e3d601f19601f82011682018060405250810190610bf591906149f1565b505f60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638224ce5f876040518263ffffffff1660e01b8152600401610c5191906142e0565b6020604051808303815f875af1158015610c6d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610c919190614752565b905060085f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166309cab5108784602001516040015184866040015160200151602001516040518563ffffffff1660e01b8152600401610d079493929190614a38565b5f604051808303815f87803b158015610d1e575f80fd5b505af1158015610d30573d5f803e3d5ffd5b50505050505050505050565b610d446135fe565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610db2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610da990614acc565b60405180910390fd5b8060045f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508060095f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b050e74b8260026040518363ffffffff1660e01b8152600401610e929291906141ea565b6020604051808303815f875af1158015610eae573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610ed2919061424d565b610f11576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f08906142c2565b60405180910390fd5b5f60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e7079180836040518263ffffffff1660e01b8152600401610f6c91906142e0565b5f604051808303815f875af1158015610f87573d5f803e3d5ffd5b505050506040513d5f823e3d601f19601f82011682018060405250810190610faf91906146a3565b90503273ffffffffffffffffffffffffffffffffffffffff1681602001516020015173ffffffffffffffffffffffffffffffffffffffff1614611027576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161101e90614734565b60405180910390fd5b60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166346834d1e836040518263ffffffff1660e01b815260040161108191906142e0565b5f604051808303815f87803b158015611098575f80fd5b505af11580156110aa573d5f803e3d5ffd5b5050505060085f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663aea3825183836020015160200151846040015160400151602001518560600151606001516040518563ffffffff1660e01b815260040161112a9493929190614a38565b5f604051808303815f87803b158015611141575f80fd5b505af1158015611153573d5f803e3d5ffd5b5050505060095f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370bea207826040518263ffffffff1660e01b81526004016111b19190614d86565b5f604051808303815f87803b1580156111c8575f80fd5b505af11580156111da573d5f803e3d5ffd5b505050505050565b6111ea6135fe565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611258576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161124f90614df0565b60405180910390fd5b8060065f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b5f60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e7079180836040518263ffffffff1660e01b81526004016112f691906142e0565b5f604051808303815f875af1158015611311573d5f803e3d5ffd5b505050506040513d5f823e3d601f19601f8201168201806040525081019061133991906146a3565b90505f60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cdd82d1d846040518263ffffffff1660e01b815260040161139691906142e0565b6101c0604051808303815f875af11580156113b3573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906113d79190614f7c565b90503273ffffffffffffffffffffffffffffffffffffffff1682602001516020015173ffffffffffffffffffffffffffffffffffffffff161461144f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161144690614734565b60405180910390fd5b6001600a81111561146357611462613fa7565b5b815f0151600a81111561147957611478613fa7565b5b146114b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b090614ff2565b60405180910390fd5b8160400151602001515f015181608001516114d4919061503d565b4211611515576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161150c906150ba565b60405180910390fd5b60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663511a9f68846040518263ffffffff1660e01b815260040161156f91906142e0565b5f604051808303815f87803b158015611586575f80fd5b505af1158015611598573d5f803e3d5ffd5b5050505060085f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633d31a11584846020015160400151856020015160200151866060015160200151876040015160200151602001516040518663ffffffff1660e01b81526004016116229594939291906150d8565b5f604051808303815f87803b158015611639575f80fd5b505af115801561164b573d5f803e3d5ffd5b50505050505050565b61165c6135fe565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036116ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116c19061517a565b60405180910390fd5b8060015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660075f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6117766135fe565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036117e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117db906151e2565b60405180910390fd5b8060035f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508060085f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b61186f6135fe565b6118785f61367c565b565b5f60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e7079180836040518263ffffffff1660e01b81526004016118d591906142e0565b5f604051808303815f875af11580156118f0573d5f803e3d5ffd5b505050506040513d5f823e3d601f19601f8201168201806040525081019061191891906146a3565b90505f60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cdd82d1d846040518263ffffffff1660e01b815260040161197591906142e0565b6101c0604051808303815f875af1158015611992573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906119b69190614f7c565b90503273ffffffffffffffffffffffffffffffffffffffff1682602001516020015173ffffffffffffffffffffffffffffffffffffffff161480611a2d57503273ffffffffffffffffffffffffffffffffffffffff1682602001516040015173ffffffffffffffffffffffffffffffffffffffff16145b611a6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a639061524a565b60405180910390fd5b5f600a811115611a7f57611a7e613fa7565b5b815f0151600a811115611a9557611a94613fa7565b5b14611ad5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611acc90614ff2565b60405180910390fd5b81604001515f01515f01518160600151611aef919061503d565b4211611b30576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b27906150ba565b60405180910390fd5b60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663795f9abf846040518263ffffffff1660e01b8152600401611b8a91906142e0565b5f604051808303815f87803b158015611ba1575f80fd5b505af1158015611bb3573d5f803e3d5ffd5b505050505f81602001511115611c675760085f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630ef0d89e84846020015160400151856040015160200151602001516040518463ffffffff1660e01b8152600401611c3593929190615268565b5f604051808303815f87803b158015611c4c575f80fd5b505af1158015611c5e573d5f803e3d5ffd5b50505050611d1e565b5f81604001511115611d1d5760085f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663afe1dff784846020015160200151856060015160200151866040015160200151602001516040518563ffffffff1660e01b8152600401611cef9493929190614a38565b5f604051808303815f87803b158015611d06575f80fd5b505af1158015611d18573d5f803e3d5ffd5b505050505b5b505050565b611d2b61373d565b73ffffffffffffffffffffffffffffffffffffffff1660045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611db9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611db0906152ee565b60405180910390fd5b611dc281613744565b611e01576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611df890615356565b60405180910390fd5b5f60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e7079180836040518263ffffffff1660e01b8152600401611e5c91906142e0565b5f604051808303815f875af1158015611e77573d5f803e3d5ffd5b505050506040513d5f823e3d601f19601f82011682018060405250810190611e9f91906146a3565b90505f60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638224ce5f846040518263ffffffff1660e01b8152600401611efc91906142e0565b6020604051808303815f875af1158015611f18573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611f3c9190614752565b905060075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166380ffdfe0846040518263ffffffff1660e01b8152600401611f9891906142e0565b5f604051808303815f87803b158015611faf575f80fd5b505af1158015611fc1573d5f803e3d5ffd5b5050505060085f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d2485cce84846020015160400151856020015160200151866060015160200151868860600151606001516040518763ffffffff1660e01b815260040161204996959493929190615374565b5f604051808303815f87803b158015612060575f80fd5b505af1158015612072573d5f803e3d5ffd5b50505050505050565b61208361373d565b73ffffffffffffffffffffffffffffffffffffffff1660045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612111576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612108906152ee565b60405180910390fd5b61211a81613744565b612159576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161215090615356565b60405180910390fd5b5f60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e7079180836040518263ffffffff1660e01b81526004016121b491906142e0565b5f604051808303815f875af11580156121cf573d5f803e3d5ffd5b505050506040513d5f823e3d601f19601f820116820180604052508101906121f791906146a3565b90505f60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166373db5c6a846040518263ffffffff1660e01b815260040161225491906142e0565b6020604051808303815f875af1158015612270573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906122949190614752565b90505f60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638224ce5f856040518263ffffffff1660e01b81526004016122f191906142e0565b6020604051808303815f875af115801561230d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906123319190614752565b905060075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663824518aa856040518263ffffffff1660e01b815260040161238d91906142e0565b5f604051808303815f87803b1580156123a4575f80fd5b505af11580156123b6573d5f803e3d5ffd5b5050505060085f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632a1f90728585602001516040015186602001516020015186886060015160200151878a60600151606001516040518863ffffffff1660e01b8152600401612440979695949392919061478c565b5f604051808303815f87803b158015612457575f80fd5b505af1158015612469573d5f803e3d5ffd5b5050505050505050565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b5f60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6124ca6135fe565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603612538576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161252f90615424565b60405180910390fd5b8060055f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6125836135fe565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036125f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e890614df0565b60405180910390fd5b8060025f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b5f8060159054906101000a900460ff16159050808015612665575060015f60149054906101000a900460ff1660ff16105b8061269357506126743061382a565b158015612692575060015f60149054906101000a900460ff1660ff16145b5b6126d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126c9906154b2565b60405180910390fd5b60015f60146101000a81548160ff021916908360ff160217905550801561270e5760015f60156101000a81548160ff0219169083151502179055505b61271787611654565b6127208661257b565b6127298561176e565b61273284610d3c565b61273b836124c2565b612744826111e2565b801561279c575f8060156101000a81548160ff0219169083151502179055507f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024986001604051612793919061551e565b60405180910390a15b50505050505050565b5f60035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b5f60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b5f60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e7079180836040518263ffffffff1660e01b815260040161285091906142e0565b5f604051808303815f875af115801561286b573d5f803e3d5ffd5b505050506040513d5f823e3d601f19601f8201168201806040525081019061289391906146a3565b90505f60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cdd82d1d846040518263ffffffff1660e01b81526004016128f091906142e0565b6101c0604051808303815f875af115801561290d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906129319190614f7c565b90503273ffffffffffffffffffffffffffffffffffffffff1682602001516040015173ffffffffffffffffffffffffffffffffffffffff1614806129a857503273ffffffffffffffffffffffffffffffffffffffff1682602001516020015173ffffffffffffffffffffffffffffffffffffffff16145b6129e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129de90615581565b60405180910390fd5b6004600a8111156129fb576129fa613fa7565b5b815f0151600a811115612a1157612a10613fa7565b5b14612a51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a4890614ff2565b60405180910390fd5b8160400151604001515f01518160a00151612a6c919061503d565b4211612aad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612aa4906150ba565b60405180910390fd5b5f60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638224ce5f856040518263ffffffff1660e01b8152600401612b0891906142e0565b6020604051808303815f875af1158015612b24573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612b489190614752565b905060075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e7b957d1856040518263ffffffff1660e01b8152600401612ba491906142e0565b5f604051808303815f87803b158015612bbb575f80fd5b505af1158015612bcd573d5f803e3d5ffd5b5050505060085f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663823f3de185856020015160400151866020015160200151876060015160200151868960600151606001516040518763ffffffff1660e01b8152600401612c5596959493929190615374565b5f604051808303815f87803b158015612c6c575f80fd5b505af1158015612c7e573d5f803e3d5ffd5b5050505050505050565b5f60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e7079180836040518263ffffffff1660e01b8152600401612ce391906142e0565b5f604051808303815f875af1158015612cfe573d5f803e3d5ffd5b505050506040513d5f823e3d601f19601f82011682018060405250810190612d2691906146a3565b90505f60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cdd82d1d846040518263ffffffff1660e01b8152600401612d8391906142e0565b6101c0604051808303815f875af1158015612da0573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612dc49190614f7c565b90503273ffffffffffffffffffffffffffffffffffffffff1682602001516040015173ffffffffffffffffffffffffffffffffffffffff1614612e3c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e33906148b2565b60405180910390fd5b6002600a811115612e5057612e4f613fa7565b5b815f0151600a811115612e6657612e65613fa7565b5b14612ea6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e9d90614ff2565b60405180910390fd5b8160400151604001515f01518160a00151612ec1919061503d565b4211612f02576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ef9906150ba565b60405180910390fd5b5f60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638224ce5f856040518263ffffffff1660e01b8152600401612f5d91906142e0565b6020604051808303815f875af1158015612f79573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612f9d9190614752565b905060075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e850be37856040518263ffffffff1660e01b8152600401612ff991906142e0565b5f604051808303815f87803b158015613010575f80fd5b505af1158015613022573d5f803e3d5ffd5b5050505060085f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637a6726b58585602001516040015186602001516020015185886040015160400151602001516040518663ffffffff1660e01b81526004016130a49594939291906150d8565b5f604051808303815f87803b1580156130bb575f80fd5b505af11580156130cd573d5f803e3d5ffd5b5050505050505050565b6130df6135fe565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361314d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016131449061560f565b60405180910390fd5b6131568161367c565b50565b61316161384c565b5f60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a6370b0e878787876040518563ffffffff1660e01b81526004016131c29493929190615734565b5f604051808303815f875af11580156131dd573d5f803e3d5ffd5b505050506040513d5f823e3d601f19601f8201168201806040525081019061320591906146a3565b90505f81602001516040015173ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff161490505f82602001516020015173ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614905081806132845750805b6132c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016132ba906157d1565b60405180910390fd5b81156134095760075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ec95b967896040518263ffffffff1660e01b815260040161332391906142e0565b6101c0604051808303815f875af1158015613340573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906133649190614f7c565b5060085f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639e3868dc89856020015160400151866040015160200151602001516040518463ffffffff1660e01b81526004016133d793929190615268565b5f604051808303815f87803b1580156133ee575f80fd5b505af1158015613400573d5f803e3d5ffd5b50505050613556565b80156135555760075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633c4135da896040518263ffffffff1660e01b815260040161346991906142e0565b6101c0604051808303815f875af1158015613486573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906134aa9190614f7c565b5060085f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b918803589856020015160200151866060015160200151876040015160400151602001516040518563ffffffff1660e01b81526004016135279493929190614a38565b5f604051808303815f87803b15801561353e575f80fd5b505af1158015613550573d5f803e3d5ffd5b505050505b5b60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cdd82d1d896040518263ffffffff1660e01b81526004016135b091906142e0565b6101c0604051808303815f875af11580156135cd573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906135f19190614f7c565b9350505050949350505050565b61360661373d565b73ffffffffffffffffffffffffffffffffffffffff16613624612473565b73ffffffffffffffffffffffffffffffffffffffff161461367a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161367190615839565b60405180910390fd5b565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f33905090565b5f60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b050e74b8360046040518363ffffffff1660e01b81526004016137a29291906141ea565b6020604051808303815f875af11580156137be573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906137e2919061424d565b613821576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613818906158a1565b60405180910390fd5b60019050919050565b5f808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b604051806101c001604052805f600a81111561386b5761386a613fa7565b5b81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81525090565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6138e8826138bf565b9050919050565b6138f8816138de565b82525050565b5f6020820190506139115f8301846138ef565b92915050565b5f604051905090565b5f80fd5b5f80fd5b5f80fd5b5f80fd5b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b61397682613930565b810181811067ffffffffffffffff8211171561399557613994613940565b5b80604052505050565b5f6139a7613917565b90506139b3828261396d565b919050565b5f67ffffffffffffffff8211156139d2576139d1613940565b5b6139db82613930565b9050602081019050919050565b828183375f83830152505050565b5f613a08613a03846139b8565b61399e565b905082815260208101848484011115613a2457613a2361392c565b5b613a2f8482856139e8565b509392505050565b5f82601f830112613a4b57613a4a613928565b5b8135613a5b8482602086016139f6565b91505092915050565b5f60208284031215613a7957613a78613920565b5b5f82013567ffffffffffffffff811115613a9657613a95613924565b5b613aa284828501613a37565b91505092915050565b5f819050919050565b613abd81613aab565b8114613ac7575f80fd5b50565b5f81359050613ad881613ab4565b92915050565b5f805f8060808587031215613af657613af5613920565b5b5f85013567ffffffffffffffff811115613b1357613b12613924565b5b613b1f87828801613a37565b945050602085013567ffffffffffffffff811115613b4057613b3f613924565b5b613b4c87828801613a37565b935050604085013567ffffffffffffffff811115613b6d57613b6c613924565b5b613b7987828801613a37565b9250506060613b8a87828801613aca565b91505092959194509250565b613b9f816138de565b8114613ba9575f80fd5b50565b5f81359050613bba81613b96565b92915050565b5f60208284031215613bd557613bd4613920565b5b5f613be284828501613bac565b91505092915050565b5f805f805f8060c08789031215613c0557613c04613920565b5b5f613c1289828a01613bac565b9650506020613c2389828a01613bac565b9550506040613c3489828a01613bac565b9450506060613c4589828a01613bac565b9350506080613c5689828a01613bac565b92505060a0613c6789828a01613bac565b9150509295509295509295565b5f80fd5b5f80fd5b5f67ffffffffffffffff821115613c9657613c95613940565b5b602082029050602081019050919050565b5f80fd5b5f613cbd613cb884613c7c565b61399e565b90508083825260208201905060208402830185811115613ce057613cdf613ca7565b5b835b81811015613d095780613cf58882613bac565b845260208401935050602081019050613ce2565b5050509392505050565b5f82601f830112613d2757613d26613928565b5b8135613d37848260208601613cab565b91505092915050565b5f60808284031215613d5557613d54613c74565b5b613d5f608061399e565b90505f613d6e84828501613bac565b5f830152506020613d8184828501613bac565b6020830152506040613d9584828501613bac565b604083015250606082013567ffffffffffffffff811115613db957613db8613c78565b5b613dc584828501613d13565b60608301525092915050565b5f60408284031215613de657613de5613c74565b5b613df0604061399e565b90505f613dff84828501613aca565b5f830152506020613e1284828501613aca565b60208301525092915050565b5f6101008284031215613e3457613e33613c74565b5b613e3e608061399e565b90505f613e4d84828501613dd1565b5f830152506040613e6084828501613dd1565b6020830152506080613e7484828501613dd1565b60408301525060c0613e8884828501613dd1565b60608301525092915050565b5f60808284031215613ea957613ea8613c74565b5b613eb3608061399e565b90505f613ec284828501613aca565b5f830152506020613ed584828501613aca565b6020830152506040613ee984828501613aca565b6040830152506060613efd84828501613aca565b60608301525092915050565b5f805f806101c08587031215613f2257613f21613920565b5b5f85013567ffffffffffffffff811115613f3f57613f3e613924565b5b613f4b87828801613a37565b945050602085013567ffffffffffffffff811115613f6c57613f6b613924565b5b613f7887828801613d40565b9350506040613f8987828801613e1e565b925050610140613f9b87828801613e94565b91505092959194509250565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b600b8110613fe557613fe4613fa7565b5b50565b5f819050613ff582613fd4565b919050565b5f61400482613fe8565b9050919050565b61401481613ffa565b82525050565b61402381613aab565b82525050565b6101c082015f82015161403e5f85018261400b565b506020820151614051602085018261401a565b506040820151614064604085018261401a565b506060820151614077606085018261401a565b50608082015161408a608085018261401a565b5060a082015161409d60a085018261401a565b5060c08201516140b060c085018261401a565b5060e08201516140c360e085018261401a565b506101008201516140d861010085018261401a565b506101208201516140ed61012085018261401a565b5061014082015161410261014085018261401a565b5061016082015161411761016085018261401a565b5061018082015161412c61018085018261401a565b506101a08201516141416101a085018261401a565b50505050565b5f6101c08201905061415b5f830184614029565b92915050565b5f81519050919050565b5f82825260208201905092915050565b5f5b8381101561419857808201518184015260208101905061417d565b5f8484015250505050565b5f6141ad82614161565b6141b7818561416b565b93506141c781856020860161417b565b6141d081613930565b840191505092915050565b6141e481613ffa565b82525050565b5f6040820190508181035f83015261420281856141a3565b905061421160208301846141db565b9392505050565b5f8115159050919050565b61422c81614218565b8114614236575f80fd5b50565b5f8151905061424781614223565b92915050565b5f6020828403121561426257614261613920565b5b5f61426f84828501614239565b91505092915050565b7f526573756c74735375626d6974746564000000000000000000000000000000005f82015250565b5f6142ac60108361416b565b91506142b782614278565b602082019050919050565b5f6020820190508181035f8301526142d9816142a0565b9050919050565b5f6020820190508181035f8301526142f881846141a3565b905092915050565b5f61431261430d846139b8565b61399e565b90508281526020810184848401111561432e5761432d61392c565b5b61433984828561417b565b509392505050565b5f82601f83011261435557614354613928565b5b8151614365848260208601614300565b91505092915050565b5f8151905061437c81613b96565b92915050565b5f61439461438f84613c7c565b61399e565b905080838252602082019050602084028301858111156143b7576143b6613ca7565b5b835b818110156143e057806143cc888261436e565b8452602084019350506020810190506143b9565b5050509392505050565b5f82601f8301126143fe576143fd613928565b5b815161440e848260208601614382565b91505092915050565b5f6080828403121561442c5761442b613c74565b5b614436608061399e565b90505f6144458482850161436e565b5f8301525060206144588482850161436e565b602083015250604061446c8482850161436e565b604083015250606082015167ffffffffffffffff8111156144905761448f613c78565b5b61449c848285016143ea565b60608301525092915050565b5f815190506144b681613ab4565b92915050565b5f604082840312156144d1576144d0613c74565b5b6144db604061399e565b90505f6144ea848285016144a8565b5f8301525060206144fd848285016144a8565b60208301525092915050565b5f610100828403121561451f5761451e613c74565b5b614529608061399e565b90505f614538848285016144bc565b5f83015250604061454b848285016144bc565b602083015250608061455f848285016144bc565b60408301525060c0614573848285016144bc565b60608301525092915050565b5f6080828403121561459457614593613c74565b5b61459e608061399e565b90505f6145ad848285016144a8565b5f8301525060206145c0848285016144a8565b60208301525060406145d4848285016144a8565b60408301525060606145e8848285016144a8565b60608301525092915050565b5f6101c0828403121561460a57614609613c74565b5b614614608061399e565b90505f82015167ffffffffffffffff81111561463357614632613c78565b5b61463f84828501614341565b5f83015250602082015167ffffffffffffffff81111561466257614661613c78565b5b61466e84828501614417565b602083015250604061468284828501614509565b6040830152506101406146978482850161457f565b60608301525092915050565b5f602082840312156146b8576146b7613920565b5b5f82015167ffffffffffffffff8111156146d5576146d4613924565b5b6146e1848285016145f4565b91505092915050565b7f4f6e6c79204a43000000000000000000000000000000000000000000000000005f82015250565b5f61471e60078361416b565b9150614729826146ea565b602082019050919050565b5f6020820190508181035f83015261474b81614712565b9050919050565b5f6020828403121561476757614766613920565b5b5f614774848285016144a8565b91505092915050565b61478681613aab565b82525050565b5f60e0820190508181035f8301526147a4818a6141a3565b90506147b360208301896138ef565b6147c060408301886138ef565b6147cd606083018761477d565b6147da608083018661477d565b6147e760a083018561477d565b6147f460c083018461477d565b98975050505050505050565b7f4465616c416772656564000000000000000000000000000000000000000000005f82015250565b5f614834600a8361416b565b915061483f82614800565b602082019050919050565b5f6020820190508181035f83015261486181614828565b9050919050565b7f4f6e6c79205250000000000000000000000000000000000000000000000000005f82015250565b5f61489c60078361416b565b91506148a782614868565b602082019050919050565b5f6020820190508181035f8301526148c981614890565b9050919050565b5f6080820190508181035f8301526148e881876141a3565b905081810360208301526148fc81866141a3565b9050818103604083015261491081856141a3565b905061491f606083018461477d565b95945050505050565b5f6080828403121561493d5761493c613c74565b5b614947608061399e565b90505f82015167ffffffffffffffff81111561496657614965613c78565b5b61497284828501614341565b5f83015250602082015167ffffffffffffffff81111561499557614994613c78565b5b6149a184828501614341565b602083015250604082015167ffffffffffffffff8111156149c5576149c4613c78565b5b6149d184828501614341565b60408301525060606149e5848285016144a8565b60608301525092915050565b5f60208284031215614a0657614a05613920565b5b5f82015167ffffffffffffffff811115614a2357614a22613924565b5b614a2f84828501614928565b91505092915050565b5f6080820190508181035f830152614a5081876141a3565b9050614a5f60208301866138ef565b614a6c604083018561477d565b614a79606083018461477d565b95945050505050565b7f4d6564696174696f6e20616464726573730000000000000000000000000000005f82015250565b5f614ab660118361416b565b9150614ac182614a82565b602082019050919050565b5f6020820190508181035f830152614ae381614aaa565b9050919050565b5f82825260208201905092915050565b5f614b0482614161565b614b0e8185614aea565b9350614b1e81856020860161417b565b614b2781613930565b840191505092915050565b614b3b816138de565b82525050565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b5f614b758383614b32565b60208301905092915050565b5f602082019050919050565b5f614b9782614b41565b614ba18185614b4b565b9350614bac83614b5b565b805f5b83811015614bdc578151614bc38882614b6a565b9750614bce83614b81565b925050600181019050614baf565b5085935050505092915050565b5f608083015f830151614bfe5f860182614b32565b506020830151614c116020860182614b32565b506040830151614c246040860182614b32565b5060608301518482036060860152614c3c8282614b8d565b9150508091505092915050565b604082015f820151614c5d5f85018261401a565b506020820151614c70602085018261401a565b50505050565b61010082015f820151614c8b5f850182614c49565b506020820151614c9e6040850182614c49565b506040820151614cb16080850182614c49565b506060820151614cc460c0850182614c49565b50505050565b608082015f820151614cde5f85018261401a565b506020820151614cf1602085018261401a565b506040820151614d04604085018261401a565b506060820151614d17606085018261401a565b50505050565b5f6101c083015f8301518482035f860152614d388282614afa565b91505060208301518482036020860152614d528282614be9565b9150506040830151614d676040860182614c76565b506060830151614d7b610140860182614cca565b508091505092915050565b5f6020820190508181035f830152614d9e8184614d1d565b905092915050565b7f55736572732061646472657373000000000000000000000000000000000000005f82015250565b5f614dda600d8361416b565b9150614de582614da6565b602082019050919050565b5f6020820190508181035f830152614e0781614dce565b9050919050565b600b8110614e1a575f80fd5b50565b5f81519050614e2b81614e0e565b92915050565b5f6101c08284031215614e4757614e46613c74565b5b614e526101c061399e565b90505f614e6184828501614e1d565b5f830152506020614e74848285016144a8565b6020830152506040614e88848285016144a8565b6040830152506060614e9c848285016144a8565b6060830152506080614eb0848285016144a8565b60808301525060a0614ec4848285016144a8565b60a08301525060c0614ed8848285016144a8565b60c08301525060e0614eec848285016144a8565b60e083015250610100614f01848285016144a8565b61010083015250610120614f17848285016144a8565b61012083015250610140614f2d848285016144a8565b61014083015250610160614f43848285016144a8565b61016083015250610180614f59848285016144a8565b610180830152506101a0614f6f848285016144a8565b6101a08301525092915050565b5f6101c08284031215614f9257614f91613920565b5b5f614f9f84828501614e31565b91505092915050565b7f4e6f7420636f72726563742073746174650000000000000000000000000000005f82015250565b5f614fdc60118361416b565b9150614fe782614fa8565b602082019050919050565b5f6020820190508181035f83015261500981614fd0565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f61504782613aab565b915061505283613aab565b925082820190508082111561506a57615069615010565b5b92915050565b7f4e6f742074696d6564206f7574000000000000000000000000000000000000005f82015250565b5f6150a4600d8361416b565b91506150af82615070565b602082019050919050565b5f6020820190508181035f8301526150d181615098565b9050919050565b5f60a0820190508181035f8301526150f081886141a3565b90506150ff60208301876138ef565b61510c60408301866138ef565b615119606083018561477d565b615126608083018461477d565b9695505050505050565b7f53746f72616765206164647265737300000000000000000000000000000000005f82015250565b5f615164600f8361416b565b915061516f82615130565b602082019050919050565b5f6020820190508181035f83015261519181615158565b9050919050565b7f5061796d656e74732061646472657373000000000000000000000000000000005f82015250565b5f6151cc60108361416b565b91506151d782615198565b602082019050919050565b5f6020820190508181035f8301526151f9816151c0565b9050919050565b7f4f6e6c79204a43206f72205250000000000000000000000000000000000000005f82015250565b5f615234600d8361416b565b915061523f82615200565b602082019050919050565b5f6020820190508181035f83015261526181615228565b9050919050565b5f6060820190508181035f83015261528081866141a3565b905061528f60208301856138ef565b61529c604083018461477d565b949350505050565b7f4f6e6c79206d6564696174696f6e0000000000000000000000000000000000005f82015250565b5f6152d8600e8361416b565b91506152e3826152a4565b602082019050919050565b5f6020820190508181035f830152615305816152cc565b9050919050565b7f43616e6e6f74206d6564696174650000000000000000000000000000000000005f82015250565b5f615340600e8361416b565b915061534b8261530c565b602082019050919050565b5f6020820190508181035f83015261536d81615334565b9050919050565b5f60c0820190508181035f83015261538c81896141a3565b905061539b60208301886138ef565b6153a860408301876138ef565b6153b5606083018661477d565b6153c2608083018561477d565b6153cf60a083018461477d565b979650505050505050565b7f4a6f6243726561746f72206164647265737300000000000000000000000000005f82015250565b5f61540e60128361416b565b9150615419826153da565b602082019050919050565b5f6020820190508181035f83015261543b81615402565b9050919050565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c7265615f8201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b5f61549c602e8361416b565b91506154a782615442565b604082019050919050565b5f6020820190508181035f8301526154c981615490565b9050919050565b5f819050919050565b5f60ff82169050919050565b5f819050919050565b5f6155086155036154fe846154d0565b6154e5565b6154d9565b9050919050565b615518816154ee565b82525050565b5f6020820190506155315f83018461550f565b92915050565b7f4f6e6c79205250206f72204a43000000000000000000000000000000000000005f82015250565b5f61556b600d8361416b565b915061557682615537565b602082019050919050565b5f6020820190508181035f8301526155988161555f565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f20615f8201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b5f6155f960268361416b565b91506156048261559f565b604082019050919050565b5f6020820190508181035f830152615626816155ed565b9050919050565b5f608083015f8301516156425f860182614b32565b5060208301516156556020860182614b32565b5060408301516156686040860182614b32565b50606083015184820360608601526156808282614b8d565b9150508091505092915050565b61010082015f8201516156a25f850182614c49565b5060208201516156b56040850182614c49565b5060408201516156c86080850182614c49565b5060608201516156db60c0850182614c49565b50505050565b608082015f8201516156f55f85018261401a565b506020820151615708602085018261401a565b50604082015161571b604085018261401a565b50606082015161572e606085018261401a565b50505050565b5f6101c0820190508181035f83015261574d81876141a3565b90508181036020830152615761818661562d565b9050615770604083018561568d565b61577e6101408301846156e1565b95945050505050565b7f4f6e6c79205250202f204a4300000000000000000000000000000000000000005f82015250565b5f6157bb600c8361416b565b91506157c682615787565b602082019050919050565b5f6020820190508181035f8301526157e8816157af565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725f82015250565b5f61582360208361416b565b915061582e826157ef565b602082019050919050565b5f6020820190508181035f83015261585081615817565b9050919050565b7f526573756c7473436865636b65640000000000000000000000000000000000005f82015250565b5f61588b600e8361416b565b915061589682615857565b602082019050919050565b5f6020820190508181035f8301526158b88161587f565b905091905056fea2646970667358221220b8ecb50936289304e06b15e6d51bddd7dea411982ee2f56694aef5dc97b21b2d64736f6c63430008150033", } // ControllerABI is the input ABI used to generate the binding from. @@ -343,6 +343,37 @@ func (_Controller *ControllerCallerSession) GetPaymentsAddress() (common.Address return _Controller.Contract.GetPaymentsAddress(&_Controller.CallOpts) } +// GetPowAddress is a free data retrieval call binding the contract method 0xd882a252. +// +// Solidity: function getPowAddress() view returns(address) +func (_Controller *ControllerCaller) GetPowAddress(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Controller.contract.Call(opts, &out, "getPowAddress") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// GetPowAddress is a free data retrieval call binding the contract method 0xd882a252. +// +// Solidity: function getPowAddress() view returns(address) +func (_Controller *ControllerSession) GetPowAddress() (common.Address, error) { + return _Controller.Contract.GetPowAddress(&_Controller.CallOpts) +} + +// GetPowAddress is a free data retrieval call binding the contract method 0xd882a252. +// +// Solidity: function getPowAddress() view returns(address) +func (_Controller *ControllerCallerSession) GetPowAddress() (common.Address, error) { + return _Controller.Contract.GetPowAddress(&_Controller.CallOpts) +} + // GetStorageAddress is a free data retrieval call binding the contract method 0x393a4d34. // // Solidity: function getStorageAddress() view returns(address) @@ -520,25 +551,25 @@ func (_Controller *ControllerTransactorSession) CheckResult(dealId string) (*typ return _Controller.Contract.CheckResult(&_Controller.TransactOpts, dealId) } -// Initialize is a paid mutator transaction binding the contract method 0x1459457a. +// Initialize is a paid mutator transaction binding the contract method 0xcc2a9a5b. // -// Solidity: function initialize(address _storageAddress, address _usersAddress, address _paymentsAddress, address _mediationAddress, address _jobCreatorAddress) returns() -func (_Controller *ControllerTransactor) Initialize(opts *bind.TransactOpts, _storageAddress common.Address, _usersAddress common.Address, _paymentsAddress common.Address, _mediationAddress common.Address, _jobCreatorAddress common.Address) (*types.Transaction, error) { - return _Controller.contract.Transact(opts, "initialize", _storageAddress, _usersAddress, _paymentsAddress, _mediationAddress, _jobCreatorAddress) +// Solidity: function initialize(address _storageAddress, address _usersAddress, address _paymentsAddress, address _mediationAddress, address _jobCreatorAddress, address _powAddress) returns() +func (_Controller *ControllerTransactor) Initialize(opts *bind.TransactOpts, _storageAddress common.Address, _usersAddress common.Address, _paymentsAddress common.Address, _mediationAddress common.Address, _jobCreatorAddress common.Address, _powAddress common.Address) (*types.Transaction, error) { + return _Controller.contract.Transact(opts, "initialize", _storageAddress, _usersAddress, _paymentsAddress, _mediationAddress, _jobCreatorAddress, _powAddress) } -// Initialize is a paid mutator transaction binding the contract method 0x1459457a. +// Initialize is a paid mutator transaction binding the contract method 0xcc2a9a5b. // -// Solidity: function initialize(address _storageAddress, address _usersAddress, address _paymentsAddress, address _mediationAddress, address _jobCreatorAddress) returns() -func (_Controller *ControllerSession) Initialize(_storageAddress common.Address, _usersAddress common.Address, _paymentsAddress common.Address, _mediationAddress common.Address, _jobCreatorAddress common.Address) (*types.Transaction, error) { - return _Controller.Contract.Initialize(&_Controller.TransactOpts, _storageAddress, _usersAddress, _paymentsAddress, _mediationAddress, _jobCreatorAddress) +// Solidity: function initialize(address _storageAddress, address _usersAddress, address _paymentsAddress, address _mediationAddress, address _jobCreatorAddress, address _powAddress) returns() +func (_Controller *ControllerSession) Initialize(_storageAddress common.Address, _usersAddress common.Address, _paymentsAddress common.Address, _mediationAddress common.Address, _jobCreatorAddress common.Address, _powAddress common.Address) (*types.Transaction, error) { + return _Controller.Contract.Initialize(&_Controller.TransactOpts, _storageAddress, _usersAddress, _paymentsAddress, _mediationAddress, _jobCreatorAddress, _powAddress) } -// Initialize is a paid mutator transaction binding the contract method 0x1459457a. +// Initialize is a paid mutator transaction binding the contract method 0xcc2a9a5b. // -// Solidity: function initialize(address _storageAddress, address _usersAddress, address _paymentsAddress, address _mediationAddress, address _jobCreatorAddress) returns() -func (_Controller *ControllerTransactorSession) Initialize(_storageAddress common.Address, _usersAddress common.Address, _paymentsAddress common.Address, _mediationAddress common.Address, _jobCreatorAddress common.Address) (*types.Transaction, error) { - return _Controller.Contract.Initialize(&_Controller.TransactOpts, _storageAddress, _usersAddress, _paymentsAddress, _mediationAddress, _jobCreatorAddress) +// Solidity: function initialize(address _storageAddress, address _usersAddress, address _paymentsAddress, address _mediationAddress, address _jobCreatorAddress, address _powAddress) returns() +func (_Controller *ControllerTransactorSession) Initialize(_storageAddress common.Address, _usersAddress common.Address, _paymentsAddress common.Address, _mediationAddress common.Address, _jobCreatorAddress common.Address, _powAddress common.Address) (*types.Transaction, error) { + return _Controller.Contract.Initialize(&_Controller.TransactOpts, _storageAddress, _usersAddress, _paymentsAddress, _mediationAddress, _jobCreatorAddress, _powAddress) } // MediationAcceptResult is a paid mutator transaction binding the contract method 0x824518aa. @@ -667,6 +698,27 @@ func (_Controller *ControllerTransactorSession) SetPaymentsAddress(_paymentsAddr return _Controller.Contract.SetPaymentsAddress(&_Controller.TransactOpts, _paymentsAddress) } +// SetPowAddress is a paid mutator transaction binding the contract method 0x4ef168a6. +// +// Solidity: function setPowAddress(address _powAddress) returns() +func (_Controller *ControllerTransactor) SetPowAddress(opts *bind.TransactOpts, _powAddress common.Address) (*types.Transaction, error) { + return _Controller.contract.Transact(opts, "setPowAddress", _powAddress) +} + +// SetPowAddress is a paid mutator transaction binding the contract method 0x4ef168a6. +// +// Solidity: function setPowAddress(address _powAddress) returns() +func (_Controller *ControllerSession) SetPowAddress(_powAddress common.Address) (*types.Transaction, error) { + return _Controller.Contract.SetPowAddress(&_Controller.TransactOpts, _powAddress) +} + +// SetPowAddress is a paid mutator transaction binding the contract method 0x4ef168a6. +// +// Solidity: function setPowAddress(address _powAddress) returns() +func (_Controller *ControllerTransactorSession) SetPowAddress(_powAddress common.Address) (*types.Transaction, error) { + return _Controller.Contract.SetPowAddress(&_Controller.TransactOpts, _powAddress) +} + // SetStorageAddress is a paid mutator transaction binding the contract method 0x59b910d6. // // Solidity: function setStorageAddress(address _storageAddress) returns() diff --git a/pkg/web3/bindings/pow/pow.go b/pkg/web3/bindings/pow/pow.go new file mode 100644 index 00000000..f451974a --- /dev/null +++ b/pkg/web3/bindings/pow/pow.go @@ -0,0 +1,1497 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package pow + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +// 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\":true,\"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\":\"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\":\"TARGET_DIFFICULTY\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"calculate_difficulty\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"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\":\"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\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"minerSubmissionCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"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_timestap\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"complete_timestap\",\"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\":[{\"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: "0x60a06040527c5269a8a800000000000000000000000000000000000000000000000000608090815250348015610033575f80fd5b5061005061004561005560201b60201c565b61005c60201b60201c565b61011d565b5f33905090565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b608051611ffe61013c5f395f818161041a0152610fd00152611ffe5ff3fe608060405234801561000f575f80fd5b506004361061011f575f3560e01c80638da5cb5b116100ab578063bfb660de1161006f578063bfb660de146102c8578063da8accf9146102d2578063e0d152af146102ee578063f2fde38b1461031e578063f6f851681461033a5761011f565b80638da5cb5b14610248578063a738bf8f14610266578063ab09894514610284578063b28d87ea146102a0578063b681f2fd146102be5761011f565b80634bbe05e4116100f25780634bbe05e4146101ad5780636189f3ac146101e3578063715018a61461021657806378e97925146102205780638129fc1c1461023e5761011f565b8063148c684a146101235780631633da6e146101535780632d68c39714610171578063331bade11461018f575b5f80fd5b61013d600480360381019061013891906111bc565b610358565b60405161014a91906111ff565b60405180910390f35b61015b61036d565b60405161016891906112cf565b60405180910390f35b6101796103f8565b60405161018691906111ff565b60405180910390f35b610197610453565b6040516101a491906111ff565b60405180910390f35b6101c760048036038101906101c29190611319565b610459565b6040516101da9796959493929190611408565b60405180910390f35b6101fd60048036038101906101f891906111bc565b610556565b60405161020d949392919061147c565b60405180910390f35b61021e610608565b005b61022861061b565b60405161023591906111ff565b60405180910390f35b610246610621565b005b610250610756565b60405161025d91906114c6565b60405180910390f35b61026e61077d565b60405161027b91906111ff565b60405180910390f35b61029e60048036038101906102999190611540565b610783565b005b6102a86108df565b6040516102b591906111ff565b60405180910390f35b6102c66108e5565b005b6102d0610935565b005b6102ec60048036038101906102e7919061158b565b61097b565b005b610308600480360381019061030391906115e8565b610f11565b60405161031591906114c6565b60405180910390f35b610338600480360381019061033391906111bc565b610f4c565b005b610342610fce565b60405161034f91906111ff565b60405180910390f35b6002602052805f5260405f205f915090505481565b606060038054806020026020016040519081016040528092919081815260200182805480156103ee57602002820191905f5260205f20905b815f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116103a5575b5050505050905090565b5f806015446104079190611640565b605a610413919061169d565b90506064817f000000000000000000000000000000000000000000000000000000000000000061044391906116d0565b61044d9190611711565b91505090565b60075481565b6001602052815f5260405f208181548110610472575f80fd5b905f5260205f2090600702015f9150915050805f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010180546104b79061176e565b80601f01602080910402602001604051908101604052809291908181526020018280546104e39061176e565b801561052e5780601f106105055761010080835404028352916020019161052e565b820191905f5260205f20905b81548152906001019060200180831161051157829003601f168201915b5050505050908060020154908060030154908060040154908060050154908060060154905087565b6004602052805f5260405f205f91509050805f0154908060010154908060020180546105819061176e565b80601f01602080910402602001604051908101604052809291908181526020018280546105ad9061176e565b80156105f85780601f106105cf576101008083540402835291602001916105f8565b820191905f5260205f20905b8154815290600101906020018083116105db57829003601f168201915b5050505050908060030154905084565b610610610ff2565b6106195f611070565b565b60065481565b5f8060159054906101000a900460ff16159050808015610652575060015f60149054906101000a900460ff1660ff16105b80610680575061066130611131565b15801561067f575060015f60149054906101000a900460ff1660ff16145b5b6106bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106b69061180e565b60405180910390fd5b60015f60146101000a81548160ff021916908360ff16021790555080156106fb5760015f60156101000a81548160ff0219169083151502179055505b8015610753575f8060156101000a81548160ff0219169083151502179055507f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498600160405161074a919061187a565b60405180910390a15b50565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60085481565b61078b610935565b5f426007543385856040516020016107a7959493929190611934565b6040516020818303038152906040528051906020012090505f6107c86103f8565b9050604051806080016040528083815260200182815260200185858080601f0160208091040260200160405190810160405280939291908181526020018383808284375f81840152601f19601f8201169050808301925050505050505081526020014281525060045f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f820151815f01556020820151816001015560408201518160020190816108929190611b40565b50606082015181600301559050507f496186a9d930bac0744acdcd1d0c054b18283eecbe99d30bda98102d3d06b8ef82826040516108d1929190611c0f565b60405180910390a150505050565b60055481565b6108ed610ff2565b43600781905550601e43610901919061169d565b6008819055507f10cc99616aca050d810fd487c95f968e516d0fa25318530ed50753153d060a1e60405160405180910390a1565b6008544310610979576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097090611c80565b60405180910390fd5b565b610983610935565b5f60045f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f206040518060800160405290815f8201548152602001600182015481526020016002820180546109ef9061176e565b80601f0160208091040260200160405190810160405280929190818152602001828054610a1b9061176e565b8015610a665780601f10610a3d57610100808354040283529160200191610a66565b820191905f5260205f20905b815481529060010190602001808311610a4957829003601f168201915b5050505050815260200160038201548152505090505f8160600151600754338686604051602001610a9b959493929190611934565b60405160208183030381529060405280519060200120905080825f015114610af8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aef90611d0e565b60405180910390fd5b5f8186604051602001610b0c929190611d4c565b6040516020818303038152906040528051906020012090508260200151815f1c10610b6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b6390611de7565b60405180910390fd5b60055f815480929190610b7e90611e05565b91905055505f60025f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205403610c2857600333908060018154018082558091505060019003905f5260205f20015f9091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b60025f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f815480929190610c7590611e05565b91905055505f60015f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f209050806040518060e001604052803373ffffffffffffffffffffffffffffffffffffffff16815260200188888080601f0160208091040260200160405190810160405280939291908181526020018383808284375f81840152601f19601f82011690508083019250505050505050815260200189815260200186606001518152602001428152602001865f015181526020018660200151815250908060018154018082558091505060019003905f5260205f2090600702015f909190919091505f820151815f015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001019081610dd19190611b40565b5060408201518160020155606082015181600301556080820151816004015560a0820151816005015560c08201518160060155505060405180608001604052805f801b81526020015f815260200160405180602001604052805f81525081526020015f81525060045f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f820151815f0155602082015181600101556040820151816002019081610e9b9190611b40565b50606082015181600301559050503373ffffffffffffffffffffffffffffffffffffffff167f5ea61d67e3236a79ab8c3c29f810e2c408b0a6b1e19f4e0da2fcd6362129c86087878a42895f01518a60200151604051610f0096959493929190611e78565b60405180910390a250505050505050565b60038181548110610f20575f80fd5b905f5260205f20015f915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610f54610ff2565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610fc2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fb990611f42565b60405180910390fd5b610fcb81611070565b50565b7f000000000000000000000000000000000000000000000000000000000000000081565b610ffa611153565b73ffffffffffffffffffffffffffffffffffffffff16611018610756565b73ffffffffffffffffffffffffffffffffffffffff161461106e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106590611faa565b60405180910390fd5b565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b5f33905090565b5f80fd5b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61118b82611162565b9050919050565b61119b81611181565b81146111a5575f80fd5b50565b5f813590506111b681611192565b92915050565b5f602082840312156111d1576111d061115a565b5b5f6111de848285016111a8565b91505092915050565b5f819050919050565b6111f9816111e7565b82525050565b5f6020820190506112125f8301846111f0565b92915050565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b61124a81611181565b82525050565b5f61125b8383611241565b60208301905092915050565b5f602082019050919050565b5f61127d82611218565b6112878185611222565b935061129283611232565b805f5b838110156112c25781516112a98882611250565b97506112b483611267565b925050600181019050611295565b5085935050505092915050565b5f6020820190508181035f8301526112e78184611273565b905092915050565b6112f8816111e7565b8114611302575f80fd5b50565b5f81359050611313816112ef565b92915050565b5f806040838503121561132f5761132e61115a565b5b5f61133c858286016111a8565b925050602061134d85828601611305565b9150509250929050565b61136081611181565b82525050565b5f81519050919050565b5f82825260208201905092915050565b5f5b8381101561139d578082015181840152602081019050611382565b5f8484015250505050565b5f601f19601f8301169050919050565b5f6113c282611366565b6113cc8185611370565b93506113dc818560208601611380565b6113e5816113a8565b840191505092915050565b5f819050919050565b611402816113f0565b82525050565b5f60e08201905061141b5f83018a611357565b818103602083015261142d81896113b8565b905061143c60408301886111f0565b61144960608301876111f0565b61145660808301866111f0565b61146360a08301856113f9565b61147060c08301846111f0565b98975050505050505050565b5f60808201905061148f5f8301876113f9565b61149c60208301866111f0565b81810360408301526114ae81856113b8565b90506114bd60608301846111f0565b95945050505050565b5f6020820190506114d95f830184611357565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f840112611500576114ff6114df565b5b8235905067ffffffffffffffff81111561151d5761151c6114e3565b5b602083019150836001820283011115611539576115386114e7565b5b9250929050565b5f80602083850312156115565761155561115a565b5b5f83013567ffffffffffffffff8111156115735761157261115e565b5b61157f858286016114eb565b92509250509250929050565b5f805f604084860312156115a2576115a161115a565b5b5f6115af86828701611305565b935050602084013567ffffffffffffffff8111156115d0576115cf61115e565b5b6115dc868287016114eb565b92509250509250925092565b5f602082840312156115fd576115fc61115a565b5b5f61160a84828501611305565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f61164a826111e7565b9150611655836111e7565b92508261166557611664611613565b5b828206905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6116a7826111e7565b91506116b2836111e7565b92508282019050808211156116ca576116c9611670565b5b92915050565b5f6116da826111e7565b91506116e5836111e7565b92508282026116f3816111e7565b9150828204841483151761170a57611709611670565b5b5092915050565b5f61171b826111e7565b9150611726836111e7565b92508261173657611735611613565b5b828204905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f600282049050600182168061178557607f821691505b60208210810361179857611797611741565b5b50919050565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c7265615f8201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b5f6117f8602e83611370565b91506118038261179e565b604082019050919050565b5f6020820190508181035f830152611825816117ec565b9050919050565b5f819050919050565b5f60ff82169050919050565b5f819050919050565b5f61186461185f61185a8461182c565b611841565b611835565b9050919050565b6118748161184a565b82525050565b5f60208201905061188d5f83018461186b565b92915050565b5f819050919050565b6118ad6118a8826111e7565b611893565b82525050565b5f8160601b9050919050565b5f6118c9826118b3565b9050919050565b5f6118da826118bf565b9050919050565b6118f26118ed82611181565b6118d0565b82525050565b5f81905092915050565b828183375f83830152505050565b5f61191b83856118f8565b9350611928838584611902565b82840190509392505050565b5f61193f828861189c565b60208201915061194f828761189c565b60208201915061195f82866118e1565b601482019150611970828486611910565b91508190509695505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f819050815f5260205f209050919050565b5f6020601f8301049050919050565b5f82821b905092915050565b5f60088302611a087fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826119cd565b611a1286836119cd565b95508019841693508086168417925050509392505050565b5f611a44611a3f611a3a846111e7565b611841565b6111e7565b9050919050565b5f819050919050565b611a5d83611a2a565b611a71611a6982611a4b565b8484546119d9565b825550505050565b5f90565b611a85611a79565b611a90818484611a54565b505050565b5b81811015611ab357611aa85f82611a7d565b600181019050611a96565b5050565b601f821115611af857611ac9816119ac565b611ad2846119be565b81016020851015611ae1578190505b611af5611aed856119be565b830182611a95565b50505b505050565b5f82821c905092915050565b5f611b185f1984600802611afd565b1980831691505092915050565b5f611b308383611b09565b9150826002028217905092915050565b611b4982611366565b67ffffffffffffffff811115611b6257611b6161197f565b5b611b6c825461176e565b611b77828285611ab7565b5f60209050601f831160018114611ba8575f8415611b96578287015190505b611ba08582611b25565b865550611c07565b601f198416611bb6866119ac565b5f5b82811015611bdd57848901518255600182019150602085019450602081019050611bb8565b86831015611bfa5784890151611bf6601f891682611b09565b8355505b6001600288020188555050505b505050505050565b5f604082019050611c225f8301856113f9565b611c2f60208301846111f0565b9392505050565b7f70726f6f662077696e646f77732068617320636c6f73656400000000000000005f82015250565b5f611c6a601883611370565b9150611c7582611c36565b602082019050919050565b5f6020820190508181035f830152611c9781611c5e565b9050919050565b7f576f726b207375626d6974206e6f7420636f6d70617461626c652077697468205f8201527f6368616c6c656e67650000000000000000000000000000000000000000000000602082015250565b5f611cf8602983611370565b9150611d0382611c9e565b604082019050919050565b5f6020820190508181035f830152611d2581611cec565b9050919050565b5f819050919050565b611d46611d41826113f0565b611d2c565b82525050565b5f611d578285611d35565b602082019150611d67828461189c565b6020820191508190509392505050565b7f576f726b20646f6573206e6f74206d65657420646966666963756c74792074615f8201527f7267657400000000000000000000000000000000000000000000000000000000602082015250565b5f611dd1602483611370565b9150611ddc82611d77565b604082019050919050565b5f6020820190508181035f830152611dfe81611dc5565b9050919050565b5f611e0f826111e7565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611e4157611e40611670565b5b600182019050919050565b5f611e578385611370565b9350611e64838584611902565b611e6d836113a8565b840190509392505050565b5f60a0820190508181035f830152611e9181888a611e4c565b9050611ea060208301876111f0565b611ead60408301866111f0565b611eba60608301856113f9565b611ec760808301846111f0565b979650505050505050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f20615f8201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b5f611f2c602683611370565b9150611f3782611ed2565b604082019050919050565b5f6020820190508181035f830152611f5981611f20565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725f82015250565b5f611f94602083611370565b9150611f9f82611f60565b602082019050919050565b5f6020820190508181035f830152611fc181611f88565b905091905056fea2646970667358221220e66d961328264141eb34b4e4f3e4360ab4e09b23e6a36ea98882788925a681ae64736f6c63430008150033", +} + +// PowABI is the input ABI used to generate the binding from. +// Deprecated: Use PowMetaData.ABI instead. +var PowABI = PowMetaData.ABI + +// PowBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use PowMetaData.Bin instead. +var PowBin = PowMetaData.Bin + +// DeployPow deploys a new Ethereum contract, binding an instance of Pow to it. +func DeployPow(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Pow, error) { + parsed, err := PowMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(PowBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &Pow{PowCaller: PowCaller{contract: contract}, PowTransactor: PowTransactor{contract: contract}, PowFilterer: PowFilterer{contract: contract}}, nil +} + +// Pow is an auto generated Go binding around an Ethereum contract. +type Pow struct { + PowCaller // Read-only binding to the contract + PowTransactor // Write-only binding to the contract + PowFilterer // Log filterer for contract events +} + +// PowCaller is an auto generated read-only Go binding around an Ethereum contract. +type PowCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// PowTransactor is an auto generated write-only Go binding around an Ethereum contract. +type PowTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// PowFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type PowFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// PowSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type PowSession struct { + Contract *Pow // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// PowCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type PowCallerSession struct { + Contract *PowCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// PowTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type PowTransactorSession struct { + Contract *PowTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// PowRaw is an auto generated low-level Go binding around an Ethereum contract. +type PowRaw struct { + Contract *Pow // Generic contract binding to access the raw methods on +} + +// PowCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type PowCallerRaw struct { + Contract *PowCaller // Generic read-only contract binding to access the raw methods on +} + +// PowTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type PowTransactorRaw struct { + Contract *PowTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewPow creates a new instance of Pow, bound to a specific deployed contract. +func NewPow(address common.Address, backend bind.ContractBackend) (*Pow, error) { + contract, err := bindPow(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &Pow{PowCaller: PowCaller{contract: contract}, PowTransactor: PowTransactor{contract: contract}, PowFilterer: PowFilterer{contract: contract}}, nil +} + +// NewPowCaller creates a new read-only instance of Pow, bound to a specific deployed contract. +func NewPowCaller(address common.Address, caller bind.ContractCaller) (*PowCaller, error) { + contract, err := bindPow(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &PowCaller{contract: contract}, nil +} + +// NewPowTransactor creates a new write-only instance of Pow, bound to a specific deployed contract. +func NewPowTransactor(address common.Address, transactor bind.ContractTransactor) (*PowTransactor, error) { + contract, err := bindPow(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &PowTransactor{contract: contract}, nil +} + +// NewPowFilterer creates a new log filterer instance of Pow, bound to a specific deployed contract. +func NewPowFilterer(address common.Address, filterer bind.ContractFilterer) (*PowFilterer, error) { + contract, err := bindPow(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &PowFilterer{contract: contract}, nil +} + +// bindPow binds a generic wrapper to an already deployed contract. +func bindPow(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := PowMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Pow *PowRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Pow.Contract.PowCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Pow *PowRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Pow.Contract.PowTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Pow *PowRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Pow.Contract.PowTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Pow *PowCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Pow.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Pow *PowTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Pow.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Pow *PowTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Pow.Contract.contract.Transact(opts, method, params...) +} + +// TARGETDIFFICULTY is a free data retrieval call binding the contract method 0xf6f85168. +// +// Solidity: function TARGET_DIFFICULTY() view returns(uint256) +func (_Pow *PowCaller) TARGETDIFFICULTY(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _Pow.contract.Call(opts, &out, "TARGET_DIFFICULTY") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// TARGETDIFFICULTY is a free data retrieval call binding the contract method 0xf6f85168. +// +// Solidity: function TARGET_DIFFICULTY() view returns(uint256) +func (_Pow *PowSession) TARGETDIFFICULTY() (*big.Int, error) { + return _Pow.Contract.TARGETDIFFICULTY(&_Pow.CallOpts) +} + +// TARGETDIFFICULTY is a free data retrieval call binding the contract method 0xf6f85168. +// +// Solidity: function TARGET_DIFFICULTY() view returns(uint256) +func (_Pow *PowCallerSession) TARGETDIFFICULTY() (*big.Int, error) { + return _Pow.Contract.TARGETDIFFICULTY(&_Pow.CallOpts) +} + +// CalculateDifficulty is a free data retrieval call binding the contract method 0x2d68c397. +// +// Solidity: function calculate_difficulty() view returns(uint256) +func (_Pow *PowCaller) CalculateDifficulty(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _Pow.contract.Call(opts, &out, "calculate_difficulty") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// CalculateDifficulty is a free data retrieval call binding the contract method 0x2d68c397. +// +// Solidity: function calculate_difficulty() view returns(uint256) +func (_Pow *PowSession) CalculateDifficulty() (*big.Int, error) { + return _Pow.Contract.CalculateDifficulty(&_Pow.CallOpts) +} + +// CalculateDifficulty is a free data retrieval call binding the contract method 0x2d68c397. +// +// Solidity: function calculate_difficulty() view returns(uint256) +func (_Pow *PowCallerSession) CalculateDifficulty() (*big.Int, error) { + return _Pow.Contract.CalculateDifficulty(&_Pow.CallOpts) +} + +// CheckTimeWindow is a free data retrieval call binding the contract method 0xbfb660de. +// +// Solidity: function checkTimeWindow() view returns() +func (_Pow *PowCaller) CheckTimeWindow(opts *bind.CallOpts) error { + var out []interface{} + err := _Pow.contract.Call(opts, &out, "checkTimeWindow") + + if err != nil { + return err + } + + return err + +} + +// CheckTimeWindow is a free data retrieval call binding the contract method 0xbfb660de. +// +// Solidity: function checkTimeWindow() view returns() +func (_Pow *PowSession) CheckTimeWindow() error { + return _Pow.Contract.CheckTimeWindow(&_Pow.CallOpts) +} + +// CheckTimeWindow is a free data retrieval call binding the contract method 0xbfb660de. +// +// Solidity: function checkTimeWindow() view returns() +func (_Pow *PowCallerSession) CheckTimeWindow() error { + return _Pow.Contract.CheckTimeWindow(&_Pow.CallOpts) +} + +// GetMiners is a free data retrieval call binding the contract method 0x1633da6e. +// +// Solidity: function getMiners() view returns(address[]) +func (_Pow *PowCaller) GetMiners(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _Pow.contract.Call(opts, &out, "getMiners") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +// GetMiners is a free data retrieval call binding the contract method 0x1633da6e. +// +// Solidity: function getMiners() view returns(address[]) +func (_Pow *PowSession) GetMiners() ([]common.Address, error) { + return _Pow.Contract.GetMiners(&_Pow.CallOpts) +} + +// GetMiners is a free data retrieval call binding the contract method 0x1633da6e. +// +// Solidity: function getMiners() view returns(address[]) +func (_Pow *PowCallerSession) GetMiners() ([]common.Address, error) { + return _Pow.Contract.GetMiners(&_Pow.CallOpts) +} + +// LastChallenges is a free data retrieval call binding the contract method 0x6189f3ac. +// +// Solidity: function lastChallenges(address ) view returns(bytes32 challenge, uint256 difficulty, string nodeId, uint256 timestamp) +func (_Pow *PowCaller) LastChallenges(opts *bind.CallOpts, arg0 common.Address) (struct { + Challenge [32]byte + Difficulty *big.Int + NodeId string + Timestamp *big.Int +}, error) { + var out []interface{} + err := _Pow.contract.Call(opts, &out, "lastChallenges", arg0) + + outstruct := new(struct { + Challenge [32]byte + Difficulty *big.Int + NodeId string + Timestamp *big.Int + }) + if err != nil { + return *outstruct, err + } + + outstruct.Challenge = *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + outstruct.Difficulty = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + outstruct.NodeId = *abi.ConvertType(out[2], new(string)).(*string) + outstruct.Timestamp = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) + + return *outstruct, err + +} + +// LastChallenges is a free data retrieval call binding the contract method 0x6189f3ac. +// +// Solidity: function lastChallenges(address ) view returns(bytes32 challenge, uint256 difficulty, string nodeId, uint256 timestamp) +func (_Pow *PowSession) LastChallenges(arg0 common.Address) (struct { + Challenge [32]byte + Difficulty *big.Int + NodeId string + Timestamp *big.Int +}, error) { + return _Pow.Contract.LastChallenges(&_Pow.CallOpts, arg0) +} + +// LastChallenges is a free data retrieval call binding the contract method 0x6189f3ac. +// +// Solidity: function lastChallenges(address ) view returns(bytes32 challenge, uint256 difficulty, string nodeId, uint256 timestamp) +func (_Pow *PowCallerSession) LastChallenges(arg0 common.Address) (struct { + Challenge [32]byte + Difficulty *big.Int + NodeId string + Timestamp *big.Int +}, error) { + return _Pow.Contract.LastChallenges(&_Pow.CallOpts, arg0) +} + +// MinerSubmissionCount is a free data retrieval call binding the contract method 0x148c684a. +// +// Solidity: function minerSubmissionCount(address ) view returns(uint256) +func (_Pow *PowCaller) MinerSubmissionCount(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { + var out []interface{} + err := _Pow.contract.Call(opts, &out, "minerSubmissionCount", arg0) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// MinerSubmissionCount is a free data retrieval call binding the contract method 0x148c684a. +// +// Solidity: function minerSubmissionCount(address ) view returns(uint256) +func (_Pow *PowSession) MinerSubmissionCount(arg0 common.Address) (*big.Int, error) { + return _Pow.Contract.MinerSubmissionCount(&_Pow.CallOpts, arg0) +} + +// MinerSubmissionCount is a free data retrieval call binding the contract method 0x148c684a. +// +// Solidity: function minerSubmissionCount(address ) view returns(uint256) +func (_Pow *PowCallerSession) MinerSubmissionCount(arg0 common.Address) (*big.Int, error) { + return _Pow.Contract.MinerSubmissionCount(&_Pow.CallOpts, arg0) +} + +// Miners is a free data retrieval call binding the contract method 0xe0d152af. +// +// Solidity: function miners(uint256 ) view returns(address) +func (_Pow *PowCaller) Miners(opts *bind.CallOpts, arg0 *big.Int) (common.Address, error) { + var out []interface{} + err := _Pow.contract.Call(opts, &out, "miners", arg0) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Miners is a free data retrieval call binding the contract method 0xe0d152af. +// +// Solidity: function miners(uint256 ) view returns(address) +func (_Pow *PowSession) Miners(arg0 *big.Int) (common.Address, error) { + return _Pow.Contract.Miners(&_Pow.CallOpts, arg0) +} + +// Miners is a free data retrieval call binding the contract method 0xe0d152af. +// +// Solidity: function miners(uint256 ) view returns(address) +func (_Pow *PowCallerSession) Miners(arg0 *big.Int) (common.Address, error) { + return _Pow.Contract.Miners(&_Pow.CallOpts, arg0) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_Pow *PowCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Pow.contract.Call(opts, &out, "owner") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_Pow *PowSession) Owner() (common.Address, error) { + return _Pow.Contract.Owner(&_Pow.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_Pow *PowCallerSession) Owner() (common.Address, error) { + return _Pow.Contract.Owner(&_Pow.CallOpts) +} + +// PowSubmissions is a free data retrieval call binding the contract method 0x4bbe05e4. +// +// Solidity: function powSubmissions(address , uint256 ) view returns(address walletAddress, string nodeId, uint256 nonce, uint256 start_timestap, uint256 complete_timestap, bytes32 challenge, uint256 difficulty) +func (_Pow *PowCaller) PowSubmissions(opts *bind.CallOpts, arg0 common.Address, arg1 *big.Int) (struct { + WalletAddress common.Address + NodeId string + Nonce *big.Int + StartTimestap *big.Int + CompleteTimestap *big.Int + Challenge [32]byte + Difficulty *big.Int +}, error) { + var out []interface{} + err := _Pow.contract.Call(opts, &out, "powSubmissions", arg0, arg1) + + outstruct := new(struct { + WalletAddress common.Address + NodeId string + Nonce *big.Int + StartTimestap *big.Int + CompleteTimestap *big.Int + Challenge [32]byte + Difficulty *big.Int + }) + if err != nil { + return *outstruct, err + } + + outstruct.WalletAddress = *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + outstruct.NodeId = *abi.ConvertType(out[1], new(string)).(*string) + outstruct.Nonce = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) + outstruct.StartTimestap = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) + outstruct.CompleteTimestap = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) + outstruct.Challenge = *abi.ConvertType(out[5], new([32]byte)).(*[32]byte) + outstruct.Difficulty = *abi.ConvertType(out[6], new(*big.Int)).(**big.Int) + + return *outstruct, err + +} + +// PowSubmissions is a free data retrieval call binding the contract method 0x4bbe05e4. +// +// Solidity: function powSubmissions(address , uint256 ) view returns(address walletAddress, string nodeId, uint256 nonce, uint256 start_timestap, uint256 complete_timestap, bytes32 challenge, uint256 difficulty) +func (_Pow *PowSession) PowSubmissions(arg0 common.Address, arg1 *big.Int) (struct { + WalletAddress common.Address + NodeId string + Nonce *big.Int + StartTimestap *big.Int + CompleteTimestap *big.Int + Challenge [32]byte + Difficulty *big.Int +}, error) { + return _Pow.Contract.PowSubmissions(&_Pow.CallOpts, arg0, arg1) +} + +// PowSubmissions is a free data retrieval call binding the contract method 0x4bbe05e4. +// +// Solidity: function powSubmissions(address , uint256 ) view returns(address walletAddress, string nodeId, uint256 nonce, uint256 start_timestap, uint256 complete_timestap, bytes32 challenge, uint256 difficulty) +func (_Pow *PowCallerSession) PowSubmissions(arg0 common.Address, arg1 *big.Int) (struct { + WalletAddress common.Address + NodeId string + Nonce *big.Int + StartTimestap *big.Int + CompleteTimestap *big.Int + Challenge [32]byte + Difficulty *big.Int +}, error) { + return _Pow.Contract.PowSubmissions(&_Pow.CallOpts, arg0, arg1) +} + +// StartTime is a free data retrieval call binding the contract method 0x78e97925. +// +// Solidity: function startTime() view returns(uint256) +func (_Pow *PowCaller) StartTime(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _Pow.contract.Call(opts, &out, "startTime") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// StartTime is a free data retrieval call binding the contract method 0x78e97925. +// +// Solidity: function startTime() view returns(uint256) +func (_Pow *PowSession) StartTime() (*big.Int, error) { + return _Pow.Contract.StartTime(&_Pow.CallOpts) +} + +// StartTime is a free data retrieval call binding the contract method 0x78e97925. +// +// Solidity: function startTime() view returns(uint256) +func (_Pow *PowCallerSession) StartTime() (*big.Int, error) { + return _Pow.Contract.StartTime(&_Pow.CallOpts) +} + +// ValidProofs is a free data retrieval call binding the contract method 0xb28d87ea. +// +// Solidity: function validProofs() view returns(uint256) +func (_Pow *PowCaller) ValidProofs(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _Pow.contract.Call(opts, &out, "validProofs") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// ValidProofs is a free data retrieval call binding the contract method 0xb28d87ea. +// +// Solidity: function validProofs() view returns(uint256) +func (_Pow *PowSession) ValidProofs() (*big.Int, error) { + return _Pow.Contract.ValidProofs(&_Pow.CallOpts) +} + +// ValidProofs is a free data retrieval call binding the contract method 0xb28d87ea. +// +// Solidity: function validProofs() view returns(uint256) +func (_Pow *PowCallerSession) ValidProofs() (*big.Int, error) { + return _Pow.Contract.ValidProofs(&_Pow.CallOpts) +} + +// WindowEnd is a free data retrieval call binding the contract method 0xa738bf8f. +// +// Solidity: function window_end() view returns(uint256) +func (_Pow *PowCaller) WindowEnd(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _Pow.contract.Call(opts, &out, "window_end") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// WindowEnd is a free data retrieval call binding the contract method 0xa738bf8f. +// +// Solidity: function window_end() view returns(uint256) +func (_Pow *PowSession) WindowEnd() (*big.Int, error) { + return _Pow.Contract.WindowEnd(&_Pow.CallOpts) +} + +// WindowEnd is a free data retrieval call binding the contract method 0xa738bf8f. +// +// Solidity: function window_end() view returns(uint256) +func (_Pow *PowCallerSession) WindowEnd() (*big.Int, error) { + return _Pow.Contract.WindowEnd(&_Pow.CallOpts) +} + +// WindowStart is a free data retrieval call binding the contract method 0x331bade1. +// +// Solidity: function window_start() view returns(uint256) +func (_Pow *PowCaller) WindowStart(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _Pow.contract.Call(opts, &out, "window_start") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// WindowStart is a free data retrieval call binding the contract method 0x331bade1. +// +// Solidity: function window_start() view returns(uint256) +func (_Pow *PowSession) WindowStart() (*big.Int, error) { + return _Pow.Contract.WindowStart(&_Pow.CallOpts) +} + +// WindowStart is a free data retrieval call binding the contract method 0x331bade1. +// +// Solidity: function window_start() view returns(uint256) +func (_Pow *PowCallerSession) WindowStart() (*big.Int, error) { + return _Pow.Contract.WindowStart(&_Pow.CallOpts) +} + +// GenerateChallenge is a paid mutator transaction binding the contract method 0xab098945. +// +// Solidity: function generateChallenge(string nodeId) returns() +func (_Pow *PowTransactor) GenerateChallenge(opts *bind.TransactOpts, nodeId string) (*types.Transaction, error) { + return _Pow.contract.Transact(opts, "generateChallenge", nodeId) +} + +// GenerateChallenge is a paid mutator transaction binding the contract method 0xab098945. +// +// Solidity: function generateChallenge(string nodeId) returns() +func (_Pow *PowSession) GenerateChallenge(nodeId string) (*types.Transaction, error) { + return _Pow.Contract.GenerateChallenge(&_Pow.TransactOpts, nodeId) +} + +// GenerateChallenge is a paid mutator transaction binding the contract method 0xab098945. +// +// Solidity: function generateChallenge(string nodeId) returns() +func (_Pow *PowTransactorSession) GenerateChallenge(nodeId string) (*types.Transaction, error) { + return _Pow.Contract.GenerateChallenge(&_Pow.TransactOpts, nodeId) +} + +// Initialize is a paid mutator transaction binding the contract method 0x8129fc1c. +// +// Solidity: function initialize() returns() +func (_Pow *PowTransactor) Initialize(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Pow.contract.Transact(opts, "initialize") +} + +// Initialize is a paid mutator transaction binding the contract method 0x8129fc1c. +// +// Solidity: function initialize() returns() +func (_Pow *PowSession) Initialize() (*types.Transaction, error) { + return _Pow.Contract.Initialize(&_Pow.TransactOpts) +} + +// Initialize is a paid mutator transaction binding the contract method 0x8129fc1c. +// +// Solidity: function initialize() returns() +func (_Pow *PowTransactorSession) Initialize() (*types.Transaction, error) { + return _Pow.Contract.Initialize(&_Pow.TransactOpts) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_Pow *PowTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Pow.contract.Transact(opts, "renounceOwnership") +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_Pow *PowSession) RenounceOwnership() (*types.Transaction, error) { + return _Pow.Contract.RenounceOwnership(&_Pow.TransactOpts) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_Pow *PowTransactorSession) RenounceOwnership() (*types.Transaction, error) { + return _Pow.Contract.RenounceOwnership(&_Pow.TransactOpts) +} + +// SubmitWork is a paid mutator transaction binding the contract method 0xda8accf9. +// +// Solidity: function submitWork(uint256 nonce, string nodeId) returns() +func (_Pow *PowTransactor) SubmitWork(opts *bind.TransactOpts, nonce *big.Int, nodeId string) (*types.Transaction, error) { + return _Pow.contract.Transact(opts, "submitWork", nonce, nodeId) +} + +// SubmitWork is a paid mutator transaction binding the contract method 0xda8accf9. +// +// Solidity: function submitWork(uint256 nonce, string nodeId) returns() +func (_Pow *PowSession) SubmitWork(nonce *big.Int, nodeId string) (*types.Transaction, error) { + return _Pow.Contract.SubmitWork(&_Pow.TransactOpts, nonce, nodeId) +} + +// SubmitWork is a paid mutator transaction binding the contract method 0xda8accf9. +// +// Solidity: function submitWork(uint256 nonce, string nodeId) returns() +func (_Pow *PowTransactorSession) SubmitWork(nonce *big.Int, nodeId string) (*types.Transaction, error) { + return _Pow.Contract.SubmitWork(&_Pow.TransactOpts, nonce, nodeId) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_Pow *PowTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { + return _Pow.contract.Transact(opts, "transferOwnership", newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_Pow *PowSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _Pow.Contract.TransferOwnership(&_Pow.TransactOpts, newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_Pow *PowTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _Pow.Contract.TransferOwnership(&_Pow.TransactOpts, newOwner) +} + +// TriggerNewPowRound is a paid mutator transaction binding the contract method 0xb681f2fd. +// +// Solidity: function triggerNewPowRound() returns() +func (_Pow *PowTransactor) TriggerNewPowRound(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Pow.contract.Transact(opts, "triggerNewPowRound") +} + +// TriggerNewPowRound is a paid mutator transaction binding the contract method 0xb681f2fd. +// +// Solidity: function triggerNewPowRound() returns() +func (_Pow *PowSession) TriggerNewPowRound() (*types.Transaction, error) { + return _Pow.Contract.TriggerNewPowRound(&_Pow.TransactOpts) +} + +// TriggerNewPowRound is a paid mutator transaction binding the contract method 0xb681f2fd. +// +// Solidity: function triggerNewPowRound() returns() +func (_Pow *PowTransactorSession) TriggerNewPowRound() (*types.Transaction, error) { + return _Pow.Contract.TriggerNewPowRound(&_Pow.TransactOpts) +} + +// PowGenerateChallengeIterator is returned from FilterGenerateChallenge and is used to iterate over the raw logs and unpacked data for GenerateChallenge events raised by the Pow contract. +type PowGenerateChallengeIterator struct { + Event *PowGenerateChallenge // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *PowGenerateChallengeIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(PowGenerateChallenge) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(PowGenerateChallenge) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *PowGenerateChallengeIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *PowGenerateChallengeIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// PowGenerateChallenge represents a GenerateChallenge event raised by the Pow contract. +type PowGenerateChallenge struct { + Challenge [32]byte + Difficulty *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterGenerateChallenge is a free log retrieval operation binding the contract event 0x496186a9d930bac0744acdcd1d0c054b18283eecbe99d30bda98102d3d06b8ef. +// +// Solidity: event GenerateChallenge(bytes32 challenge, uint256 difficulty) +func (_Pow *PowFilterer) FilterGenerateChallenge(opts *bind.FilterOpts) (*PowGenerateChallengeIterator, error) { + + logs, sub, err := _Pow.contract.FilterLogs(opts, "GenerateChallenge") + if err != nil { + return nil, err + } + return &PowGenerateChallengeIterator{contract: _Pow.contract, event: "GenerateChallenge", logs: logs, sub: sub}, nil +} + +// WatchGenerateChallenge is a free log subscription operation binding the contract event 0x496186a9d930bac0744acdcd1d0c054b18283eecbe99d30bda98102d3d06b8ef. +// +// Solidity: event GenerateChallenge(bytes32 challenge, uint256 difficulty) +func (_Pow *PowFilterer) WatchGenerateChallenge(opts *bind.WatchOpts, sink chan<- *PowGenerateChallenge) (event.Subscription, error) { + + logs, sub, err := _Pow.contract.WatchLogs(opts, "GenerateChallenge") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(PowGenerateChallenge) + if err := _Pow.contract.UnpackLog(event, "GenerateChallenge", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseGenerateChallenge is a log parse operation binding the contract event 0x496186a9d930bac0744acdcd1d0c054b18283eecbe99d30bda98102d3d06b8ef. +// +// Solidity: event GenerateChallenge(bytes32 challenge, uint256 difficulty) +func (_Pow *PowFilterer) ParseGenerateChallenge(log types.Log) (*PowGenerateChallenge, error) { + event := new(PowGenerateChallenge) + if err := _Pow.contract.UnpackLog(event, "GenerateChallenge", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// PowInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the Pow contract. +type PowInitializedIterator struct { + Event *PowInitialized // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *PowInitializedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(PowInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(PowInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *PowInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *PowInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// PowInitialized represents a Initialized event raised by the Pow contract. +type PowInitialized struct { + Version uint8 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_Pow *PowFilterer) FilterInitialized(opts *bind.FilterOpts) (*PowInitializedIterator, error) { + + logs, sub, err := _Pow.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &PowInitializedIterator{contract: _Pow.contract, event: "Initialized", logs: logs, sub: sub}, nil +} + +// WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_Pow *PowFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *PowInitialized) (event.Subscription, error) { + + logs, sub, err := _Pow.contract.WatchLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(PowInitialized) + if err := _Pow.contract.UnpackLog(event, "Initialized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_Pow *PowFilterer) ParseInitialized(log types.Log) (*PowInitialized, error) { + event := new(PowInitialized) + if err := _Pow.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// PowNewPowRoundIterator is returned from FilterNewPowRound and is used to iterate over the raw logs and unpacked data for NewPowRound events raised by the Pow contract. +type PowNewPowRoundIterator struct { + Event *PowNewPowRound // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *PowNewPowRoundIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(PowNewPowRound) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(PowNewPowRound) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *PowNewPowRoundIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *PowNewPowRoundIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// PowNewPowRound represents a NewPowRound event raised by the Pow contract. +type PowNewPowRound struct { + Raw types.Log // Blockchain specific contextual infos +} + +// FilterNewPowRound is a free log retrieval operation binding the contract event 0x10cc99616aca050d810fd487c95f968e516d0fa25318530ed50753153d060a1e. +// +// Solidity: event NewPowRound() +func (_Pow *PowFilterer) FilterNewPowRound(opts *bind.FilterOpts) (*PowNewPowRoundIterator, error) { + + logs, sub, err := _Pow.contract.FilterLogs(opts, "NewPowRound") + if err != nil { + return nil, err + } + return &PowNewPowRoundIterator{contract: _Pow.contract, event: "NewPowRound", logs: logs, sub: sub}, nil +} + +// WatchNewPowRound is a free log subscription operation binding the contract event 0x10cc99616aca050d810fd487c95f968e516d0fa25318530ed50753153d060a1e. +// +// Solidity: event NewPowRound() +func (_Pow *PowFilterer) WatchNewPowRound(opts *bind.WatchOpts, sink chan<- *PowNewPowRound) (event.Subscription, error) { + + logs, sub, err := _Pow.contract.WatchLogs(opts, "NewPowRound") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(PowNewPowRound) + if err := _Pow.contract.UnpackLog(event, "NewPowRound", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseNewPowRound is a log parse operation binding the contract event 0x10cc99616aca050d810fd487c95f968e516d0fa25318530ed50753153d060a1e. +// +// Solidity: event NewPowRound() +func (_Pow *PowFilterer) ParseNewPowRound(log types.Log) (*PowNewPowRound, error) { + event := new(PowNewPowRound) + if err := _Pow.contract.UnpackLog(event, "NewPowRound", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// PowOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the Pow contract. +type PowOwnershipTransferredIterator struct { + Event *PowOwnershipTransferred // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *PowOwnershipTransferredIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(PowOwnershipTransferred) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(PowOwnershipTransferred) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *PowOwnershipTransferredIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *PowOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// PowOwnershipTransferred represents a OwnershipTransferred event raised by the Pow contract. +type PowOwnershipTransferred struct { + PreviousOwner common.Address + NewOwner common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_Pow *PowFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*PowOwnershipTransferredIterator, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _Pow.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return &PowOwnershipTransferredIterator{contract: _Pow.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_Pow *PowFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *PowOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _Pow.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(PowOwnershipTransferred) + if err := _Pow.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_Pow *PowFilterer) ParseOwnershipTransferred(log types.Log) (*PowOwnershipTransferred, error) { + event := new(PowOwnershipTransferred) + if err := _Pow.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// PowValidPOWSubmittedIterator is returned from FilterValidPOWSubmitted and is used to iterate over the raw logs and unpacked data for ValidPOWSubmitted events raised by the Pow contract. +type PowValidPOWSubmittedIterator struct { + Event *PowValidPOWSubmitted // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *PowValidPOWSubmittedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(PowValidPOWSubmitted) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(PowValidPOWSubmitted) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *PowValidPOWSubmittedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *PowValidPOWSubmittedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// PowValidPOWSubmitted represents a ValidPOWSubmitted event raised by the Pow contract. +type PowValidPOWSubmitted struct { + WalletAddress common.Address + NodeId string + Nonce *big.Int + Timestamp *big.Int + Challenge [32]byte + Difficulty *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterValidPOWSubmitted is a free log retrieval operation binding the contract event 0x5ea61d67e3236a79ab8c3c29f810e2c408b0a6b1e19f4e0da2fcd6362129c860. +// +// Solidity: event ValidPOWSubmitted(address indexed walletAddress, string nodeId, uint256 nonce, uint256 timestamp, bytes32 challenge, uint256 difficulty) +func (_Pow *PowFilterer) FilterValidPOWSubmitted(opts *bind.FilterOpts, walletAddress []common.Address) (*PowValidPOWSubmittedIterator, error) { + + var walletAddressRule []interface{} + for _, walletAddressItem := range walletAddress { + walletAddressRule = append(walletAddressRule, walletAddressItem) + } + + logs, sub, err := _Pow.contract.FilterLogs(opts, "ValidPOWSubmitted", walletAddressRule) + if err != nil { + return nil, err + } + return &PowValidPOWSubmittedIterator{contract: _Pow.contract, event: "ValidPOWSubmitted", logs: logs, sub: sub}, nil +} + +// WatchValidPOWSubmitted is a free log subscription operation binding the contract event 0x5ea61d67e3236a79ab8c3c29f810e2c408b0a6b1e19f4e0da2fcd6362129c860. +// +// Solidity: event ValidPOWSubmitted(address indexed walletAddress, string nodeId, uint256 nonce, uint256 timestamp, bytes32 challenge, uint256 difficulty) +func (_Pow *PowFilterer) WatchValidPOWSubmitted(opts *bind.WatchOpts, sink chan<- *PowValidPOWSubmitted, walletAddress []common.Address) (event.Subscription, error) { + + var walletAddressRule []interface{} + for _, walletAddressItem := range walletAddress { + walletAddressRule = append(walletAddressRule, walletAddressItem) + } + + logs, sub, err := _Pow.contract.WatchLogs(opts, "ValidPOWSubmitted", walletAddressRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(PowValidPOWSubmitted) + if err := _Pow.contract.UnpackLog(event, "ValidPOWSubmitted", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseValidPOWSubmitted is a log parse operation binding the contract event 0x5ea61d67e3236a79ab8c3c29f810e2c408b0a6b1e19f4e0da2fcd6362129c860. +// +// Solidity: event ValidPOWSubmitted(address indexed walletAddress, string nodeId, uint256 nonce, uint256 timestamp, bytes32 challenge, uint256 difficulty) +func (_Pow *PowFilterer) ParseValidPOWSubmitted(log types.Log) (*PowValidPOWSubmitted, error) { + event := new(PowValidPOWSubmitted) + if err := _Pow.contract.UnpackLog(event, "ValidPOWSubmitted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/pkg/web3/events.go b/pkg/web3/events.go index e7ded4ef..02eb4ccc 100644 --- a/pkg/web3/events.go +++ b/pkg/web3/events.go @@ -13,6 +13,7 @@ type EventChannels struct { Storage *StorageEventChannels JobCreator *JobCreatorEventChannels Mediation *MediationEventChannels + Pow *PowEventChannels collections []EventChannelCollection } @@ -22,12 +23,14 @@ func NewEventChannels() *EventChannels { storageChannels := NewStorageEventChannels() jobCreatorChannels := NewJobCreatorEventChannels() mediationChannels := NewMediationEventChannels() + powChannels := NewPowEventChannels() collections := []EventChannelCollection{ tokenChannels, paymentChannels, storageChannels, jobCreatorChannels, mediationChannels, + powChannels, } return &EventChannels{ Token: tokenChannels, @@ -35,6 +38,7 @@ func NewEventChannels() *EventChannels { Storage: storageChannels, JobCreator: jobCreatorChannels, Mediation: mediationChannels, + Pow: powChannels, collections: collections, } } diff --git a/pkg/web3/events_pow.go b/pkg/web3/events_pow.go new file mode 100644 index 00000000..b2dd21ec --- /dev/null +++ b/pkg/web3/events_pow.go @@ -0,0 +1,78 @@ +package web3 + +import ( + "context" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/event" + "github.com/lilypad-tech/lilypad/pkg/system" + "github.com/lilypad-tech/lilypad/pkg/web3/bindings/pow" + "github.com/rs/zerolog/log" +) + +type PowEventChannels struct { + newPowRoundChan chan *pow.PowNewPowRound + newPowRoundSubs []func(pow.PowNewPowRound) +} + +func NewPowEventChannels() *PowEventChannels { + return &PowEventChannels{ + newPowRoundChan: make(chan *pow.PowNewPowRound), + newPowRoundSubs: []func(pow.PowNewPowRound){}, + } +} + +func (s *PowEventChannels) Start( + sdk *Web3SDK, + ctx context.Context, + cm *system.CleanupManager, +) error { + blockNumber, err := sdk.getBlockNumber() + if err != nil { + return err + } + + var newPowRoundSub event.Subscription + + connectnewPowRoundSub := func() (event.Subscription, error) { + log.Debug(). + Str("jobcreator->connect", "newPowRound"). + Msgf("") + return sdk.Contracts.Pow.WatchNewPowRound( + &bind.WatchOpts{Start: &blockNumber, Context: ctx}, + s.newPowRoundChan, + ) + } + + newPowRoundSub, err = connectnewPowRoundSub() + if err != nil { + return err + } + + go func() { + <-ctx.Done() + newPowRoundSub.Unsubscribe() + }() + + for { + select { + case event := <-s.newPowRoundChan: + log.Debug(). + Str("pow->event", "PowNewPowRound"). + Msgf("%+v", event) + for _, handler := range s.newPowRoundSubs { + go handler(*event) + } + case <-newPowRoundSub.Err(): + newPowRoundSub.Unsubscribe() + newPowRoundSub, err = connectnewPowRoundSub() + if err != nil { + return err + } + } + } +} + +func (t *PowEventChannels) SubscribenewPowRound(handler func(pow.PowNewPowRound)) { + t.newPowRoundSubs = append(t.newPowRoundSubs, handler) +} diff --git a/pkg/web3/sdk.go b/pkg/web3/sdk.go index f4e5b478..27019b21 100644 --- a/pkg/web3/sdk.go +++ b/pkg/web3/sdk.go @@ -7,18 +7,19 @@ import ( "strconv" "strings" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/ethclient" "github.com/lilypad-tech/lilypad/pkg/web3/bindings/controller" "github.com/lilypad-tech/lilypad/pkg/web3/bindings/jobcreator" "github.com/lilypad-tech/lilypad/pkg/web3/bindings/mediation" "github.com/lilypad-tech/lilypad/pkg/web3/bindings/payments" + "github.com/lilypad-tech/lilypad/pkg/web3/bindings/pow" "github.com/lilypad-tech/lilypad/pkg/web3/bindings/storage" "github.com/lilypad-tech/lilypad/pkg/web3/bindings/token" "github.com/lilypad-tech/lilypad/pkg/web3/bindings/users" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethclient" "github.com/rs/zerolog/log" ) @@ -31,6 +32,7 @@ type Contracts struct { JobCreator *jobcreator.Jobcreator Mediation *mediation.Mediation Controller *controller.Controller + Pow *pow.Pow } type Web3SDK struct { @@ -69,6 +71,24 @@ func NewContracts( return nil, err } + powAddress := options.PowAddress + log.Debug().Msgf("TokenAddress: %s", powAddress) + if powAddress == "" { + loadedPowAddress, err := controller.GetPowAddress(callOpts) + if err != nil { + return nil, err + } + powAddress = loadedPowAddress.String() + log.Debug(). + Str("load token address", powAddress). + Msgf("") + } + + pow, err := pow.NewPow(common.HexToAddress(powAddress), client) + if err != nil { + return nil, err + } + tokenAddress := options.TokenAddress log.Debug().Msgf("TokenAddress: %s", tokenAddress) if tokenAddress == "" { @@ -167,6 +187,7 @@ func NewContracts( JobCreator: jobCreator, Mediation: mediation, Controller: controller, + Pow: pow, }, nil } diff --git a/pkg/web3/types.go b/pkg/web3/types.go index feab4da0..e2fb05de 100644 --- a/pkg/web3/types.go +++ b/pkg/web3/types.go @@ -21,7 +21,7 @@ type Web3Options struct { TokenAddress string `json:"token_address" toml:"token_address"` MediationAddress string `json:"mediation_address" toml:"mediation_address"` JobCreatorAddress string `json:"jobcreator_address" toml:"jobcreator_address"` - + PowAddress string `json:"pow_address"` // this is injected by whatever service we are running // it's used for logging tx's Service system.Service `json:"-" toml:"-"` diff --git a/stack b/stack index 29ef6509..a035cca3 100755 --- a/stack +++ b/stack @@ -69,6 +69,7 @@ function go-bindings() { go-binding LilypadMediationRandom mediation go-binding LilypadOnChainJobCreator jobcreator go-binding LilypadController controller + go-binding LilypadPow pow echo "- Generated all go bindings pkg/contract/bindings/" } From 6f04361fd77e260f852581e53412ef86bdde9617 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 12 Jun 2024 08:29:44 +0000 Subject: [PATCH 02/14] feat: simplly code --- cmd/lilypad/pow_signal.go | 6 +- pkg/options/pow_signal.go | 14 ++-- pkg/options/resource-provider.go | 3 +- pkg/resourceprovider/powsignal/powsignal.go | 86 --------------------- pkg/web3/api.go | 66 ++++++++++++++++ 5 files changed, 79 insertions(+), 96 deletions(-) delete mode 100644 pkg/resourceprovider/powsignal/powsignal.go diff --git a/cmd/lilypad/pow_signal.go b/cmd/lilypad/pow_signal.go index 1ac15049..007ad2c3 100644 --- a/cmd/lilypad/pow_signal.go +++ b/cmd/lilypad/pow_signal.go @@ -1,8 +1,8 @@ package lilypad import ( + "github.com/lilypad-tech/lilypad/pkg/options" optionsfactory "github.com/lilypad-tech/lilypad/pkg/options" - "github.com/lilypad-tech/lilypad/pkg/resourceprovider/powsignal" "github.com/lilypad-tech/lilypad/pkg/system" "github.com/lilypad-tech/lilypad/pkg/web3" "github.com/rs/zerolog/log" @@ -33,7 +33,7 @@ func newPowSignalCmd() *cobra.Command { return powSignalCmd } -func runPowSignal(cmd *cobra.Command, options powsignal.PowSignalOptions) error { +func runPowSignal(cmd *cobra.Command, options options.PowSignalOptions) error { commandCtx := system.NewCommandContext(cmd) defer commandCtx.Cleanup() @@ -42,7 +42,7 @@ func runPowSignal(cmd *cobra.Command, options powsignal.PowSignalOptions) error return err } - _, err = powsignal.SendPowSignal(commandCtx.Ctx, web3SDK, options) + _, err = web3SDK.SendPowSignal(commandCtx.Ctx) if err != nil { return err } diff --git a/pkg/options/pow_signal.go b/pkg/options/pow_signal.go index 4095f7bf..c48bdd8e 100644 --- a/pkg/options/pow_signal.go +++ b/pkg/options/pow_signal.go @@ -1,17 +1,21 @@ package options import ( - "github.com/lilypad-tech/lilypad/pkg/resourceprovider/powsignal" + "github.com/lilypad-tech/lilypad/pkg/web3" ) -func NewPowSignalOptions() powsignal.PowSignalOptions { - options := powsignal.PowSignalOptions{ +type PowSignalOptions struct { + Web3 web3.Web3Options +} + +func NewPowSignalOptions() PowSignalOptions { + options := PowSignalOptions{ Web3: GetDefaultWeb3Options(), } return options } -func ProcessPowSignalrOptions(options powsignal.PowSignalOptions, network string) (powsignal.PowSignalOptions, error) { +func ProcessPowSignalrOptions(options PowSignalOptions, network string) (PowSignalOptions, error) { newWeb3Options, err := ProcessWeb3Options(options.Web3, network) if err != nil { return options, err @@ -20,6 +24,6 @@ func ProcessPowSignalrOptions(options powsignal.PowSignalOptions, network string return options, CheckPowSignalOptions(options) } -func CheckPowSignalOptions(options powsignal.PowSignalOptions) error { +func CheckPowSignalOptions(options PowSignalOptions) error { return CheckWeb3Options(options.Web3) } diff --git a/pkg/options/resource-provider.go b/pkg/options/resource-provider.go index a1a28e30..eac8d270 100644 --- a/pkg/options/resource-provider.go +++ b/pkg/options/resource-provider.go @@ -5,7 +5,6 @@ import ( "github.com/lilypad-tech/lilypad/pkg/data" "github.com/lilypad-tech/lilypad/pkg/resourceprovider" - "github.com/lilypad-tech/lilypad/pkg/resourceprovider/powsignal" "github.com/lilypad-tech/lilypad/pkg/system" "github.com/spf13/cobra" ) @@ -94,7 +93,7 @@ func AddResourceProviderCliFlags(cmd *cobra.Command, options *resourceprovider.R AddResourceProviderPowCliFlags(cmd, &options.Pow) } -func AddPowSignalCliFlags(cmd *cobra.Command, options *powsignal.PowSignalOptions) { +func AddPowSignalCliFlags(cmd *cobra.Command, options *PowSignalOptions) { AddWeb3CliFlags(cmd, &options.Web3) } diff --git a/pkg/resourceprovider/powsignal/powsignal.go b/pkg/resourceprovider/powsignal/powsignal.go deleted file mode 100644 index 403f44ed..00000000 --- a/pkg/resourceprovider/powsignal/powsignal.go +++ /dev/null @@ -1,86 +0,0 @@ -package powsignal - -import ( - "context" - "fmt" - "math/big" - - "github.com/ethereum/go-ethereum/common" - "github.com/lilypad-tech/lilypad/pkg/web3" - "github.com/lilypad-tech/lilypad/pkg/web3/bindings/pow" -) - -type PowSignalOptions struct { - Web3 web3.Web3Options -} - -type ResourceProvider struct { - web3SDK *web3.Web3SDK - options PowSignalOptions -} - -func SendPowSignal(ctx context.Context, web3SDK *web3.Web3SDK, options PowSignalOptions) (*pow.PowNewPowRound, error) { - tx, err := web3SDK.Contracts.Pow.TriggerNewPowRound(web3SDK.TransactOpts) - if err != nil { - return nil, err - } - - receipt, err := web3SDK.WaitTx(ctx, tx) - if err != nil { - return nil, fmt.Errorf("wait new pow siganl tx(%s) %w", tx.Hash(), err) - } - - if receipt.Status == 0 { - return nil, fmt.Errorf("send new pow signal successfully but execute fail status(%d) tx(%s)", receipt.Status, tx.Hash()) - } - - newPowRoundEvent, err := web3SDK.Contracts.Pow.ParseNewPowRound(*receipt.Logs[0]) - if err != nil { - return nil, fmt.Errorf("parse new pow round event fail tx(%s) %w", tx.Hash(), err) - } - return newPowRoundEvent, nil -} - -type PowValidPOWSubmission struct { - WalletAddress common.Address - NodeId string - Nonce *big.Int - StartTimestap *big.Int - CompleteTimestap *big.Int - Challenge [32]byte - Difficulty *big.Int -} - -func GetPowSubmission(ctx context.Context, web3SDK *web3.Web3SDK) (map[common.Address][]PowValidPOWSubmission, error) { - miners, err := web3SDK.Contracts.Pow.GetMiners(web3SDK.CallOpts) - if err != nil { - return nil, err - } - - results := make(map[common.Address][]PowValidPOWSubmission) - for _, minerAddr := range miners { - validProofCount, err := web3SDK.Contracts.Pow.MinerSubmissionCount(web3SDK.CallOpts, minerAddr) - if err != nil { - return nil, err - } - - var powSubmissions []PowValidPOWSubmission - for i := uint64(0); i < validProofCount.Uint64(); i++ { //enough large - submission, err := web3SDK.Contracts.Pow.PowSubmissions(web3SDK.CallOpts, minerAddr, new(big.Int).SetUint64(i)) - if err != nil { - return nil, err - } - powSubmissions = append(powSubmissions, PowValidPOWSubmission{ - WalletAddress: submission.WalletAddress, - NodeId: submission.NodeId, - Nonce: submission.Nonce, - StartTimestap: submission.StartTimestap, - CompleteTimestap: submission.CompleteTimestap, - Challenge: submission.Challenge, - Difficulty: submission.Difficulty, - }) - } - results[minerAddr] = powSubmissions - } - return results, nil -} diff --git a/pkg/web3/api.go b/pkg/web3/api.go index ae695378..5db8604c 100644 --- a/pkg/web3/api.go +++ b/pkg/web3/api.go @@ -297,3 +297,69 @@ func (sdk *Web3SDK) SubmitWork( return tx.Hash(), validPosSubmission, nil } + +type PowValidPOWSubmission struct { + WalletAddress common.Address + NodeId string + Nonce *big.Int + StartTimestap *big.Int + CompleteTimestap *big.Int + Challenge [32]byte + Difficulty *big.Int +} + +func (sdk *Web3SDK) GetPowSubmission(ctx context.Context) (map[common.Address][]PowValidPOWSubmission, error) { + miners, err := sdk.Contracts.Pow.GetMiners(sdk.CallOpts) + if err != nil { + return nil, err + } + + results := make(map[common.Address][]PowValidPOWSubmission) + for _, minerAddr := range miners { + validProofCount, err := sdk.Contracts.Pow.MinerSubmissionCount(sdk.CallOpts, minerAddr) + if err != nil { + return nil, err + } + + var powSubmissions []PowValidPOWSubmission + for i := uint64(0); i < validProofCount.Uint64(); i++ { //enough large + submission, err := sdk.Contracts.Pow.PowSubmissions(sdk.CallOpts, minerAddr, new(big.Int).SetUint64(i)) + if err != nil { + return nil, err + } + powSubmissions = append(powSubmissions, PowValidPOWSubmission{ + WalletAddress: submission.WalletAddress, + NodeId: submission.NodeId, + Nonce: submission.Nonce, + StartTimestap: submission.StartTimestap, + CompleteTimestap: submission.CompleteTimestap, + Challenge: submission.Challenge, + Difficulty: submission.Difficulty, + }) + } + results[minerAddr] = powSubmissions + } + return results, nil +} + +func (sdk *Web3SDK) SendPowSignal(ctx context.Context) (*pow.PowNewPowRound, error) { + tx, err := sdk.Contracts.Pow.TriggerNewPowRound(sdk.TransactOpts) + if err != nil { + return nil, err + } + + receipt, err := sdk.WaitTx(ctx, tx) + if err != nil { + return nil, fmt.Errorf("wait new pow siganl tx(%s) %w", tx.Hash(), err) + } + + if receipt.Status == 0 { + return nil, fmt.Errorf("send new pow signal successfully but execute fail status(%d) tx(%s)", receipt.Status, tx.Hash()) + } + + newPowRoundEvent, err := sdk.Contracts.Pow.ParseNewPowRound(*receipt.Logs[0]) + if err != nil { + return nil, fmt.Errorf("parse new pow round event fail tx(%s) %w", tx.Hash(), err) + } + return newPowRoundEvent, nil +} From 94984d206fd4e163d8028ac18b7c917a0453aed1 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 12 Jun 2024 09:02:41 +0000 Subject: [PATCH 03/14] chore: add a explain comment for target difficulty --- hardhat/contracts/LilypadPow.sol | 4 ++++ pkg/web3/bindings/pow/pow.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/hardhat/contracts/LilypadPow.sol b/hardhat/contracts/LilypadPow.sol index 4a53c0c7..93c4314e 100644 --- a/hardhat/contracts/LilypadPow.sol +++ b/hardhat/contracts/LilypadPow.sol @@ -22,6 +22,10 @@ contract LilypadPow is Ownable, Initializable { uint256 timestamp; } + // todo difficulty may need to adjust in test + // this difficulty was calculate with this tool https://github.com/hunjixin/pow-tool/tree/main/difficulty + // Theoretically A machine with a hash rate of 2M 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 immutable TARGET_DIFFICULTY = 2221842798488549893930113429797694032668256326301844165995655665287168; mapping(address => POWSubmission[]) public powSubmissions; diff --git a/pkg/web3/bindings/pow/pow.go b/pkg/web3/bindings/pow/pow.go index f451974a..c8e6aa1d 100644 --- a/pkg/web3/bindings/pow/pow.go +++ b/pkg/web3/bindings/pow/pow.go @@ -32,7 +32,7 @@ var ( // 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\":true,\"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\":\"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\":\"TARGET_DIFFICULTY\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"calculate_difficulty\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"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\":\"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\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"minerSubmissionCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"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_timestap\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"complete_timestap\",\"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\":[{\"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: "0x60a06040527c5269a8a800000000000000000000000000000000000000000000000000608090815250348015610033575f80fd5b5061005061004561005560201b60201c565b61005c60201b60201c565b61011d565b5f33905090565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b608051611ffe61013c5f395f818161041a0152610fd00152611ffe5ff3fe608060405234801561000f575f80fd5b506004361061011f575f3560e01c80638da5cb5b116100ab578063bfb660de1161006f578063bfb660de146102c8578063da8accf9146102d2578063e0d152af146102ee578063f2fde38b1461031e578063f6f851681461033a5761011f565b80638da5cb5b14610248578063a738bf8f14610266578063ab09894514610284578063b28d87ea146102a0578063b681f2fd146102be5761011f565b80634bbe05e4116100f25780634bbe05e4146101ad5780636189f3ac146101e3578063715018a61461021657806378e97925146102205780638129fc1c1461023e5761011f565b8063148c684a146101235780631633da6e146101535780632d68c39714610171578063331bade11461018f575b5f80fd5b61013d600480360381019061013891906111bc565b610358565b60405161014a91906111ff565b60405180910390f35b61015b61036d565b60405161016891906112cf565b60405180910390f35b6101796103f8565b60405161018691906111ff565b60405180910390f35b610197610453565b6040516101a491906111ff565b60405180910390f35b6101c760048036038101906101c29190611319565b610459565b6040516101da9796959493929190611408565b60405180910390f35b6101fd60048036038101906101f891906111bc565b610556565b60405161020d949392919061147c565b60405180910390f35b61021e610608565b005b61022861061b565b60405161023591906111ff565b60405180910390f35b610246610621565b005b610250610756565b60405161025d91906114c6565b60405180910390f35b61026e61077d565b60405161027b91906111ff565b60405180910390f35b61029e60048036038101906102999190611540565b610783565b005b6102a86108df565b6040516102b591906111ff565b60405180910390f35b6102c66108e5565b005b6102d0610935565b005b6102ec60048036038101906102e7919061158b565b61097b565b005b610308600480360381019061030391906115e8565b610f11565b60405161031591906114c6565b60405180910390f35b610338600480360381019061033391906111bc565b610f4c565b005b610342610fce565b60405161034f91906111ff565b60405180910390f35b6002602052805f5260405f205f915090505481565b606060038054806020026020016040519081016040528092919081815260200182805480156103ee57602002820191905f5260205f20905b815f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116103a5575b5050505050905090565b5f806015446104079190611640565b605a610413919061169d565b90506064817f000000000000000000000000000000000000000000000000000000000000000061044391906116d0565b61044d9190611711565b91505090565b60075481565b6001602052815f5260405f208181548110610472575f80fd5b905f5260205f2090600702015f9150915050805f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010180546104b79061176e565b80601f01602080910402602001604051908101604052809291908181526020018280546104e39061176e565b801561052e5780601f106105055761010080835404028352916020019161052e565b820191905f5260205f20905b81548152906001019060200180831161051157829003601f168201915b5050505050908060020154908060030154908060040154908060050154908060060154905087565b6004602052805f5260405f205f91509050805f0154908060010154908060020180546105819061176e565b80601f01602080910402602001604051908101604052809291908181526020018280546105ad9061176e565b80156105f85780601f106105cf576101008083540402835291602001916105f8565b820191905f5260205f20905b8154815290600101906020018083116105db57829003601f168201915b5050505050908060030154905084565b610610610ff2565b6106195f611070565b565b60065481565b5f8060159054906101000a900460ff16159050808015610652575060015f60149054906101000a900460ff1660ff16105b80610680575061066130611131565b15801561067f575060015f60149054906101000a900460ff1660ff16145b5b6106bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106b69061180e565b60405180910390fd5b60015f60146101000a81548160ff021916908360ff16021790555080156106fb5760015f60156101000a81548160ff0219169083151502179055505b8015610753575f8060156101000a81548160ff0219169083151502179055507f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498600160405161074a919061187a565b60405180910390a15b50565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60085481565b61078b610935565b5f426007543385856040516020016107a7959493929190611934565b6040516020818303038152906040528051906020012090505f6107c86103f8565b9050604051806080016040528083815260200182815260200185858080601f0160208091040260200160405190810160405280939291908181526020018383808284375f81840152601f19601f8201169050808301925050505050505081526020014281525060045f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f820151815f01556020820151816001015560408201518160020190816108929190611b40565b50606082015181600301559050507f496186a9d930bac0744acdcd1d0c054b18283eecbe99d30bda98102d3d06b8ef82826040516108d1929190611c0f565b60405180910390a150505050565b60055481565b6108ed610ff2565b43600781905550601e43610901919061169d565b6008819055507f10cc99616aca050d810fd487c95f968e516d0fa25318530ed50753153d060a1e60405160405180910390a1565b6008544310610979576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097090611c80565b60405180910390fd5b565b610983610935565b5f60045f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f206040518060800160405290815f8201548152602001600182015481526020016002820180546109ef9061176e565b80601f0160208091040260200160405190810160405280929190818152602001828054610a1b9061176e565b8015610a665780601f10610a3d57610100808354040283529160200191610a66565b820191905f5260205f20905b815481529060010190602001808311610a4957829003601f168201915b5050505050815260200160038201548152505090505f8160600151600754338686604051602001610a9b959493929190611934565b60405160208183030381529060405280519060200120905080825f015114610af8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aef90611d0e565b60405180910390fd5b5f8186604051602001610b0c929190611d4c565b6040516020818303038152906040528051906020012090508260200151815f1c10610b6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b6390611de7565b60405180910390fd5b60055f815480929190610b7e90611e05565b91905055505f60025f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205403610c2857600333908060018154018082558091505060019003905f5260205f20015f9091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b60025f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f815480929190610c7590611e05565b91905055505f60015f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f209050806040518060e001604052803373ffffffffffffffffffffffffffffffffffffffff16815260200188888080601f0160208091040260200160405190810160405280939291908181526020018383808284375f81840152601f19601f82011690508083019250505050505050815260200189815260200186606001518152602001428152602001865f015181526020018660200151815250908060018154018082558091505060019003905f5260205f2090600702015f909190919091505f820151815f015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001019081610dd19190611b40565b5060408201518160020155606082015181600301556080820151816004015560a0820151816005015560c08201518160060155505060405180608001604052805f801b81526020015f815260200160405180602001604052805f81525081526020015f81525060045f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f820151815f0155602082015181600101556040820151816002019081610e9b9190611b40565b50606082015181600301559050503373ffffffffffffffffffffffffffffffffffffffff167f5ea61d67e3236a79ab8c3c29f810e2c408b0a6b1e19f4e0da2fcd6362129c86087878a42895f01518a60200151604051610f0096959493929190611e78565b60405180910390a250505050505050565b60038181548110610f20575f80fd5b905f5260205f20015f915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610f54610ff2565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610fc2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fb990611f42565b60405180910390fd5b610fcb81611070565b50565b7f000000000000000000000000000000000000000000000000000000000000000081565b610ffa611153565b73ffffffffffffffffffffffffffffffffffffffff16611018610756565b73ffffffffffffffffffffffffffffffffffffffff161461106e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106590611faa565b60405180910390fd5b565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b5f33905090565b5f80fd5b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61118b82611162565b9050919050565b61119b81611181565b81146111a5575f80fd5b50565b5f813590506111b681611192565b92915050565b5f602082840312156111d1576111d061115a565b5b5f6111de848285016111a8565b91505092915050565b5f819050919050565b6111f9816111e7565b82525050565b5f6020820190506112125f8301846111f0565b92915050565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b61124a81611181565b82525050565b5f61125b8383611241565b60208301905092915050565b5f602082019050919050565b5f61127d82611218565b6112878185611222565b935061129283611232565b805f5b838110156112c25781516112a98882611250565b97506112b483611267565b925050600181019050611295565b5085935050505092915050565b5f6020820190508181035f8301526112e78184611273565b905092915050565b6112f8816111e7565b8114611302575f80fd5b50565b5f81359050611313816112ef565b92915050565b5f806040838503121561132f5761132e61115a565b5b5f61133c858286016111a8565b925050602061134d85828601611305565b9150509250929050565b61136081611181565b82525050565b5f81519050919050565b5f82825260208201905092915050565b5f5b8381101561139d578082015181840152602081019050611382565b5f8484015250505050565b5f601f19601f8301169050919050565b5f6113c282611366565b6113cc8185611370565b93506113dc818560208601611380565b6113e5816113a8565b840191505092915050565b5f819050919050565b611402816113f0565b82525050565b5f60e08201905061141b5f83018a611357565b818103602083015261142d81896113b8565b905061143c60408301886111f0565b61144960608301876111f0565b61145660808301866111f0565b61146360a08301856113f9565b61147060c08301846111f0565b98975050505050505050565b5f60808201905061148f5f8301876113f9565b61149c60208301866111f0565b81810360408301526114ae81856113b8565b90506114bd60608301846111f0565b95945050505050565b5f6020820190506114d95f830184611357565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f840112611500576114ff6114df565b5b8235905067ffffffffffffffff81111561151d5761151c6114e3565b5b602083019150836001820283011115611539576115386114e7565b5b9250929050565b5f80602083850312156115565761155561115a565b5b5f83013567ffffffffffffffff8111156115735761157261115e565b5b61157f858286016114eb565b92509250509250929050565b5f805f604084860312156115a2576115a161115a565b5b5f6115af86828701611305565b935050602084013567ffffffffffffffff8111156115d0576115cf61115e565b5b6115dc868287016114eb565b92509250509250925092565b5f602082840312156115fd576115fc61115a565b5b5f61160a84828501611305565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f61164a826111e7565b9150611655836111e7565b92508261166557611664611613565b5b828206905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6116a7826111e7565b91506116b2836111e7565b92508282019050808211156116ca576116c9611670565b5b92915050565b5f6116da826111e7565b91506116e5836111e7565b92508282026116f3816111e7565b9150828204841483151761170a57611709611670565b5b5092915050565b5f61171b826111e7565b9150611726836111e7565b92508261173657611735611613565b5b828204905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f600282049050600182168061178557607f821691505b60208210810361179857611797611741565b5b50919050565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c7265615f8201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b5f6117f8602e83611370565b91506118038261179e565b604082019050919050565b5f6020820190508181035f830152611825816117ec565b9050919050565b5f819050919050565b5f60ff82169050919050565b5f819050919050565b5f61186461185f61185a8461182c565b611841565b611835565b9050919050565b6118748161184a565b82525050565b5f60208201905061188d5f83018461186b565b92915050565b5f819050919050565b6118ad6118a8826111e7565b611893565b82525050565b5f8160601b9050919050565b5f6118c9826118b3565b9050919050565b5f6118da826118bf565b9050919050565b6118f26118ed82611181565b6118d0565b82525050565b5f81905092915050565b828183375f83830152505050565b5f61191b83856118f8565b9350611928838584611902565b82840190509392505050565b5f61193f828861189c565b60208201915061194f828761189c565b60208201915061195f82866118e1565b601482019150611970828486611910565b91508190509695505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f819050815f5260205f209050919050565b5f6020601f8301049050919050565b5f82821b905092915050565b5f60088302611a087fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826119cd565b611a1286836119cd565b95508019841693508086168417925050509392505050565b5f611a44611a3f611a3a846111e7565b611841565b6111e7565b9050919050565b5f819050919050565b611a5d83611a2a565b611a71611a6982611a4b565b8484546119d9565b825550505050565b5f90565b611a85611a79565b611a90818484611a54565b505050565b5b81811015611ab357611aa85f82611a7d565b600181019050611a96565b5050565b601f821115611af857611ac9816119ac565b611ad2846119be565b81016020851015611ae1578190505b611af5611aed856119be565b830182611a95565b50505b505050565b5f82821c905092915050565b5f611b185f1984600802611afd565b1980831691505092915050565b5f611b308383611b09565b9150826002028217905092915050565b611b4982611366565b67ffffffffffffffff811115611b6257611b6161197f565b5b611b6c825461176e565b611b77828285611ab7565b5f60209050601f831160018114611ba8575f8415611b96578287015190505b611ba08582611b25565b865550611c07565b601f198416611bb6866119ac565b5f5b82811015611bdd57848901518255600182019150602085019450602081019050611bb8565b86831015611bfa5784890151611bf6601f891682611b09565b8355505b6001600288020188555050505b505050505050565b5f604082019050611c225f8301856113f9565b611c2f60208301846111f0565b9392505050565b7f70726f6f662077696e646f77732068617320636c6f73656400000000000000005f82015250565b5f611c6a601883611370565b9150611c7582611c36565b602082019050919050565b5f6020820190508181035f830152611c9781611c5e565b9050919050565b7f576f726b207375626d6974206e6f7420636f6d70617461626c652077697468205f8201527f6368616c6c656e67650000000000000000000000000000000000000000000000602082015250565b5f611cf8602983611370565b9150611d0382611c9e565b604082019050919050565b5f6020820190508181035f830152611d2581611cec565b9050919050565b5f819050919050565b611d46611d41826113f0565b611d2c565b82525050565b5f611d578285611d35565b602082019150611d67828461189c565b6020820191508190509392505050565b7f576f726b20646f6573206e6f74206d65657420646966666963756c74792074615f8201527f7267657400000000000000000000000000000000000000000000000000000000602082015250565b5f611dd1602483611370565b9150611ddc82611d77565b604082019050919050565b5f6020820190508181035f830152611dfe81611dc5565b9050919050565b5f611e0f826111e7565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611e4157611e40611670565b5b600182019050919050565b5f611e578385611370565b9350611e64838584611902565b611e6d836113a8565b840190509392505050565b5f60a0820190508181035f830152611e9181888a611e4c565b9050611ea060208301876111f0565b611ead60408301866111f0565b611eba60608301856113f9565b611ec760808301846111f0565b979650505050505050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f20615f8201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b5f611f2c602683611370565b9150611f3782611ed2565b604082019050919050565b5f6020820190508181035f830152611f5981611f20565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725f82015250565b5f611f94602083611370565b9150611f9f82611f60565b602082019050919050565b5f6020820190508181035f830152611fc181611f88565b905091905056fea2646970667358221220e66d961328264141eb34b4e4f3e4360ab4e09b23e6a36ea98882788925a681ae64736f6c63430008150033", + Bin: "0x60a06040527c5269a8a800000000000000000000000000000000000000000000000000608090815250348015610033575f80fd5b5061005061004561005560201b60201c565b61005c60201b60201c565b61011d565b5f33905090565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b608051611ffe61013c5f395f818161041a0152610fd00152611ffe5ff3fe608060405234801561000f575f80fd5b506004361061011f575f3560e01c80638da5cb5b116100ab578063bfb660de1161006f578063bfb660de146102c8578063da8accf9146102d2578063e0d152af146102ee578063f2fde38b1461031e578063f6f851681461033a5761011f565b80638da5cb5b14610248578063a738bf8f14610266578063ab09894514610284578063b28d87ea146102a0578063b681f2fd146102be5761011f565b80634bbe05e4116100f25780634bbe05e4146101ad5780636189f3ac146101e3578063715018a61461021657806378e97925146102205780638129fc1c1461023e5761011f565b8063148c684a146101235780631633da6e146101535780632d68c39714610171578063331bade11461018f575b5f80fd5b61013d600480360381019061013891906111bc565b610358565b60405161014a91906111ff565b60405180910390f35b61015b61036d565b60405161016891906112cf565b60405180910390f35b6101796103f8565b60405161018691906111ff565b60405180910390f35b610197610453565b6040516101a491906111ff565b60405180910390f35b6101c760048036038101906101c29190611319565b610459565b6040516101da9796959493929190611408565b60405180910390f35b6101fd60048036038101906101f891906111bc565b610556565b60405161020d949392919061147c565b60405180910390f35b61021e610608565b005b61022861061b565b60405161023591906111ff565b60405180910390f35b610246610621565b005b610250610756565b60405161025d91906114c6565b60405180910390f35b61026e61077d565b60405161027b91906111ff565b60405180910390f35b61029e60048036038101906102999190611540565b610783565b005b6102a86108df565b6040516102b591906111ff565b60405180910390f35b6102c66108e5565b005b6102d0610935565b005b6102ec60048036038101906102e7919061158b565b61097b565b005b610308600480360381019061030391906115e8565b610f11565b60405161031591906114c6565b60405180910390f35b610338600480360381019061033391906111bc565b610f4c565b005b610342610fce565b60405161034f91906111ff565b60405180910390f35b6002602052805f5260405f205f915090505481565b606060038054806020026020016040519081016040528092919081815260200182805480156103ee57602002820191905f5260205f20905b815f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116103a5575b5050505050905090565b5f806015446104079190611640565b605a610413919061169d565b90506064817f000000000000000000000000000000000000000000000000000000000000000061044391906116d0565b61044d9190611711565b91505090565b60075481565b6001602052815f5260405f208181548110610472575f80fd5b905f5260205f2090600702015f9150915050805f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010180546104b79061176e565b80601f01602080910402602001604051908101604052809291908181526020018280546104e39061176e565b801561052e5780601f106105055761010080835404028352916020019161052e565b820191905f5260205f20905b81548152906001019060200180831161051157829003601f168201915b5050505050908060020154908060030154908060040154908060050154908060060154905087565b6004602052805f5260405f205f91509050805f0154908060010154908060020180546105819061176e565b80601f01602080910402602001604051908101604052809291908181526020018280546105ad9061176e565b80156105f85780601f106105cf576101008083540402835291602001916105f8565b820191905f5260205f20905b8154815290600101906020018083116105db57829003601f168201915b5050505050908060030154905084565b610610610ff2565b6106195f611070565b565b60065481565b5f8060159054906101000a900460ff16159050808015610652575060015f60149054906101000a900460ff1660ff16105b80610680575061066130611131565b15801561067f575060015f60149054906101000a900460ff1660ff16145b5b6106bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106b69061180e565b60405180910390fd5b60015f60146101000a81548160ff021916908360ff16021790555080156106fb5760015f60156101000a81548160ff0219169083151502179055505b8015610753575f8060156101000a81548160ff0219169083151502179055507f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498600160405161074a919061187a565b60405180910390a15b50565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60085481565b61078b610935565b5f426007543385856040516020016107a7959493929190611934565b6040516020818303038152906040528051906020012090505f6107c86103f8565b9050604051806080016040528083815260200182815260200185858080601f0160208091040260200160405190810160405280939291908181526020018383808284375f81840152601f19601f8201169050808301925050505050505081526020014281525060045f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f820151815f01556020820151816001015560408201518160020190816108929190611b40565b50606082015181600301559050507f496186a9d930bac0744acdcd1d0c054b18283eecbe99d30bda98102d3d06b8ef82826040516108d1929190611c0f565b60405180910390a150505050565b60055481565b6108ed610ff2565b43600781905550601e43610901919061169d565b6008819055507f10cc99616aca050d810fd487c95f968e516d0fa25318530ed50753153d060a1e60405160405180910390a1565b6008544310610979576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097090611c80565b60405180910390fd5b565b610983610935565b5f60045f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f206040518060800160405290815f8201548152602001600182015481526020016002820180546109ef9061176e565b80601f0160208091040260200160405190810160405280929190818152602001828054610a1b9061176e565b8015610a665780601f10610a3d57610100808354040283529160200191610a66565b820191905f5260205f20905b815481529060010190602001808311610a4957829003601f168201915b5050505050815260200160038201548152505090505f8160600151600754338686604051602001610a9b959493929190611934565b60405160208183030381529060405280519060200120905080825f015114610af8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aef90611d0e565b60405180910390fd5b5f8186604051602001610b0c929190611d4c565b6040516020818303038152906040528051906020012090508260200151815f1c10610b6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b6390611de7565b60405180910390fd5b60055f815480929190610b7e90611e05565b91905055505f60025f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205403610c2857600333908060018154018082558091505060019003905f5260205f20015f9091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b60025f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f815480929190610c7590611e05565b91905055505f60015f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f209050806040518060e001604052803373ffffffffffffffffffffffffffffffffffffffff16815260200188888080601f0160208091040260200160405190810160405280939291908181526020018383808284375f81840152601f19601f82011690508083019250505050505050815260200189815260200186606001518152602001428152602001865f015181526020018660200151815250908060018154018082558091505060019003905f5260205f2090600702015f909190919091505f820151815f015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001019081610dd19190611b40565b5060408201518160020155606082015181600301556080820151816004015560a0820151816005015560c08201518160060155505060405180608001604052805f801b81526020015f815260200160405180602001604052805f81525081526020015f81525060045f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f820151815f0155602082015181600101556040820151816002019081610e9b9190611b40565b50606082015181600301559050503373ffffffffffffffffffffffffffffffffffffffff167f5ea61d67e3236a79ab8c3c29f810e2c408b0a6b1e19f4e0da2fcd6362129c86087878a42895f01518a60200151604051610f0096959493929190611e78565b60405180910390a250505050505050565b60038181548110610f20575f80fd5b905f5260205f20015f915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610f54610ff2565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610fc2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fb990611f42565b60405180910390fd5b610fcb81611070565b50565b7f000000000000000000000000000000000000000000000000000000000000000081565b610ffa611153565b73ffffffffffffffffffffffffffffffffffffffff16611018610756565b73ffffffffffffffffffffffffffffffffffffffff161461106e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106590611faa565b60405180910390fd5b565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b5f33905090565b5f80fd5b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61118b82611162565b9050919050565b61119b81611181565b81146111a5575f80fd5b50565b5f813590506111b681611192565b92915050565b5f602082840312156111d1576111d061115a565b5b5f6111de848285016111a8565b91505092915050565b5f819050919050565b6111f9816111e7565b82525050565b5f6020820190506112125f8301846111f0565b92915050565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b61124a81611181565b82525050565b5f61125b8383611241565b60208301905092915050565b5f602082019050919050565b5f61127d82611218565b6112878185611222565b935061129283611232565b805f5b838110156112c25781516112a98882611250565b97506112b483611267565b925050600181019050611295565b5085935050505092915050565b5f6020820190508181035f8301526112e78184611273565b905092915050565b6112f8816111e7565b8114611302575f80fd5b50565b5f81359050611313816112ef565b92915050565b5f806040838503121561132f5761132e61115a565b5b5f61133c858286016111a8565b925050602061134d85828601611305565b9150509250929050565b61136081611181565b82525050565b5f81519050919050565b5f82825260208201905092915050565b5f5b8381101561139d578082015181840152602081019050611382565b5f8484015250505050565b5f601f19601f8301169050919050565b5f6113c282611366565b6113cc8185611370565b93506113dc818560208601611380565b6113e5816113a8565b840191505092915050565b5f819050919050565b611402816113f0565b82525050565b5f60e08201905061141b5f83018a611357565b818103602083015261142d81896113b8565b905061143c60408301886111f0565b61144960608301876111f0565b61145660808301866111f0565b61146360a08301856113f9565b61147060c08301846111f0565b98975050505050505050565b5f60808201905061148f5f8301876113f9565b61149c60208301866111f0565b81810360408301526114ae81856113b8565b90506114bd60608301846111f0565b95945050505050565b5f6020820190506114d95f830184611357565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f840112611500576114ff6114df565b5b8235905067ffffffffffffffff81111561151d5761151c6114e3565b5b602083019150836001820283011115611539576115386114e7565b5b9250929050565b5f80602083850312156115565761155561115a565b5b5f83013567ffffffffffffffff8111156115735761157261115e565b5b61157f858286016114eb565b92509250509250929050565b5f805f604084860312156115a2576115a161115a565b5b5f6115af86828701611305565b935050602084013567ffffffffffffffff8111156115d0576115cf61115e565b5b6115dc868287016114eb565b92509250509250925092565b5f602082840312156115fd576115fc61115a565b5b5f61160a84828501611305565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f61164a826111e7565b9150611655836111e7565b92508261166557611664611613565b5b828206905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6116a7826111e7565b91506116b2836111e7565b92508282019050808211156116ca576116c9611670565b5b92915050565b5f6116da826111e7565b91506116e5836111e7565b92508282026116f3816111e7565b9150828204841483151761170a57611709611670565b5b5092915050565b5f61171b826111e7565b9150611726836111e7565b92508261173657611735611613565b5b828204905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f600282049050600182168061178557607f821691505b60208210810361179857611797611741565b5b50919050565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c7265615f8201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b5f6117f8602e83611370565b91506118038261179e565b604082019050919050565b5f6020820190508181035f830152611825816117ec565b9050919050565b5f819050919050565b5f60ff82169050919050565b5f819050919050565b5f61186461185f61185a8461182c565b611841565b611835565b9050919050565b6118748161184a565b82525050565b5f60208201905061188d5f83018461186b565b92915050565b5f819050919050565b6118ad6118a8826111e7565b611893565b82525050565b5f8160601b9050919050565b5f6118c9826118b3565b9050919050565b5f6118da826118bf565b9050919050565b6118f26118ed82611181565b6118d0565b82525050565b5f81905092915050565b828183375f83830152505050565b5f61191b83856118f8565b9350611928838584611902565b82840190509392505050565b5f61193f828861189c565b60208201915061194f828761189c565b60208201915061195f82866118e1565b601482019150611970828486611910565b91508190509695505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f819050815f5260205f209050919050565b5f6020601f8301049050919050565b5f82821b905092915050565b5f60088302611a087fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826119cd565b611a1286836119cd565b95508019841693508086168417925050509392505050565b5f611a44611a3f611a3a846111e7565b611841565b6111e7565b9050919050565b5f819050919050565b611a5d83611a2a565b611a71611a6982611a4b565b8484546119d9565b825550505050565b5f90565b611a85611a79565b611a90818484611a54565b505050565b5b81811015611ab357611aa85f82611a7d565b600181019050611a96565b5050565b601f821115611af857611ac9816119ac565b611ad2846119be565b81016020851015611ae1578190505b611af5611aed856119be565b830182611a95565b50505b505050565b5f82821c905092915050565b5f611b185f1984600802611afd565b1980831691505092915050565b5f611b308383611b09565b9150826002028217905092915050565b611b4982611366565b67ffffffffffffffff811115611b6257611b6161197f565b5b611b6c825461176e565b611b77828285611ab7565b5f60209050601f831160018114611ba8575f8415611b96578287015190505b611ba08582611b25565b865550611c07565b601f198416611bb6866119ac565b5f5b82811015611bdd57848901518255600182019150602085019450602081019050611bb8565b86831015611bfa5784890151611bf6601f891682611b09565b8355505b6001600288020188555050505b505050505050565b5f604082019050611c225f8301856113f9565b611c2f60208301846111f0565b9392505050565b7f70726f6f662077696e646f77732068617320636c6f73656400000000000000005f82015250565b5f611c6a601883611370565b9150611c7582611c36565b602082019050919050565b5f6020820190508181035f830152611c9781611c5e565b9050919050565b7f576f726b207375626d6974206e6f7420636f6d70617461626c652077697468205f8201527f6368616c6c656e67650000000000000000000000000000000000000000000000602082015250565b5f611cf8602983611370565b9150611d0382611c9e565b604082019050919050565b5f6020820190508181035f830152611d2581611cec565b9050919050565b5f819050919050565b611d46611d41826113f0565b611d2c565b82525050565b5f611d578285611d35565b602082019150611d67828461189c565b6020820191508190509392505050565b7f576f726b20646f6573206e6f74206d65657420646966666963756c74792074615f8201527f7267657400000000000000000000000000000000000000000000000000000000602082015250565b5f611dd1602483611370565b9150611ddc82611d77565b604082019050919050565b5f6020820190508181035f830152611dfe81611dc5565b9050919050565b5f611e0f826111e7565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611e4157611e40611670565b5b600182019050919050565b5f611e578385611370565b9350611e64838584611902565b611e6d836113a8565b840190509392505050565b5f60a0820190508181035f830152611e9181888a611e4c565b9050611ea060208301876111f0565b611ead60408301866111f0565b611eba60608301856113f9565b611ec760808301846111f0565b979650505050505050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f20615f8201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b5f611f2c602683611370565b9150611f3782611ed2565b604082019050919050565b5f6020820190508181035f830152611f5981611f20565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725f82015250565b5f611f94602083611370565b9150611f9f82611f60565b602082019050919050565b5f6020820190508181035f830152611fc181611f88565b905091905056fea264697066735822122091eae8c08697772bc800c9562030c2dea2e03319ae55fe6f31e3fd15d6e4006b64736f6c63430008150033", } // PowABI is the input ABI used to generate the binding from. From 33152815b704c45b05bd3257d9178ca682790840 Mon Sep 17 00:00:00 2001 From: hunjixin Date: Thu, 13 Jun 2024 03:41:59 +0000 Subject: [PATCH 04/14] fix typo --- cmd/lilypad/pow_signal.go | 2 +- pkg/options/pow_signal.go | 2 +- pkg/web3/bindings/pow/pow.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/lilypad/pow_signal.go b/cmd/lilypad/pow_signal.go index 007ad2c3..266b0d5b 100644 --- a/cmd/lilypad/pow_signal.go +++ b/cmd/lilypad/pow_signal.go @@ -20,7 +20,7 @@ func newPowSignalCmd() *cobra.Command { RunE: func(cmd *cobra.Command, _ []string) error { network, _ := cmd.Flags().GetString("network") - options, err := optionsfactory.ProcessPowSignalrOptions(options, network) + options, err := optionsfactory.ProcessPowSignalOptions(options, network) if err != nil { return err } diff --git a/pkg/options/pow_signal.go b/pkg/options/pow_signal.go index c48bdd8e..1930aa8b 100644 --- a/pkg/options/pow_signal.go +++ b/pkg/options/pow_signal.go @@ -15,7 +15,7 @@ func NewPowSignalOptions() PowSignalOptions { return options } -func ProcessPowSignalrOptions(options PowSignalOptions, network string) (PowSignalOptions, error) { +func ProcessPowSignalOptions(options PowSignalOptions, network string) (PowSignalOptions, error) { newWeb3Options, err := ProcessWeb3Options(options.Web3, network) if err != nil { return options, err diff --git a/pkg/web3/bindings/pow/pow.go b/pkg/web3/bindings/pow/pow.go index c8e6aa1d..2ed9e519 100644 --- a/pkg/web3/bindings/pow/pow.go +++ b/pkg/web3/bindings/pow/pow.go @@ -32,7 +32,7 @@ var ( // 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\":true,\"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\":\"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\":\"TARGET_DIFFICULTY\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"calculate_difficulty\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"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\":\"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\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"minerSubmissionCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"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_timestap\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"complete_timestap\",\"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\":[{\"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: "0x60a06040527c5269a8a800000000000000000000000000000000000000000000000000608090815250348015610033575f80fd5b5061005061004561005560201b60201c565b61005c60201b60201c565b61011d565b5f33905090565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b608051611ffe61013c5f395f818161041a0152610fd00152611ffe5ff3fe608060405234801561000f575f80fd5b506004361061011f575f3560e01c80638da5cb5b116100ab578063bfb660de1161006f578063bfb660de146102c8578063da8accf9146102d2578063e0d152af146102ee578063f2fde38b1461031e578063f6f851681461033a5761011f565b80638da5cb5b14610248578063a738bf8f14610266578063ab09894514610284578063b28d87ea146102a0578063b681f2fd146102be5761011f565b80634bbe05e4116100f25780634bbe05e4146101ad5780636189f3ac146101e3578063715018a61461021657806378e97925146102205780638129fc1c1461023e5761011f565b8063148c684a146101235780631633da6e146101535780632d68c39714610171578063331bade11461018f575b5f80fd5b61013d600480360381019061013891906111bc565b610358565b60405161014a91906111ff565b60405180910390f35b61015b61036d565b60405161016891906112cf565b60405180910390f35b6101796103f8565b60405161018691906111ff565b60405180910390f35b610197610453565b6040516101a491906111ff565b60405180910390f35b6101c760048036038101906101c29190611319565b610459565b6040516101da9796959493929190611408565b60405180910390f35b6101fd60048036038101906101f891906111bc565b610556565b60405161020d949392919061147c565b60405180910390f35b61021e610608565b005b61022861061b565b60405161023591906111ff565b60405180910390f35b610246610621565b005b610250610756565b60405161025d91906114c6565b60405180910390f35b61026e61077d565b60405161027b91906111ff565b60405180910390f35b61029e60048036038101906102999190611540565b610783565b005b6102a86108df565b6040516102b591906111ff565b60405180910390f35b6102c66108e5565b005b6102d0610935565b005b6102ec60048036038101906102e7919061158b565b61097b565b005b610308600480360381019061030391906115e8565b610f11565b60405161031591906114c6565b60405180910390f35b610338600480360381019061033391906111bc565b610f4c565b005b610342610fce565b60405161034f91906111ff565b60405180910390f35b6002602052805f5260405f205f915090505481565b606060038054806020026020016040519081016040528092919081815260200182805480156103ee57602002820191905f5260205f20905b815f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116103a5575b5050505050905090565b5f806015446104079190611640565b605a610413919061169d565b90506064817f000000000000000000000000000000000000000000000000000000000000000061044391906116d0565b61044d9190611711565b91505090565b60075481565b6001602052815f5260405f208181548110610472575f80fd5b905f5260205f2090600702015f9150915050805f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010180546104b79061176e565b80601f01602080910402602001604051908101604052809291908181526020018280546104e39061176e565b801561052e5780601f106105055761010080835404028352916020019161052e565b820191905f5260205f20905b81548152906001019060200180831161051157829003601f168201915b5050505050908060020154908060030154908060040154908060050154908060060154905087565b6004602052805f5260405f205f91509050805f0154908060010154908060020180546105819061176e565b80601f01602080910402602001604051908101604052809291908181526020018280546105ad9061176e565b80156105f85780601f106105cf576101008083540402835291602001916105f8565b820191905f5260205f20905b8154815290600101906020018083116105db57829003601f168201915b5050505050908060030154905084565b610610610ff2565b6106195f611070565b565b60065481565b5f8060159054906101000a900460ff16159050808015610652575060015f60149054906101000a900460ff1660ff16105b80610680575061066130611131565b15801561067f575060015f60149054906101000a900460ff1660ff16145b5b6106bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106b69061180e565b60405180910390fd5b60015f60146101000a81548160ff021916908360ff16021790555080156106fb5760015f60156101000a81548160ff0219169083151502179055505b8015610753575f8060156101000a81548160ff0219169083151502179055507f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498600160405161074a919061187a565b60405180910390a15b50565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60085481565b61078b610935565b5f426007543385856040516020016107a7959493929190611934565b6040516020818303038152906040528051906020012090505f6107c86103f8565b9050604051806080016040528083815260200182815260200185858080601f0160208091040260200160405190810160405280939291908181526020018383808284375f81840152601f19601f8201169050808301925050505050505081526020014281525060045f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f820151815f01556020820151816001015560408201518160020190816108929190611b40565b50606082015181600301559050507f496186a9d930bac0744acdcd1d0c054b18283eecbe99d30bda98102d3d06b8ef82826040516108d1929190611c0f565b60405180910390a150505050565b60055481565b6108ed610ff2565b43600781905550601e43610901919061169d565b6008819055507f10cc99616aca050d810fd487c95f968e516d0fa25318530ed50753153d060a1e60405160405180910390a1565b6008544310610979576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097090611c80565b60405180910390fd5b565b610983610935565b5f60045f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f206040518060800160405290815f8201548152602001600182015481526020016002820180546109ef9061176e565b80601f0160208091040260200160405190810160405280929190818152602001828054610a1b9061176e565b8015610a665780601f10610a3d57610100808354040283529160200191610a66565b820191905f5260205f20905b815481529060010190602001808311610a4957829003601f168201915b5050505050815260200160038201548152505090505f8160600151600754338686604051602001610a9b959493929190611934565b60405160208183030381529060405280519060200120905080825f015114610af8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aef90611d0e565b60405180910390fd5b5f8186604051602001610b0c929190611d4c565b6040516020818303038152906040528051906020012090508260200151815f1c10610b6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b6390611de7565b60405180910390fd5b60055f815480929190610b7e90611e05565b91905055505f60025f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205403610c2857600333908060018154018082558091505060019003905f5260205f20015f9091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b60025f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f815480929190610c7590611e05565b91905055505f60015f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f209050806040518060e001604052803373ffffffffffffffffffffffffffffffffffffffff16815260200188888080601f0160208091040260200160405190810160405280939291908181526020018383808284375f81840152601f19601f82011690508083019250505050505050815260200189815260200186606001518152602001428152602001865f015181526020018660200151815250908060018154018082558091505060019003905f5260205f2090600702015f909190919091505f820151815f015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001019081610dd19190611b40565b5060408201518160020155606082015181600301556080820151816004015560a0820151816005015560c08201518160060155505060405180608001604052805f801b81526020015f815260200160405180602001604052805f81525081526020015f81525060045f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f820151815f0155602082015181600101556040820151816002019081610e9b9190611b40565b50606082015181600301559050503373ffffffffffffffffffffffffffffffffffffffff167f5ea61d67e3236a79ab8c3c29f810e2c408b0a6b1e19f4e0da2fcd6362129c86087878a42895f01518a60200151604051610f0096959493929190611e78565b60405180910390a250505050505050565b60038181548110610f20575f80fd5b905f5260205f20015f915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610f54610ff2565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610fc2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fb990611f42565b60405180910390fd5b610fcb81611070565b50565b7f000000000000000000000000000000000000000000000000000000000000000081565b610ffa611153565b73ffffffffffffffffffffffffffffffffffffffff16611018610756565b73ffffffffffffffffffffffffffffffffffffffff161461106e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106590611faa565b60405180910390fd5b565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b5f33905090565b5f80fd5b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61118b82611162565b9050919050565b61119b81611181565b81146111a5575f80fd5b50565b5f813590506111b681611192565b92915050565b5f602082840312156111d1576111d061115a565b5b5f6111de848285016111a8565b91505092915050565b5f819050919050565b6111f9816111e7565b82525050565b5f6020820190506112125f8301846111f0565b92915050565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b61124a81611181565b82525050565b5f61125b8383611241565b60208301905092915050565b5f602082019050919050565b5f61127d82611218565b6112878185611222565b935061129283611232565b805f5b838110156112c25781516112a98882611250565b97506112b483611267565b925050600181019050611295565b5085935050505092915050565b5f6020820190508181035f8301526112e78184611273565b905092915050565b6112f8816111e7565b8114611302575f80fd5b50565b5f81359050611313816112ef565b92915050565b5f806040838503121561132f5761132e61115a565b5b5f61133c858286016111a8565b925050602061134d85828601611305565b9150509250929050565b61136081611181565b82525050565b5f81519050919050565b5f82825260208201905092915050565b5f5b8381101561139d578082015181840152602081019050611382565b5f8484015250505050565b5f601f19601f8301169050919050565b5f6113c282611366565b6113cc8185611370565b93506113dc818560208601611380565b6113e5816113a8565b840191505092915050565b5f819050919050565b611402816113f0565b82525050565b5f60e08201905061141b5f83018a611357565b818103602083015261142d81896113b8565b905061143c60408301886111f0565b61144960608301876111f0565b61145660808301866111f0565b61146360a08301856113f9565b61147060c08301846111f0565b98975050505050505050565b5f60808201905061148f5f8301876113f9565b61149c60208301866111f0565b81810360408301526114ae81856113b8565b90506114bd60608301846111f0565b95945050505050565b5f6020820190506114d95f830184611357565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f840112611500576114ff6114df565b5b8235905067ffffffffffffffff81111561151d5761151c6114e3565b5b602083019150836001820283011115611539576115386114e7565b5b9250929050565b5f80602083850312156115565761155561115a565b5b5f83013567ffffffffffffffff8111156115735761157261115e565b5b61157f858286016114eb565b92509250509250929050565b5f805f604084860312156115a2576115a161115a565b5b5f6115af86828701611305565b935050602084013567ffffffffffffffff8111156115d0576115cf61115e565b5b6115dc868287016114eb565b92509250509250925092565b5f602082840312156115fd576115fc61115a565b5b5f61160a84828501611305565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f61164a826111e7565b9150611655836111e7565b92508261166557611664611613565b5b828206905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6116a7826111e7565b91506116b2836111e7565b92508282019050808211156116ca576116c9611670565b5b92915050565b5f6116da826111e7565b91506116e5836111e7565b92508282026116f3816111e7565b9150828204841483151761170a57611709611670565b5b5092915050565b5f61171b826111e7565b9150611726836111e7565b92508261173657611735611613565b5b828204905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f600282049050600182168061178557607f821691505b60208210810361179857611797611741565b5b50919050565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c7265615f8201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b5f6117f8602e83611370565b91506118038261179e565b604082019050919050565b5f6020820190508181035f830152611825816117ec565b9050919050565b5f819050919050565b5f60ff82169050919050565b5f819050919050565b5f61186461185f61185a8461182c565b611841565b611835565b9050919050565b6118748161184a565b82525050565b5f60208201905061188d5f83018461186b565b92915050565b5f819050919050565b6118ad6118a8826111e7565b611893565b82525050565b5f8160601b9050919050565b5f6118c9826118b3565b9050919050565b5f6118da826118bf565b9050919050565b6118f26118ed82611181565b6118d0565b82525050565b5f81905092915050565b828183375f83830152505050565b5f61191b83856118f8565b9350611928838584611902565b82840190509392505050565b5f61193f828861189c565b60208201915061194f828761189c565b60208201915061195f82866118e1565b601482019150611970828486611910565b91508190509695505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f819050815f5260205f209050919050565b5f6020601f8301049050919050565b5f82821b905092915050565b5f60088302611a087fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826119cd565b611a1286836119cd565b95508019841693508086168417925050509392505050565b5f611a44611a3f611a3a846111e7565b611841565b6111e7565b9050919050565b5f819050919050565b611a5d83611a2a565b611a71611a6982611a4b565b8484546119d9565b825550505050565b5f90565b611a85611a79565b611a90818484611a54565b505050565b5b81811015611ab357611aa85f82611a7d565b600181019050611a96565b5050565b601f821115611af857611ac9816119ac565b611ad2846119be565b81016020851015611ae1578190505b611af5611aed856119be565b830182611a95565b50505b505050565b5f82821c905092915050565b5f611b185f1984600802611afd565b1980831691505092915050565b5f611b308383611b09565b9150826002028217905092915050565b611b4982611366565b67ffffffffffffffff811115611b6257611b6161197f565b5b611b6c825461176e565b611b77828285611ab7565b5f60209050601f831160018114611ba8575f8415611b96578287015190505b611ba08582611b25565b865550611c07565b601f198416611bb6866119ac565b5f5b82811015611bdd57848901518255600182019150602085019450602081019050611bb8565b86831015611bfa5784890151611bf6601f891682611b09565b8355505b6001600288020188555050505b505050505050565b5f604082019050611c225f8301856113f9565b611c2f60208301846111f0565b9392505050565b7f70726f6f662077696e646f77732068617320636c6f73656400000000000000005f82015250565b5f611c6a601883611370565b9150611c7582611c36565b602082019050919050565b5f6020820190508181035f830152611c9781611c5e565b9050919050565b7f576f726b207375626d6974206e6f7420636f6d70617461626c652077697468205f8201527f6368616c6c656e67650000000000000000000000000000000000000000000000602082015250565b5f611cf8602983611370565b9150611d0382611c9e565b604082019050919050565b5f6020820190508181035f830152611d2581611cec565b9050919050565b5f819050919050565b611d46611d41826113f0565b611d2c565b82525050565b5f611d578285611d35565b602082019150611d67828461189c565b6020820191508190509392505050565b7f576f726b20646f6573206e6f74206d65657420646966666963756c74792074615f8201527f7267657400000000000000000000000000000000000000000000000000000000602082015250565b5f611dd1602483611370565b9150611ddc82611d77565b604082019050919050565b5f6020820190508181035f830152611dfe81611dc5565b9050919050565b5f611e0f826111e7565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611e4157611e40611670565b5b600182019050919050565b5f611e578385611370565b9350611e64838584611902565b611e6d836113a8565b840190509392505050565b5f60a0820190508181035f830152611e9181888a611e4c565b9050611ea060208301876111f0565b611ead60408301866111f0565b611eba60608301856113f9565b611ec760808301846111f0565b979650505050505050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f20615f8201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b5f611f2c602683611370565b9150611f3782611ed2565b604082019050919050565b5f6020820190508181035f830152611f5981611f20565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725f82015250565b5f611f94602083611370565b9150611f9f82611f60565b602082019050919050565b5f6020820190508181035f830152611fc181611f88565b905091905056fea264697066735822122091eae8c08697772bc800c9562030c2dea2e03319ae55fe6f31e3fd15d6e4006b64736f6c63430008150033", + Bin: "0x60a06040527c5269a8a800000000000000000000000000000000000000000000000000608090815250348015610033575f80fd5b5061005061004561005560201b60201c565b61005c60201b60201c565b61011d565b5f33905090565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b608051611ffe61013c5f395f818161041a0152610fd00152611ffe5ff3fe608060405234801561000f575f80fd5b506004361061011f575f3560e01c80638da5cb5b116100ab578063bfb660de1161006f578063bfb660de146102c8578063da8accf9146102d2578063e0d152af146102ee578063f2fde38b1461031e578063f6f851681461033a5761011f565b80638da5cb5b14610248578063a738bf8f14610266578063ab09894514610284578063b28d87ea146102a0578063b681f2fd146102be5761011f565b80634bbe05e4116100f25780634bbe05e4146101ad5780636189f3ac146101e3578063715018a61461021657806378e97925146102205780638129fc1c1461023e5761011f565b8063148c684a146101235780631633da6e146101535780632d68c39714610171578063331bade11461018f575b5f80fd5b61013d600480360381019061013891906111bc565b610358565b60405161014a91906111ff565b60405180910390f35b61015b61036d565b60405161016891906112cf565b60405180910390f35b6101796103f8565b60405161018691906111ff565b60405180910390f35b610197610453565b6040516101a491906111ff565b60405180910390f35b6101c760048036038101906101c29190611319565b610459565b6040516101da9796959493929190611408565b60405180910390f35b6101fd60048036038101906101f891906111bc565b610556565b60405161020d949392919061147c565b60405180910390f35b61021e610608565b005b61022861061b565b60405161023591906111ff565b60405180910390f35b610246610621565b005b610250610756565b60405161025d91906114c6565b60405180910390f35b61026e61077d565b60405161027b91906111ff565b60405180910390f35b61029e60048036038101906102999190611540565b610783565b005b6102a86108df565b6040516102b591906111ff565b60405180910390f35b6102c66108e5565b005b6102d0610935565b005b6102ec60048036038101906102e7919061158b565b61097b565b005b610308600480360381019061030391906115e8565b610f11565b60405161031591906114c6565b60405180910390f35b610338600480360381019061033391906111bc565b610f4c565b005b610342610fce565b60405161034f91906111ff565b60405180910390f35b6002602052805f5260405f205f915090505481565b606060038054806020026020016040519081016040528092919081815260200182805480156103ee57602002820191905f5260205f20905b815f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116103a5575b5050505050905090565b5f806015446104079190611640565b605a610413919061169d565b90506064817f000000000000000000000000000000000000000000000000000000000000000061044391906116d0565b61044d9190611711565b91505090565b60075481565b6001602052815f5260405f208181548110610472575f80fd5b905f5260205f2090600702015f9150915050805f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010180546104b79061176e565b80601f01602080910402602001604051908101604052809291908181526020018280546104e39061176e565b801561052e5780601f106105055761010080835404028352916020019161052e565b820191905f5260205f20905b81548152906001019060200180831161051157829003601f168201915b5050505050908060020154908060030154908060040154908060050154908060060154905087565b6004602052805f5260405f205f91509050805f0154908060010154908060020180546105819061176e565b80601f01602080910402602001604051908101604052809291908181526020018280546105ad9061176e565b80156105f85780601f106105cf576101008083540402835291602001916105f8565b820191905f5260205f20905b8154815290600101906020018083116105db57829003601f168201915b5050505050908060030154905084565b610610610ff2565b6106195f611070565b565b60065481565b5f8060159054906101000a900460ff16159050808015610652575060015f60149054906101000a900460ff1660ff16105b80610680575061066130611131565b15801561067f575060015f60149054906101000a900460ff1660ff16145b5b6106bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106b69061180e565b60405180910390fd5b60015f60146101000a81548160ff021916908360ff16021790555080156106fb5760015f60156101000a81548160ff0219169083151502179055505b8015610753575f8060156101000a81548160ff0219169083151502179055507f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498600160405161074a919061187a565b60405180910390a15b50565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60085481565b61078b610935565b5f426007543385856040516020016107a7959493929190611934565b6040516020818303038152906040528051906020012090505f6107c86103f8565b9050604051806080016040528083815260200182815260200185858080601f0160208091040260200160405190810160405280939291908181526020018383808284375f81840152601f19601f8201169050808301925050505050505081526020014281525060045f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f820151815f01556020820151816001015560408201518160020190816108929190611b40565b50606082015181600301559050507f496186a9d930bac0744acdcd1d0c054b18283eecbe99d30bda98102d3d06b8ef82826040516108d1929190611c0f565b60405180910390a150505050565b60055481565b6108ed610ff2565b43600781905550601e43610901919061169d565b6008819055507f10cc99616aca050d810fd487c95f968e516d0fa25318530ed50753153d060a1e60405160405180910390a1565b6008544310610979576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097090611c80565b60405180910390fd5b565b610983610935565b5f60045f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f206040518060800160405290815f8201548152602001600182015481526020016002820180546109ef9061176e565b80601f0160208091040260200160405190810160405280929190818152602001828054610a1b9061176e565b8015610a665780601f10610a3d57610100808354040283529160200191610a66565b820191905f5260205f20905b815481529060010190602001808311610a4957829003601f168201915b5050505050815260200160038201548152505090505f8160600151600754338686604051602001610a9b959493929190611934565b60405160208183030381529060405280519060200120905080825f015114610af8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aef90611d0e565b60405180910390fd5b5f8186604051602001610b0c929190611d4c565b6040516020818303038152906040528051906020012090508260200151815f1c10610b6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b6390611de7565b60405180910390fd5b60055f815480929190610b7e90611e05565b91905055505f60025f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205403610c2857600333908060018154018082558091505060019003905f5260205f20015f9091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b60025f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f815480929190610c7590611e05565b91905055505f60015f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f209050806040518060e001604052803373ffffffffffffffffffffffffffffffffffffffff16815260200188888080601f0160208091040260200160405190810160405280939291908181526020018383808284375f81840152601f19601f82011690508083019250505050505050815260200189815260200186606001518152602001428152602001865f015181526020018660200151815250908060018154018082558091505060019003905f5260205f2090600702015f909190919091505f820151815f015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001019081610dd19190611b40565b5060408201518160020155606082015181600301556080820151816004015560a0820151816005015560c08201518160060155505060405180608001604052805f801b81526020015f815260200160405180602001604052805f81525081526020015f81525060045f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f820151815f0155602082015181600101556040820151816002019081610e9b9190611b40565b50606082015181600301559050503373ffffffffffffffffffffffffffffffffffffffff167f5ea61d67e3236a79ab8c3c29f810e2c408b0a6b1e19f4e0da2fcd6362129c86087878a42895f01518a60200151604051610f0096959493929190611e78565b60405180910390a250505050505050565b60038181548110610f20575f80fd5b905f5260205f20015f915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610f54610ff2565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610fc2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fb990611f42565b60405180910390fd5b610fcb81611070565b50565b7f000000000000000000000000000000000000000000000000000000000000000081565b610ffa611153565b73ffffffffffffffffffffffffffffffffffffffff16611018610756565b73ffffffffffffffffffffffffffffffffffffffff161461106e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106590611faa565b60405180910390fd5b565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b5f33905090565b5f80fd5b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61118b82611162565b9050919050565b61119b81611181565b81146111a5575f80fd5b50565b5f813590506111b681611192565b92915050565b5f602082840312156111d1576111d061115a565b5b5f6111de848285016111a8565b91505092915050565b5f819050919050565b6111f9816111e7565b82525050565b5f6020820190506112125f8301846111f0565b92915050565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b61124a81611181565b82525050565b5f61125b8383611241565b60208301905092915050565b5f602082019050919050565b5f61127d82611218565b6112878185611222565b935061129283611232565b805f5b838110156112c25781516112a98882611250565b97506112b483611267565b925050600181019050611295565b5085935050505092915050565b5f6020820190508181035f8301526112e78184611273565b905092915050565b6112f8816111e7565b8114611302575f80fd5b50565b5f81359050611313816112ef565b92915050565b5f806040838503121561132f5761132e61115a565b5b5f61133c858286016111a8565b925050602061134d85828601611305565b9150509250929050565b61136081611181565b82525050565b5f81519050919050565b5f82825260208201905092915050565b5f5b8381101561139d578082015181840152602081019050611382565b5f8484015250505050565b5f601f19601f8301169050919050565b5f6113c282611366565b6113cc8185611370565b93506113dc818560208601611380565b6113e5816113a8565b840191505092915050565b5f819050919050565b611402816113f0565b82525050565b5f60e08201905061141b5f83018a611357565b818103602083015261142d81896113b8565b905061143c60408301886111f0565b61144960608301876111f0565b61145660808301866111f0565b61146360a08301856113f9565b61147060c08301846111f0565b98975050505050505050565b5f60808201905061148f5f8301876113f9565b61149c60208301866111f0565b81810360408301526114ae81856113b8565b90506114bd60608301846111f0565b95945050505050565b5f6020820190506114d95f830184611357565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f840112611500576114ff6114df565b5b8235905067ffffffffffffffff81111561151d5761151c6114e3565b5b602083019150836001820283011115611539576115386114e7565b5b9250929050565b5f80602083850312156115565761155561115a565b5b5f83013567ffffffffffffffff8111156115735761157261115e565b5b61157f858286016114eb565b92509250509250929050565b5f805f604084860312156115a2576115a161115a565b5b5f6115af86828701611305565b935050602084013567ffffffffffffffff8111156115d0576115cf61115e565b5b6115dc868287016114eb565b92509250509250925092565b5f602082840312156115fd576115fc61115a565b5b5f61160a84828501611305565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f61164a826111e7565b9150611655836111e7565b92508261166557611664611613565b5b828206905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6116a7826111e7565b91506116b2836111e7565b92508282019050808211156116ca576116c9611670565b5b92915050565b5f6116da826111e7565b91506116e5836111e7565b92508282026116f3816111e7565b9150828204841483151761170a57611709611670565b5b5092915050565b5f61171b826111e7565b9150611726836111e7565b92508261173657611735611613565b5b828204905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f600282049050600182168061178557607f821691505b60208210810361179857611797611741565b5b50919050565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c7265615f8201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b5f6117f8602e83611370565b91506118038261179e565b604082019050919050565b5f6020820190508181035f830152611825816117ec565b9050919050565b5f819050919050565b5f60ff82169050919050565b5f819050919050565b5f61186461185f61185a8461182c565b611841565b611835565b9050919050565b6118748161184a565b82525050565b5f60208201905061188d5f83018461186b565b92915050565b5f819050919050565b6118ad6118a8826111e7565b611893565b82525050565b5f8160601b9050919050565b5f6118c9826118b3565b9050919050565b5f6118da826118bf565b9050919050565b6118f26118ed82611181565b6118d0565b82525050565b5f81905092915050565b828183375f83830152505050565b5f61191b83856118f8565b9350611928838584611902565b82840190509392505050565b5f61193f828861189c565b60208201915061194f828761189c565b60208201915061195f82866118e1565b601482019150611970828486611910565b91508190509695505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f819050815f5260205f209050919050565b5f6020601f8301049050919050565b5f82821b905092915050565b5f60088302611a087fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826119cd565b611a1286836119cd565b95508019841693508086168417925050509392505050565b5f611a44611a3f611a3a846111e7565b611841565b6111e7565b9050919050565b5f819050919050565b611a5d83611a2a565b611a71611a6982611a4b565b8484546119d9565b825550505050565b5f90565b611a85611a79565b611a90818484611a54565b505050565b5b81811015611ab357611aa85f82611a7d565b600181019050611a96565b5050565b601f821115611af857611ac9816119ac565b611ad2846119be565b81016020851015611ae1578190505b611af5611aed856119be565b830182611a95565b50505b505050565b5f82821c905092915050565b5f611b185f1984600802611afd565b1980831691505092915050565b5f611b308383611b09565b9150826002028217905092915050565b611b4982611366565b67ffffffffffffffff811115611b6257611b6161197f565b5b611b6c825461176e565b611b77828285611ab7565b5f60209050601f831160018114611ba8575f8415611b96578287015190505b611ba08582611b25565b865550611c07565b601f198416611bb6866119ac565b5f5b82811015611bdd57848901518255600182019150602085019450602081019050611bb8565b86831015611bfa5784890151611bf6601f891682611b09565b8355505b6001600288020188555050505b505050505050565b5f604082019050611c225f8301856113f9565b611c2f60208301846111f0565b9392505050565b7f70726f6f662077696e646f77732068617320636c6f73656400000000000000005f82015250565b5f611c6a601883611370565b9150611c7582611c36565b602082019050919050565b5f6020820190508181035f830152611c9781611c5e565b9050919050565b7f576f726b207375626d6974206e6f7420636f6d70617461626c652077697468205f8201527f6368616c6c656e67650000000000000000000000000000000000000000000000602082015250565b5f611cf8602983611370565b9150611d0382611c9e565b604082019050919050565b5f6020820190508181035f830152611d2581611cec565b9050919050565b5f819050919050565b611d46611d41826113f0565b611d2c565b82525050565b5f611d578285611d35565b602082019150611d67828461189c565b6020820191508190509392505050565b7f576f726b20646f6573206e6f74206d65657420646966666963756c74792074615f8201527f7267657400000000000000000000000000000000000000000000000000000000602082015250565b5f611dd1602483611370565b9150611ddc82611d77565b604082019050919050565b5f6020820190508181035f830152611dfe81611dc5565b9050919050565b5f611e0f826111e7565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611e4157611e40611670565b5b600182019050919050565b5f611e578385611370565b9350611e64838584611902565b611e6d836113a8565b840190509392505050565b5f60a0820190508181035f830152611e9181888a611e4c565b9050611ea060208301876111f0565b611ead60408301866111f0565b611eba60608301856113f9565b611ec760808301846111f0565b979650505050505050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f20615f8201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b5f611f2c602683611370565b9150611f3782611ed2565b604082019050919050565b5f6020820190508181035f830152611f5981611f20565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725f82015250565b5f611f94602083611370565b9150611f9f82611f60565b602082019050919050565b5f6020820190508181035f830152611fc181611f88565b905091905056fea26469706673582212209a434f69ce9cd04c6b0e8d120d210e7526b104c408b8e8de15ff091b1e35acd164736f6c63430008150033", } // PowABI is the input ABI used to generate the binding from. From 80af65aa00dc1d4760ae1a2bd5fc22cc1464f528 Mon Sep 17 00:00:00 2001 From: hunjixin Date: Thu, 13 Jun 2024 07:53:34 +0000 Subject: [PATCH 05/14] fix: blocked error channel --- pkg/solver/controller.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/solver/controller.go b/pkg/solver/controller.go index c5165fb8..4d1580cd 100644 --- a/pkg/solver/controller.go +++ b/pkg/solver/controller.go @@ -71,7 +71,7 @@ func NewSolverController( } func (controller *SolverController) Start(ctx context.Context, cm *system.CleanupManager) chan error { - errorChan := make(chan error) + errorChan := make(chan error, 1) // get the local subscriptions setup err := controller.subscribeToWeb3() if err != nil { From b2d7287e8d4465ff659624c0d82b4d27fd8ba227 Mon Sep 17 00:00:00 2001 From: hunjixin <16705420332lee@gmai.com> Date: Fri, 14 Jun 2024 05:44:31 +0000 Subject: [PATCH 06/14] chore: update dev toml sc address --- pkg/options/configs/dev.toml | 5 ++++- pkg/options/configs/devnet.toml | 1 + pkg/options/configs/testnet.toml | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/options/configs/dev.toml b/pkg/options/configs/dev.toml index 1dfb307c..1a0f922e 100644 --- a/pkg/options/configs/dev.toml +++ b/pkg/options/configs/dev.toml @@ -5,10 +5,13 @@ mediator = ["0x90F79bf6EB2c4f870365E785982E1f101E93b906"] [web3] rpc_url = "ws://localhost:8548" chain_id = 412346 -controller_address = "0x4ed7c70F96B99c776995fB64377f0d4aB3B0e1C1" +controller_address = "0xa85233C63b9Ee964Add6F2cffe00Fd84eb32338f" payments_address = "0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6" storage_address = "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e" users_address = "0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82" token_address = "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853" mediation_address = "0x0B306BF915C4d645ff596e518fAf3F9669b97016" jobcreator_address = "0x9A9f2CCfdE556A7E9Ff0848998Aa4a0CFD8863AE" +pow_address = "0x4ed7c70F96B99c776995fB64377f0d4aB3B0e1C1" + + diff --git a/pkg/options/configs/devnet.toml b/pkg/options/configs/devnet.toml index 6217e257..9659af6a 100644 --- a/pkg/options/configs/devnet.toml +++ b/pkg/options/configs/devnet.toml @@ -12,3 +12,4 @@ users_address = "0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82" token_address = "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853" mediation_address = "0x0B306BF915C4d645ff596e518fAf3F9669b97016" jobcreator_address = "0x9A9f2CCfdE556A7E9Ff0848998Aa4a0CFD8863AE" +pow_address = "" diff --git a/pkg/options/configs/testnet.toml b/pkg/options/configs/testnet.toml index 2b2edf10..b31d56f5 100644 --- a/pkg/options/configs/testnet.toml +++ b/pkg/options/configs/testnet.toml @@ -12,3 +12,4 @@ users_address = "0x8FBAC8549fe9cb0630f7E30929C8256b9b67E68f" token_address = "0x0AabEbf21Cc4591475bb64e105267b3d55C7e0f1" mediation_address = "0x7B49d6ee530B0A538D26E344f3B02E79ACa96De2" jobcreator_address = "0x691ddE4710baFA7D0d7c02da32FeFB513CC870fA" +pow_address = "" From 44d8198c467615bad00ce671ff414f3eeecb76f9 Mon Sep 17 00:00:00 2001 From: hunjixin <16705420332lee@gmai.com> Date: Fri, 14 Jun 2024 12:59:50 +0000 Subject: [PATCH 07/14] feat: change wrong log and add toml tag --- pkg/options/configs/devnet.toml | 2 +- pkg/web3/sdk.go | 4 ++-- pkg/web3/types.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/options/configs/devnet.toml b/pkg/options/configs/devnet.toml index 9659af6a..8ebb76e5 100644 --- a/pkg/options/configs/devnet.toml +++ b/pkg/options/configs/devnet.toml @@ -12,4 +12,4 @@ users_address = "0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82" token_address = "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853" mediation_address = "0x0B306BF915C4d645ff596e518fAf3F9669b97016" jobcreator_address = "0x9A9f2CCfdE556A7E9Ff0848998Aa4a0CFD8863AE" -pow_address = "" +pow_address = "0x4ed7c70F96B99c776995fB64377f0d4aB3B0e1C1" diff --git a/pkg/web3/sdk.go b/pkg/web3/sdk.go index 27019b21..f4a28795 100644 --- a/pkg/web3/sdk.go +++ b/pkg/web3/sdk.go @@ -72,7 +72,7 @@ func NewContracts( } powAddress := options.PowAddress - log.Debug().Msgf("TokenAddress: %s", powAddress) + log.Debug().Msgf("PowAddress: %s", powAddress) if powAddress == "" { loadedPowAddress, err := controller.GetPowAddress(callOpts) if err != nil { @@ -80,7 +80,7 @@ func NewContracts( } powAddress = loadedPowAddress.String() log.Debug(). - Str("load token address", powAddress). + Str("load pow address", powAddress). Msgf("") } diff --git a/pkg/web3/types.go b/pkg/web3/types.go index e2fb05de..6ae7768b 100644 --- a/pkg/web3/types.go +++ b/pkg/web3/types.go @@ -21,7 +21,7 @@ type Web3Options struct { TokenAddress string `json:"token_address" toml:"token_address"` MediationAddress string `json:"mediation_address" toml:"mediation_address"` JobCreatorAddress string `json:"jobcreator_address" toml:"jobcreator_address"` - PowAddress string `json:"pow_address"` + PowAddress string `json:"pow_address" toml:"pow_address` // this is injected by whatever service we are running // it's used for logging tx's Service system.Service `json:"-" toml:"-"` From f0ae8dc652080e1232be968019ba5ef5c746eaa2 Mon Sep 17 00:00:00 2001 From: hunjixin <16705420332lee@gmai.com> Date: Fri, 14 Jun 2024 13:00:40 +0000 Subject: [PATCH 08/14] fix: upgrade cowsay to v0.0.4 --- test/integration_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration_test.go b/test/integration_test.go index 4ce34b20..3d6e0433 100644 --- a/test/integration_test.go +++ b/test/integration_test.go @@ -115,7 +115,7 @@ func getJobCreatorOptions(options testOptions) (jobcreator.JobCreatorOptions, er } ret, err := optionsfactory.ProcessJobCreatorOptions(jobCreatorOptions, []string{ // this should point to the shortcut - "cowsay:v0.0.2", + "cowsay:v0.0.4", }, "dev") if err != nil { From 4211285ec22932c8e4afd4230a3516220b0be08c Mon Sep 17 00:00:00 2001 From: hunjixin <16705420332lee@gmai.com> Date: Fri, 14 Jun 2024 13:02:54 +0000 Subject: [PATCH 09/14] fix: update devent controller address --- pkg/options/configs/devnet.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/options/configs/devnet.toml b/pkg/options/configs/devnet.toml index 8ebb76e5..660e1b41 100644 --- a/pkg/options/configs/devnet.toml +++ b/pkg/options/configs/devnet.toml @@ -5,7 +5,7 @@ mediator = ["0x90F79bf6EB2c4f870365E785982E1f101E93b906"] [web3] rpc_url = "wss://devnet-chain-ws.lilypad.tech" chain_id = 412346 -controller_address = "0x4ed7c70F96B99c776995fB64377f0d4aB3B0e1C1" +controller_address = "0xa85233C63b9Ee964Add6F2cffe00Fd84eb32338f" payments_address = "0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6" storage_address = "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e" users_address = "0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82" From 68ca34f813f06bda8280848085fa220c47e317e8 Mon Sep 17 00:00:00 2001 From: Brian Ginsburg Date: Fri, 14 Jun 2024 10:02:22 -0700 Subject: [PATCH 10/14] fix: Add POW config processor --- pkg/options/web3.go | 3 +++ pkg/web3/types.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/options/web3.go b/pkg/options/web3.go index eb79f94a..afa79a86 100644 --- a/pkg/options/web3.go +++ b/pkg/options/web3.go @@ -126,6 +126,9 @@ func ProcessWeb3Options(options web3.Web3Options, network string) (web3.Web3Opti if options.TokenAddress == "" { options.TokenAddress = config.Web3.TokenAddress } + if options.PowAddress == "" { + options.PowAddress = config.Web3.PowAddress + } if options.PrivateKey == "" { options.PrivateKey = os.Getenv("WEB3_PRIVATE_KEY") diff --git a/pkg/web3/types.go b/pkg/web3/types.go index 6ae7768b..f5af6437 100644 --- a/pkg/web3/types.go +++ b/pkg/web3/types.go @@ -21,7 +21,7 @@ type Web3Options struct { TokenAddress string `json:"token_address" toml:"token_address"` MediationAddress string `json:"mediation_address" toml:"mediation_address"` JobCreatorAddress string `json:"jobcreator_address" toml:"jobcreator_address"` - PowAddress string `json:"pow_address" toml:"pow_address` + PowAddress string `json:"pow_address" toml:"pow_address"` // this is injected by whatever service we are running // it's used for logging tx's Service system.Service `json:"-" toml:"-"` From 072f99743ec8bdabe0f6e1b5843bf674e76e36fe Mon Sep 17 00:00:00 2001 From: Gorka Date: Fri, 14 Jun 2024 16:43:36 -0300 Subject: [PATCH 11/14] feat: add pow address for testnet --- pkg/options/configs/testnet.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/options/configs/testnet.toml b/pkg/options/configs/testnet.toml index b31d56f5..be2f6fbe 100644 --- a/pkg/options/configs/testnet.toml +++ b/pkg/options/configs/testnet.toml @@ -12,4 +12,4 @@ users_address = "0x8FBAC8549fe9cb0630f7E30929C8256b9b67E68f" token_address = "0x0AabEbf21Cc4591475bb64e105267b3d55C7e0f1" mediation_address = "0x7B49d6ee530B0A538D26E344f3B02E79ACa96De2" jobcreator_address = "0x691ddE4710baFA7D0d7c02da32FeFB513CC870fA" -pow_address = "" +pow_address = "0xacDf1005fAb67C13603C19aC5471F0c7dDBc90b2" From 4f7caeff4411466eada500ec30daa37664c8553d Mon Sep 17 00:00:00 2001 From: Gorka Date: Fri, 14 Jun 2024 17:29:07 -0300 Subject: [PATCH 12/14] chore: update to latest controller address --- pkg/options/configs/testnet.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/options/configs/testnet.toml b/pkg/options/configs/testnet.toml index be2f6fbe..0794b37b 100644 --- a/pkg/options/configs/testnet.toml +++ b/pkg/options/configs/testnet.toml @@ -5,7 +5,7 @@ mediator = ["0x7B49d6ee530B0A538D26E344f3B02E79ACa96De2"] [web3] rpc_url = "wss://arbitrum-sepolia.infura.io/ws/v3/07472a48382e4679ae818aad0c21cf90" chain_id = 421614 -controller_address = "0xF2fD1B9b262982F12446149A27d8901Ac68dcB59" +controller_address = "0x4a83270045FB4BCd1bdFe1bD6B00762A9D8bbF4E" payments_address = "0x6f982192B4D225D67ED52A31308a602438882D6b" storage_address = "0xEB383625D7837aD49C1909f74d05a2db247CE0ca" users_address = "0x8FBAC8549fe9cb0630f7E30929C8256b9b67E68f" From a94fce76c8459f6d0444125be8d75690a162a0ad Mon Sep 17 00:00:00 2001 From: Arsen Yeremin Date: Fri, 14 Jun 2024 13:47:21 -0700 Subject: [PATCH 13/14] chore: update contract addresses --- pkg/options/configs/testnet.toml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/options/configs/testnet.toml b/pkg/options/configs/testnet.toml index 0794b37b..cb184e15 100644 --- a/pkg/options/configs/testnet.toml +++ b/pkg/options/configs/testnet.toml @@ -6,10 +6,10 @@ mediator = ["0x7B49d6ee530B0A538D26E344f3B02E79ACa96De2"] rpc_url = "wss://arbitrum-sepolia.infura.io/ws/v3/07472a48382e4679ae818aad0c21cf90" chain_id = 421614 controller_address = "0x4a83270045FB4BCd1bdFe1bD6B00762A9D8bbF4E" -payments_address = "0x6f982192B4D225D67ED52A31308a602438882D6b" -storage_address = "0xEB383625D7837aD49C1909f74d05a2db247CE0ca" -users_address = "0x8FBAC8549fe9cb0630f7E30929C8256b9b67E68f" -token_address = "0x0AabEbf21Cc4591475bb64e105267b3d55C7e0f1" -mediation_address = "0x7B49d6ee530B0A538D26E344f3B02E79ACa96De2" -jobcreator_address = "0x691ddE4710baFA7D0d7c02da32FeFB513CC870fA" -pow_address = "0xacDf1005fAb67C13603C19aC5471F0c7dDBc90b2" +payments_address = "0xdE7CEa09A23e7Aa4980B95F69B8912F39A0e323A" +storage_address = "0x8d06cEB457d336c6c938FCe9C4862615a4F79af0" +users_address = "0x90ed1AC9c74B9340468134F8c669BA1169A11c58" +token_address = "0x0352485f8a3cB6d305875FaC0C40ef01e0C06535" +mediation_address = "0xD1377D4617CD634426A8b595507fd2045A2DFB03" +jobcreator_address = "0xDBA89e33EFE2eD227c04CB31356EFdE618d4953F" +pow_address = "0xacDf1005fAb67C13603C19aC5471F0c7dDBc90b2" \ No newline at end of file From fcb82b4e659692019121afb0ad670d6a79c090f0 Mon Sep 17 00:00:00 2001 From: Arsen Yeremin Date: Fri, 14 Jun 2024 13:49:48 -0700 Subject: [PATCH 14/14] build: add hardhat testnet config --- hardhat/hardhat.config.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hardhat/hardhat.config.ts b/hardhat/hardhat.config.ts index 338ecd8c..4823e273 100644 --- a/hardhat/hardhat.config.ts +++ b/hardhat/hardhat.config.ts @@ -39,6 +39,11 @@ const config: HardhatUserConfig = { chainId: 412346, accounts: [getAccount('admin').privateKey], }, + testnet:{ + url: 'https://sepolia-rollup.arbitrum.io/rpc', + chainId: 421614, + accounts: [getAccount('admin').privateKey], + }, }, etherscan: { apiKey: process.env.ETHERSCAN_API_KEY,