From 9d1f56d658bb7a800dba091b0fd0c13626e58a81 Mon Sep 17 00:00:00 2001 From: cam-schultz Date: Fri, 9 Aug 2024 10:11:03 -0500 Subject: [PATCH 01/27] native staking manager abi --- .../NativeTokenStakingManager.go | 1214 +++++++++++++++++ scripts/abi_bindings.sh | 2 +- 2 files changed, 1215 insertions(+), 1 deletion(-) create mode 100644 abi-bindings/go/staking/NativeTokenStakingManager/NativeTokenStakingManager.go diff --git a/abi-bindings/go/staking/NativeTokenStakingManager/NativeTokenStakingManager.go b/abi-bindings/go/staking/NativeTokenStakingManager/NativeTokenStakingManager.go new file mode 100644 index 000000000..89dca2386 --- /dev/null +++ b/abi-bindings/go/staking/NativeTokenStakingManager/NativeTokenStakingManager.go @@ -0,0 +1,1214 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package nativetokenstakingmanager + +import ( + "errors" + "math/big" + "strings" + + "github.com/ava-labs/subnet-evm/accounts/abi" + "github.com/ava-labs/subnet-evm/accounts/abi/bind" + "github.com/ava-labs/subnet-evm/core/types" + "github.com/ava-labs/subnet-evm/interfaces" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = interfaces.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +// InitialStakerInfo is an auto generated low-level Go binding around an user-defined struct. +type InitialStakerInfo struct { + ValidationInfo StakingMessagesValidationInfo + Owner common.Address +} + +// StakingManagerSettings is an auto generated low-level Go binding around an user-defined struct. +type StakingManagerSettings struct { + PChainBlockchainID [32]byte + SubnetID [32]byte + MinimumStakeAmount *big.Int + MaximumStakeAmount *big.Int + MinimumStakeDuration uint64 + MaximumHourlyChurn uint8 + InitialStakers []InitialStakerInfo + RewardCalculator common.Address +} + +// StakingMessagesValidationInfo is an auto generated low-level Go binding around an user-defined struct. +type StakingMessagesValidationInfo struct { + SubnetID [32]byte + NodeID [32]byte + Weight uint64 + RegistrationExpiry uint64 + Signature []byte +} + +// NativeTokenStakingManagerMetaData contains all meta data concerning the NativeTokenStakingManager contract. +var NativeTokenStakingManagerMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"init\",\"type\":\"uint8\",\"internalType\":\"enumICMInitializable\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"WARP_MESSENGER\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIWarpMessenger\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"completeEndValidation\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"setWeightMessageType\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"completeValidatorRegistration\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"settings\",\"type\":\"tuple\",\"internalType\":\"structStakingManagerSettings\",\"components\":[{\"name\":\"pChainBlockchainID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"subnetID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"minimumStakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"maximumStakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"minimumStakeDuration\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"maximumHourlyChurn\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"initialStakers\",\"type\":\"tuple[]\",\"internalType\":\"structInitialStakerInfo[]\",\"components\":[{\"name\":\"validationInfo\",\"type\":\"tuple\",\"internalType\":\"structStakingMessages.ValidationInfo\",\"components\":[{\"name\":\"subnetID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"nodeID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"weight\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"name\":\"rewardCalculator\",\"type\":\"address\",\"internalType\":\"contractIRewardCalculator\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeEndValidation\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"includeUptimeProof\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeValidatorRegistration\",\"inputs\":[{\"name\":\"nodeID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"resendEndValidatorMessage\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"resendRegisterValidatorMessage\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"valueToWeight\",\"inputs\":[{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"weightToValue\",\"inputs\":[{\"name\":\"weight\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"pure\"},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodCreated\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"nodeID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"registerValidationMessageID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"weight\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodEnded\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodRegistered\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"stakeAmount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"timestamp\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidatorRemovalInitialized\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"setWeightMessageID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"stakeAmount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"endTime\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"uptime\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ReentrancyGuardReentrantCall\",\"inputs\":[]}]", + Bin: "0x608060405234801561000f575f80fd5b5060405161302038038061302083398101604081905261002e91610107565b60018160018111156100425761004261012c565b0361004f5761004f610055565b50610140565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156100a55760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146101045780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b5f60208284031215610117575f80fd5b815160028110610125575f80fd5b9392505050565b634e487b7160e01b5f52602160045260245ffd5b612ed38061014d5f395ff3fe60806040526004361061008f575f3560e01c8063a3a65e4811610057578063a3a65e481461015b578063b771b3bc1461017a578063bee0a03f146101ac578063f40797d7146101cb578063fdf94a1a146101de575f80fd5b80630322ed98146100935780631a0d36fe146100b45780632e2194d8146100d3578063620658561461010f57806376f786211461013c575b5f80fd5b34801561009e575f80fd5b506100b26100ad3660046125d3565b6101fd565b005b3480156100bf575f80fd5b506100b26100ce3660046125ea565b6103f3565b3480156100de575f80fd5b506100f26100ed3660046125d3565b6104ff565b6040516001600160401b0390911681526020015b60405180910390f35b34801561011a575f80fd5b5061012e610129366004612643565b610515565b604051908152602001610106565b348015610147575f80fd5b506100b261015636600461267c565b61052e565b348015610166575f80fd5b506100b26101753660046126b7565b610aae565b348015610185575f80fd5b506101946005600160991b0181565b6040516001600160a01b039091168152602001610106565b3480156101b7575f80fd5b506100b26101c63660046125d3565b610d36565b61012e6101d9366004612762565b610e4a565b3480156101e9575f80fd5b506100b26101f83660046127f4565b610e5f565b5f8181527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab60860205260408082208151610120810190925280545f80516020612ea783398151915293929190829060ff16600581111561025e5761025e612829565b600581111561026f5761026f612829565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003928301546001600160a01b03811660c084015260ff600160a01b820416151560e0840152600160a81b900416610100909101529091508151600581111561030657610306612829565b1461036e5760405162461bcd60e51b815260206004820152602d60248201527f5374616b696e674d616e616765723a2056616c696461746f72206e6f7420706560448201526c1b991a5b99c81c995b5bdd985b609a1b60648201526084015b60405180910390fd5b5f61037f848361010001515f611286565b60405163ee5b48eb60e01b81529091506005600160991b019063ee5b48eb906103ac90849060040161285f565b6020604051808303815f875af11580156103c8573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103ec9190612891565b5050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff1615906001600160401b03165f811580156104375750825b90505f826001600160401b031660011480156104525750303b155b905081158015610460575080155b1561047e5760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff1916600117855583156104a857845460ff60401b1916600160401b1785555b6104b186611448565b83156104f757845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050565b5f61050f64e8d4a51000836128d0565b92915050565b5f61050f6001600160401b03831664e8d4a510006128e3565b5f8381527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab60860205260408082208151610120810190925280545f80516020612ea783398151915293929190829060ff16600581111561058f5761058f612829565b60058111156105a0576105a0612829565b8152600182015460208201526002808301546001600160401b038082166040850152600160401b820481166060850152600160801b820481166080850152600160c01b909104811660a08401526003909301546001600160a01b03811660c084015260ff600160a01b820416151560e0840152600160a81b9004909216610100909101529091508151600581111561063a5761063a612829565b146106935760405162461bcd60e51b8152602060048201526024808201527f5374616b696e674d616e616765723a2056616c696461746f72206e6f742061636044820152637469766560e01b6064820152608401610365565b60c08101516001600160a01b0316336001600160a01b0316146106c85760405162461bcd60e51b8152600401610365906128fa565b6106d5816040015161146c565b60038152426001600160401b031660808201525f84156108ae576040516306f8253560e41b815263ffffffff851660048201525f9081906005600160991b0190636f825350906024015f60405180830381865afa158015610738573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f1916820160405261075f9190810190612963565b91509150806107805760405162461bcd60e51b815260040161036590612a35565b6005600160991b016001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107c3573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107e79190612891565b8251146108065760405162461bcd60e51b815260040161036590612a79565b60208201516001600160a01b0316156108315760405162461bcd60e51b815260040161036590612ac0565b5f806108408460400151611650565b91509150818a146108a85760405162461bcd60e51b815260206004820152602c60248201527f5374616b696e674d616e616765723a20496e76616c696420757074696d65207660448201526b185b1a59185d1a5bdb88125160a21b6064820152608401610365565b93505050505b6001600160401b03811660a08301525f86815260088401602052604090208251815484929190829060ff191660018360058111156108ee576108ee612829565b02179055506020820151600182015560408201516002820180546060850151608086015160a08701516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c08301516003909201805460e0850151610100958601516001600160a01b039095166001600160a81b031990921691909117600160a01b911515919091021767ffffffffffffffff60a81b1916600160a81b93909216929092021790558201515f906109df90889083611286565b60405163ee5b48eb60e01b81529091505f906005600160991b019063ee5b48eb90610a0e90859060040161285f565b6020604051808303815f875af1158015610a2a573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a4e9190612891565b60408581015181516001600160401b03918216815242602082015290861681830152905191925082918a917f530b908725650fb1052974f9df59e834fefac78c9ec2f00c6d2464d60cc6add5919081900360600190a35050505050505050565b5f5f80516020612ea78339815191526040516306f8253560e41b815263ffffffff841660048201529091505f9081906005600160991b0190636f825350906024015f60405180830381865afa158015610b09573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052610b309190810190612963565b9150915080610b515760405162461bcd60e51b815260040161036590612a35565b8254825114610b725760405162461bcd60e51b815260040161036590612a79565b60208201516001600160a01b031615610b9d5760405162461bcd60e51b815260040161036590612ac0565b5f80610bac84604001516117ab565b9150915080610c0c5760405162461bcd60e51b815260206004820152602660248201527f5374616b696e674d616e616765723a20526567697374726174696f6e206e6f74604482015265081d985b1a5960d21b6064820152608401610365565b5f82815260078601602052604081208054610c2690612b0d565b9050118015610c58575060015f83815260088701602052604090205460ff166005811115610c5657610c56612829565b145b610c745760405162461bcd60e51b815260040161036590612b45565b5f8281526007860160205260408120610c8c91612589565b5f8281526008860160208181526040808420805460ff191660029081178255810180546001600160401b0342818116600160401b0267ffffffffffffffff60401b19909316929092178355600190930154875260098c0185528387208990559588905293835292548151931683529082019290925283917ff8fd1c90fb9cfa2ca2358fdf5806b086ad43315d92b221c929efc7f105ce7568910160405180910390a2505050505050565b5f8181527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6076020526040812080545f80516020612ea7833981519152929190610d7e90612b0d565b9050118015610db0575060015f83815260088301602052604090205460ff166005811115610dae57610dae612829565b145b610dcc5760405162461bcd60e51b815260040161036590612b45565b5f82815260078201602052604090819020905163ee5b48eb60e01b81526005600160991b019163ee5b48eb91610e059190600401612b8a565b6020604051808303815f875af1158015610e21573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e459190612891565b505050565b5f610e57843485856118cf565b949350505050565b5f5f80516020612ea78339815191526040516306f8253560e41b815263ffffffff851660048201529091505f9081906005600160991b0190636f825350906024015f60405180830381865afa158015610eba573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052610ee19190810190612963565b9150915080610f025760405162461bcd60e51b815260040161036590612a35565b5f8415610f7b575f610f178460400151611dd1565b919350909150506001600160401b03811615610f755760405162461bcd60e51b815260206004820181905260248201527f5374616b696e674d616e616765723a20576569676874206d75737420626520306044820152606401610365565b50610fef565b5f610f8984604001516117ab565b90925090508015610fed5760405162461bcd60e51b815260206004820152602860248201527f5374616b696e674d616e616765723a20526567697374726174696f6e207374696044820152671b1b081d985b1a5960c21b6064820152608401610365565b505b5f818152600885016020526040808220815161012081019092528054829060ff16600581111561102157611021612829565b600581111561103257611032612829565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003909201546001600160a01b0380821660c080850191909152600160a01b830460ff16151560e0850152600160a81b909204909316610100909201919091528201519192501633146110e35760405162461bcd60e51b8152600401610365906128fa565b5f6003825160058111156110f9576110f9612829565b1480611117575060028251600581111561111557611115612829565b145b1561113a57506020808201515f908152600987019091526040812055600461113e565b5060055b5f83815260088701602052604090208251815484929190829060ff1916600183600581111561116f5761116f612829565b0217905550602082015160018201556040808301516002830180546060860151608087015160a08801516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c08401516003909301805460e0860151610100909601516001600160a01b039095166001600160a81b031990911617600160a01b951515959095029490941767ffffffffffffffff60a81b1916600160a81b9390911692909202919091179091555183907f3532ad18e70a039beb4663d48c15acbef558c96ec9b8fd0cc3c0304f774740b8905f90a25050505050505050565b60408051603480825260608281019093525f91906020820181803683370190505090505f5b6004811015611307576112bf816003612c14565b6112ca9060086128e3565b600263ffffffff16901c60f81b8282815181106112e9576112e9612c27565b60200101906001600160f81b03191690815f1a9053506001016112ab565b505f5b60208110156113695761131e81601f612c14565b6113299060086128e3565b86901c60f81b8261133b836004612c3b565b8151811061134b5761134b612c27565b60200101906001600160f81b03191690815f1a90535060010161130a565b505f5b60088110156113d457611380816007612c14565b61138b9060086128e3565b6001600160401b038616901c60f81b826113a6836024612c3b565b815181106113b6576113b6612c27565b60200101906001600160f81b03191690815f1a90535060010161136c565b505f5b600881101561143f576113eb816007612c14565b6113f69060086128e3565b6001600160401b038516901c60f81b8261141183602c612c3b565b8151811061142157611421612c27565b60200101906001600160f81b03191690815f1a9053506001016113d7565b50949350505050565b611450611f8f565b611458611fda565b611460611fea565b61146981611ff2565b50565b7fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab604545f80516020612ea783398151915290600160e01b900460ff165f036114b1575050565b6005810180544290610e10906114c79083612c14565b106114fb5760018201805467ffffffffffffffff60401b1916600160401b6001600160401b03871602179055808255611546565b838260010160088282829054906101000a90046001600160401b03166115219190612c4e565b92506101000a8154816001600160401b0302191690836001600160401b031602179055505b60018201545f906001600160401b038082169161156d91600160401b909104166064612c75565b6115779190612ca0565b600485015490915060ff600160e01b909104811690821611156115f75760405162461bcd60e51b815260206004820152603260248201527f5374616b696e674d616e616765723a204d6178696d756d20686f75726c7920636044820152711a1d5c9b881c985d1948195e18d95959195960721b6064820152608401610365565b5050805460058301556001018054600690920180546001600160401b0393841667ffffffffffffffff1982168117835592546001600160801b0319909116909217600160401b9283900490931690910291909117905550565b5f808251602c146116735760405162461bcd60e51b815260040161036590612cc5565b5f805b60048110156116c45761168a816003612c14565b6116959060086128e3565b63ffffffff168582815181106116ad576116ad612c27565b016020015160f81c901b9190911790600101611676565b5063ffffffff81166003146116eb5760405162461bcd60e51b815260040161036590612d0c565b5f805b60208110156117405761170281601f612c14565b61170d9060086128e3565b86611719836004612c3b565b8151811061172957611729612c27565b016020015160f81c901b91909117906001016116ee565b505f805b600881101561179f57611758816007612c14565b6117639060086128e3565b6001600160401b031687611778836024612c3b565b8151811061178857611788612c27565b016020015160f81c901b9190911790600101611744565b50909590945092505050565b5f8082516025146117ce5760405162461bcd60e51b815260040161036590612cc5565b5f805b600481101561181f576117e5816003612c14565b6117f09060086128e3565b63ffffffff1685828151811061180857611808612c27565b016020015160f81c901b91909117906001016117d1565b5063ffffffff81166001146118465760405162461bcd60e51b815260040161036590612d0c565b5f805b602081101561189b5761185d81601f612c14565b6118689060086128e3565b86611874836004612c3b565b8151811061188457611884612c27565b016020015160f81c901b9190911790600101611849565b505f856024815181106118b0576118b0612c27565b016020015191966001600160f81b031990921615159550909350505050565b5f6118d8612123565b5f80516020612ea7833981519152426001600160401b03851611801561191257506001600160401b038416611910426202a300612c3b565b115b6119725760405162461bcd60e51b815260206004820152602b60248201527f5374616b696e674d616e616765723a20496e76616c696420726567697374726160448201526a74696f6e2065787069727960a81b6064820152608401610365565b856119bf5760405162461bcd60e51b815260206004820152601f60248201527f5374616b696e674d616e616765723a20496e76616c6964206e6f6465204944006044820152606401610365565b5f86815260098201602052604090205415611a2b5760405162461bcd60e51b815260206004820152602660248201527f5374616b696e674d616e616765723a204e6f646520494420616c72656164792060448201526561637469766560d01b6064820152608401610365565b8251604014611a8d5760405162461bcd60e51b815260206004820152602860248201527f5374616b696e674d616e616765723a20496e76616c6964207369676e617475726044820152670ca40d8cadccee8d60c31b6064820152608401610365565b845f611a98826104ff565b9050611aa38161146c565b8260020154816001600160401b031610158015611acd57508260030154816001600160401b031611155b611b255760405162461bcd60e51b8152602060048201526024808201527f5374616b696e674d616e616765723a20496e76616c6964207374616b6520616d6044820152631bdd5b9d60e21b6064820152608401610365565b5f80611b6c6040518060a00160405280876001015481526020018c8152602001856001600160401b031681526020018a6001600160401b031681526020018981525061216d565b5f82815260078801602052604090209193509150611b8a8282612d95565b5060405163ee5b48eb60e01b81525f906005600160991b019063ee5b48eb90611bb790859060040161285f565b6020604051808303815f875af1158015611bd3573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611bf79190612891565b6040805161012081019091529091508060018152602081018d90526001600160401b03861660408201525f606082018190526080820181905260a082015260c001336001600160a01b031681525f6020808301829052604092830182905286825260088a0190522081518154829060ff19166001836005811115611c7d57611c7d612829565b021790555060208281015160018301556040808401516002840180546060870151608088015160a08901516001600160401b03908116600160c01b026001600160c01b03928216600160801b02929092166001600160801b03938216600160401b026001600160801b03199095169682169690961793909317919091169390931792909217905560c08501516003909401805460e0870151610100909701518316600160a81b0267ffffffffffffffff60a81b19971515600160a01b026001600160a81b03199092166001600160a01b039097169690961717959095169390931790935582518783168152918c169082015282918d9186917f79b81620b81daf2c08cd5bb3dbb79e75d2d7a87f52171fde5aadc8c47823026e910160405180910390a45090945050505050610e5760017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b5f805f8351603414611df55760405162461bcd60e51b815260040161036590612cc5565b5f805b6004811015611e4657611e0c816003612c14565b611e179060086128e3565b63ffffffff16868281518110611e2f57611e2f612c27565b016020015160f81c901b9190911790600101611df8565b5063ffffffff8116600214611e6d5760405162461bcd60e51b815260040161036590612d0c565b5f805b6020811015611ec257611e8481601f612c14565b611e8f9060086128e3565b87611e9b836004612c3b565b81518110611eab57611eab612c27565b016020015160f81c901b9190911790600101611e70565b505f805b6008811015611f2157611eda816007612c14565b611ee59060086128e3565b6001600160401b031688611efa836024612c3b565b81518110611f0a57611f0a612c27565b016020015160f81c901b9190911790600101611ec6565b505f805b6008811015611f8057611f39816007612c14565b611f449060086128e3565b6001600160401b031689611f5983602c612c3b565b81518110611f6957611f69612c27565b016020015160f81c901b9190911790600101611f25565b50919790965090945092505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff16611fd857604051631afcd79f60e31b815260040160405180910390fd5b565b611fe2611f8f565b611fd861229b565b611fd8611f8f565b611ffa611f8f565b80355f80516020612ea783398151915290815560208201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6015560408201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6025560608201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6035561209260a0830160808401612643565b60048201805467ffffffffffffffff19166001600160401b03929092169190911790556120c560c0830160a08401612e50565b60048201805460ff92909216600160e01b0260ff60e01b199092169190911790556120f7610100830160e08401612e70565b8160040160086101000a8154816001600160a01b0302191690836001600160a01b031602179055505050565b7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0080546001190161216757604051633ee5aeb560e01b815260040160405180910390fd5b60029055565b5f60605f8061217b856122a3565b60408051609480825260c082019092529294509092505f91906020820181803683370190505090505f5b6004811015612201576121b9816003612c14565b6121c49060086128e3565b600163ffffffff16901c60f81b8282815181106121e3576121e3612c27565b60200101906001600160f81b03191690815f1a9053506001016121a5565b505f5b60908110156122685782818151811061221f5761221f612c27565b01602001516001600160f81b0319168261223a836004612c3b565b8151811061224a5761224a612c27565b60200101906001600160f81b03191690815f1a905350600101612204565b5091959194509092505050565b60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b612275611f8f565b5f606082608001515160401461230d5760405162461bcd60e51b815260206004820152602960248201527f5374616b696e674d657373616765733a20496e76616c6964207369676e6174756044820152680e4ca40d8cadccee8d60bb1b6064820152608401610365565b60408051609080825260c082019092525f916020820181803683370190505090505f5b6020811015612380578451816020811061234c5761234c612c27565b1a60f81b82828151811061236257612362612c27565b60200101906001600160f81b03191690815f1a905350600101612330565b505f5b60208110156123e057846020015181602081106123a2576123a2612c27565b1a60f81b826123b2836020612c3b565b815181106123c2576123c2612c27565b60200101906001600160f81b03191690815f1a905350600101612383565b505f5b6008811015612454576123f7816007612c14565b6124029060086128e3565b60ff1685604001516001600160401b0316901c60f81b828260406124269190612c3b565b8151811061243657612436612c27565b60200101906001600160f81b03191690815f1a9053506001016123e3565b505f5b60088110156124c65761246b816007612c14565b6124769060086128e3565b60608601516001600160401b0390811691161c60f81b82612498836048612c3b565b815181106124a8576124a8612c27565b60200101906001600160f81b03191690815f1a905350600101612457565b505f5b604081101561253157846080015181815181106124e8576124e8612c27565b01602001516001600160f81b03191682612503836050612c3b565b8151811061251357612513612c27565b60200101906001600160f81b03191690815f1a9053506001016124c9565b506002816040516125429190612e8b565b602060405180830381855afa15801561255d573d5f803e3d5ffd5b5050506040513d601f19601f820116820180604052508101906125809190612891565b94909350915050565b50805461259590612b0d565b5f825580601f106125a4575050565b601f0160209004905f5260205f209081019061146991905b808211156125cf575f81556001016125bc565b5090565b5f602082840312156125e3575f80fd5b5035919050565b5f602082840312156125fa575f80fd5b81356001600160401b0381111561260f575f80fd5b82016101008185031215612621575f80fd5b9392505050565b80356001600160401b038116811461263e575f80fd5b919050565b5f60208284031215612653575f80fd5b61262182612628565b8015158114611469575f80fd5b803563ffffffff8116811461263e575f80fd5b5f805f6060848603121561268e575f80fd5b8335925060208401356126a08161265c565b91506126ae60408501612669565b90509250925092565b5f602082840312156126c7575f80fd5b61262182612669565b634e487b7160e01b5f52604160045260245ffd5b604051606081016001600160401b0381118282101715612706576127066126d0565b60405290565b604051601f8201601f191681016001600160401b0381118282101715612734576127346126d0565b604052919050565b5f6001600160401b03821115612754576127546126d0565b50601f01601f191660200190565b5f805f60608486031215612774575f80fd5b8335925061278460208501612628565b915060408401356001600160401b0381111561279e575f80fd5b8401601f810186136127ae575f80fd5b80356127c16127bc8261273c565b61270c565b8181528760208385010111156127d5575f80fd5b816020840160208301375f602083830101528093505050509250925092565b5f8060408385031215612805575f80fd5b61280e83612669565b9150602083013561281e8161265c565b809150509250929050565b634e487b7160e01b5f52602160045260245ffd5b5f5b8381101561285757818101518382015260200161283f565b50505f910152565b602081525f825180602084015261287d81604085016020870161283d565b601f01601f19169190910160400192915050565b5f602082840312156128a1575f80fd5b5051919050565b634e487b7160e01b5f52601260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b5f826128de576128de6128a8565b500490565b808202811582820484141761050f5761050f6128bc565b6020808252602a908201527f5374616b696e674d616e616765723a2053656e646572206e6f742076616c696460408201526930ba37b91037bbb732b960b11b606082015260800190565b6001600160a01b0381168114611469575f80fd5b805161263e8161265c565b5f8060408385031215612974575f80fd5b82516001600160401b038082111561298a575f80fd5b908401906060828703121561299d575f80fd5b6129a56126e4565b825181526020808401516129b881612944565b828201526040840151838111156129cd575f80fd5b80850194505087601f8501126129e1575f80fd5b835192506129f16127bc8461273c565b8381528882858701011115612a04575f80fd5b612a138483830184880161283d565b80604084015250819550612a28818801612958565b9450505050509250929050565b60208082526024908201527f5374616b696e674d616e616765723a20496e76616c69642077617270206d65736040820152637361676560e01b606082015260800190565b60208082526027908201527f5374616b696e674d616e616765723a20496e76616c696420736f7572636520636040820152661a185a5b88125160ca1b606082015260800190565b6020808252602d908201527f5374616b696e674d616e616765723a20496e76616c6964206f726967696e207360408201526c656e646572206164647265737360981b606082015260800190565b600181811c90821680612b2157607f821691505b602082108103612b3f57634e487b7160e01b5f52602260045260245ffd5b50919050565b60208082526025908201527f5374616b696e674d616e616765723a20496e76616c69642076616c69646174696040820152641bdb88125160da1b606082015260800190565b5f60208083525f8454612b9c81612b0d565b806020870152604060018084165f8114612bbd5760018114612bd957612c06565b60ff19851660408a0152604084151560051b8a01019550612c06565b895f5260205f205f5b85811015612bfd5781548b8201860152908301908801612be2565b8a016040019650505b509398975050505050505050565b8181038181111561050f5761050f6128bc565b634e487b7160e01b5f52603260045260245ffd5b8082018082111561050f5761050f6128bc565b6001600160401b03818116838216019080821115612c6e57612c6e6128bc565b5092915050565b6001600160401b03818116838216028082169190828114612c9857612c986128bc565b505092915050565b5f6001600160401b0380841680612cb957612cb96128a8565b92169190910492915050565b60208082526027908201527f5374616b696e674d657373616765733a20496e76616c6964206d657373616765604082015266040d8cadccee8d60cb1b606082015260800190565b60208082526025908201527f5374616b696e674d657373616765733a20496e76616c6964206d657373616765604082015264207479706560d81b606082015260800190565b601f821115610e4557805f5260205f20601f840160051c81016020851015612d765750805b601f840160051c820191505b818110156103ec575f8155600101612d82565b81516001600160401b03811115612dae57612dae6126d0565b612dc281612dbc8454612b0d565b84612d51565b602080601f831160018114612df5575f8415612dde5750858301515b5f19600386901b1c1916600185901b1785556104f7565b5f85815260208120601f198616915b82811015612e2357888601518255948401946001909101908401612e04565b5085821015612e4057878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b5f60208284031215612e60575f80fd5b813560ff81168114612621575f80fd5b5f60208284031215612e80575f80fd5b813561262181612944565b5f8251612e9c81846020870161283d565b919091019291505056feafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab600a164736f6c6343000819000a", +} + +// NativeTokenStakingManagerABI is the input ABI used to generate the binding from. +// Deprecated: Use NativeTokenStakingManagerMetaData.ABI instead. +var NativeTokenStakingManagerABI = NativeTokenStakingManagerMetaData.ABI + +// NativeTokenStakingManagerBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use NativeTokenStakingManagerMetaData.Bin instead. +var NativeTokenStakingManagerBin = NativeTokenStakingManagerMetaData.Bin + +// DeployNativeTokenStakingManager deploys a new Ethereum contract, binding an instance of NativeTokenStakingManager to it. +func DeployNativeTokenStakingManager(auth *bind.TransactOpts, backend bind.ContractBackend, init uint8) (common.Address, *types.Transaction, *NativeTokenStakingManager, error) { + parsed, err := NativeTokenStakingManagerMetaData.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(NativeTokenStakingManagerBin), backend, init) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &NativeTokenStakingManager{NativeTokenStakingManagerCaller: NativeTokenStakingManagerCaller{contract: contract}, NativeTokenStakingManagerTransactor: NativeTokenStakingManagerTransactor{contract: contract}, NativeTokenStakingManagerFilterer: NativeTokenStakingManagerFilterer{contract: contract}}, nil +} + +// NativeTokenStakingManager is an auto generated Go binding around an Ethereum contract. +type NativeTokenStakingManager struct { + NativeTokenStakingManagerCaller // Read-only binding to the contract + NativeTokenStakingManagerTransactor // Write-only binding to the contract + NativeTokenStakingManagerFilterer // Log filterer for contract events +} + +// NativeTokenStakingManagerCaller is an auto generated read-only Go binding around an Ethereum contract. +type NativeTokenStakingManagerCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// NativeTokenStakingManagerTransactor is an auto generated write-only Go binding around an Ethereum contract. +type NativeTokenStakingManagerTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// NativeTokenStakingManagerFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type NativeTokenStakingManagerFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// NativeTokenStakingManagerSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type NativeTokenStakingManagerSession struct { + Contract *NativeTokenStakingManager // 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 +} + +// NativeTokenStakingManagerCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type NativeTokenStakingManagerCallerSession struct { + Contract *NativeTokenStakingManagerCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// NativeTokenStakingManagerTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type NativeTokenStakingManagerTransactorSession struct { + Contract *NativeTokenStakingManagerTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// NativeTokenStakingManagerRaw is an auto generated low-level Go binding around an Ethereum contract. +type NativeTokenStakingManagerRaw struct { + Contract *NativeTokenStakingManager // Generic contract binding to access the raw methods on +} + +// NativeTokenStakingManagerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type NativeTokenStakingManagerCallerRaw struct { + Contract *NativeTokenStakingManagerCaller // Generic read-only contract binding to access the raw methods on +} + +// NativeTokenStakingManagerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type NativeTokenStakingManagerTransactorRaw struct { + Contract *NativeTokenStakingManagerTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewNativeTokenStakingManager creates a new instance of NativeTokenStakingManager, bound to a specific deployed contract. +func NewNativeTokenStakingManager(address common.Address, backend bind.ContractBackend) (*NativeTokenStakingManager, error) { + contract, err := bindNativeTokenStakingManager(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &NativeTokenStakingManager{NativeTokenStakingManagerCaller: NativeTokenStakingManagerCaller{contract: contract}, NativeTokenStakingManagerTransactor: NativeTokenStakingManagerTransactor{contract: contract}, NativeTokenStakingManagerFilterer: NativeTokenStakingManagerFilterer{contract: contract}}, nil +} + +// NewNativeTokenStakingManagerCaller creates a new read-only instance of NativeTokenStakingManager, bound to a specific deployed contract. +func NewNativeTokenStakingManagerCaller(address common.Address, caller bind.ContractCaller) (*NativeTokenStakingManagerCaller, error) { + contract, err := bindNativeTokenStakingManager(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &NativeTokenStakingManagerCaller{contract: contract}, nil +} + +// NewNativeTokenStakingManagerTransactor creates a new write-only instance of NativeTokenStakingManager, bound to a specific deployed contract. +func NewNativeTokenStakingManagerTransactor(address common.Address, transactor bind.ContractTransactor) (*NativeTokenStakingManagerTransactor, error) { + contract, err := bindNativeTokenStakingManager(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &NativeTokenStakingManagerTransactor{contract: contract}, nil +} + +// NewNativeTokenStakingManagerFilterer creates a new log filterer instance of NativeTokenStakingManager, bound to a specific deployed contract. +func NewNativeTokenStakingManagerFilterer(address common.Address, filterer bind.ContractFilterer) (*NativeTokenStakingManagerFilterer, error) { + contract, err := bindNativeTokenStakingManager(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &NativeTokenStakingManagerFilterer{contract: contract}, nil +} + +// bindNativeTokenStakingManager binds a generic wrapper to an already deployed contract. +func bindNativeTokenStakingManager(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := NativeTokenStakingManagerMetaData.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 (_NativeTokenStakingManager *NativeTokenStakingManagerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _NativeTokenStakingManager.Contract.NativeTokenStakingManagerCaller.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 (_NativeTokenStakingManager *NativeTokenStakingManagerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _NativeTokenStakingManager.Contract.NativeTokenStakingManagerTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_NativeTokenStakingManager *NativeTokenStakingManagerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _NativeTokenStakingManager.Contract.NativeTokenStakingManagerTransactor.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 (_NativeTokenStakingManager *NativeTokenStakingManagerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _NativeTokenStakingManager.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 (_NativeTokenStakingManager *NativeTokenStakingManagerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _NativeTokenStakingManager.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_NativeTokenStakingManager *NativeTokenStakingManagerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _NativeTokenStakingManager.Contract.contract.Transact(opts, method, params...) +} + +// WARPMESSENGER is a free data retrieval call binding the contract method 0xb771b3bc. +// +// Solidity: function WARP_MESSENGER() view returns(address) +func (_NativeTokenStakingManager *NativeTokenStakingManagerCaller) WARPMESSENGER(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _NativeTokenStakingManager.contract.Call(opts, &out, "WARP_MESSENGER") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// WARPMESSENGER is a free data retrieval call binding the contract method 0xb771b3bc. +// +// Solidity: function WARP_MESSENGER() view returns(address) +func (_NativeTokenStakingManager *NativeTokenStakingManagerSession) WARPMESSENGER() (common.Address, error) { + return _NativeTokenStakingManager.Contract.WARPMESSENGER(&_NativeTokenStakingManager.CallOpts) +} + +// WARPMESSENGER is a free data retrieval call binding the contract method 0xb771b3bc. +// +// Solidity: function WARP_MESSENGER() view returns(address) +func (_NativeTokenStakingManager *NativeTokenStakingManagerCallerSession) WARPMESSENGER() (common.Address, error) { + return _NativeTokenStakingManager.Contract.WARPMESSENGER(&_NativeTokenStakingManager.CallOpts) +} + +// ValueToWeight is a free data retrieval call binding the contract method 0x2e2194d8. +// +// Solidity: function valueToWeight(uint256 value) pure returns(uint64) +func (_NativeTokenStakingManager *NativeTokenStakingManagerCaller) ValueToWeight(opts *bind.CallOpts, value *big.Int) (uint64, error) { + var out []interface{} + err := _NativeTokenStakingManager.contract.Call(opts, &out, "valueToWeight", value) + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// ValueToWeight is a free data retrieval call binding the contract method 0x2e2194d8. +// +// Solidity: function valueToWeight(uint256 value) pure returns(uint64) +func (_NativeTokenStakingManager *NativeTokenStakingManagerSession) ValueToWeight(value *big.Int) (uint64, error) { + return _NativeTokenStakingManager.Contract.ValueToWeight(&_NativeTokenStakingManager.CallOpts, value) +} + +// ValueToWeight is a free data retrieval call binding the contract method 0x2e2194d8. +// +// Solidity: function valueToWeight(uint256 value) pure returns(uint64) +func (_NativeTokenStakingManager *NativeTokenStakingManagerCallerSession) ValueToWeight(value *big.Int) (uint64, error) { + return _NativeTokenStakingManager.Contract.ValueToWeight(&_NativeTokenStakingManager.CallOpts, value) +} + +// WeightToValue is a free data retrieval call binding the contract method 0x62065856. +// +// Solidity: function weightToValue(uint64 weight) pure returns(uint256) +func (_NativeTokenStakingManager *NativeTokenStakingManagerCaller) WeightToValue(opts *bind.CallOpts, weight uint64) (*big.Int, error) { + var out []interface{} + err := _NativeTokenStakingManager.contract.Call(opts, &out, "weightToValue", weight) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// WeightToValue is a free data retrieval call binding the contract method 0x62065856. +// +// Solidity: function weightToValue(uint64 weight) pure returns(uint256) +func (_NativeTokenStakingManager *NativeTokenStakingManagerSession) WeightToValue(weight uint64) (*big.Int, error) { + return _NativeTokenStakingManager.Contract.WeightToValue(&_NativeTokenStakingManager.CallOpts, weight) +} + +// WeightToValue is a free data retrieval call binding the contract method 0x62065856. +// +// Solidity: function weightToValue(uint64 weight) pure returns(uint256) +func (_NativeTokenStakingManager *NativeTokenStakingManagerCallerSession) WeightToValue(weight uint64) (*big.Int, error) { + return _NativeTokenStakingManager.Contract.WeightToValue(&_NativeTokenStakingManager.CallOpts, weight) +} + +// CompleteEndValidation is a paid mutator transaction binding the contract method 0xfdf94a1a. +// +// Solidity: function completeEndValidation(uint32 messageIndex, bool setWeightMessageType) returns() +func (_NativeTokenStakingManager *NativeTokenStakingManagerTransactor) CompleteEndValidation(opts *bind.TransactOpts, messageIndex uint32, setWeightMessageType bool) (*types.Transaction, error) { + return _NativeTokenStakingManager.contract.Transact(opts, "completeEndValidation", messageIndex, setWeightMessageType) +} + +// CompleteEndValidation is a paid mutator transaction binding the contract method 0xfdf94a1a. +// +// Solidity: function completeEndValidation(uint32 messageIndex, bool setWeightMessageType) returns() +func (_NativeTokenStakingManager *NativeTokenStakingManagerSession) CompleteEndValidation(messageIndex uint32, setWeightMessageType bool) (*types.Transaction, error) { + return _NativeTokenStakingManager.Contract.CompleteEndValidation(&_NativeTokenStakingManager.TransactOpts, messageIndex, setWeightMessageType) +} + +// CompleteEndValidation is a paid mutator transaction binding the contract method 0xfdf94a1a. +// +// Solidity: function completeEndValidation(uint32 messageIndex, bool setWeightMessageType) returns() +func (_NativeTokenStakingManager *NativeTokenStakingManagerTransactorSession) CompleteEndValidation(messageIndex uint32, setWeightMessageType bool) (*types.Transaction, error) { + return _NativeTokenStakingManager.Contract.CompleteEndValidation(&_NativeTokenStakingManager.TransactOpts, messageIndex, setWeightMessageType) +} + +// CompleteValidatorRegistration is a paid mutator transaction binding the contract method 0xa3a65e48. +// +// Solidity: function completeValidatorRegistration(uint32 messageIndex) returns() +func (_NativeTokenStakingManager *NativeTokenStakingManagerTransactor) CompleteValidatorRegistration(opts *bind.TransactOpts, messageIndex uint32) (*types.Transaction, error) { + return _NativeTokenStakingManager.contract.Transact(opts, "completeValidatorRegistration", messageIndex) +} + +// CompleteValidatorRegistration is a paid mutator transaction binding the contract method 0xa3a65e48. +// +// Solidity: function completeValidatorRegistration(uint32 messageIndex) returns() +func (_NativeTokenStakingManager *NativeTokenStakingManagerSession) CompleteValidatorRegistration(messageIndex uint32) (*types.Transaction, error) { + return _NativeTokenStakingManager.Contract.CompleteValidatorRegistration(&_NativeTokenStakingManager.TransactOpts, messageIndex) +} + +// CompleteValidatorRegistration is a paid mutator transaction binding the contract method 0xa3a65e48. +// +// Solidity: function completeValidatorRegistration(uint32 messageIndex) returns() +func (_NativeTokenStakingManager *NativeTokenStakingManagerTransactorSession) CompleteValidatorRegistration(messageIndex uint32) (*types.Transaction, error) { + return _NativeTokenStakingManager.Contract.CompleteValidatorRegistration(&_NativeTokenStakingManager.TransactOpts, messageIndex) +} + +// Initialize is a paid mutator transaction binding the contract method 0x1a0d36fe. +// +// Solidity: function initialize((bytes32,bytes32,uint256,uint256,uint64,uint8,((bytes32,bytes32,uint64,uint64,bytes),address)[],address) settings) returns() +func (_NativeTokenStakingManager *NativeTokenStakingManagerTransactor) Initialize(opts *bind.TransactOpts, settings StakingManagerSettings) (*types.Transaction, error) { + return _NativeTokenStakingManager.contract.Transact(opts, "initialize", settings) +} + +// Initialize is a paid mutator transaction binding the contract method 0x1a0d36fe. +// +// Solidity: function initialize((bytes32,bytes32,uint256,uint256,uint64,uint8,((bytes32,bytes32,uint64,uint64,bytes),address)[],address) settings) returns() +func (_NativeTokenStakingManager *NativeTokenStakingManagerSession) Initialize(settings StakingManagerSettings) (*types.Transaction, error) { + return _NativeTokenStakingManager.Contract.Initialize(&_NativeTokenStakingManager.TransactOpts, settings) +} + +// Initialize is a paid mutator transaction binding the contract method 0x1a0d36fe. +// +// Solidity: function initialize((bytes32,bytes32,uint256,uint256,uint64,uint8,((bytes32,bytes32,uint64,uint64,bytes),address)[],address) settings) returns() +func (_NativeTokenStakingManager *NativeTokenStakingManagerTransactorSession) Initialize(settings StakingManagerSettings) (*types.Transaction, error) { + return _NativeTokenStakingManager.Contract.Initialize(&_NativeTokenStakingManager.TransactOpts, settings) +} + +// InitializeEndValidation is a paid mutator transaction binding the contract method 0x76f78621. +// +// Solidity: function initializeEndValidation(bytes32 validationID, bool includeUptimeProof, uint32 messageIndex) returns() +func (_NativeTokenStakingManager *NativeTokenStakingManagerTransactor) InitializeEndValidation(opts *bind.TransactOpts, validationID [32]byte, includeUptimeProof bool, messageIndex uint32) (*types.Transaction, error) { + return _NativeTokenStakingManager.contract.Transact(opts, "initializeEndValidation", validationID, includeUptimeProof, messageIndex) +} + +// InitializeEndValidation is a paid mutator transaction binding the contract method 0x76f78621. +// +// Solidity: function initializeEndValidation(bytes32 validationID, bool includeUptimeProof, uint32 messageIndex) returns() +func (_NativeTokenStakingManager *NativeTokenStakingManagerSession) InitializeEndValidation(validationID [32]byte, includeUptimeProof bool, messageIndex uint32) (*types.Transaction, error) { + return _NativeTokenStakingManager.Contract.InitializeEndValidation(&_NativeTokenStakingManager.TransactOpts, validationID, includeUptimeProof, messageIndex) +} + +// InitializeEndValidation is a paid mutator transaction binding the contract method 0x76f78621. +// +// Solidity: function initializeEndValidation(bytes32 validationID, bool includeUptimeProof, uint32 messageIndex) returns() +func (_NativeTokenStakingManager *NativeTokenStakingManagerTransactorSession) InitializeEndValidation(validationID [32]byte, includeUptimeProof bool, messageIndex uint32) (*types.Transaction, error) { + return _NativeTokenStakingManager.Contract.InitializeEndValidation(&_NativeTokenStakingManager.TransactOpts, validationID, includeUptimeProof, messageIndex) +} + +// InitializeValidatorRegistration is a paid mutator transaction binding the contract method 0xf40797d7. +// +// Solidity: function initializeValidatorRegistration(bytes32 nodeID, uint64 registrationExpiry, bytes signature) payable returns(bytes32) +func (_NativeTokenStakingManager *NativeTokenStakingManagerTransactor) InitializeValidatorRegistration(opts *bind.TransactOpts, nodeID [32]byte, registrationExpiry uint64, signature []byte) (*types.Transaction, error) { + return _NativeTokenStakingManager.contract.Transact(opts, "initializeValidatorRegistration", nodeID, registrationExpiry, signature) +} + +// InitializeValidatorRegistration is a paid mutator transaction binding the contract method 0xf40797d7. +// +// Solidity: function initializeValidatorRegistration(bytes32 nodeID, uint64 registrationExpiry, bytes signature) payable returns(bytes32) +func (_NativeTokenStakingManager *NativeTokenStakingManagerSession) InitializeValidatorRegistration(nodeID [32]byte, registrationExpiry uint64, signature []byte) (*types.Transaction, error) { + return _NativeTokenStakingManager.Contract.InitializeValidatorRegistration(&_NativeTokenStakingManager.TransactOpts, nodeID, registrationExpiry, signature) +} + +// InitializeValidatorRegistration is a paid mutator transaction binding the contract method 0xf40797d7. +// +// Solidity: function initializeValidatorRegistration(bytes32 nodeID, uint64 registrationExpiry, bytes signature) payable returns(bytes32) +func (_NativeTokenStakingManager *NativeTokenStakingManagerTransactorSession) InitializeValidatorRegistration(nodeID [32]byte, registrationExpiry uint64, signature []byte) (*types.Transaction, error) { + return _NativeTokenStakingManager.Contract.InitializeValidatorRegistration(&_NativeTokenStakingManager.TransactOpts, nodeID, registrationExpiry, signature) +} + +// ResendEndValidatorMessage is a paid mutator transaction binding the contract method 0x0322ed98. +// +// Solidity: function resendEndValidatorMessage(bytes32 validationID) returns() +func (_NativeTokenStakingManager *NativeTokenStakingManagerTransactor) ResendEndValidatorMessage(opts *bind.TransactOpts, validationID [32]byte) (*types.Transaction, error) { + return _NativeTokenStakingManager.contract.Transact(opts, "resendEndValidatorMessage", validationID) +} + +// ResendEndValidatorMessage is a paid mutator transaction binding the contract method 0x0322ed98. +// +// Solidity: function resendEndValidatorMessage(bytes32 validationID) returns() +func (_NativeTokenStakingManager *NativeTokenStakingManagerSession) ResendEndValidatorMessage(validationID [32]byte) (*types.Transaction, error) { + return _NativeTokenStakingManager.Contract.ResendEndValidatorMessage(&_NativeTokenStakingManager.TransactOpts, validationID) +} + +// ResendEndValidatorMessage is a paid mutator transaction binding the contract method 0x0322ed98. +// +// Solidity: function resendEndValidatorMessage(bytes32 validationID) returns() +func (_NativeTokenStakingManager *NativeTokenStakingManagerTransactorSession) ResendEndValidatorMessage(validationID [32]byte) (*types.Transaction, error) { + return _NativeTokenStakingManager.Contract.ResendEndValidatorMessage(&_NativeTokenStakingManager.TransactOpts, validationID) +} + +// ResendRegisterValidatorMessage is a paid mutator transaction binding the contract method 0xbee0a03f. +// +// Solidity: function resendRegisterValidatorMessage(bytes32 validationID) returns() +func (_NativeTokenStakingManager *NativeTokenStakingManagerTransactor) ResendRegisterValidatorMessage(opts *bind.TransactOpts, validationID [32]byte) (*types.Transaction, error) { + return _NativeTokenStakingManager.contract.Transact(opts, "resendRegisterValidatorMessage", validationID) +} + +// ResendRegisterValidatorMessage is a paid mutator transaction binding the contract method 0xbee0a03f. +// +// Solidity: function resendRegisterValidatorMessage(bytes32 validationID) returns() +func (_NativeTokenStakingManager *NativeTokenStakingManagerSession) ResendRegisterValidatorMessage(validationID [32]byte) (*types.Transaction, error) { + return _NativeTokenStakingManager.Contract.ResendRegisterValidatorMessage(&_NativeTokenStakingManager.TransactOpts, validationID) +} + +// ResendRegisterValidatorMessage is a paid mutator transaction binding the contract method 0xbee0a03f. +// +// Solidity: function resendRegisterValidatorMessage(bytes32 validationID) returns() +func (_NativeTokenStakingManager *NativeTokenStakingManagerTransactorSession) ResendRegisterValidatorMessage(validationID [32]byte) (*types.Transaction, error) { + return _NativeTokenStakingManager.Contract.ResendRegisterValidatorMessage(&_NativeTokenStakingManager.TransactOpts, validationID) +} + +// NativeTokenStakingManagerInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the NativeTokenStakingManager contract. +type NativeTokenStakingManagerInitializedIterator struct { + Event *NativeTokenStakingManagerInitialized // 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 interfaces.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 *NativeTokenStakingManagerInitializedIterator) 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(NativeTokenStakingManagerInitialized) + 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(NativeTokenStakingManagerInitialized) + 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 *NativeTokenStakingManagerInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *NativeTokenStakingManagerInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// NativeTokenStakingManagerInitialized represents a Initialized event raised by the NativeTokenStakingManager contract. +type NativeTokenStakingManagerInitialized struct { + Version uint64 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInitialized is a free log retrieval operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. +// +// Solidity: event Initialized(uint64 version) +func (_NativeTokenStakingManager *NativeTokenStakingManagerFilterer) FilterInitialized(opts *bind.FilterOpts) (*NativeTokenStakingManagerInitializedIterator, error) { + + logs, sub, err := _NativeTokenStakingManager.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &NativeTokenStakingManagerInitializedIterator{contract: _NativeTokenStakingManager.contract, event: "Initialized", logs: logs, sub: sub}, nil +} + +// WatchInitialized is a free log subscription operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. +// +// Solidity: event Initialized(uint64 version) +func (_NativeTokenStakingManager *NativeTokenStakingManagerFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *NativeTokenStakingManagerInitialized) (event.Subscription, error) { + + logs, sub, err := _NativeTokenStakingManager.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(NativeTokenStakingManagerInitialized) + if err := _NativeTokenStakingManager.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 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. +// +// Solidity: event Initialized(uint64 version) +func (_NativeTokenStakingManager *NativeTokenStakingManagerFilterer) ParseInitialized(log types.Log) (*NativeTokenStakingManagerInitialized, error) { + event := new(NativeTokenStakingManagerInitialized) + if err := _NativeTokenStakingManager.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// NativeTokenStakingManagerValidationPeriodCreatedIterator is returned from FilterValidationPeriodCreated and is used to iterate over the raw logs and unpacked data for ValidationPeriodCreated events raised by the NativeTokenStakingManager contract. +type NativeTokenStakingManagerValidationPeriodCreatedIterator struct { + Event *NativeTokenStakingManagerValidationPeriodCreated // 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 interfaces.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 *NativeTokenStakingManagerValidationPeriodCreatedIterator) 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(NativeTokenStakingManagerValidationPeriodCreated) + 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(NativeTokenStakingManagerValidationPeriodCreated) + 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 *NativeTokenStakingManagerValidationPeriodCreatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *NativeTokenStakingManagerValidationPeriodCreatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// NativeTokenStakingManagerValidationPeriodCreated represents a ValidationPeriodCreated event raised by the NativeTokenStakingManager contract. +type NativeTokenStakingManagerValidationPeriodCreated struct { + ValidationID [32]byte + NodeID [32]byte + RegisterValidationMessageID [32]byte + Weight *big.Int + RegistrationExpiry uint64 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterValidationPeriodCreated is a free log retrieval operation binding the contract event 0x79b81620b81daf2c08cd5bb3dbb79e75d2d7a87f52171fde5aadc8c47823026e. +// +// Solidity: event ValidationPeriodCreated(bytes32 indexed validationID, bytes32 indexed nodeID, bytes32 indexed registerValidationMessageID, uint256 weight, uint64 registrationExpiry) +func (_NativeTokenStakingManager *NativeTokenStakingManagerFilterer) FilterValidationPeriodCreated(opts *bind.FilterOpts, validationID [][32]byte, nodeID [][32]byte, registerValidationMessageID [][32]byte) (*NativeTokenStakingManagerValidationPeriodCreatedIterator, error) { + + var validationIDRule []interface{} + for _, validationIDItem := range validationID { + validationIDRule = append(validationIDRule, validationIDItem) + } + var nodeIDRule []interface{} + for _, nodeIDItem := range nodeID { + nodeIDRule = append(nodeIDRule, nodeIDItem) + } + var registerValidationMessageIDRule []interface{} + for _, registerValidationMessageIDItem := range registerValidationMessageID { + registerValidationMessageIDRule = append(registerValidationMessageIDRule, registerValidationMessageIDItem) + } + + logs, sub, err := _NativeTokenStakingManager.contract.FilterLogs(opts, "ValidationPeriodCreated", validationIDRule, nodeIDRule, registerValidationMessageIDRule) + if err != nil { + return nil, err + } + return &NativeTokenStakingManagerValidationPeriodCreatedIterator{contract: _NativeTokenStakingManager.contract, event: "ValidationPeriodCreated", logs: logs, sub: sub}, nil +} + +// WatchValidationPeriodCreated is a free log subscription operation binding the contract event 0x79b81620b81daf2c08cd5bb3dbb79e75d2d7a87f52171fde5aadc8c47823026e. +// +// Solidity: event ValidationPeriodCreated(bytes32 indexed validationID, bytes32 indexed nodeID, bytes32 indexed registerValidationMessageID, uint256 weight, uint64 registrationExpiry) +func (_NativeTokenStakingManager *NativeTokenStakingManagerFilterer) WatchValidationPeriodCreated(opts *bind.WatchOpts, sink chan<- *NativeTokenStakingManagerValidationPeriodCreated, validationID [][32]byte, nodeID [][32]byte, registerValidationMessageID [][32]byte) (event.Subscription, error) { + + var validationIDRule []interface{} + for _, validationIDItem := range validationID { + validationIDRule = append(validationIDRule, validationIDItem) + } + var nodeIDRule []interface{} + for _, nodeIDItem := range nodeID { + nodeIDRule = append(nodeIDRule, nodeIDItem) + } + var registerValidationMessageIDRule []interface{} + for _, registerValidationMessageIDItem := range registerValidationMessageID { + registerValidationMessageIDRule = append(registerValidationMessageIDRule, registerValidationMessageIDItem) + } + + logs, sub, err := _NativeTokenStakingManager.contract.WatchLogs(opts, "ValidationPeriodCreated", validationIDRule, nodeIDRule, registerValidationMessageIDRule) + 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(NativeTokenStakingManagerValidationPeriodCreated) + if err := _NativeTokenStakingManager.contract.UnpackLog(event, "ValidationPeriodCreated", 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 +} + +// ParseValidationPeriodCreated is a log parse operation binding the contract event 0x79b81620b81daf2c08cd5bb3dbb79e75d2d7a87f52171fde5aadc8c47823026e. +// +// Solidity: event ValidationPeriodCreated(bytes32 indexed validationID, bytes32 indexed nodeID, bytes32 indexed registerValidationMessageID, uint256 weight, uint64 registrationExpiry) +func (_NativeTokenStakingManager *NativeTokenStakingManagerFilterer) ParseValidationPeriodCreated(log types.Log) (*NativeTokenStakingManagerValidationPeriodCreated, error) { + event := new(NativeTokenStakingManagerValidationPeriodCreated) + if err := _NativeTokenStakingManager.contract.UnpackLog(event, "ValidationPeriodCreated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// NativeTokenStakingManagerValidationPeriodEndedIterator is returned from FilterValidationPeriodEnded and is used to iterate over the raw logs and unpacked data for ValidationPeriodEnded events raised by the NativeTokenStakingManager contract. +type NativeTokenStakingManagerValidationPeriodEndedIterator struct { + Event *NativeTokenStakingManagerValidationPeriodEnded // 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 interfaces.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 *NativeTokenStakingManagerValidationPeriodEndedIterator) 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(NativeTokenStakingManagerValidationPeriodEnded) + 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(NativeTokenStakingManagerValidationPeriodEnded) + 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 *NativeTokenStakingManagerValidationPeriodEndedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *NativeTokenStakingManagerValidationPeriodEndedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// NativeTokenStakingManagerValidationPeriodEnded represents a ValidationPeriodEnded event raised by the NativeTokenStakingManager contract. +type NativeTokenStakingManagerValidationPeriodEnded struct { + ValidationID [32]byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterValidationPeriodEnded is a free log retrieval operation binding the contract event 0x3532ad18e70a039beb4663d48c15acbef558c96ec9b8fd0cc3c0304f774740b8. +// +// Solidity: event ValidationPeriodEnded(bytes32 indexed validationID) +func (_NativeTokenStakingManager *NativeTokenStakingManagerFilterer) FilterValidationPeriodEnded(opts *bind.FilterOpts, validationID [][32]byte) (*NativeTokenStakingManagerValidationPeriodEndedIterator, error) { + + var validationIDRule []interface{} + for _, validationIDItem := range validationID { + validationIDRule = append(validationIDRule, validationIDItem) + } + + logs, sub, err := _NativeTokenStakingManager.contract.FilterLogs(opts, "ValidationPeriodEnded", validationIDRule) + if err != nil { + return nil, err + } + return &NativeTokenStakingManagerValidationPeriodEndedIterator{contract: _NativeTokenStakingManager.contract, event: "ValidationPeriodEnded", logs: logs, sub: sub}, nil +} + +// WatchValidationPeriodEnded is a free log subscription operation binding the contract event 0x3532ad18e70a039beb4663d48c15acbef558c96ec9b8fd0cc3c0304f774740b8. +// +// Solidity: event ValidationPeriodEnded(bytes32 indexed validationID) +func (_NativeTokenStakingManager *NativeTokenStakingManagerFilterer) WatchValidationPeriodEnded(opts *bind.WatchOpts, sink chan<- *NativeTokenStakingManagerValidationPeriodEnded, validationID [][32]byte) (event.Subscription, error) { + + var validationIDRule []interface{} + for _, validationIDItem := range validationID { + validationIDRule = append(validationIDRule, validationIDItem) + } + + logs, sub, err := _NativeTokenStakingManager.contract.WatchLogs(opts, "ValidationPeriodEnded", validationIDRule) + 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(NativeTokenStakingManagerValidationPeriodEnded) + if err := _NativeTokenStakingManager.contract.UnpackLog(event, "ValidationPeriodEnded", 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 +} + +// ParseValidationPeriodEnded is a log parse operation binding the contract event 0x3532ad18e70a039beb4663d48c15acbef558c96ec9b8fd0cc3c0304f774740b8. +// +// Solidity: event ValidationPeriodEnded(bytes32 indexed validationID) +func (_NativeTokenStakingManager *NativeTokenStakingManagerFilterer) ParseValidationPeriodEnded(log types.Log) (*NativeTokenStakingManagerValidationPeriodEnded, error) { + event := new(NativeTokenStakingManagerValidationPeriodEnded) + if err := _NativeTokenStakingManager.contract.UnpackLog(event, "ValidationPeriodEnded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// NativeTokenStakingManagerValidationPeriodRegisteredIterator is returned from FilterValidationPeriodRegistered and is used to iterate over the raw logs and unpacked data for ValidationPeriodRegistered events raised by the NativeTokenStakingManager contract. +type NativeTokenStakingManagerValidationPeriodRegisteredIterator struct { + Event *NativeTokenStakingManagerValidationPeriodRegistered // 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 interfaces.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 *NativeTokenStakingManagerValidationPeriodRegisteredIterator) 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(NativeTokenStakingManagerValidationPeriodRegistered) + 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(NativeTokenStakingManagerValidationPeriodRegistered) + 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 *NativeTokenStakingManagerValidationPeriodRegisteredIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *NativeTokenStakingManagerValidationPeriodRegisteredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// NativeTokenStakingManagerValidationPeriodRegistered represents a ValidationPeriodRegistered event raised by the NativeTokenStakingManager contract. +type NativeTokenStakingManagerValidationPeriodRegistered struct { + ValidationID [32]byte + StakeAmount *big.Int + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterValidationPeriodRegistered is a free log retrieval operation binding the contract event 0xf8fd1c90fb9cfa2ca2358fdf5806b086ad43315d92b221c929efc7f105ce7568. +// +// Solidity: event ValidationPeriodRegistered(bytes32 indexed validationID, uint256 stakeAmount, uint256 timestamp) +func (_NativeTokenStakingManager *NativeTokenStakingManagerFilterer) FilterValidationPeriodRegistered(opts *bind.FilterOpts, validationID [][32]byte) (*NativeTokenStakingManagerValidationPeriodRegisteredIterator, error) { + + var validationIDRule []interface{} + for _, validationIDItem := range validationID { + validationIDRule = append(validationIDRule, validationIDItem) + } + + logs, sub, err := _NativeTokenStakingManager.contract.FilterLogs(opts, "ValidationPeriodRegistered", validationIDRule) + if err != nil { + return nil, err + } + return &NativeTokenStakingManagerValidationPeriodRegisteredIterator{contract: _NativeTokenStakingManager.contract, event: "ValidationPeriodRegistered", logs: logs, sub: sub}, nil +} + +// WatchValidationPeriodRegistered is a free log subscription operation binding the contract event 0xf8fd1c90fb9cfa2ca2358fdf5806b086ad43315d92b221c929efc7f105ce7568. +// +// Solidity: event ValidationPeriodRegistered(bytes32 indexed validationID, uint256 stakeAmount, uint256 timestamp) +func (_NativeTokenStakingManager *NativeTokenStakingManagerFilterer) WatchValidationPeriodRegistered(opts *bind.WatchOpts, sink chan<- *NativeTokenStakingManagerValidationPeriodRegistered, validationID [][32]byte) (event.Subscription, error) { + + var validationIDRule []interface{} + for _, validationIDItem := range validationID { + validationIDRule = append(validationIDRule, validationIDItem) + } + + logs, sub, err := _NativeTokenStakingManager.contract.WatchLogs(opts, "ValidationPeriodRegistered", validationIDRule) + 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(NativeTokenStakingManagerValidationPeriodRegistered) + if err := _NativeTokenStakingManager.contract.UnpackLog(event, "ValidationPeriodRegistered", 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 +} + +// ParseValidationPeriodRegistered is a log parse operation binding the contract event 0xf8fd1c90fb9cfa2ca2358fdf5806b086ad43315d92b221c929efc7f105ce7568. +// +// Solidity: event ValidationPeriodRegistered(bytes32 indexed validationID, uint256 stakeAmount, uint256 timestamp) +func (_NativeTokenStakingManager *NativeTokenStakingManagerFilterer) ParseValidationPeriodRegistered(log types.Log) (*NativeTokenStakingManagerValidationPeriodRegistered, error) { + event := new(NativeTokenStakingManagerValidationPeriodRegistered) + if err := _NativeTokenStakingManager.contract.UnpackLog(event, "ValidationPeriodRegistered", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// NativeTokenStakingManagerValidatorRemovalInitializedIterator is returned from FilterValidatorRemovalInitialized and is used to iterate over the raw logs and unpacked data for ValidatorRemovalInitialized events raised by the NativeTokenStakingManager contract. +type NativeTokenStakingManagerValidatorRemovalInitializedIterator struct { + Event *NativeTokenStakingManagerValidatorRemovalInitialized // 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 interfaces.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 *NativeTokenStakingManagerValidatorRemovalInitializedIterator) 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(NativeTokenStakingManagerValidatorRemovalInitialized) + 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(NativeTokenStakingManagerValidatorRemovalInitialized) + 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 *NativeTokenStakingManagerValidatorRemovalInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *NativeTokenStakingManagerValidatorRemovalInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// NativeTokenStakingManagerValidatorRemovalInitialized represents a ValidatorRemovalInitialized event raised by the NativeTokenStakingManager contract. +type NativeTokenStakingManagerValidatorRemovalInitialized struct { + ValidationID [32]byte + SetWeightMessageID [32]byte + StakeAmount *big.Int + EndTime *big.Int + Uptime uint64 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterValidatorRemovalInitialized is a free log retrieval operation binding the contract event 0x530b908725650fb1052974f9df59e834fefac78c9ec2f00c6d2464d60cc6add5. +// +// Solidity: event ValidatorRemovalInitialized(bytes32 indexed validationID, bytes32 indexed setWeightMessageID, uint256 stakeAmount, uint256 endTime, uint64 uptime) +func (_NativeTokenStakingManager *NativeTokenStakingManagerFilterer) FilterValidatorRemovalInitialized(opts *bind.FilterOpts, validationID [][32]byte, setWeightMessageID [][32]byte) (*NativeTokenStakingManagerValidatorRemovalInitializedIterator, error) { + + var validationIDRule []interface{} + for _, validationIDItem := range validationID { + validationIDRule = append(validationIDRule, validationIDItem) + } + var setWeightMessageIDRule []interface{} + for _, setWeightMessageIDItem := range setWeightMessageID { + setWeightMessageIDRule = append(setWeightMessageIDRule, setWeightMessageIDItem) + } + + logs, sub, err := _NativeTokenStakingManager.contract.FilterLogs(opts, "ValidatorRemovalInitialized", validationIDRule, setWeightMessageIDRule) + if err != nil { + return nil, err + } + return &NativeTokenStakingManagerValidatorRemovalInitializedIterator{contract: _NativeTokenStakingManager.contract, event: "ValidatorRemovalInitialized", logs: logs, sub: sub}, nil +} + +// WatchValidatorRemovalInitialized is a free log subscription operation binding the contract event 0x530b908725650fb1052974f9df59e834fefac78c9ec2f00c6d2464d60cc6add5. +// +// Solidity: event ValidatorRemovalInitialized(bytes32 indexed validationID, bytes32 indexed setWeightMessageID, uint256 stakeAmount, uint256 endTime, uint64 uptime) +func (_NativeTokenStakingManager *NativeTokenStakingManagerFilterer) WatchValidatorRemovalInitialized(opts *bind.WatchOpts, sink chan<- *NativeTokenStakingManagerValidatorRemovalInitialized, validationID [][32]byte, setWeightMessageID [][32]byte) (event.Subscription, error) { + + var validationIDRule []interface{} + for _, validationIDItem := range validationID { + validationIDRule = append(validationIDRule, validationIDItem) + } + var setWeightMessageIDRule []interface{} + for _, setWeightMessageIDItem := range setWeightMessageID { + setWeightMessageIDRule = append(setWeightMessageIDRule, setWeightMessageIDItem) + } + + logs, sub, err := _NativeTokenStakingManager.contract.WatchLogs(opts, "ValidatorRemovalInitialized", validationIDRule, setWeightMessageIDRule) + 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(NativeTokenStakingManagerValidatorRemovalInitialized) + if err := _NativeTokenStakingManager.contract.UnpackLog(event, "ValidatorRemovalInitialized", 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 +} + +// ParseValidatorRemovalInitialized is a log parse operation binding the contract event 0x530b908725650fb1052974f9df59e834fefac78c9ec2f00c6d2464d60cc6add5. +// +// Solidity: event ValidatorRemovalInitialized(bytes32 indexed validationID, bytes32 indexed setWeightMessageID, uint256 stakeAmount, uint256 endTime, uint64 uptime) +func (_NativeTokenStakingManager *NativeTokenStakingManagerFilterer) ParseValidatorRemovalInitialized(log types.Log) (*NativeTokenStakingManagerValidatorRemovalInitialized, error) { + event := new(NativeTokenStakingManagerValidatorRemovalInitialized) + if err := _NativeTokenStakingManager.contract.UnpackLog(event, "ValidatorRemovalInitialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/scripts/abi_bindings.sh b/scripts/abi_bindings.sh index 737b13eec..4c8cca62a 100755 --- a/scripts/abi_bindings.sh +++ b/scripts/abi_bindings.sh @@ -16,7 +16,7 @@ export ARCH=$(uname -m) [ $ARCH = x86_64 ] && ARCH=amd64 echo "ARCH set to $ARCH" -DEFAULT_CONTRACT_LIST="TeleporterMessenger TeleporterRegistry ExampleERC20 TestMessenger ValidatorSetSig" +DEFAULT_CONTRACT_LIST="TeleporterMessenger TeleporterRegistry ExampleERC20 TestMessenger ValidatorSetSig NativeTokenStakingManager" CONTRACT_LIST= HELP= From 088810db036566196e05d167464a833ad79459ed Mon Sep 17 00:00:00 2001 From: cam-schultz Date: Fri, 9 Aug 2024 13:06:13 -0500 Subject: [PATCH 02/27] grab commit from go mod --- scripts/versions.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/versions.sh b/scripts/versions.sh index e1b97e297..d3b6ff089 100755 --- a/scripts/versions.sh +++ b/scripts/versions.sh @@ -16,7 +16,7 @@ function getDepVersion() { grep -m1 "^\s*$1" $TELEPORTER_PATH/go.mod | cut -d ' ' -f2 } -extract_commit() { +function extract_commit() { local version=$1 if [[ $version == *-* ]]; then # Extract the substring after the last '-' @@ -29,9 +29,10 @@ extract_commit() { AWM_RELAYER_VERSION=${AWM_RELAYER_VERSION:-'v1.0.0'} # Don't export them as they're used in the context of other calls -AVALANCHEGO_VERSION=${AVALANCHEGO_VERSION:-$(getDepVersion github.com/ava-labs/avalanchego)} -GINKGO_VERSION=${GINKGO_VERSION:-$(getDepVersion github.com/onsi/ginkgo/v2)} -SUBNET_EVM_VERSION=${SUBNET_EVM_VERSION:-$(getDepVersion github.com/ava-labs/subnet-evm)} +AVALANCHEGO_VERSION=${AVALANCHEGO_VERSION:-$(extract_commit "$(getDepVersion github.com/ava-labs/avalanchego)")} +GINKGO_VERSION=${GINKGO_VERSION:-$(extract_commit "$(getDepVersion github.com/onsi/ginkgo/v2)")} +SUBNET_EVM_VERSION=${SUBNET_EVM_VERSION:-$(extract_commit "$(getDepVersion github.com/ava-labs/subnet-evm)")} + # Set golangci-lint version GOLANGCI_LINT_VERSION=${GOLANGCI_LINT_VERSION:-'v1.55'} From 17ae18f595ce5752f6b7925959f4471958bccbb1 Mon Sep 17 00:00:00 2001 From: cam-schultz Date: Fri, 9 Aug 2024 13:06:24 -0500 Subject: [PATCH 03/27] update deps --- go.mod | 6 +++--- go.sum | 14 ++++++++++---- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 47defd6a5..62d99a002 100644 --- a/go.mod +++ b/go.mod @@ -3,12 +3,12 @@ module github.com/ava-labs/teleporter go 1.21.13 require ( - github.com/ava-labs/avalanchego v1.11.10 + github.com/ava-labs/avalanchego v1.11.11-0.20240807224540-c7cf573a95ff github.com/supranational/blst v0.3.11 // indirect ) require ( - github.com/ava-labs/subnet-evm v0.6.8 + github.com/ava-labs/subnet-evm v0.6.9-0.20240809021034-3ceec5c96a5f github.com/ethereum/go-ethereum v1.13.8 github.com/onsi/ginkgo/v2 v2.19.1 github.com/onsi/gomega v1.34.1 @@ -23,7 +23,7 @@ require ( github.com/DataDog/zstd v1.5.2 // indirect github.com/NYTimes/gziphandler v1.1.1 // indirect github.com/VictoriaMetrics/fastcache v1.12.1 // indirect - github.com/ava-labs/coreth v0.13.7 // indirect + github.com/ava-labs/coreth v0.13.8-0.20240807212152-f7acfafec094 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bits-and-blooms/bitset v1.10.0 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect diff --git a/go.sum b/go.sum index bab5300d6..2338ac37d 100644 --- a/go.sum +++ b/go.sum @@ -56,12 +56,18 @@ github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah4HI848JfFxHt+iPb26b4zyfspmqY0/8= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/ava-labs/avalanchego v1.11.10 h1:QujciF5OEp5FwAoe/RciFF/i47rxU5rkEr6fVuUBS1Q= -github.com/ava-labs/avalanchego v1.11.10/go.mod h1:POgZPryqe80OeHCDNrXrPOKoFre736iFuMgmUBeKaLc= -github.com/ava-labs/coreth v0.13.7 h1:k8T9u/ROifl8f7oXjHRc1KvSISRl9txvy7gGVmHEz6g= -github.com/ava-labs/coreth v0.13.7/go.mod h1:tXDujonxXFOF6oK5HS2EmgtSXJK3Gy6RpZxb5WzR9rM= +github.com/ava-labs/avalanchego v1.11.11-0.20240807224540-c7cf573a95ff h1:Nz97kwcbf9DCQxVegBF+GZiUt9HqodeJHR9TtXw8rR8= +github.com/ava-labs/avalanchego v1.11.11-0.20240807224540-c7cf573a95ff/go.mod h1:9e0UPXJboybmgFjeTj+SFbK4ugbrdG4t68VdiUW5oQ8= +github.com/ava-labs/coreth v0.13.8-0.20240802110637-b3e5088d062d h1:klPTcKVvqfA2KSKaRvQAO56Pd4XAqGhwgMTQ6/W+w7w= +github.com/ava-labs/coreth v0.13.8-0.20240802110637-b3e5088d062d/go.mod h1:tXDujonxXFOF6oK5HS2EmgtSXJK3Gy6RpZxb5WzR9rM= +github.com/ava-labs/coreth v0.13.8-0.20240807212152-f7acfafec094 h1:e7TvIKDGzsMsKU3Y4HreRcK7f16EcEPUO04UwSCFtng= +github.com/ava-labs/coreth v0.13.8-0.20240807212152-f7acfafec094/go.mod h1:Ouul9dJouniUIJVX1gDqx8CrHyGvmwZkK28mrgKb/4I= github.com/ava-labs/subnet-evm v0.6.8 h1:IrHGajBYWs692YIYdd5J0oVWWt88Q/XAZQq/dOtkHFw= github.com/ava-labs/subnet-evm v0.6.8/go.mod h1:qt8DXyGm40CY9yffNOe1+4yUyL9mD3v5RPWqAuGj5u4= +github.com/ava-labs/subnet-evm v0.6.9-0.20240809021034-3ceec5c96a5f h1:moqjaNZ1RSXL2/yYUXvwSEpIWjmXcWxTORMBHWuwrtE= +github.com/ava-labs/subnet-evm v0.6.9-0.20240809021034-3ceec5c96a5f/go.mod h1:DM/HccJ8PghYk7fA3Cq76OOoVprOtyITICkjwuzEPfg= +github.com/ava-labs/subnet-evm v0.6.9-0.20240809152905-7387c7129d6f h1:uf7WgXJXOKbNuO7F5BzQ2VBFHbXCAHECinz1FxSXENY= +github.com/ava-labs/subnet-evm v0.6.9-0.20240809152905-7387c7129d6f/go.mod h1:BryiYmD6HWmugkSUpDdj/KyMi7ou5pJzPRNPMbMgpbA= github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= From 460a9434446f9f6b0962793c226e2893bd09eb03 Mon Sep 17 00:00:00 2001 From: cam-schultz Date: Fri, 9 Aug 2024 13:10:02 -0500 Subject: [PATCH 04/27] erc20 staking manager abi --- .../ERC20TokenStakingManager.go | 1198 +++++++++++++++++ .../NativeTokenStakingManager.go | 32 +- scripts/abi_bindings.sh | 2 +- 3 files changed, 1207 insertions(+), 25 deletions(-) create mode 100644 abi-bindings/go/staking/ERC20TokenStakingManager/ERC20TokenStakingManager.go diff --git a/abi-bindings/go/staking/ERC20TokenStakingManager/ERC20TokenStakingManager.go b/abi-bindings/go/staking/ERC20TokenStakingManager/ERC20TokenStakingManager.go new file mode 100644 index 000000000..eac8acbfe --- /dev/null +++ b/abi-bindings/go/staking/ERC20TokenStakingManager/ERC20TokenStakingManager.go @@ -0,0 +1,1198 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package erc20tokenstakingmanager + +import ( + "errors" + "math/big" + "strings" + + "github.com/ava-labs/subnet-evm/accounts/abi" + "github.com/ava-labs/subnet-evm/accounts/abi/bind" + "github.com/ava-labs/subnet-evm/core/types" + "github.com/ava-labs/subnet-evm/interfaces" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = interfaces.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +// StakingManagerSettings is an auto generated low-level Go binding around an user-defined struct. +type StakingManagerSettings struct { + PChainBlockchainID [32]byte + SubnetID [32]byte + MinimumStakeAmount *big.Int + MaximumStakeAmount *big.Int + MinimumStakeDuration uint64 + MaximumHourlyChurn uint8 + RewardCalculator common.Address +} + +// ERC20TokenStakingManagerMetaData contains all meta data concerning the ERC20TokenStakingManager contract. +var ERC20TokenStakingManagerMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"init\",\"type\":\"uint8\",\"internalType\":\"enumICMInitializable\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"WARP_MESSENGER\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIWarpMessenger\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"completeEndValidation\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"setWeightMessageType\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"completeValidatorRegistration\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"settings\",\"type\":\"tuple\",\"internalType\":\"structStakingManagerSettings\",\"components\":[{\"name\":\"pChainBlockchainID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"subnetID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"minimumStakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"maximumStakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"minimumStakeDuration\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"maximumHourlyChurn\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"rewardCalculator\",\"type\":\"address\",\"internalType\":\"contractIRewardCalculator\"}]},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeEndValidation\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"includeUptimeProof\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeValidatorRegistration\",\"inputs\":[{\"name\":\"stakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"nodeID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"resendEndValidatorMessage\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"resendRegisterValidatorMessage\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"valueToWeight\",\"inputs\":[{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"weightToValue\",\"inputs\":[{\"name\":\"weight\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"pure\"},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodCreated\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"nodeID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"registerValidationMessageID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"weight\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodEnded\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodRegistered\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"stakeAmount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"timestamp\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidatorRemovalInitialized\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"setWeightMessageID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"stakeAmount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"endTime\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"uptime\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ReentrancyGuardReentrantCall\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"SafeERC20FailedOperation\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}]}]", + Bin: "0x608060405234801561000f575f80fd5b506040516132dc3803806132dc83398101604081905261002e91610107565b60018160018111156100425761004261012c565b0361004f5761004f610055565b50610140565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156100a55760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146101045780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b5f60208284031215610117575f80fd5b815160028110610125575f80fd5b9392505050565b634e487b7160e01b5f52602160045260245ffd5b61318f8061014d5f395ff3fe608060405234801561000f575f80fd5b506004361061009b575f3560e01c8063872fda6411610063578063872fda641461012b578063a3a65e481461013e578063b771b3bc14610151578063bee0a03f14610177578063fdf94a1a1461018a575f80fd5b80630322ed981461009f5780632e2194d8146100b45780635d0d7466146100e457806362065856146100f757806376f7862114610118575b5f80fd5b6100b26100ad366004612886565b61019d565b005b6100c76100c2366004612886565b610393565b6040516001600160401b0390911681526020015b60405180910390f35b6100b26100f23660046128b1565b6103a9565b61010a610105366004612909565b6104b7565b6040519081526020016100db565b6100b2610126366004612949565b6104d0565b61010a610139366004612a16565b610a50565b6100b261014c366004612ab2565b610a68565b61015f6005600160991b0181565b6040516001600160a01b0390911681526020016100db565b6100b2610185366004612886565b610cf5565b6100b2610198366004612acb565b610e09565b5f8181527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab60860205260408082208151610120810190925280545f8051602061316383398151915293929190829060ff1660058111156101fe576101fe612af5565b600581111561020f5761020f612af5565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003928301546001600160a01b03811660c084015260ff600160a01b820416151560e0840152600160a81b90041661010090910152909150815160058111156102a6576102a6612af5565b1461030e5760405162461bcd60e51b815260206004820152602d60248201527f5374616b696e674d616e616765723a2056616c696461746f72206e6f7420706560448201526c1b991a5b99c81c995b5bdd985b609a1b60648201526084015b60405180910390fd5b5f61031f848361010001515f611230565b60405163ee5b48eb60e01b81529091506005600160991b019063ee5b48eb9061034c908490600401612b2b565b6020604051808303815f875af1158015610368573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061038c9190612b5d565b5050505050565b5f6103a364e8d4a5100083612b9c565b92915050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff1615906001600160401b03165f811580156103ed5750825b90505f826001600160401b031660011480156104085750303b155b905081158015610416575080155b156104345760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561045e57845460ff60401b1916600160401b1785555b61046887876113f2565b83156104ae57845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50505050505050565b5f6103a36001600160401b03831664e8d4a51000612baf565b5f8381527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab60860205260408082208151610120810190925280545f8051602061316383398151915293929190829060ff16600581111561053157610531612af5565b600581111561054257610542612af5565b8152600182015460208201526002808301546001600160401b038082166040850152600160401b820481166060850152600160801b820481166080850152600160c01b909104811660a08401526003909301546001600160a01b03811660c084015260ff600160a01b820416151560e0840152600160a81b900490921661010090910152909150815160058111156105dc576105dc612af5565b146106355760405162461bcd60e51b8152602060048201526024808201527f5374616b696e674d616e616765723a2056616c696461746f72206e6f742061636044820152637469766560e01b6064820152608401610305565b60c08101516001600160a01b0316336001600160a01b03161461066a5760405162461bcd60e51b815260040161030590612bc6565b6106778160400151611410565b60038152426001600160401b031660808201525f8415610850576040516306f8253560e41b815263ffffffff851660048201525f9081906005600160991b0190636f825350906024015f60405180830381865afa1580156106da573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f191682016040526107019190810190612c1b565b91509150806107225760405162461bcd60e51b815260040161030590612ced565b6005600160991b016001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa158015610765573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107899190612b5d565b8251146107a85760405162461bcd60e51b815260040161030590612d31565b60208201516001600160a01b0316156107d35760405162461bcd60e51b815260040161030590612d78565b5f806107e284604001516115bd565b91509150818a1461084a5760405162461bcd60e51b815260206004820152602c60248201527f5374616b696e674d616e616765723a20496e76616c696420757074696d65207660448201526b185b1a59185d1a5bdb88125160a21b6064820152608401610305565b93505050505b6001600160401b03811660a08301525f86815260088401602052604090208251815484929190829060ff1916600183600581111561089057610890612af5565b02179055506020820151600182015560408201516002820180546060850151608086015160a08701516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c08301516003909201805460e0850151610100958601516001600160a01b039095166001600160a81b031990921691909117600160a01b911515919091021767ffffffffffffffff60a81b1916600160a81b93909216929092021790558201515f9061098190889083611230565b60405163ee5b48eb60e01b81529091505f906005600160991b019063ee5b48eb906109b0908590600401612b2b565b6020604051808303815f875af11580156109cc573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109f09190612b5d565b60408581015181516001600160401b03918216815242602082015290861681830152905191925082918a917f530b908725650fb1052974f9df59e834fefac78c9ec2f00c6d2464d60cc6add5919081900360600190a35050505050505050565b5f610a5d84868585611718565b90505b949350505050565b5f5f805160206131638339815191526040516306f8253560e41b815263ffffffff841660048201529091505f9081906005600160991b0190636f825350906024015f60405180830381865afa158015610ac3573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052610aea9190810190612c1b565b9150915080610b0b5760405162461bcd60e51b815260040161030590612ced565b8254825114610b2c5760405162461bcd60e51b815260040161030590612d31565b60208201516001600160a01b031615610b575760405162461bcd60e51b815260040161030590612d78565b5f80610b668460400151611c25565b9150915080610bc65760405162461bcd60e51b815260206004820152602660248201527f5374616b696e674d616e616765723a20526567697374726174696f6e206e6f74604482015265081d985b1a5960d21b6064820152608401610305565b5f82815260078601602052604081208054610be090612dc5565b9050118015610c12575060015f83815260088701602052604090205460ff166005811115610c1057610c10612af5565b145b610c2e5760405162461bcd60e51b815260040161030590612dfd565b5f8281526007860160205260408120610c469161283c565b5f8281526008860160208181526040808420805460ff191660029081178255810180546001600160401b0342818116600160401b026fffffffffffffffff000000000000000019909316929092178355600190930154875260098c0185528387208990559588905293835292548151931683529082019290925283917ff8fd1c90fb9cfa2ca2358fdf5806b086ad43315d92b221c929efc7f105ce7568910160405180910390a2505050505050565b5f8181527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6076020526040812080545f80516020613163833981519152929190610d3d90612dc5565b9050118015610d6f575060015f83815260088301602052604090205460ff166005811115610d6d57610d6d612af5565b145b610d8b5760405162461bcd60e51b815260040161030590612dfd565b5f82815260078201602052604090819020905163ee5b48eb60e01b81526005600160991b019163ee5b48eb91610dc49190600401612e42565b6020604051808303815f875af1158015610de0573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e049190612b5d565b505050565b5f5f805160206131638339815191526040516306f8253560e41b815263ffffffff851660048201529091505f9081906005600160991b0190636f825350906024015f60405180830381865afa158015610e64573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052610e8b9190810190612c1b565b9150915080610eac5760405162461bcd60e51b815260040161030590612ced565b5f8415610f25575f610ec18460400151611d49565b919350909150506001600160401b03811615610f1f5760405162461bcd60e51b815260206004820181905260248201527f5374616b696e674d616e616765723a20576569676874206d75737420626520306044820152606401610305565b50610f99565b5f610f338460400151611c25565b90925090508015610f975760405162461bcd60e51b815260206004820152602860248201527f5374616b696e674d616e616765723a20526567697374726174696f6e207374696044820152671b1b081d985b1a5960c21b6064820152608401610305565b505b5f818152600885016020526040808220815161012081019092528054829060ff166005811115610fcb57610fcb612af5565b6005811115610fdc57610fdc612af5565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003909201546001600160a01b0380821660c080850191909152600160a01b830460ff16151560e0850152600160a81b9092049093166101009092019190915282015191925016331461108d5760405162461bcd60e51b815260040161030590612bc6565b5f6003825160058111156110a3576110a3612af5565b14806110c157506002825160058111156110bf576110bf612af5565b145b156110e457506020808201515f90815260098701909152604081205560046110e8565b5060055b5f83815260088701602052604090208251815484929190829060ff1916600183600581111561111957611119612af5565b0217905550602082015160018201556040808301516002830180546060860151608087015160a08801516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c08401516003909301805460e0860151610100909601516001600160a01b039095166001600160a81b031990911617600160a01b951515959095029490941767ffffffffffffffff60a81b1916600160a81b9390911692909202919091179091555183907f3532ad18e70a039beb4663d48c15acbef558c96ec9b8fd0cc3c0304f774740b8905f90a25050505050505050565b60408051603480825260608281019093525f91906020820181803683370190505090505f5b60048110156112b157611269816003612ecc565b611274906008612baf565b600263ffffffff16901c60f81b82828151811061129357611293612edf565b60200101906001600160f81b03191690815f1a905350600101611255565b505f5b6020811015611313576112c881601f612ecc565b6112d3906008612baf565b86901c60f81b826112e5836004612ef3565b815181106112f5576112f5612edf565b60200101906001600160f81b03191690815f1a9053506001016112b4565b505f5b600881101561137e5761132a816007612ecc565b611335906008612baf565b6001600160401b038616901c60f81b82611350836024612ef3565b8151811061136057611360612edf565b60200101906001600160f81b03191690815f1a905350600101611316565b505f5b60088110156113e957611395816007612ecc565b6113a0906008612baf565b6001600160401b038516901c60f81b826113bb83602c612ef3565b815181106113cb576113cb612edf565b60200101906001600160f81b03191690815f1a905350600101611381565b50949350505050565b6113fa611f07565b61140382611f52565b61140c81611f76565b5050565b7fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab604545f8051602061316383398151915290600160e01b900460ff165f03611455575050565b60408051606081018252600583015480825260068401546001600160401b038082166020850152600160401b9091041692820192909252904290610e109061149d9083612ecc565b106114b9576001600160401b03841660408301528082526114d8565b83826040018181516114cb9190612f06565b6001600160401b03169052505b5f8260200151836040015160646114ef9190612f2d565b6114f99190612f58565b600485015490915060ff600160e01b909104811690821611156115795760405162461bcd60e51b815260206004820152603260248201527f5374616b696e674d616e616765723a204d6178696d756d20686f75726c7920636044820152711a1d5c9b881c985d1948195e18d95959195960721b6064820152608401610305565b5050805160058301556020810151600690920180546040909201516001600160401b03908116600160401b026001600160801b031990931693169290921717905550565b5f808251602c146115e05760405162461bcd60e51b815260040161030590612f7d565b5f805b6004811015611631576115f7816003612ecc565b611602906008612baf565b63ffffffff1685828151811061161a5761161a612edf565b016020015160f81c901b91909117906001016115e3565b5063ffffffff81166003146116585760405162461bcd60e51b815260040161030590612fc4565b5f805b60208110156116ad5761166f81601f612ecc565b61167a906008612baf565b86611686836004612ef3565b8151811061169657611696612edf565b016020015160f81c901b919091179060010161165b565b505f805b600881101561170c576116c5816007612ecc565b6116d0906008612baf565b6001600160401b0316876116e5836024612ef3565b815181106116f5576116f5612edf565b016020015160f81c901b91909117906001016116b1565b50909590945092505050565b5f61172161202a565b5f80516020613163833981519152426001600160401b03851611801561175b57506001600160401b038416611759426202a300612ef3565b115b6117bb5760405162461bcd60e51b815260206004820152602b60248201527f5374616b696e674d616e616765723a20496e76616c696420726567697374726160448201526a74696f6e2065787069727960a81b6064820152608401610305565b856118085760405162461bcd60e51b815260206004820152601f60248201527f5374616b696e674d616e616765723a20496e76616c6964206e6f6465204944006044820152606401610305565b5f868152600982016020526040902054156118745760405162461bcd60e51b815260206004820152602660248201527f5374616b696e674d616e616765723a204e6f646520494420616c72656164792060448201526561637469766560d01b6064820152608401610305565b82516040146118d65760405162461bcd60e51b815260206004820152602860248201527f5374616b696e674d616e616765723a20496e76616c6964207369676e617475726044820152670ca40d8cadccee8d60c31b6064820152608401610305565b5f6118e086612074565b90505f6118ec82610393565b90506118f781611410565b8260020154816001600160401b03161015801561192157508260030154816001600160401b031611155b6119795760405162461bcd60e51b8152602060048201526024808201527f5374616b696e674d616e616765723a20496e76616c6964207374616b6520616d6044820152631bdd5b9d60e21b6064820152608401610305565b5f806119c06040518060a00160405280876001015481526020018c8152602001856001600160401b031681526020018a6001600160401b03168152602001898152506120aa565b5f828152600788016020526040902091935091506119de828261304d565b5060405163ee5b48eb60e01b81525f906005600160991b019063ee5b48eb90611a0b908590600401612b2b565b6020604051808303815f875af1158015611a27573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611a4b9190612b5d565b6040805161012081019091529091508060018152602081018d90526001600160401b03861660408201525f606082018190526080820181905260a082015260c001336001600160a01b031681525f6020808301829052604092830182905286825260088a0190522081518154829060ff19166001836005811115611ad157611ad1612af5565b021790555060208281015160018301556040808401516002840180546060870151608088015160a08901516001600160401b03908116600160c01b026001600160c01b03928216600160801b02929092166001600160801b03938216600160401b026001600160801b03199095169682169690961793909317919091169390931792909217905560c08501516003909401805460e0870151610100909701518316600160a81b0267ffffffffffffffff60a81b19971515600160a01b026001600160a81b03199092166001600160a01b039097169690961717959095169390931790935582518783168152918c169082015282918d9186917f79b81620b81daf2c08cd5bb3dbb79e75d2d7a87f52171fde5aadc8c47823026e910160405180910390a45090945050505050610a6060017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b5f808251602514611c485760405162461bcd60e51b815260040161030590612f7d565b5f805b6004811015611c9957611c5f816003612ecc565b611c6a906008612baf565b63ffffffff16858281518110611c8257611c82612edf565b016020015160f81c901b9190911790600101611c4b565b5063ffffffff8116600114611cc05760405162461bcd60e51b815260040161030590612fc4565b5f805b6020811015611d1557611cd781601f612ecc565b611ce2906008612baf565b86611cee836004612ef3565b81518110611cfe57611cfe612edf565b016020015160f81c901b9190911790600101611cc3565b505f85602481518110611d2a57611d2a612edf565b016020015191966001600160f81b031990921615159550909350505050565b5f805f8351603414611d6d5760405162461bcd60e51b815260040161030590612f7d565b5f805b6004811015611dbe57611d84816003612ecc565b611d8f906008612baf565b63ffffffff16868281518110611da757611da7612edf565b016020015160f81c901b9190911790600101611d70565b5063ffffffff8116600214611de55760405162461bcd60e51b815260040161030590612fc4565b5f805b6020811015611e3a57611dfc81601f612ecc565b611e07906008612baf565b87611e13836004612ef3565b81518110611e2357611e23612edf565b016020015160f81c901b9190911790600101611de8565b505f805b6008811015611e9957611e52816007612ecc565b611e5d906008612baf565b6001600160401b031688611e72836024612ef3565b81518110611e8257611e82612edf565b016020015160f81c901b9190911790600101611e3e565b505f805b6008811015611ef857611eb1816007612ecc565b611ebc906008612baf565b6001600160401b031689611ed183602c612ef3565b81518110611ee157611ee1612edf565b016020015160f81c901b9190911790600101611e9d565b50919790965090945092505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff16611f5057604051631afcd79f60e31b815260040160405180910390fd5b565b611f5a611f07565b611f626121d8565b611f6a6121e8565b611f73816121f0565b50565b611f7e611f07565b7f8568826440873e37a96cb0aab773b28d8154d963d2f0e41bd9b5c15f63625f916001600160a01b03821661200a5760405162461bcd60e51b815260206004820152602c60248201527f4552433230546f6b656e5374616b696e674d616e616765723a207a65726f207460448201526b6f6b656e206164647265737360a01b6064820152608401610305565b80546001600160a01b0319166001600160a01b0392909216919091179055565b7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0080546001190161206e57604051633ee5aeb560e01b815260040160405180910390fd5b60029055565b5f6103a3827f8568826440873e37a96cb0aab773b28d8154d963d2f0e41bd9b5c15f63625f91546001600160a01b031690612320565b5f60605f806120b885612482565b60408051609480825260c082019092529294509092505f91906020820181803683370190505090505f5b600481101561213e576120f6816003612ecc565b612101906008612baf565b600163ffffffff16901c60f81b82828151811061212057612120612edf565b60200101906001600160f81b03191690815f1a9053506001016120e2565b505f5b60908110156121a55782818151811061215c5761215c612edf565b01602001516001600160f81b03191682612177836004612ef3565b8151811061218757612187612edf565b60200101906001600160f81b03191690815f1a905350600101612141565b5091959194509092505050565b60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b6121e0611f07565b611f50612768565b611f50611f07565b6121f8611f07565b80355f8051602061316383398151915290815560208201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6015560408201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6025560608201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6035561229060a0830160808401612909565b60048201805467ffffffffffffffff19166001600160401b03929092169190911790556122c360c0830160a0840161310c565b60048201805460ff92909216600160e01b0260ff60e01b199092169190911790556122f460e0830160c0840161312c565b8160040160086101000a8154816001600160a01b0302191690836001600160a01b031602179055505050565b6040516370a0823160e01b81523060048201525f9081906001600160a01b038516906370a0823190602401602060405180830381865afa158015612366573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061238a9190612b5d565b90506123a16001600160a01b038516333086612770565b6040516370a0823160e01b81523060048201525f906001600160a01b038616906370a0823190602401602060405180830381865afa1580156123e5573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906124099190612b5d565b905081811161246f5760405162461bcd60e51b815260206004820152602c60248201527f5361666545524332305472616e7366657246726f6d3a2062616c616e6365206e60448201526b1bdd081a5b98dc99585cd95960a21b6064820152608401610305565b6124798282612ecc565b95945050505050565b5f60608260800151516040146124ec5760405162461bcd60e51b815260206004820152602960248201527f5374616b696e674d657373616765733a20496e76616c6964207369676e6174756044820152680e4ca40d8cadccee8d60bb1b6064820152608401610305565b60408051609080825260c082019092525f916020820181803683370190505090505f5b602081101561255f578451816020811061252b5761252b612edf565b1a60f81b82828151811061254157612541612edf565b60200101906001600160f81b03191690815f1a90535060010161250f565b505f5b60208110156125bf578460200151816020811061258157612581612edf565b1a60f81b82612591836020612ef3565b815181106125a1576125a1612edf565b60200101906001600160f81b03191690815f1a905350600101612562565b505f5b6008811015612633576125d6816007612ecc565b6125e1906008612baf565b60ff1685604001516001600160401b0316901c60f81b828260406126059190612ef3565b8151811061261557612615612edf565b60200101906001600160f81b03191690815f1a9053506001016125c2565b505f5b60088110156126a55761264a816007612ecc565b612655906008612baf565b60608601516001600160401b0390811691161c60f81b82612677836048612ef3565b8151811061268757612687612edf565b60200101906001600160f81b03191690815f1a905350600101612636565b505f5b604081101561271057846080015181815181106126c7576126c7612edf565b01602001516001600160f81b031916826126e2836050612ef3565b815181106126f2576126f2612edf565b60200101906001600160f81b03191690815f1a9053506001016126a8565b506002816040516127219190613147565b602060405180830381855afa15801561273c573d5f803e3d5ffd5b5050506040513d601f19601f8201168201806040525081019061275f9190612b5d565b94909350915050565b6121b2611f07565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526127ca9085906127d0565b50505050565b5f8060205f8451602086015f885af1806127ef576040513d5f823e3d81fd5b50505f513d91508115612806578060011415612813565b6001600160a01b0384163b155b156127ca57604051635274afe760e01b81526001600160a01b0385166004820152602401610305565b50805461284890612dc5565b5f825580601f10612857575050565b601f0160209004905f5260205f2090810190611f7391905b80821115612882575f815560010161286f565b5090565b5f60208284031215612896575f80fd5b5035919050565b6001600160a01b0381168114611f73575f80fd5b5f808284036101008112156128c4575f80fd5b60e08112156128d1575f80fd5b5082915060e08301356128e38161289d565b809150509250929050565b80356001600160401b0381168114612904575f80fd5b919050565b5f60208284031215612919575f80fd5b612922826128ee565b9392505050565b8015158114611f73575f80fd5b803563ffffffff81168114612904575f80fd5b5f805f6060848603121561295b575f80fd5b83359250602084013561296d81612929565b915061297b60408501612936565b90509250925092565b634e487b7160e01b5f52604160045260245ffd5b604051606081016001600160401b03811182821017156129ba576129ba612984565b60405290565b604051601f8201601f191681016001600160401b03811182821017156129e8576129e8612984565b604052919050565b5f6001600160401b03821115612a0857612a08612984565b50601f01601f191660200190565b5f805f8060808587031215612a29575f80fd5b8435935060208501359250612a40604086016128ee565b915060608501356001600160401b03811115612a5a575f80fd5b8501601f81018713612a6a575f80fd5b8035612a7d612a78826129f0565b6129c0565b818152886020838501011115612a91575f80fd5b816020840160208301375f6020838301015280935050505092959194509250565b5f60208284031215612ac2575f80fd5b61292282612936565b5f8060408385031215612adc575f80fd5b612ae583612936565b915060208301356128e381612929565b634e487b7160e01b5f52602160045260245ffd5b5f5b83811015612b23578181015183820152602001612b0b565b50505f910152565b602081525f8251806020840152612b49816040850160208701612b09565b601f01601f19169190910160400192915050565b5f60208284031215612b6d575f80fd5b5051919050565b634e487b7160e01b5f52601260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b5f82612baa57612baa612b74565b500490565b80820281158282048414176103a3576103a3612b88565b6020808252602a908201527f5374616b696e674d616e616765723a2053656e646572206e6f742076616c696460408201526930ba37b91037bbb732b960b11b606082015260800190565b805161290481612929565b5f8060408385031215612c2c575f80fd5b82516001600160401b0380821115612c42575f80fd5b9084019060608287031215612c55575f80fd5b612c5d612998565b82518152602080840151612c708161289d565b82820152604084015183811115612c85575f80fd5b80850194505087601f850112612c99575f80fd5b83519250612ca9612a78846129f0565b8381528882858701011115612cbc575f80fd5b612ccb84838301848801612b09565b80604084015250819550612ce0818801612c10565b9450505050509250929050565b60208082526024908201527f5374616b696e674d616e616765723a20496e76616c69642077617270206d65736040820152637361676560e01b606082015260800190565b60208082526027908201527f5374616b696e674d616e616765723a20496e76616c696420736f7572636520636040820152661a185a5b88125160ca1b606082015260800190565b6020808252602d908201527f5374616b696e674d616e616765723a20496e76616c6964206f726967696e207360408201526c656e646572206164647265737360981b606082015260800190565b600181811c90821680612dd957607f821691505b602082108103612df757634e487b7160e01b5f52602260045260245ffd5b50919050565b60208082526025908201527f5374616b696e674d616e616765723a20496e76616c69642076616c69646174696040820152641bdb88125160da1b606082015260800190565b5f60208083525f8454612e5481612dc5565b806020870152604060018084165f8114612e755760018114612e9157612ebe565b60ff19851660408a0152604084151560051b8a01019550612ebe565b895f5260205f205f5b85811015612eb55781548b8201860152908301908801612e9a565b8a016040019650505b509398975050505050505050565b818103818111156103a3576103a3612b88565b634e487b7160e01b5f52603260045260245ffd5b808201808211156103a3576103a3612b88565b6001600160401b03818116838216019080821115612f2657612f26612b88565b5092915050565b6001600160401b03818116838216028082169190828114612f5057612f50612b88565b505092915050565b5f6001600160401b0380841680612f7157612f71612b74565b92169190910492915050565b60208082526027908201527f5374616b696e674d657373616765733a20496e76616c6964206d657373616765604082015266040d8cadccee8d60cb1b606082015260800190565b60208082526025908201527f5374616b696e674d657373616765733a20496e76616c6964206d657373616765604082015264207479706560d81b606082015260800190565b601f821115610e0457805f5260205f20601f840160051c8101602085101561302e5750805b601f840160051c820191505b8181101561038c575f815560010161303a565b81516001600160401b0381111561306657613066612984565b61307a816130748454612dc5565b84613009565b602080601f8311600181146130ad575f84156130965750858301515b5f19600386901b1c1916600185901b178555613104565b5f85815260208120601f198616915b828110156130db578886015182559484019460019091019084016130bc565b50858210156130f857878501515f19600388901b60f8161c191681555b505060018460011b0185555b505050505050565b5f6020828403121561311c575f80fd5b813560ff81168114612922575f80fd5b5f6020828403121561313c575f80fd5b81356129228161289d565b5f8251613158818460208701612b09565b919091019291505056feafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab600a164736f6c6343000819000a", +} + +// ERC20TokenStakingManagerABI is the input ABI used to generate the binding from. +// Deprecated: Use ERC20TokenStakingManagerMetaData.ABI instead. +var ERC20TokenStakingManagerABI = ERC20TokenStakingManagerMetaData.ABI + +// ERC20TokenStakingManagerBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use ERC20TokenStakingManagerMetaData.Bin instead. +var ERC20TokenStakingManagerBin = ERC20TokenStakingManagerMetaData.Bin + +// DeployERC20TokenStakingManager deploys a new Ethereum contract, binding an instance of ERC20TokenStakingManager to it. +func DeployERC20TokenStakingManager(auth *bind.TransactOpts, backend bind.ContractBackend, init uint8) (common.Address, *types.Transaction, *ERC20TokenStakingManager, error) { + parsed, err := ERC20TokenStakingManagerMetaData.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(ERC20TokenStakingManagerBin), backend, init) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &ERC20TokenStakingManager{ERC20TokenStakingManagerCaller: ERC20TokenStakingManagerCaller{contract: contract}, ERC20TokenStakingManagerTransactor: ERC20TokenStakingManagerTransactor{contract: contract}, ERC20TokenStakingManagerFilterer: ERC20TokenStakingManagerFilterer{contract: contract}}, nil +} + +// ERC20TokenStakingManager is an auto generated Go binding around an Ethereum contract. +type ERC20TokenStakingManager struct { + ERC20TokenStakingManagerCaller // Read-only binding to the contract + ERC20TokenStakingManagerTransactor // Write-only binding to the contract + ERC20TokenStakingManagerFilterer // Log filterer for contract events +} + +// ERC20TokenStakingManagerCaller is an auto generated read-only Go binding around an Ethereum contract. +type ERC20TokenStakingManagerCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ERC20TokenStakingManagerTransactor is an auto generated write-only Go binding around an Ethereum contract. +type ERC20TokenStakingManagerTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ERC20TokenStakingManagerFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type ERC20TokenStakingManagerFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ERC20TokenStakingManagerSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type ERC20TokenStakingManagerSession struct { + Contract *ERC20TokenStakingManager // 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 +} + +// ERC20TokenStakingManagerCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type ERC20TokenStakingManagerCallerSession struct { + Contract *ERC20TokenStakingManagerCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// ERC20TokenStakingManagerTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type ERC20TokenStakingManagerTransactorSession struct { + Contract *ERC20TokenStakingManagerTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// ERC20TokenStakingManagerRaw is an auto generated low-level Go binding around an Ethereum contract. +type ERC20TokenStakingManagerRaw struct { + Contract *ERC20TokenStakingManager // Generic contract binding to access the raw methods on +} + +// ERC20TokenStakingManagerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type ERC20TokenStakingManagerCallerRaw struct { + Contract *ERC20TokenStakingManagerCaller // Generic read-only contract binding to access the raw methods on +} + +// ERC20TokenStakingManagerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type ERC20TokenStakingManagerTransactorRaw struct { + Contract *ERC20TokenStakingManagerTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewERC20TokenStakingManager creates a new instance of ERC20TokenStakingManager, bound to a specific deployed contract. +func NewERC20TokenStakingManager(address common.Address, backend bind.ContractBackend) (*ERC20TokenStakingManager, error) { + contract, err := bindERC20TokenStakingManager(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &ERC20TokenStakingManager{ERC20TokenStakingManagerCaller: ERC20TokenStakingManagerCaller{contract: contract}, ERC20TokenStakingManagerTransactor: ERC20TokenStakingManagerTransactor{contract: contract}, ERC20TokenStakingManagerFilterer: ERC20TokenStakingManagerFilterer{contract: contract}}, nil +} + +// NewERC20TokenStakingManagerCaller creates a new read-only instance of ERC20TokenStakingManager, bound to a specific deployed contract. +func NewERC20TokenStakingManagerCaller(address common.Address, caller bind.ContractCaller) (*ERC20TokenStakingManagerCaller, error) { + contract, err := bindERC20TokenStakingManager(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &ERC20TokenStakingManagerCaller{contract: contract}, nil +} + +// NewERC20TokenStakingManagerTransactor creates a new write-only instance of ERC20TokenStakingManager, bound to a specific deployed contract. +func NewERC20TokenStakingManagerTransactor(address common.Address, transactor bind.ContractTransactor) (*ERC20TokenStakingManagerTransactor, error) { + contract, err := bindERC20TokenStakingManager(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &ERC20TokenStakingManagerTransactor{contract: contract}, nil +} + +// NewERC20TokenStakingManagerFilterer creates a new log filterer instance of ERC20TokenStakingManager, bound to a specific deployed contract. +func NewERC20TokenStakingManagerFilterer(address common.Address, filterer bind.ContractFilterer) (*ERC20TokenStakingManagerFilterer, error) { + contract, err := bindERC20TokenStakingManager(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &ERC20TokenStakingManagerFilterer{contract: contract}, nil +} + +// bindERC20TokenStakingManager binds a generic wrapper to an already deployed contract. +func bindERC20TokenStakingManager(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := ERC20TokenStakingManagerMetaData.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 (_ERC20TokenStakingManager *ERC20TokenStakingManagerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _ERC20TokenStakingManager.Contract.ERC20TokenStakingManagerCaller.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 (_ERC20TokenStakingManager *ERC20TokenStakingManagerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ERC20TokenStakingManager.Contract.ERC20TokenStakingManagerTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ERC20TokenStakingManager.Contract.ERC20TokenStakingManagerTransactor.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 (_ERC20TokenStakingManager *ERC20TokenStakingManagerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _ERC20TokenStakingManager.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 (_ERC20TokenStakingManager *ERC20TokenStakingManagerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ERC20TokenStakingManager.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ERC20TokenStakingManager.Contract.contract.Transact(opts, method, params...) +} + +// WARPMESSENGER is a free data retrieval call binding the contract method 0xb771b3bc. +// +// Solidity: function WARP_MESSENGER() view returns(address) +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerCaller) WARPMESSENGER(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _ERC20TokenStakingManager.contract.Call(opts, &out, "WARP_MESSENGER") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// WARPMESSENGER is a free data retrieval call binding the contract method 0xb771b3bc. +// +// Solidity: function WARP_MESSENGER() view returns(address) +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerSession) WARPMESSENGER() (common.Address, error) { + return _ERC20TokenStakingManager.Contract.WARPMESSENGER(&_ERC20TokenStakingManager.CallOpts) +} + +// WARPMESSENGER is a free data retrieval call binding the contract method 0xb771b3bc. +// +// Solidity: function WARP_MESSENGER() view returns(address) +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerCallerSession) WARPMESSENGER() (common.Address, error) { + return _ERC20TokenStakingManager.Contract.WARPMESSENGER(&_ERC20TokenStakingManager.CallOpts) +} + +// ValueToWeight is a free data retrieval call binding the contract method 0x2e2194d8. +// +// Solidity: function valueToWeight(uint256 value) pure returns(uint64) +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerCaller) ValueToWeight(opts *bind.CallOpts, value *big.Int) (uint64, error) { + var out []interface{} + err := _ERC20TokenStakingManager.contract.Call(opts, &out, "valueToWeight", value) + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// ValueToWeight is a free data retrieval call binding the contract method 0x2e2194d8. +// +// Solidity: function valueToWeight(uint256 value) pure returns(uint64) +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerSession) ValueToWeight(value *big.Int) (uint64, error) { + return _ERC20TokenStakingManager.Contract.ValueToWeight(&_ERC20TokenStakingManager.CallOpts, value) +} + +// ValueToWeight is a free data retrieval call binding the contract method 0x2e2194d8. +// +// Solidity: function valueToWeight(uint256 value) pure returns(uint64) +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerCallerSession) ValueToWeight(value *big.Int) (uint64, error) { + return _ERC20TokenStakingManager.Contract.ValueToWeight(&_ERC20TokenStakingManager.CallOpts, value) +} + +// WeightToValue is a free data retrieval call binding the contract method 0x62065856. +// +// Solidity: function weightToValue(uint64 weight) pure returns(uint256) +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerCaller) WeightToValue(opts *bind.CallOpts, weight uint64) (*big.Int, error) { + var out []interface{} + err := _ERC20TokenStakingManager.contract.Call(opts, &out, "weightToValue", weight) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// WeightToValue is a free data retrieval call binding the contract method 0x62065856. +// +// Solidity: function weightToValue(uint64 weight) pure returns(uint256) +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerSession) WeightToValue(weight uint64) (*big.Int, error) { + return _ERC20TokenStakingManager.Contract.WeightToValue(&_ERC20TokenStakingManager.CallOpts, weight) +} + +// WeightToValue is a free data retrieval call binding the contract method 0x62065856. +// +// Solidity: function weightToValue(uint64 weight) pure returns(uint256) +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerCallerSession) WeightToValue(weight uint64) (*big.Int, error) { + return _ERC20TokenStakingManager.Contract.WeightToValue(&_ERC20TokenStakingManager.CallOpts, weight) +} + +// CompleteEndValidation is a paid mutator transaction binding the contract method 0xfdf94a1a. +// +// Solidity: function completeEndValidation(uint32 messageIndex, bool setWeightMessageType) returns() +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerTransactor) CompleteEndValidation(opts *bind.TransactOpts, messageIndex uint32, setWeightMessageType bool) (*types.Transaction, error) { + return _ERC20TokenStakingManager.contract.Transact(opts, "completeEndValidation", messageIndex, setWeightMessageType) +} + +// CompleteEndValidation is a paid mutator transaction binding the contract method 0xfdf94a1a. +// +// Solidity: function completeEndValidation(uint32 messageIndex, bool setWeightMessageType) returns() +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerSession) CompleteEndValidation(messageIndex uint32, setWeightMessageType bool) (*types.Transaction, error) { + return _ERC20TokenStakingManager.Contract.CompleteEndValidation(&_ERC20TokenStakingManager.TransactOpts, messageIndex, setWeightMessageType) +} + +// CompleteEndValidation is a paid mutator transaction binding the contract method 0xfdf94a1a. +// +// Solidity: function completeEndValidation(uint32 messageIndex, bool setWeightMessageType) returns() +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerTransactorSession) CompleteEndValidation(messageIndex uint32, setWeightMessageType bool) (*types.Transaction, error) { + return _ERC20TokenStakingManager.Contract.CompleteEndValidation(&_ERC20TokenStakingManager.TransactOpts, messageIndex, setWeightMessageType) +} + +// CompleteValidatorRegistration is a paid mutator transaction binding the contract method 0xa3a65e48. +// +// Solidity: function completeValidatorRegistration(uint32 messageIndex) returns() +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerTransactor) CompleteValidatorRegistration(opts *bind.TransactOpts, messageIndex uint32) (*types.Transaction, error) { + return _ERC20TokenStakingManager.contract.Transact(opts, "completeValidatorRegistration", messageIndex) +} + +// CompleteValidatorRegistration is a paid mutator transaction binding the contract method 0xa3a65e48. +// +// Solidity: function completeValidatorRegistration(uint32 messageIndex) returns() +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerSession) CompleteValidatorRegistration(messageIndex uint32) (*types.Transaction, error) { + return _ERC20TokenStakingManager.Contract.CompleteValidatorRegistration(&_ERC20TokenStakingManager.TransactOpts, messageIndex) +} + +// CompleteValidatorRegistration is a paid mutator transaction binding the contract method 0xa3a65e48. +// +// Solidity: function completeValidatorRegistration(uint32 messageIndex) returns() +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerTransactorSession) CompleteValidatorRegistration(messageIndex uint32) (*types.Transaction, error) { + return _ERC20TokenStakingManager.Contract.CompleteValidatorRegistration(&_ERC20TokenStakingManager.TransactOpts, messageIndex) +} + +// Initialize is a paid mutator transaction binding the contract method 0x5d0d7466. +// +// Solidity: function initialize((bytes32,bytes32,uint256,uint256,uint64,uint8,address) settings, address token) returns() +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerTransactor) Initialize(opts *bind.TransactOpts, settings StakingManagerSettings, token common.Address) (*types.Transaction, error) { + return _ERC20TokenStakingManager.contract.Transact(opts, "initialize", settings, token) +} + +// Initialize is a paid mutator transaction binding the contract method 0x5d0d7466. +// +// Solidity: function initialize((bytes32,bytes32,uint256,uint256,uint64,uint8,address) settings, address token) returns() +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerSession) Initialize(settings StakingManagerSettings, token common.Address) (*types.Transaction, error) { + return _ERC20TokenStakingManager.Contract.Initialize(&_ERC20TokenStakingManager.TransactOpts, settings, token) +} + +// Initialize is a paid mutator transaction binding the contract method 0x5d0d7466. +// +// Solidity: function initialize((bytes32,bytes32,uint256,uint256,uint64,uint8,address) settings, address token) returns() +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerTransactorSession) Initialize(settings StakingManagerSettings, token common.Address) (*types.Transaction, error) { + return _ERC20TokenStakingManager.Contract.Initialize(&_ERC20TokenStakingManager.TransactOpts, settings, token) +} + +// InitializeEndValidation is a paid mutator transaction binding the contract method 0x76f78621. +// +// Solidity: function initializeEndValidation(bytes32 validationID, bool includeUptimeProof, uint32 messageIndex) returns() +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerTransactor) InitializeEndValidation(opts *bind.TransactOpts, validationID [32]byte, includeUptimeProof bool, messageIndex uint32) (*types.Transaction, error) { + return _ERC20TokenStakingManager.contract.Transact(opts, "initializeEndValidation", validationID, includeUptimeProof, messageIndex) +} + +// InitializeEndValidation is a paid mutator transaction binding the contract method 0x76f78621. +// +// Solidity: function initializeEndValidation(bytes32 validationID, bool includeUptimeProof, uint32 messageIndex) returns() +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerSession) InitializeEndValidation(validationID [32]byte, includeUptimeProof bool, messageIndex uint32) (*types.Transaction, error) { + return _ERC20TokenStakingManager.Contract.InitializeEndValidation(&_ERC20TokenStakingManager.TransactOpts, validationID, includeUptimeProof, messageIndex) +} + +// InitializeEndValidation is a paid mutator transaction binding the contract method 0x76f78621. +// +// Solidity: function initializeEndValidation(bytes32 validationID, bool includeUptimeProof, uint32 messageIndex) returns() +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerTransactorSession) InitializeEndValidation(validationID [32]byte, includeUptimeProof bool, messageIndex uint32) (*types.Transaction, error) { + return _ERC20TokenStakingManager.Contract.InitializeEndValidation(&_ERC20TokenStakingManager.TransactOpts, validationID, includeUptimeProof, messageIndex) +} + +// InitializeValidatorRegistration is a paid mutator transaction binding the contract method 0x872fda64. +// +// Solidity: function initializeValidatorRegistration(uint256 stakeAmount, bytes32 nodeID, uint64 registrationExpiry, bytes signature) returns(bytes32 validationID) +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerTransactor) InitializeValidatorRegistration(opts *bind.TransactOpts, stakeAmount *big.Int, nodeID [32]byte, registrationExpiry uint64, signature []byte) (*types.Transaction, error) { + return _ERC20TokenStakingManager.contract.Transact(opts, "initializeValidatorRegistration", stakeAmount, nodeID, registrationExpiry, signature) +} + +// InitializeValidatorRegistration is a paid mutator transaction binding the contract method 0x872fda64. +// +// Solidity: function initializeValidatorRegistration(uint256 stakeAmount, bytes32 nodeID, uint64 registrationExpiry, bytes signature) returns(bytes32 validationID) +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerSession) InitializeValidatorRegistration(stakeAmount *big.Int, nodeID [32]byte, registrationExpiry uint64, signature []byte) (*types.Transaction, error) { + return _ERC20TokenStakingManager.Contract.InitializeValidatorRegistration(&_ERC20TokenStakingManager.TransactOpts, stakeAmount, nodeID, registrationExpiry, signature) +} + +// InitializeValidatorRegistration is a paid mutator transaction binding the contract method 0x872fda64. +// +// Solidity: function initializeValidatorRegistration(uint256 stakeAmount, bytes32 nodeID, uint64 registrationExpiry, bytes signature) returns(bytes32 validationID) +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerTransactorSession) InitializeValidatorRegistration(stakeAmount *big.Int, nodeID [32]byte, registrationExpiry uint64, signature []byte) (*types.Transaction, error) { + return _ERC20TokenStakingManager.Contract.InitializeValidatorRegistration(&_ERC20TokenStakingManager.TransactOpts, stakeAmount, nodeID, registrationExpiry, signature) +} + +// ResendEndValidatorMessage is a paid mutator transaction binding the contract method 0x0322ed98. +// +// Solidity: function resendEndValidatorMessage(bytes32 validationID) returns() +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerTransactor) ResendEndValidatorMessage(opts *bind.TransactOpts, validationID [32]byte) (*types.Transaction, error) { + return _ERC20TokenStakingManager.contract.Transact(opts, "resendEndValidatorMessage", validationID) +} + +// ResendEndValidatorMessage is a paid mutator transaction binding the contract method 0x0322ed98. +// +// Solidity: function resendEndValidatorMessage(bytes32 validationID) returns() +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerSession) ResendEndValidatorMessage(validationID [32]byte) (*types.Transaction, error) { + return _ERC20TokenStakingManager.Contract.ResendEndValidatorMessage(&_ERC20TokenStakingManager.TransactOpts, validationID) +} + +// ResendEndValidatorMessage is a paid mutator transaction binding the contract method 0x0322ed98. +// +// Solidity: function resendEndValidatorMessage(bytes32 validationID) returns() +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerTransactorSession) ResendEndValidatorMessage(validationID [32]byte) (*types.Transaction, error) { + return _ERC20TokenStakingManager.Contract.ResendEndValidatorMessage(&_ERC20TokenStakingManager.TransactOpts, validationID) +} + +// ResendRegisterValidatorMessage is a paid mutator transaction binding the contract method 0xbee0a03f. +// +// Solidity: function resendRegisterValidatorMessage(bytes32 validationID) returns() +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerTransactor) ResendRegisterValidatorMessage(opts *bind.TransactOpts, validationID [32]byte) (*types.Transaction, error) { + return _ERC20TokenStakingManager.contract.Transact(opts, "resendRegisterValidatorMessage", validationID) +} + +// ResendRegisterValidatorMessage is a paid mutator transaction binding the contract method 0xbee0a03f. +// +// Solidity: function resendRegisterValidatorMessage(bytes32 validationID) returns() +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerSession) ResendRegisterValidatorMessage(validationID [32]byte) (*types.Transaction, error) { + return _ERC20TokenStakingManager.Contract.ResendRegisterValidatorMessage(&_ERC20TokenStakingManager.TransactOpts, validationID) +} + +// ResendRegisterValidatorMessage is a paid mutator transaction binding the contract method 0xbee0a03f. +// +// Solidity: function resendRegisterValidatorMessage(bytes32 validationID) returns() +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerTransactorSession) ResendRegisterValidatorMessage(validationID [32]byte) (*types.Transaction, error) { + return _ERC20TokenStakingManager.Contract.ResendRegisterValidatorMessage(&_ERC20TokenStakingManager.TransactOpts, validationID) +} + +// ERC20TokenStakingManagerInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the ERC20TokenStakingManager contract. +type ERC20TokenStakingManagerInitializedIterator struct { + Event *ERC20TokenStakingManagerInitialized // 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 interfaces.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 *ERC20TokenStakingManagerInitializedIterator) 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(ERC20TokenStakingManagerInitialized) + 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(ERC20TokenStakingManagerInitialized) + 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 *ERC20TokenStakingManagerInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC20TokenStakingManagerInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC20TokenStakingManagerInitialized represents a Initialized event raised by the ERC20TokenStakingManager contract. +type ERC20TokenStakingManagerInitialized struct { + Version uint64 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInitialized is a free log retrieval operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. +// +// Solidity: event Initialized(uint64 version) +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerFilterer) FilterInitialized(opts *bind.FilterOpts) (*ERC20TokenStakingManagerInitializedIterator, error) { + + logs, sub, err := _ERC20TokenStakingManager.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &ERC20TokenStakingManagerInitializedIterator{contract: _ERC20TokenStakingManager.contract, event: "Initialized", logs: logs, sub: sub}, nil +} + +// WatchInitialized is a free log subscription operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. +// +// Solidity: event Initialized(uint64 version) +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *ERC20TokenStakingManagerInitialized) (event.Subscription, error) { + + logs, sub, err := _ERC20TokenStakingManager.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(ERC20TokenStakingManagerInitialized) + if err := _ERC20TokenStakingManager.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 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. +// +// Solidity: event Initialized(uint64 version) +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerFilterer) ParseInitialized(log types.Log) (*ERC20TokenStakingManagerInitialized, error) { + event := new(ERC20TokenStakingManagerInitialized) + if err := _ERC20TokenStakingManager.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// ERC20TokenStakingManagerValidationPeriodCreatedIterator is returned from FilterValidationPeriodCreated and is used to iterate over the raw logs and unpacked data for ValidationPeriodCreated events raised by the ERC20TokenStakingManager contract. +type ERC20TokenStakingManagerValidationPeriodCreatedIterator struct { + Event *ERC20TokenStakingManagerValidationPeriodCreated // 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 interfaces.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 *ERC20TokenStakingManagerValidationPeriodCreatedIterator) 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(ERC20TokenStakingManagerValidationPeriodCreated) + 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(ERC20TokenStakingManagerValidationPeriodCreated) + 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 *ERC20TokenStakingManagerValidationPeriodCreatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC20TokenStakingManagerValidationPeriodCreatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC20TokenStakingManagerValidationPeriodCreated represents a ValidationPeriodCreated event raised by the ERC20TokenStakingManager contract. +type ERC20TokenStakingManagerValidationPeriodCreated struct { + ValidationID [32]byte + NodeID [32]byte + RegisterValidationMessageID [32]byte + Weight *big.Int + RegistrationExpiry uint64 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterValidationPeriodCreated is a free log retrieval operation binding the contract event 0x79b81620b81daf2c08cd5bb3dbb79e75d2d7a87f52171fde5aadc8c47823026e. +// +// Solidity: event ValidationPeriodCreated(bytes32 indexed validationID, bytes32 indexed nodeID, bytes32 indexed registerValidationMessageID, uint256 weight, uint64 registrationExpiry) +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerFilterer) FilterValidationPeriodCreated(opts *bind.FilterOpts, validationID [][32]byte, nodeID [][32]byte, registerValidationMessageID [][32]byte) (*ERC20TokenStakingManagerValidationPeriodCreatedIterator, error) { + + var validationIDRule []interface{} + for _, validationIDItem := range validationID { + validationIDRule = append(validationIDRule, validationIDItem) + } + var nodeIDRule []interface{} + for _, nodeIDItem := range nodeID { + nodeIDRule = append(nodeIDRule, nodeIDItem) + } + var registerValidationMessageIDRule []interface{} + for _, registerValidationMessageIDItem := range registerValidationMessageID { + registerValidationMessageIDRule = append(registerValidationMessageIDRule, registerValidationMessageIDItem) + } + + logs, sub, err := _ERC20TokenStakingManager.contract.FilterLogs(opts, "ValidationPeriodCreated", validationIDRule, nodeIDRule, registerValidationMessageIDRule) + if err != nil { + return nil, err + } + return &ERC20TokenStakingManagerValidationPeriodCreatedIterator{contract: _ERC20TokenStakingManager.contract, event: "ValidationPeriodCreated", logs: logs, sub: sub}, nil +} + +// WatchValidationPeriodCreated is a free log subscription operation binding the contract event 0x79b81620b81daf2c08cd5bb3dbb79e75d2d7a87f52171fde5aadc8c47823026e. +// +// Solidity: event ValidationPeriodCreated(bytes32 indexed validationID, bytes32 indexed nodeID, bytes32 indexed registerValidationMessageID, uint256 weight, uint64 registrationExpiry) +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerFilterer) WatchValidationPeriodCreated(opts *bind.WatchOpts, sink chan<- *ERC20TokenStakingManagerValidationPeriodCreated, validationID [][32]byte, nodeID [][32]byte, registerValidationMessageID [][32]byte) (event.Subscription, error) { + + var validationIDRule []interface{} + for _, validationIDItem := range validationID { + validationIDRule = append(validationIDRule, validationIDItem) + } + var nodeIDRule []interface{} + for _, nodeIDItem := range nodeID { + nodeIDRule = append(nodeIDRule, nodeIDItem) + } + var registerValidationMessageIDRule []interface{} + for _, registerValidationMessageIDItem := range registerValidationMessageID { + registerValidationMessageIDRule = append(registerValidationMessageIDRule, registerValidationMessageIDItem) + } + + logs, sub, err := _ERC20TokenStakingManager.contract.WatchLogs(opts, "ValidationPeriodCreated", validationIDRule, nodeIDRule, registerValidationMessageIDRule) + 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(ERC20TokenStakingManagerValidationPeriodCreated) + if err := _ERC20TokenStakingManager.contract.UnpackLog(event, "ValidationPeriodCreated", 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 +} + +// ParseValidationPeriodCreated is a log parse operation binding the contract event 0x79b81620b81daf2c08cd5bb3dbb79e75d2d7a87f52171fde5aadc8c47823026e. +// +// Solidity: event ValidationPeriodCreated(bytes32 indexed validationID, bytes32 indexed nodeID, bytes32 indexed registerValidationMessageID, uint256 weight, uint64 registrationExpiry) +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerFilterer) ParseValidationPeriodCreated(log types.Log) (*ERC20TokenStakingManagerValidationPeriodCreated, error) { + event := new(ERC20TokenStakingManagerValidationPeriodCreated) + if err := _ERC20TokenStakingManager.contract.UnpackLog(event, "ValidationPeriodCreated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// ERC20TokenStakingManagerValidationPeriodEndedIterator is returned from FilterValidationPeriodEnded and is used to iterate over the raw logs and unpacked data for ValidationPeriodEnded events raised by the ERC20TokenStakingManager contract. +type ERC20TokenStakingManagerValidationPeriodEndedIterator struct { + Event *ERC20TokenStakingManagerValidationPeriodEnded // 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 interfaces.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 *ERC20TokenStakingManagerValidationPeriodEndedIterator) 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(ERC20TokenStakingManagerValidationPeriodEnded) + 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(ERC20TokenStakingManagerValidationPeriodEnded) + 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 *ERC20TokenStakingManagerValidationPeriodEndedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC20TokenStakingManagerValidationPeriodEndedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC20TokenStakingManagerValidationPeriodEnded represents a ValidationPeriodEnded event raised by the ERC20TokenStakingManager contract. +type ERC20TokenStakingManagerValidationPeriodEnded struct { + ValidationID [32]byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterValidationPeriodEnded is a free log retrieval operation binding the contract event 0x3532ad18e70a039beb4663d48c15acbef558c96ec9b8fd0cc3c0304f774740b8. +// +// Solidity: event ValidationPeriodEnded(bytes32 indexed validationID) +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerFilterer) FilterValidationPeriodEnded(opts *bind.FilterOpts, validationID [][32]byte) (*ERC20TokenStakingManagerValidationPeriodEndedIterator, error) { + + var validationIDRule []interface{} + for _, validationIDItem := range validationID { + validationIDRule = append(validationIDRule, validationIDItem) + } + + logs, sub, err := _ERC20TokenStakingManager.contract.FilterLogs(opts, "ValidationPeriodEnded", validationIDRule) + if err != nil { + return nil, err + } + return &ERC20TokenStakingManagerValidationPeriodEndedIterator{contract: _ERC20TokenStakingManager.contract, event: "ValidationPeriodEnded", logs: logs, sub: sub}, nil +} + +// WatchValidationPeriodEnded is a free log subscription operation binding the contract event 0x3532ad18e70a039beb4663d48c15acbef558c96ec9b8fd0cc3c0304f774740b8. +// +// Solidity: event ValidationPeriodEnded(bytes32 indexed validationID) +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerFilterer) WatchValidationPeriodEnded(opts *bind.WatchOpts, sink chan<- *ERC20TokenStakingManagerValidationPeriodEnded, validationID [][32]byte) (event.Subscription, error) { + + var validationIDRule []interface{} + for _, validationIDItem := range validationID { + validationIDRule = append(validationIDRule, validationIDItem) + } + + logs, sub, err := _ERC20TokenStakingManager.contract.WatchLogs(opts, "ValidationPeriodEnded", validationIDRule) + 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(ERC20TokenStakingManagerValidationPeriodEnded) + if err := _ERC20TokenStakingManager.contract.UnpackLog(event, "ValidationPeriodEnded", 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 +} + +// ParseValidationPeriodEnded is a log parse operation binding the contract event 0x3532ad18e70a039beb4663d48c15acbef558c96ec9b8fd0cc3c0304f774740b8. +// +// Solidity: event ValidationPeriodEnded(bytes32 indexed validationID) +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerFilterer) ParseValidationPeriodEnded(log types.Log) (*ERC20TokenStakingManagerValidationPeriodEnded, error) { + event := new(ERC20TokenStakingManagerValidationPeriodEnded) + if err := _ERC20TokenStakingManager.contract.UnpackLog(event, "ValidationPeriodEnded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// ERC20TokenStakingManagerValidationPeriodRegisteredIterator is returned from FilterValidationPeriodRegistered and is used to iterate over the raw logs and unpacked data for ValidationPeriodRegistered events raised by the ERC20TokenStakingManager contract. +type ERC20TokenStakingManagerValidationPeriodRegisteredIterator struct { + Event *ERC20TokenStakingManagerValidationPeriodRegistered // 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 interfaces.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 *ERC20TokenStakingManagerValidationPeriodRegisteredIterator) 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(ERC20TokenStakingManagerValidationPeriodRegistered) + 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(ERC20TokenStakingManagerValidationPeriodRegistered) + 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 *ERC20TokenStakingManagerValidationPeriodRegisteredIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC20TokenStakingManagerValidationPeriodRegisteredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC20TokenStakingManagerValidationPeriodRegistered represents a ValidationPeriodRegistered event raised by the ERC20TokenStakingManager contract. +type ERC20TokenStakingManagerValidationPeriodRegistered struct { + ValidationID [32]byte + StakeAmount *big.Int + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterValidationPeriodRegistered is a free log retrieval operation binding the contract event 0xf8fd1c90fb9cfa2ca2358fdf5806b086ad43315d92b221c929efc7f105ce7568. +// +// Solidity: event ValidationPeriodRegistered(bytes32 indexed validationID, uint256 stakeAmount, uint256 timestamp) +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerFilterer) FilterValidationPeriodRegistered(opts *bind.FilterOpts, validationID [][32]byte) (*ERC20TokenStakingManagerValidationPeriodRegisteredIterator, error) { + + var validationIDRule []interface{} + for _, validationIDItem := range validationID { + validationIDRule = append(validationIDRule, validationIDItem) + } + + logs, sub, err := _ERC20TokenStakingManager.contract.FilterLogs(opts, "ValidationPeriodRegistered", validationIDRule) + if err != nil { + return nil, err + } + return &ERC20TokenStakingManagerValidationPeriodRegisteredIterator{contract: _ERC20TokenStakingManager.contract, event: "ValidationPeriodRegistered", logs: logs, sub: sub}, nil +} + +// WatchValidationPeriodRegistered is a free log subscription operation binding the contract event 0xf8fd1c90fb9cfa2ca2358fdf5806b086ad43315d92b221c929efc7f105ce7568. +// +// Solidity: event ValidationPeriodRegistered(bytes32 indexed validationID, uint256 stakeAmount, uint256 timestamp) +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerFilterer) WatchValidationPeriodRegistered(opts *bind.WatchOpts, sink chan<- *ERC20TokenStakingManagerValidationPeriodRegistered, validationID [][32]byte) (event.Subscription, error) { + + var validationIDRule []interface{} + for _, validationIDItem := range validationID { + validationIDRule = append(validationIDRule, validationIDItem) + } + + logs, sub, err := _ERC20TokenStakingManager.contract.WatchLogs(opts, "ValidationPeriodRegistered", validationIDRule) + 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(ERC20TokenStakingManagerValidationPeriodRegistered) + if err := _ERC20TokenStakingManager.contract.UnpackLog(event, "ValidationPeriodRegistered", 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 +} + +// ParseValidationPeriodRegistered is a log parse operation binding the contract event 0xf8fd1c90fb9cfa2ca2358fdf5806b086ad43315d92b221c929efc7f105ce7568. +// +// Solidity: event ValidationPeriodRegistered(bytes32 indexed validationID, uint256 stakeAmount, uint256 timestamp) +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerFilterer) ParseValidationPeriodRegistered(log types.Log) (*ERC20TokenStakingManagerValidationPeriodRegistered, error) { + event := new(ERC20TokenStakingManagerValidationPeriodRegistered) + if err := _ERC20TokenStakingManager.contract.UnpackLog(event, "ValidationPeriodRegistered", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// ERC20TokenStakingManagerValidatorRemovalInitializedIterator is returned from FilterValidatorRemovalInitialized and is used to iterate over the raw logs and unpacked data for ValidatorRemovalInitialized events raised by the ERC20TokenStakingManager contract. +type ERC20TokenStakingManagerValidatorRemovalInitializedIterator struct { + Event *ERC20TokenStakingManagerValidatorRemovalInitialized // 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 interfaces.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 *ERC20TokenStakingManagerValidatorRemovalInitializedIterator) 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(ERC20TokenStakingManagerValidatorRemovalInitialized) + 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(ERC20TokenStakingManagerValidatorRemovalInitialized) + 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 *ERC20TokenStakingManagerValidatorRemovalInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC20TokenStakingManagerValidatorRemovalInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC20TokenStakingManagerValidatorRemovalInitialized represents a ValidatorRemovalInitialized event raised by the ERC20TokenStakingManager contract. +type ERC20TokenStakingManagerValidatorRemovalInitialized struct { + ValidationID [32]byte + SetWeightMessageID [32]byte + StakeAmount *big.Int + EndTime *big.Int + Uptime uint64 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterValidatorRemovalInitialized is a free log retrieval operation binding the contract event 0x530b908725650fb1052974f9df59e834fefac78c9ec2f00c6d2464d60cc6add5. +// +// Solidity: event ValidatorRemovalInitialized(bytes32 indexed validationID, bytes32 indexed setWeightMessageID, uint256 stakeAmount, uint256 endTime, uint64 uptime) +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerFilterer) FilterValidatorRemovalInitialized(opts *bind.FilterOpts, validationID [][32]byte, setWeightMessageID [][32]byte) (*ERC20TokenStakingManagerValidatorRemovalInitializedIterator, error) { + + var validationIDRule []interface{} + for _, validationIDItem := range validationID { + validationIDRule = append(validationIDRule, validationIDItem) + } + var setWeightMessageIDRule []interface{} + for _, setWeightMessageIDItem := range setWeightMessageID { + setWeightMessageIDRule = append(setWeightMessageIDRule, setWeightMessageIDItem) + } + + logs, sub, err := _ERC20TokenStakingManager.contract.FilterLogs(opts, "ValidatorRemovalInitialized", validationIDRule, setWeightMessageIDRule) + if err != nil { + return nil, err + } + return &ERC20TokenStakingManagerValidatorRemovalInitializedIterator{contract: _ERC20TokenStakingManager.contract, event: "ValidatorRemovalInitialized", logs: logs, sub: sub}, nil +} + +// WatchValidatorRemovalInitialized is a free log subscription operation binding the contract event 0x530b908725650fb1052974f9df59e834fefac78c9ec2f00c6d2464d60cc6add5. +// +// Solidity: event ValidatorRemovalInitialized(bytes32 indexed validationID, bytes32 indexed setWeightMessageID, uint256 stakeAmount, uint256 endTime, uint64 uptime) +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerFilterer) WatchValidatorRemovalInitialized(opts *bind.WatchOpts, sink chan<- *ERC20TokenStakingManagerValidatorRemovalInitialized, validationID [][32]byte, setWeightMessageID [][32]byte) (event.Subscription, error) { + + var validationIDRule []interface{} + for _, validationIDItem := range validationID { + validationIDRule = append(validationIDRule, validationIDItem) + } + var setWeightMessageIDRule []interface{} + for _, setWeightMessageIDItem := range setWeightMessageID { + setWeightMessageIDRule = append(setWeightMessageIDRule, setWeightMessageIDItem) + } + + logs, sub, err := _ERC20TokenStakingManager.contract.WatchLogs(opts, "ValidatorRemovalInitialized", validationIDRule, setWeightMessageIDRule) + 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(ERC20TokenStakingManagerValidatorRemovalInitialized) + if err := _ERC20TokenStakingManager.contract.UnpackLog(event, "ValidatorRemovalInitialized", 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 +} + +// ParseValidatorRemovalInitialized is a log parse operation binding the contract event 0x530b908725650fb1052974f9df59e834fefac78c9ec2f00c6d2464d60cc6add5. +// +// Solidity: event ValidatorRemovalInitialized(bytes32 indexed validationID, bytes32 indexed setWeightMessageID, uint256 stakeAmount, uint256 endTime, uint64 uptime) +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerFilterer) ParseValidatorRemovalInitialized(log types.Log) (*ERC20TokenStakingManagerValidatorRemovalInitialized, error) { + event := new(ERC20TokenStakingManagerValidatorRemovalInitialized) + if err := _ERC20TokenStakingManager.contract.UnpackLog(event, "ValidatorRemovalInitialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/abi-bindings/go/staking/NativeTokenStakingManager/NativeTokenStakingManager.go b/abi-bindings/go/staking/NativeTokenStakingManager/NativeTokenStakingManager.go index 89dca2386..0a045fe68 100644 --- a/abi-bindings/go/staking/NativeTokenStakingManager/NativeTokenStakingManager.go +++ b/abi-bindings/go/staking/NativeTokenStakingManager/NativeTokenStakingManager.go @@ -29,12 +29,6 @@ var ( _ = abi.ConvertType ) -// InitialStakerInfo is an auto generated low-level Go binding around an user-defined struct. -type InitialStakerInfo struct { - ValidationInfo StakingMessagesValidationInfo - Owner common.Address -} - // StakingManagerSettings is an auto generated low-level Go binding around an user-defined struct. type StakingManagerSettings struct { PChainBlockchainID [32]byte @@ -43,23 +37,13 @@ type StakingManagerSettings struct { MaximumStakeAmount *big.Int MinimumStakeDuration uint64 MaximumHourlyChurn uint8 - InitialStakers []InitialStakerInfo RewardCalculator common.Address } -// StakingMessagesValidationInfo is an auto generated low-level Go binding around an user-defined struct. -type StakingMessagesValidationInfo struct { - SubnetID [32]byte - NodeID [32]byte - Weight uint64 - RegistrationExpiry uint64 - Signature []byte -} - // NativeTokenStakingManagerMetaData contains all meta data concerning the NativeTokenStakingManager contract. var NativeTokenStakingManagerMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"init\",\"type\":\"uint8\",\"internalType\":\"enumICMInitializable\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"WARP_MESSENGER\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIWarpMessenger\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"completeEndValidation\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"setWeightMessageType\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"completeValidatorRegistration\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"settings\",\"type\":\"tuple\",\"internalType\":\"structStakingManagerSettings\",\"components\":[{\"name\":\"pChainBlockchainID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"subnetID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"minimumStakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"maximumStakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"minimumStakeDuration\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"maximumHourlyChurn\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"initialStakers\",\"type\":\"tuple[]\",\"internalType\":\"structInitialStakerInfo[]\",\"components\":[{\"name\":\"validationInfo\",\"type\":\"tuple\",\"internalType\":\"structStakingMessages.ValidationInfo\",\"components\":[{\"name\":\"subnetID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"nodeID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"weight\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"name\":\"rewardCalculator\",\"type\":\"address\",\"internalType\":\"contractIRewardCalculator\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeEndValidation\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"includeUptimeProof\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeValidatorRegistration\",\"inputs\":[{\"name\":\"nodeID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"resendEndValidatorMessage\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"resendRegisterValidatorMessage\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"valueToWeight\",\"inputs\":[{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"weightToValue\",\"inputs\":[{\"name\":\"weight\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"pure\"},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodCreated\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"nodeID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"registerValidationMessageID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"weight\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodEnded\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodRegistered\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"stakeAmount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"timestamp\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidatorRemovalInitialized\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"setWeightMessageID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"stakeAmount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"endTime\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"uptime\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ReentrancyGuardReentrantCall\",\"inputs\":[]}]", - Bin: "0x608060405234801561000f575f80fd5b5060405161302038038061302083398101604081905261002e91610107565b60018160018111156100425761004261012c565b0361004f5761004f610055565b50610140565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156100a55760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146101045780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b5f60208284031215610117575f80fd5b815160028110610125575f80fd5b9392505050565b634e487b7160e01b5f52602160045260245ffd5b612ed38061014d5f395ff3fe60806040526004361061008f575f3560e01c8063a3a65e4811610057578063a3a65e481461015b578063b771b3bc1461017a578063bee0a03f146101ac578063f40797d7146101cb578063fdf94a1a146101de575f80fd5b80630322ed98146100935780631a0d36fe146100b45780632e2194d8146100d3578063620658561461010f57806376f786211461013c575b5f80fd5b34801561009e575f80fd5b506100b26100ad3660046125d3565b6101fd565b005b3480156100bf575f80fd5b506100b26100ce3660046125ea565b6103f3565b3480156100de575f80fd5b506100f26100ed3660046125d3565b6104ff565b6040516001600160401b0390911681526020015b60405180910390f35b34801561011a575f80fd5b5061012e610129366004612643565b610515565b604051908152602001610106565b348015610147575f80fd5b506100b261015636600461267c565b61052e565b348015610166575f80fd5b506100b26101753660046126b7565b610aae565b348015610185575f80fd5b506101946005600160991b0181565b6040516001600160a01b039091168152602001610106565b3480156101b7575f80fd5b506100b26101c63660046125d3565b610d36565b61012e6101d9366004612762565b610e4a565b3480156101e9575f80fd5b506100b26101f83660046127f4565b610e5f565b5f8181527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab60860205260408082208151610120810190925280545f80516020612ea783398151915293929190829060ff16600581111561025e5761025e612829565b600581111561026f5761026f612829565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003928301546001600160a01b03811660c084015260ff600160a01b820416151560e0840152600160a81b900416610100909101529091508151600581111561030657610306612829565b1461036e5760405162461bcd60e51b815260206004820152602d60248201527f5374616b696e674d616e616765723a2056616c696461746f72206e6f7420706560448201526c1b991a5b99c81c995b5bdd985b609a1b60648201526084015b60405180910390fd5b5f61037f848361010001515f611286565b60405163ee5b48eb60e01b81529091506005600160991b019063ee5b48eb906103ac90849060040161285f565b6020604051808303815f875af11580156103c8573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103ec9190612891565b5050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff1615906001600160401b03165f811580156104375750825b90505f826001600160401b031660011480156104525750303b155b905081158015610460575080155b1561047e5760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff1916600117855583156104a857845460ff60401b1916600160401b1785555b6104b186611448565b83156104f757845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050565b5f61050f64e8d4a51000836128d0565b92915050565b5f61050f6001600160401b03831664e8d4a510006128e3565b5f8381527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab60860205260408082208151610120810190925280545f80516020612ea783398151915293929190829060ff16600581111561058f5761058f612829565b60058111156105a0576105a0612829565b8152600182015460208201526002808301546001600160401b038082166040850152600160401b820481166060850152600160801b820481166080850152600160c01b909104811660a08401526003909301546001600160a01b03811660c084015260ff600160a01b820416151560e0840152600160a81b9004909216610100909101529091508151600581111561063a5761063a612829565b146106935760405162461bcd60e51b8152602060048201526024808201527f5374616b696e674d616e616765723a2056616c696461746f72206e6f742061636044820152637469766560e01b6064820152608401610365565b60c08101516001600160a01b0316336001600160a01b0316146106c85760405162461bcd60e51b8152600401610365906128fa565b6106d5816040015161146c565b60038152426001600160401b031660808201525f84156108ae576040516306f8253560e41b815263ffffffff851660048201525f9081906005600160991b0190636f825350906024015f60405180830381865afa158015610738573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f1916820160405261075f9190810190612963565b91509150806107805760405162461bcd60e51b815260040161036590612a35565b6005600160991b016001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107c3573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107e79190612891565b8251146108065760405162461bcd60e51b815260040161036590612a79565b60208201516001600160a01b0316156108315760405162461bcd60e51b815260040161036590612ac0565b5f806108408460400151611650565b91509150818a146108a85760405162461bcd60e51b815260206004820152602c60248201527f5374616b696e674d616e616765723a20496e76616c696420757074696d65207660448201526b185b1a59185d1a5bdb88125160a21b6064820152608401610365565b93505050505b6001600160401b03811660a08301525f86815260088401602052604090208251815484929190829060ff191660018360058111156108ee576108ee612829565b02179055506020820151600182015560408201516002820180546060850151608086015160a08701516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c08301516003909201805460e0850151610100958601516001600160a01b039095166001600160a81b031990921691909117600160a01b911515919091021767ffffffffffffffff60a81b1916600160a81b93909216929092021790558201515f906109df90889083611286565b60405163ee5b48eb60e01b81529091505f906005600160991b019063ee5b48eb90610a0e90859060040161285f565b6020604051808303815f875af1158015610a2a573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a4e9190612891565b60408581015181516001600160401b03918216815242602082015290861681830152905191925082918a917f530b908725650fb1052974f9df59e834fefac78c9ec2f00c6d2464d60cc6add5919081900360600190a35050505050505050565b5f5f80516020612ea78339815191526040516306f8253560e41b815263ffffffff841660048201529091505f9081906005600160991b0190636f825350906024015f60405180830381865afa158015610b09573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052610b309190810190612963565b9150915080610b515760405162461bcd60e51b815260040161036590612a35565b8254825114610b725760405162461bcd60e51b815260040161036590612a79565b60208201516001600160a01b031615610b9d5760405162461bcd60e51b815260040161036590612ac0565b5f80610bac84604001516117ab565b9150915080610c0c5760405162461bcd60e51b815260206004820152602660248201527f5374616b696e674d616e616765723a20526567697374726174696f6e206e6f74604482015265081d985b1a5960d21b6064820152608401610365565b5f82815260078601602052604081208054610c2690612b0d565b9050118015610c58575060015f83815260088701602052604090205460ff166005811115610c5657610c56612829565b145b610c745760405162461bcd60e51b815260040161036590612b45565b5f8281526007860160205260408120610c8c91612589565b5f8281526008860160208181526040808420805460ff191660029081178255810180546001600160401b0342818116600160401b0267ffffffffffffffff60401b19909316929092178355600190930154875260098c0185528387208990559588905293835292548151931683529082019290925283917ff8fd1c90fb9cfa2ca2358fdf5806b086ad43315d92b221c929efc7f105ce7568910160405180910390a2505050505050565b5f8181527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6076020526040812080545f80516020612ea7833981519152929190610d7e90612b0d565b9050118015610db0575060015f83815260088301602052604090205460ff166005811115610dae57610dae612829565b145b610dcc5760405162461bcd60e51b815260040161036590612b45565b5f82815260078201602052604090819020905163ee5b48eb60e01b81526005600160991b019163ee5b48eb91610e059190600401612b8a565b6020604051808303815f875af1158015610e21573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e459190612891565b505050565b5f610e57843485856118cf565b949350505050565b5f5f80516020612ea78339815191526040516306f8253560e41b815263ffffffff851660048201529091505f9081906005600160991b0190636f825350906024015f60405180830381865afa158015610eba573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052610ee19190810190612963565b9150915080610f025760405162461bcd60e51b815260040161036590612a35565b5f8415610f7b575f610f178460400151611dd1565b919350909150506001600160401b03811615610f755760405162461bcd60e51b815260206004820181905260248201527f5374616b696e674d616e616765723a20576569676874206d75737420626520306044820152606401610365565b50610fef565b5f610f8984604001516117ab565b90925090508015610fed5760405162461bcd60e51b815260206004820152602860248201527f5374616b696e674d616e616765723a20526567697374726174696f6e207374696044820152671b1b081d985b1a5960c21b6064820152608401610365565b505b5f818152600885016020526040808220815161012081019092528054829060ff16600581111561102157611021612829565b600581111561103257611032612829565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003909201546001600160a01b0380821660c080850191909152600160a01b830460ff16151560e0850152600160a81b909204909316610100909201919091528201519192501633146110e35760405162461bcd60e51b8152600401610365906128fa565b5f6003825160058111156110f9576110f9612829565b1480611117575060028251600581111561111557611115612829565b145b1561113a57506020808201515f908152600987019091526040812055600461113e565b5060055b5f83815260088701602052604090208251815484929190829060ff1916600183600581111561116f5761116f612829565b0217905550602082015160018201556040808301516002830180546060860151608087015160a08801516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c08401516003909301805460e0860151610100909601516001600160a01b039095166001600160a81b031990911617600160a01b951515959095029490941767ffffffffffffffff60a81b1916600160a81b9390911692909202919091179091555183907f3532ad18e70a039beb4663d48c15acbef558c96ec9b8fd0cc3c0304f774740b8905f90a25050505050505050565b60408051603480825260608281019093525f91906020820181803683370190505090505f5b6004811015611307576112bf816003612c14565b6112ca9060086128e3565b600263ffffffff16901c60f81b8282815181106112e9576112e9612c27565b60200101906001600160f81b03191690815f1a9053506001016112ab565b505f5b60208110156113695761131e81601f612c14565b6113299060086128e3565b86901c60f81b8261133b836004612c3b565b8151811061134b5761134b612c27565b60200101906001600160f81b03191690815f1a90535060010161130a565b505f5b60088110156113d457611380816007612c14565b61138b9060086128e3565b6001600160401b038616901c60f81b826113a6836024612c3b565b815181106113b6576113b6612c27565b60200101906001600160f81b03191690815f1a90535060010161136c565b505f5b600881101561143f576113eb816007612c14565b6113f69060086128e3565b6001600160401b038516901c60f81b8261141183602c612c3b565b8151811061142157611421612c27565b60200101906001600160f81b03191690815f1a9053506001016113d7565b50949350505050565b611450611f8f565b611458611fda565b611460611fea565b61146981611ff2565b50565b7fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab604545f80516020612ea783398151915290600160e01b900460ff165f036114b1575050565b6005810180544290610e10906114c79083612c14565b106114fb5760018201805467ffffffffffffffff60401b1916600160401b6001600160401b03871602179055808255611546565b838260010160088282829054906101000a90046001600160401b03166115219190612c4e565b92506101000a8154816001600160401b0302191690836001600160401b031602179055505b60018201545f906001600160401b038082169161156d91600160401b909104166064612c75565b6115779190612ca0565b600485015490915060ff600160e01b909104811690821611156115f75760405162461bcd60e51b815260206004820152603260248201527f5374616b696e674d616e616765723a204d6178696d756d20686f75726c7920636044820152711a1d5c9b881c985d1948195e18d95959195960721b6064820152608401610365565b5050805460058301556001018054600690920180546001600160401b0393841667ffffffffffffffff1982168117835592546001600160801b0319909116909217600160401b9283900490931690910291909117905550565b5f808251602c146116735760405162461bcd60e51b815260040161036590612cc5565b5f805b60048110156116c45761168a816003612c14565b6116959060086128e3565b63ffffffff168582815181106116ad576116ad612c27565b016020015160f81c901b9190911790600101611676565b5063ffffffff81166003146116eb5760405162461bcd60e51b815260040161036590612d0c565b5f805b60208110156117405761170281601f612c14565b61170d9060086128e3565b86611719836004612c3b565b8151811061172957611729612c27565b016020015160f81c901b91909117906001016116ee565b505f805b600881101561179f57611758816007612c14565b6117639060086128e3565b6001600160401b031687611778836024612c3b565b8151811061178857611788612c27565b016020015160f81c901b9190911790600101611744565b50909590945092505050565b5f8082516025146117ce5760405162461bcd60e51b815260040161036590612cc5565b5f805b600481101561181f576117e5816003612c14565b6117f09060086128e3565b63ffffffff1685828151811061180857611808612c27565b016020015160f81c901b91909117906001016117d1565b5063ffffffff81166001146118465760405162461bcd60e51b815260040161036590612d0c565b5f805b602081101561189b5761185d81601f612c14565b6118689060086128e3565b86611874836004612c3b565b8151811061188457611884612c27565b016020015160f81c901b9190911790600101611849565b505f856024815181106118b0576118b0612c27565b016020015191966001600160f81b031990921615159550909350505050565b5f6118d8612123565b5f80516020612ea7833981519152426001600160401b03851611801561191257506001600160401b038416611910426202a300612c3b565b115b6119725760405162461bcd60e51b815260206004820152602b60248201527f5374616b696e674d616e616765723a20496e76616c696420726567697374726160448201526a74696f6e2065787069727960a81b6064820152608401610365565b856119bf5760405162461bcd60e51b815260206004820152601f60248201527f5374616b696e674d616e616765723a20496e76616c6964206e6f6465204944006044820152606401610365565b5f86815260098201602052604090205415611a2b5760405162461bcd60e51b815260206004820152602660248201527f5374616b696e674d616e616765723a204e6f646520494420616c72656164792060448201526561637469766560d01b6064820152608401610365565b8251604014611a8d5760405162461bcd60e51b815260206004820152602860248201527f5374616b696e674d616e616765723a20496e76616c6964207369676e617475726044820152670ca40d8cadccee8d60c31b6064820152608401610365565b845f611a98826104ff565b9050611aa38161146c565b8260020154816001600160401b031610158015611acd57508260030154816001600160401b031611155b611b255760405162461bcd60e51b8152602060048201526024808201527f5374616b696e674d616e616765723a20496e76616c6964207374616b6520616d6044820152631bdd5b9d60e21b6064820152608401610365565b5f80611b6c6040518060a00160405280876001015481526020018c8152602001856001600160401b031681526020018a6001600160401b031681526020018981525061216d565b5f82815260078801602052604090209193509150611b8a8282612d95565b5060405163ee5b48eb60e01b81525f906005600160991b019063ee5b48eb90611bb790859060040161285f565b6020604051808303815f875af1158015611bd3573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611bf79190612891565b6040805161012081019091529091508060018152602081018d90526001600160401b03861660408201525f606082018190526080820181905260a082015260c001336001600160a01b031681525f6020808301829052604092830182905286825260088a0190522081518154829060ff19166001836005811115611c7d57611c7d612829565b021790555060208281015160018301556040808401516002840180546060870151608088015160a08901516001600160401b03908116600160c01b026001600160c01b03928216600160801b02929092166001600160801b03938216600160401b026001600160801b03199095169682169690961793909317919091169390931792909217905560c08501516003909401805460e0870151610100909701518316600160a81b0267ffffffffffffffff60a81b19971515600160a01b026001600160a81b03199092166001600160a01b039097169690961717959095169390931790935582518783168152918c169082015282918d9186917f79b81620b81daf2c08cd5bb3dbb79e75d2d7a87f52171fde5aadc8c47823026e910160405180910390a45090945050505050610e5760017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b5f805f8351603414611df55760405162461bcd60e51b815260040161036590612cc5565b5f805b6004811015611e4657611e0c816003612c14565b611e179060086128e3565b63ffffffff16868281518110611e2f57611e2f612c27565b016020015160f81c901b9190911790600101611df8565b5063ffffffff8116600214611e6d5760405162461bcd60e51b815260040161036590612d0c565b5f805b6020811015611ec257611e8481601f612c14565b611e8f9060086128e3565b87611e9b836004612c3b565b81518110611eab57611eab612c27565b016020015160f81c901b9190911790600101611e70565b505f805b6008811015611f2157611eda816007612c14565b611ee59060086128e3565b6001600160401b031688611efa836024612c3b565b81518110611f0a57611f0a612c27565b016020015160f81c901b9190911790600101611ec6565b505f805b6008811015611f8057611f39816007612c14565b611f449060086128e3565b6001600160401b031689611f5983602c612c3b565b81518110611f6957611f69612c27565b016020015160f81c901b9190911790600101611f25565b50919790965090945092505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff16611fd857604051631afcd79f60e31b815260040160405180910390fd5b565b611fe2611f8f565b611fd861229b565b611fd8611f8f565b611ffa611f8f565b80355f80516020612ea783398151915290815560208201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6015560408201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6025560608201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6035561209260a0830160808401612643565b60048201805467ffffffffffffffff19166001600160401b03929092169190911790556120c560c0830160a08401612e50565b60048201805460ff92909216600160e01b0260ff60e01b199092169190911790556120f7610100830160e08401612e70565b8160040160086101000a8154816001600160a01b0302191690836001600160a01b031602179055505050565b7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0080546001190161216757604051633ee5aeb560e01b815260040160405180910390fd5b60029055565b5f60605f8061217b856122a3565b60408051609480825260c082019092529294509092505f91906020820181803683370190505090505f5b6004811015612201576121b9816003612c14565b6121c49060086128e3565b600163ffffffff16901c60f81b8282815181106121e3576121e3612c27565b60200101906001600160f81b03191690815f1a9053506001016121a5565b505f5b60908110156122685782818151811061221f5761221f612c27565b01602001516001600160f81b0319168261223a836004612c3b565b8151811061224a5761224a612c27565b60200101906001600160f81b03191690815f1a905350600101612204565b5091959194509092505050565b60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b612275611f8f565b5f606082608001515160401461230d5760405162461bcd60e51b815260206004820152602960248201527f5374616b696e674d657373616765733a20496e76616c6964207369676e6174756044820152680e4ca40d8cadccee8d60bb1b6064820152608401610365565b60408051609080825260c082019092525f916020820181803683370190505090505f5b6020811015612380578451816020811061234c5761234c612c27565b1a60f81b82828151811061236257612362612c27565b60200101906001600160f81b03191690815f1a905350600101612330565b505f5b60208110156123e057846020015181602081106123a2576123a2612c27565b1a60f81b826123b2836020612c3b565b815181106123c2576123c2612c27565b60200101906001600160f81b03191690815f1a905350600101612383565b505f5b6008811015612454576123f7816007612c14565b6124029060086128e3565b60ff1685604001516001600160401b0316901c60f81b828260406124269190612c3b565b8151811061243657612436612c27565b60200101906001600160f81b03191690815f1a9053506001016123e3565b505f5b60088110156124c65761246b816007612c14565b6124769060086128e3565b60608601516001600160401b0390811691161c60f81b82612498836048612c3b565b815181106124a8576124a8612c27565b60200101906001600160f81b03191690815f1a905350600101612457565b505f5b604081101561253157846080015181815181106124e8576124e8612c27565b01602001516001600160f81b03191682612503836050612c3b565b8151811061251357612513612c27565b60200101906001600160f81b03191690815f1a9053506001016124c9565b506002816040516125429190612e8b565b602060405180830381855afa15801561255d573d5f803e3d5ffd5b5050506040513d601f19601f820116820180604052508101906125809190612891565b94909350915050565b50805461259590612b0d565b5f825580601f106125a4575050565b601f0160209004905f5260205f209081019061146991905b808211156125cf575f81556001016125bc565b5090565b5f602082840312156125e3575f80fd5b5035919050565b5f602082840312156125fa575f80fd5b81356001600160401b0381111561260f575f80fd5b82016101008185031215612621575f80fd5b9392505050565b80356001600160401b038116811461263e575f80fd5b919050565b5f60208284031215612653575f80fd5b61262182612628565b8015158114611469575f80fd5b803563ffffffff8116811461263e575f80fd5b5f805f6060848603121561268e575f80fd5b8335925060208401356126a08161265c565b91506126ae60408501612669565b90509250925092565b5f602082840312156126c7575f80fd5b61262182612669565b634e487b7160e01b5f52604160045260245ffd5b604051606081016001600160401b0381118282101715612706576127066126d0565b60405290565b604051601f8201601f191681016001600160401b0381118282101715612734576127346126d0565b604052919050565b5f6001600160401b03821115612754576127546126d0565b50601f01601f191660200190565b5f805f60608486031215612774575f80fd5b8335925061278460208501612628565b915060408401356001600160401b0381111561279e575f80fd5b8401601f810186136127ae575f80fd5b80356127c16127bc8261273c565b61270c565b8181528760208385010111156127d5575f80fd5b816020840160208301375f602083830101528093505050509250925092565b5f8060408385031215612805575f80fd5b61280e83612669565b9150602083013561281e8161265c565b809150509250929050565b634e487b7160e01b5f52602160045260245ffd5b5f5b8381101561285757818101518382015260200161283f565b50505f910152565b602081525f825180602084015261287d81604085016020870161283d565b601f01601f19169190910160400192915050565b5f602082840312156128a1575f80fd5b5051919050565b634e487b7160e01b5f52601260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b5f826128de576128de6128a8565b500490565b808202811582820484141761050f5761050f6128bc565b6020808252602a908201527f5374616b696e674d616e616765723a2053656e646572206e6f742076616c696460408201526930ba37b91037bbb732b960b11b606082015260800190565b6001600160a01b0381168114611469575f80fd5b805161263e8161265c565b5f8060408385031215612974575f80fd5b82516001600160401b038082111561298a575f80fd5b908401906060828703121561299d575f80fd5b6129a56126e4565b825181526020808401516129b881612944565b828201526040840151838111156129cd575f80fd5b80850194505087601f8501126129e1575f80fd5b835192506129f16127bc8461273c565b8381528882858701011115612a04575f80fd5b612a138483830184880161283d565b80604084015250819550612a28818801612958565b9450505050509250929050565b60208082526024908201527f5374616b696e674d616e616765723a20496e76616c69642077617270206d65736040820152637361676560e01b606082015260800190565b60208082526027908201527f5374616b696e674d616e616765723a20496e76616c696420736f7572636520636040820152661a185a5b88125160ca1b606082015260800190565b6020808252602d908201527f5374616b696e674d616e616765723a20496e76616c6964206f726967696e207360408201526c656e646572206164647265737360981b606082015260800190565b600181811c90821680612b2157607f821691505b602082108103612b3f57634e487b7160e01b5f52602260045260245ffd5b50919050565b60208082526025908201527f5374616b696e674d616e616765723a20496e76616c69642076616c69646174696040820152641bdb88125160da1b606082015260800190565b5f60208083525f8454612b9c81612b0d565b806020870152604060018084165f8114612bbd5760018114612bd957612c06565b60ff19851660408a0152604084151560051b8a01019550612c06565b895f5260205f205f5b85811015612bfd5781548b8201860152908301908801612be2565b8a016040019650505b509398975050505050505050565b8181038181111561050f5761050f6128bc565b634e487b7160e01b5f52603260045260245ffd5b8082018082111561050f5761050f6128bc565b6001600160401b03818116838216019080821115612c6e57612c6e6128bc565b5092915050565b6001600160401b03818116838216028082169190828114612c9857612c986128bc565b505092915050565b5f6001600160401b0380841680612cb957612cb96128a8565b92169190910492915050565b60208082526027908201527f5374616b696e674d657373616765733a20496e76616c6964206d657373616765604082015266040d8cadccee8d60cb1b606082015260800190565b60208082526025908201527f5374616b696e674d657373616765733a20496e76616c6964206d657373616765604082015264207479706560d81b606082015260800190565b601f821115610e4557805f5260205f20601f840160051c81016020851015612d765750805b601f840160051c820191505b818110156103ec575f8155600101612d82565b81516001600160401b03811115612dae57612dae6126d0565b612dc281612dbc8454612b0d565b84612d51565b602080601f831160018114612df5575f8415612dde5750858301515b5f19600386901b1c1916600185901b1785556104f7565b5f85815260208120601f198616915b82811015612e2357888601518255948401946001909101908401612e04565b5085821015612e4057878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b5f60208284031215612e60575f80fd5b813560ff81168114612621575f80fd5b5f60208284031215612e80575f80fd5b813561262181612944565b5f8251612e9c81846020870161283d565b919091019291505056feafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab600a164736f6c6343000819000a", + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"init\",\"type\":\"uint8\",\"internalType\":\"enumICMInitializable\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"WARP_MESSENGER\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIWarpMessenger\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"completeEndValidation\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"setWeightMessageType\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"completeValidatorRegistration\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"settings\",\"type\":\"tuple\",\"internalType\":\"structStakingManagerSettings\",\"components\":[{\"name\":\"pChainBlockchainID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"subnetID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"minimumStakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"maximumStakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"minimumStakeDuration\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"maximumHourlyChurn\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"rewardCalculator\",\"type\":\"address\",\"internalType\":\"contractIRewardCalculator\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeEndValidation\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"includeUptimeProof\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeValidatorRegistration\",\"inputs\":[{\"name\":\"nodeID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"resendEndValidatorMessage\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"resendRegisterValidatorMessage\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"valueToWeight\",\"inputs\":[{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"weightToValue\",\"inputs\":[{\"name\":\"weight\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"pure\"},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodCreated\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"nodeID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"registerValidationMessageID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"weight\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodEnded\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodRegistered\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"stakeAmount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"timestamp\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidatorRemovalInitialized\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"setWeightMessageID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"stakeAmount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"endTime\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"uptime\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ReentrancyGuardReentrantCall\",\"inputs\":[]}]", + Bin: "0x608060405234801561000f575f80fd5b50604051612fd7380380612fd783398101604081905261002e91610107565b60018160018111156100425761004261012c565b0361004f5761004f610055565b50610140565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156100a55760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146101045780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b5f60208284031215610117575f80fd5b815160028110610125575f80fd5b9392505050565b634e487b7160e01b5f52602160045260245ffd5b612e8a8061014d5f395ff3fe60806040526004361061008f575f3560e01c8063a3a65e4811610057578063a3a65e481461015b578063b771b3bc1461017a578063bee0a03f146101ac578063f40797d7146101cb578063fdf94a1a146101de575f80fd5b80630322ed98146100935780632e2194d8146100b457806362065856146100f057806376f786211461011d57806379f54eb11461013c575b5f80fd5b34801561009e575f80fd5b506100b26100ad3660046125b1565b6101fd565b005b3480156100bf575f80fd5b506100d36100ce3660046125b1565b6103f3565b6040516001600160401b0390911681526020015b60405180910390f35b3480156100fb575f80fd5b5061010f61010a3660046125e3565b610409565b6040519081526020016100e7565b348015610128575f80fd5b506100b2610137366004612623565b610422565b348015610147575f80fd5b506100b261015636600461265e565b6109a2565b348015610166575f80fd5b506100b2610175366004612674565b610aae565b348015610185575f80fd5b506101946005600160991b0181565b6040516001600160a01b0390911681526020016100e7565b3480156101b7575f80fd5b506100b26101c63660046125b1565b610d3b565b61010f6101d936600461271f565b610e4f565b3480156101e9575f80fd5b506100b26101f83660046127b1565b610e64565b5f8181527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab60860205260408082208151610120810190925280545f80516020612e5e83398151915293929190829060ff16600581111561025e5761025e6127e6565b600581111561026f5761026f6127e6565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003928301546001600160a01b03811660c084015260ff600160a01b820416151560e0840152600160a81b9004166101009091015290915081516005811115610306576103066127e6565b1461036e5760405162461bcd60e51b815260206004820152602d60248201527f5374616b696e674d616e616765723a2056616c696461746f72206e6f7420706560448201526c1b991a5b99c81c995b5bdd985b609a1b60648201526084015b60405180910390fd5b5f61037f848361010001515f61128b565b60405163ee5b48eb60e01b81529091506005600160991b019063ee5b48eb906103ac90849060040161281c565b6020604051808303815f875af11580156103c8573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103ec919061284e565b5050505050565b5f61040364e8d4a510008361288d565b92915050565b5f6104036001600160401b03831664e8d4a510006128a0565b5f8381527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab60860205260408082208151610120810190925280545f80516020612e5e83398151915293929190829060ff166005811115610483576104836127e6565b6005811115610494576104946127e6565b8152600182015460208201526002808301546001600160401b038082166040850152600160401b820481166060850152600160801b820481166080850152600160c01b909104811660a08401526003909301546001600160a01b03811660c084015260ff600160a01b820416151560e0840152600160a81b9004909216610100909101529091508151600581111561052e5761052e6127e6565b146105875760405162461bcd60e51b8152602060048201526024808201527f5374616b696e674d616e616765723a2056616c696461746f72206e6f742061636044820152637469766560e01b6064820152608401610365565b60c08101516001600160a01b0316336001600160a01b0316146105bc5760405162461bcd60e51b8152600401610365906128b7565b6105c9816040015161144d565b60038152426001600160401b031660808201525f84156107a2576040516306f8253560e41b815263ffffffff851660048201525f9081906005600160991b0190636f825350906024015f60405180830381865afa15801561062c573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f191682016040526106539190810190612920565b91509150806106745760405162461bcd60e51b8152600401610365906129f2565b6005600160991b016001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106b7573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106db919061284e565b8251146106fa5760405162461bcd60e51b815260040161036590612a36565b60208201516001600160a01b0316156107255760405162461bcd60e51b815260040161036590612a7d565b5f8061073484604001516115fa565b91509150818a1461079c5760405162461bcd60e51b815260206004820152602c60248201527f5374616b696e674d616e616765723a20496e76616c696420757074696d65207660448201526b185b1a59185d1a5bdb88125160a21b6064820152608401610365565b93505050505b6001600160401b03811660a08301525f86815260088401602052604090208251815484929190829060ff191660018360058111156107e2576107e26127e6565b02179055506020820151600182015560408201516002820180546060850151608086015160a08701516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c08301516003909201805460e0850151610100958601516001600160a01b039095166001600160a81b031990921691909117600160a01b911515919091021767ffffffffffffffff60a81b1916600160a81b93909216929092021790558201515f906108d39088908361128b565b60405163ee5b48eb60e01b81529091505f906005600160991b019063ee5b48eb9061090290859060040161281c565b6020604051808303815f875af115801561091e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610942919061284e565b60408581015181516001600160401b03918216815242602082015290861681830152905191925082918a917f530b908725650fb1052974f9df59e834fefac78c9ec2f00c6d2464d60cc6add5919081900360600190a35050505050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff1615906001600160401b03165f811580156109e65750825b90505f826001600160401b03166001148015610a015750303b155b905081158015610a0f575080155b15610a2d5760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff191660011785558315610a5757845460ff60401b1916600160401b1785555b610a6086611755565b8315610aa657845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050565b5f5f80516020612e5e8339815191526040516306f8253560e41b815263ffffffff841660048201529091505f9081906005600160991b0190636f825350906024015f60405180830381865afa158015610b09573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052610b309190810190612920565b9150915080610b515760405162461bcd60e51b8152600401610365906129f2565b8254825114610b725760405162461bcd60e51b815260040161036590612a36565b60208201516001600160a01b031615610b9d5760405162461bcd60e51b815260040161036590612a7d565b5f80610bac8460400151611769565b9150915080610c0c5760405162461bcd60e51b815260206004820152602660248201527f5374616b696e674d616e616765723a20526567697374726174696f6e206e6f74604482015265081d985b1a5960d21b6064820152608401610365565b5f82815260078601602052604081208054610c2690612aca565b9050118015610c58575060015f83815260088701602052604090205460ff166005811115610c5657610c566127e6565b145b610c745760405162461bcd60e51b815260040161036590612afc565b5f8281526007860160205260408120610c8c91612567565b5f8281526008860160208181526040808420805460ff191660029081178255810180546001600160401b0342818116600160401b026fffffffffffffffff000000000000000019909316929092178355600190930154875260098c0185528387208990559588905293835292548151931683529082019290925283917ff8fd1c90fb9cfa2ca2358fdf5806b086ad43315d92b221c929efc7f105ce7568910160405180910390a2505050505050565b5f8181527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6076020526040812080545f80516020612e5e833981519152929190610d8390612aca565b9050118015610db5575060015f83815260088301602052604090205460ff166005811115610db357610db36127e6565b145b610dd15760405162461bcd60e51b815260040161036590612afc565b5f82815260078201602052604090819020905163ee5b48eb60e01b81526005600160991b019163ee5b48eb91610e0a9190600401612b41565b6020604051808303815f875af1158015610e26573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e4a919061284e565b505050565b5f610e5c8434858561188d565b949350505050565b5f5f80516020612e5e8339815191526040516306f8253560e41b815263ffffffff851660048201529091505f9081906005600160991b0190636f825350906024015f60405180830381865afa158015610ebf573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052610ee69190810190612920565b9150915080610f075760405162461bcd60e51b8152600401610365906129f2565b5f8415610f80575f610f1c8460400151611d8f565b919350909150506001600160401b03811615610f7a5760405162461bcd60e51b815260206004820181905260248201527f5374616b696e674d616e616765723a20576569676874206d75737420626520306044820152606401610365565b50610ff4565b5f610f8e8460400151611769565b90925090508015610ff25760405162461bcd60e51b815260206004820152602860248201527f5374616b696e674d616e616765723a20526567697374726174696f6e207374696044820152671b1b081d985b1a5960c21b6064820152608401610365565b505b5f818152600885016020526040808220815161012081019092528054829060ff166005811115611026576110266127e6565b6005811115611037576110376127e6565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003909201546001600160a01b0380821660c080850191909152600160a01b830460ff16151560e0850152600160a81b909204909316610100909201919091528201519192501633146110e85760405162461bcd60e51b8152600401610365906128b7565b5f6003825160058111156110fe576110fe6127e6565b148061111c575060028251600581111561111a5761111a6127e6565b145b1561113f57506020808201515f9081526009870190915260408120556004611143565b5060055b5f83815260088701602052604090208251815484929190829060ff19166001836005811115611174576111746127e6565b0217905550602082015160018201556040808301516002830180546060860151608087015160a08801516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c08401516003909301805460e0860151610100909601516001600160a01b039095166001600160a81b031990911617600160a01b951515959095029490941767ffffffffffffffff60a81b1916600160a81b9390911692909202919091179091555183907f3532ad18e70a039beb4663d48c15acbef558c96ec9b8fd0cc3c0304f774740b8905f90a25050505050505050565b60408051603480825260608281019093525f91906020820181803683370190505090505f5b600481101561130c576112c4816003612bcb565b6112cf9060086128a0565b600263ffffffff16901c60f81b8282815181106112ee576112ee612bde565b60200101906001600160f81b03191690815f1a9053506001016112b0565b505f5b602081101561136e5761132381601f612bcb565b61132e9060086128a0565b86901c60f81b82611340836004612bf2565b8151811061135057611350612bde565b60200101906001600160f81b03191690815f1a90535060010161130f565b505f5b60088110156113d957611385816007612bcb565b6113909060086128a0565b6001600160401b038616901c60f81b826113ab836024612bf2565b815181106113bb576113bb612bde565b60200101906001600160f81b03191690815f1a905350600101611371565b505f5b6008811015611444576113f0816007612bcb565b6113fb9060086128a0565b6001600160401b038516901c60f81b8261141683602c612bf2565b8151811061142657611426612bde565b60200101906001600160f81b03191690815f1a9053506001016113dc565b50949350505050565b7fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab604545f80516020612e5e83398151915290600160e01b900460ff165f03611492575050565b60408051606081018252600583015480825260068401546001600160401b038082166020850152600160401b9091041692820192909252904290610e10906114da9083612bcb565b106114f6576001600160401b0384166040830152808252611515565b83826040018181516115089190612c05565b6001600160401b03169052505b5f82602001518360400151606461152c9190612c2c565b6115369190612c57565b600485015490915060ff600160e01b909104811690821611156115b65760405162461bcd60e51b815260206004820152603260248201527f5374616b696e674d616e616765723a204d6178696d756d20686f75726c7920636044820152711a1d5c9b881c985d1948195e18d95959195960721b6064820152608401610365565b5050805160058301556020810151600690920180546040909201516001600160401b03908116600160401b026001600160801b031990931693169290921717905550565b5f808251602c1461161d5760405162461bcd60e51b815260040161036590612c7c565b5f805b600481101561166e57611634816003612bcb565b61163f9060086128a0565b63ffffffff1685828151811061165757611657612bde565b016020015160f81c901b9190911790600101611620565b5063ffffffff81166003146116955760405162461bcd60e51b815260040161036590612cc3565b5f805b60208110156116ea576116ac81601f612bcb565b6116b79060086128a0565b866116c3836004612bf2565b815181106116d3576116d3612bde565b016020015160f81c901b9190911790600101611698565b505f805b600881101561174957611702816007612bcb565b61170d9060086128a0565b6001600160401b031687611722836024612bf2565b8151811061173257611732612bde565b016020015160f81c901b91909117906001016116ee565b50909590945092505050565b61175d611f4d565b61176681611f98565b50565b5f80825160251461178c5760405162461bcd60e51b815260040161036590612c7c565b5f805b60048110156117dd576117a3816003612bcb565b6117ae9060086128a0565b63ffffffff168582815181106117c6576117c6612bde565b016020015160f81c901b919091179060010161178f565b5063ffffffff81166001146118045760405162461bcd60e51b815260040161036590612cc3565b5f805b60208110156118595761181b81601f612bcb565b6118269060086128a0565b86611832836004612bf2565b8151811061184257611842612bde565b016020015160f81c901b9190911790600101611807565b505f8560248151811061186e5761186e612bde565b016020015191966001600160f81b031990921615159550909350505050565b5f611896611fb9565b5f80516020612e5e833981519152426001600160401b0385161180156118d057506001600160401b0384166118ce426202a300612bf2565b115b6119305760405162461bcd60e51b815260206004820152602b60248201527f5374616b696e674d616e616765723a20496e76616c696420726567697374726160448201526a74696f6e2065787069727960a81b6064820152608401610365565b8561197d5760405162461bcd60e51b815260206004820152601f60248201527f5374616b696e674d616e616765723a20496e76616c6964206e6f6465204944006044820152606401610365565b5f868152600982016020526040902054156119e95760405162461bcd60e51b815260206004820152602660248201527f5374616b696e674d616e616765723a204e6f646520494420616c72656164792060448201526561637469766560d01b6064820152608401610365565b8251604014611a4b5760405162461bcd60e51b815260206004820152602860248201527f5374616b696e674d616e616765723a20496e76616c6964207369676e617475726044820152670ca40d8cadccee8d60c31b6064820152608401610365565b845f611a56826103f3565b9050611a618161144d565b8260020154816001600160401b031610158015611a8b57508260030154816001600160401b031611155b611ae35760405162461bcd60e51b8152602060048201526024808201527f5374616b696e674d616e616765723a20496e76616c6964207374616b6520616d6044820152631bdd5b9d60e21b6064820152608401610365565b5f80611b2a6040518060a00160405280876001015481526020018c8152602001856001600160401b031681526020018a6001600160401b0316815260200189815250612003565b5f82815260078801602052604090209193509150611b488282612d4c565b5060405163ee5b48eb60e01b81525f906005600160991b019063ee5b48eb90611b7590859060040161281c565b6020604051808303815f875af1158015611b91573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611bb5919061284e565b6040805161012081019091529091508060018152602081018d90526001600160401b03861660408201525f606082018190526080820181905260a082015260c001336001600160a01b031681525f6020808301829052604092830182905286825260088a0190522081518154829060ff19166001836005811115611c3b57611c3b6127e6565b021790555060208281015160018301556040808401516002840180546060870151608088015160a08901516001600160401b03908116600160c01b026001600160c01b03928216600160801b02929092166001600160801b03938216600160401b026001600160801b03199095169682169690961793909317919091169390931792909217905560c08501516003909401805460e0870151610100909701518316600160a81b0267ffffffffffffffff60a81b19971515600160a01b026001600160a81b03199092166001600160a01b039097169690961717959095169390931790935582518783168152918c169082015282918d9186917f79b81620b81daf2c08cd5bb3dbb79e75d2d7a87f52171fde5aadc8c47823026e910160405180910390a45090945050505050610e5c60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b5f805f8351603414611db35760405162461bcd60e51b815260040161036590612c7c565b5f805b6004811015611e0457611dca816003612bcb565b611dd59060086128a0565b63ffffffff16868281518110611ded57611ded612bde565b016020015160f81c901b9190911790600101611db6565b5063ffffffff8116600214611e2b5760405162461bcd60e51b815260040161036590612cc3565b5f805b6020811015611e8057611e4281601f612bcb565b611e4d9060086128a0565b87611e59836004612bf2565b81518110611e6957611e69612bde565b016020015160f81c901b9190911790600101611e2e565b505f805b6008811015611edf57611e98816007612bcb565b611ea39060086128a0565b6001600160401b031688611eb8836024612bf2565b81518110611ec857611ec8612bde565b016020015160f81c901b9190911790600101611e84565b505f805b6008811015611f3e57611ef7816007612bcb565b611f029060086128a0565b6001600160401b031689611f1783602c612bf2565b81518110611f2757611f27612bde565b016020015160f81c901b9190911790600101611ee3565b50919790965090945092505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff16611f9657604051631afcd79f60e31b815260040160405180910390fd5b565b611fa0611f4d565b611fa8612131565b611fb0612141565b61176681612149565b7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00805460011901611ffd57604051633ee5aeb560e01b815260040160405180910390fd5b60029055565b5f60605f8061201185612279565b60408051609480825260c082019092529294509092505f91906020820181803683370190505090505f5b60048110156120975761204f816003612bcb565b61205a9060086128a0565b600163ffffffff16901c60f81b82828151811061207957612079612bde565b60200101906001600160f81b03191690815f1a90535060010161203b565b505f5b60908110156120fe578281815181106120b5576120b5612bde565b01602001516001600160f81b031916826120d0836004612bf2565b815181106120e0576120e0612bde565b60200101906001600160f81b03191690815f1a90535060010161209a565b5091959194509092505050565b60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b612139611f4d565b611f9661255f565b611f96611f4d565b612151611f4d565b80355f80516020612e5e83398151915290815560208201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6015560408201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6025560608201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab603556121e960a08301608084016125e3565b60048201805467ffffffffffffffff19166001600160401b039290921691909117905561221c60c0830160a08401612e07565b60048201805460ff92909216600160e01b0260ff60e01b1990921691909117905561224d60e0830160c08401612e27565b8160040160086101000a8154816001600160a01b0302191690836001600160a01b031602179055505050565b5f60608260800151516040146122e35760405162461bcd60e51b815260206004820152602960248201527f5374616b696e674d657373616765733a20496e76616c6964207369676e6174756044820152680e4ca40d8cadccee8d60bb1b6064820152608401610365565b60408051609080825260c082019092525f916020820181803683370190505090505f5b6020811015612356578451816020811061232257612322612bde565b1a60f81b82828151811061233857612338612bde565b60200101906001600160f81b03191690815f1a905350600101612306565b505f5b60208110156123b6578460200151816020811061237857612378612bde565b1a60f81b82612388836020612bf2565b8151811061239857612398612bde565b60200101906001600160f81b03191690815f1a905350600101612359565b505f5b600881101561242a576123cd816007612bcb565b6123d89060086128a0565b60ff1685604001516001600160401b0316901c60f81b828260406123fc9190612bf2565b8151811061240c5761240c612bde565b60200101906001600160f81b03191690815f1a9053506001016123b9565b505f5b600881101561249c57612441816007612bcb565b61244c9060086128a0565b60608601516001600160401b0390811691161c60f81b8261246e836048612bf2565b8151811061247e5761247e612bde565b60200101906001600160f81b03191690815f1a90535060010161242d565b505f5b604081101561250757846080015181815181106124be576124be612bde565b01602001516001600160f81b031916826124d9836050612bf2565b815181106124e9576124e9612bde565b60200101906001600160f81b03191690815f1a90535060010161249f565b506002816040516125189190612e42565b602060405180830381855afa158015612533573d5f803e3d5ffd5b5050506040513d601f19601f82011682018060405250810190612556919061284e565b94909350915050565b61210b611f4d565b50805461257390612aca565b5f825580601f10612582575050565b601f0160209004905f5260205f209081019061176691905b808211156125ad575f815560010161259a565b5090565b5f602082840312156125c1575f80fd5b5035919050565b80356001600160401b03811681146125de575f80fd5b919050565b5f602082840312156125f3575f80fd5b6125fc826125c8565b9392505050565b8015158114611766575f80fd5b803563ffffffff811681146125de575f80fd5b5f805f60608486031215612635575f80fd5b83359250602084013561264781612603565b915061265560408501612610565b90509250925092565b5f60e0828403121561266e575f80fd5b50919050565b5f60208284031215612684575f80fd5b6125fc82612610565b634e487b7160e01b5f52604160045260245ffd5b604051606081016001600160401b03811182821017156126c3576126c361268d565b60405290565b604051601f8201601f191681016001600160401b03811182821017156126f1576126f161268d565b604052919050565b5f6001600160401b038211156127115761271161268d565b50601f01601f191660200190565b5f805f60608486031215612731575f80fd5b83359250612741602085016125c8565b915060408401356001600160401b0381111561275b575f80fd5b8401601f8101861361276b575f80fd5b803561277e612779826126f9565b6126c9565b818152876020838501011115612792575f80fd5b816020840160208301375f602083830101528093505050509250925092565b5f80604083850312156127c2575f80fd5b6127cb83612610565b915060208301356127db81612603565b809150509250929050565b634e487b7160e01b5f52602160045260245ffd5b5f5b838110156128145781810151838201526020016127fc565b50505f910152565b602081525f825180602084015261283a8160408501602087016127fa565b601f01601f19169190910160400192915050565b5f6020828403121561285e575f80fd5b5051919050565b634e487b7160e01b5f52601260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b5f8261289b5761289b612865565b500490565b808202811582820484141761040357610403612879565b6020808252602a908201527f5374616b696e674d616e616765723a2053656e646572206e6f742076616c696460408201526930ba37b91037bbb732b960b11b606082015260800190565b6001600160a01b0381168114611766575f80fd5b80516125de81612603565b5f8060408385031215612931575f80fd5b82516001600160401b0380821115612947575f80fd5b908401906060828703121561295a575f80fd5b6129626126a1565b8251815260208084015161297581612901565b8282015260408401518381111561298a575f80fd5b80850194505087601f85011261299e575f80fd5b835192506129ae612779846126f9565b83815288828587010111156129c1575f80fd5b6129d0848383018488016127fa565b806040840152508195506129e5818801612915565b9450505050509250929050565b60208082526024908201527f5374616b696e674d616e616765723a20496e76616c69642077617270206d65736040820152637361676560e01b606082015260800190565b60208082526027908201527f5374616b696e674d616e616765723a20496e76616c696420736f7572636520636040820152661a185a5b88125160ca1b606082015260800190565b6020808252602d908201527f5374616b696e674d616e616765723a20496e76616c6964206f726967696e207360408201526c656e646572206164647265737360981b606082015260800190565b600181811c90821680612ade57607f821691505b60208210810361266e57634e487b7160e01b5f52602260045260245ffd5b60208082526025908201527f5374616b696e674d616e616765723a20496e76616c69642076616c69646174696040820152641bdb88125160da1b606082015260800190565b5f60208083525f8454612b5381612aca565b806020870152604060018084165f8114612b745760018114612b9057612bbd565b60ff19851660408a0152604084151560051b8a01019550612bbd565b895f5260205f205f5b85811015612bb45781548b8201860152908301908801612b99565b8a016040019650505b509398975050505050505050565b8181038181111561040357610403612879565b634e487b7160e01b5f52603260045260245ffd5b8082018082111561040357610403612879565b6001600160401b03818116838216019080821115612c2557612c25612879565b5092915050565b6001600160401b03818116838216028082169190828114612c4f57612c4f612879565b505092915050565b5f6001600160401b0380841680612c7057612c70612865565b92169190910492915050565b60208082526027908201527f5374616b696e674d657373616765733a20496e76616c6964206d657373616765604082015266040d8cadccee8d60cb1b606082015260800190565b60208082526025908201527f5374616b696e674d657373616765733a20496e76616c6964206d657373616765604082015264207479706560d81b606082015260800190565b601f821115610e4a57805f5260205f20601f840160051c81016020851015612d2d5750805b601f840160051c820191505b818110156103ec575f8155600101612d39565b81516001600160401b03811115612d6557612d6561268d565b612d7981612d738454612aca565b84612d08565b602080601f831160018114612dac575f8415612d955750858301515b5f19600386901b1c1916600185901b178555610aa6565b5f85815260208120601f198616915b82811015612dda57888601518255948401946001909101908401612dbb565b5085821015612df757878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b5f60208284031215612e17575f80fd5b813560ff811681146125fc575f80fd5b5f60208284031215612e37575f80fd5b81356125fc81612901565b5f8251612e538184602087016127fa565b919091019291505056feafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab600a164736f6c6343000819000a", } // NativeTokenStakingManagerABI is the input ABI used to generate the binding from. @@ -364,23 +348,23 @@ func (_NativeTokenStakingManager *NativeTokenStakingManagerTransactorSession) Co return _NativeTokenStakingManager.Contract.CompleteValidatorRegistration(&_NativeTokenStakingManager.TransactOpts, messageIndex) } -// Initialize is a paid mutator transaction binding the contract method 0x1a0d36fe. +// Initialize is a paid mutator transaction binding the contract method 0x79f54eb1. // -// Solidity: function initialize((bytes32,bytes32,uint256,uint256,uint64,uint8,((bytes32,bytes32,uint64,uint64,bytes),address)[],address) settings) returns() +// Solidity: function initialize((bytes32,bytes32,uint256,uint256,uint64,uint8,address) settings) returns() func (_NativeTokenStakingManager *NativeTokenStakingManagerTransactor) Initialize(opts *bind.TransactOpts, settings StakingManagerSettings) (*types.Transaction, error) { return _NativeTokenStakingManager.contract.Transact(opts, "initialize", settings) } -// Initialize is a paid mutator transaction binding the contract method 0x1a0d36fe. +// Initialize is a paid mutator transaction binding the contract method 0x79f54eb1. // -// Solidity: function initialize((bytes32,bytes32,uint256,uint256,uint64,uint8,((bytes32,bytes32,uint64,uint64,bytes),address)[],address) settings) returns() +// Solidity: function initialize((bytes32,bytes32,uint256,uint256,uint64,uint8,address) settings) returns() func (_NativeTokenStakingManager *NativeTokenStakingManagerSession) Initialize(settings StakingManagerSettings) (*types.Transaction, error) { return _NativeTokenStakingManager.Contract.Initialize(&_NativeTokenStakingManager.TransactOpts, settings) } -// Initialize is a paid mutator transaction binding the contract method 0x1a0d36fe. +// Initialize is a paid mutator transaction binding the contract method 0x79f54eb1. // -// Solidity: function initialize((bytes32,bytes32,uint256,uint256,uint64,uint8,((bytes32,bytes32,uint64,uint64,bytes),address)[],address) settings) returns() +// Solidity: function initialize((bytes32,bytes32,uint256,uint256,uint64,uint8,address) settings) returns() func (_NativeTokenStakingManager *NativeTokenStakingManagerTransactorSession) Initialize(settings StakingManagerSettings) (*types.Transaction, error) { return _NativeTokenStakingManager.Contract.Initialize(&_NativeTokenStakingManager.TransactOpts, settings) } diff --git a/scripts/abi_bindings.sh b/scripts/abi_bindings.sh index 4c8cca62a..4b2f09dce 100755 --- a/scripts/abi_bindings.sh +++ b/scripts/abi_bindings.sh @@ -16,7 +16,7 @@ export ARCH=$(uname -m) [ $ARCH = x86_64 ] && ARCH=amd64 echo "ARCH set to $ARCH" -DEFAULT_CONTRACT_LIST="TeleporterMessenger TeleporterRegistry ExampleERC20 TestMessenger ValidatorSetSig NativeTokenStakingManager" +DEFAULT_CONTRACT_LIST="TeleporterMessenger TeleporterRegistry ExampleERC20 TestMessenger ValidatorSetSig NativeTokenStakingManager ERC20TokenStakingManager" CONTRACT_LIST= HELP= From 93cd2556c9071a17bea7215e685236a3b02308e0 Mon Sep 17 00:00:00 2001 From: cam-schultz Date: Tue, 13 Aug 2024 13:09:36 -0500 Subject: [PATCH 05/27] wip --- go.mod | 25 ++-- go.sum | 57 ++++----- tests/flows/native_token_staking.go | 59 +++++++++ tests/local/e2e_test.go | 180 ++++++++++++++-------------- 4 files changed, 190 insertions(+), 131 deletions(-) create mode 100644 tests/flows/native_token_staking.go diff --git a/go.mod b/go.mod index 62d99a002..13ce2a9f8 100644 --- a/go.mod +++ b/go.mod @@ -8,11 +8,13 @@ require ( ) require ( + github.com/ava-labs/awm-relayer v1.4.0-rc.2.0.20240812210713-0fc39ab2d471 github.com/ava-labs/subnet-evm v0.6.9-0.20240809021034-3ceec5c96a5f github.com/ethereum/go-ethereum v1.13.8 - github.com/onsi/ginkgo/v2 v2.19.1 + github.com/onsi/ginkgo/v2 v2.20.0 github.com/onsi/gomega v1.34.1 github.com/pkg/errors v0.9.1 + github.com/prometheus/client_golang v1.19.1 github.com/spf13/cobra v1.8.1 github.com/stretchr/testify v1.9.0 go.uber.org/zap v1.27.0 @@ -29,7 +31,7 @@ require ( github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect github.com/btcsuite/btcd/btcutil v1.1.3 // indirect github.com/cenkalti/backoff/v4 v4.2.1 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cockroachdb/errors v1.9.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593 // indirect @@ -58,18 +60,17 @@ require ( github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/protobuf v1.5.4 // indirect github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect github.com/google/btree v1.1.2 // indirect github.com/google/go-cmp v0.6.0 // indirect - github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 // indirect + github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 // indirect github.com/google/renameio/v2 v2.0.0 // indirect github.com/google/uuid v1.6.0 // indirect github.com/gorilla/mux v1.8.0 // indirect github.com/gorilla/rpc v1.2.0 // indirect github.com/gorilla/websocket v1.4.2 // indirect github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 // indirect github.com/hashicorp/go-bexpr v0.1.10 // indirect github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect github.com/hashicorp/hcl v1.0.0 // indirect @@ -87,7 +88,6 @@ require ( github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.17 // indirect github.com/mattn/go-runewidth v0.0.13 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/pointerstructure v1.2.0 // indirect github.com/mmcloughlin/addchain v0.4.0 // indirect @@ -97,10 +97,9 @@ require ( github.com/pelletier/go-toml/v2 v2.0.8 // indirect github.com/pires/go-proxyproto v0.6.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.16.0 // indirect - github.com/prometheus/client_model v0.3.0 // indirect - github.com/prometheus/common v0.42.0 // indirect - github.com/prometheus/procfs v0.10.1 // indirect + github.com/prometheus/client_model v0.5.0 // indirect + github.com/prometheus/common v0.48.0 // indirect + github.com/prometheus/procfs v0.12.0 // indirect github.com/rivo/uniseg v0.2.0 // indirect github.com/rogpeppe/go-internal v1.10.0 // indirect github.com/rs/cors v1.7.0 // indirect @@ -140,9 +139,9 @@ require ( golang.org/x/text v0.17.0 // indirect golang.org/x/time v0.3.0 // indirect gonum.org/v1/gonum v0.11.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect - google.golang.org/grpc v1.64.1 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect + google.golang.org/grpc v1.65.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect diff --git a/go.sum b/go.sum index 2338ac37d..e786b7f4e 100644 --- a/go.sum +++ b/go.sum @@ -58,16 +58,12 @@ github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/ava-labs/avalanchego v1.11.11-0.20240807224540-c7cf573a95ff h1:Nz97kwcbf9DCQxVegBF+GZiUt9HqodeJHR9TtXw8rR8= github.com/ava-labs/avalanchego v1.11.11-0.20240807224540-c7cf573a95ff/go.mod h1:9e0UPXJboybmgFjeTj+SFbK4ugbrdG4t68VdiUW5oQ8= -github.com/ava-labs/coreth v0.13.8-0.20240802110637-b3e5088d062d h1:klPTcKVvqfA2KSKaRvQAO56Pd4XAqGhwgMTQ6/W+w7w= -github.com/ava-labs/coreth v0.13.8-0.20240802110637-b3e5088d062d/go.mod h1:tXDujonxXFOF6oK5HS2EmgtSXJK3Gy6RpZxb5WzR9rM= +github.com/ava-labs/awm-relayer v1.4.0-rc.2.0.20240812210713-0fc39ab2d471 h1:7tF/hjIeUqd7DTLWkQUG136gTWsJzT5s6wkUsZcTL0s= +github.com/ava-labs/awm-relayer v1.4.0-rc.2.0.20240812210713-0fc39ab2d471/go.mod h1:j8G0O0up+nFIHIH6YjWjSlM5fGx9s/Fcp5SO9SZOEyY= github.com/ava-labs/coreth v0.13.8-0.20240807212152-f7acfafec094 h1:e7TvIKDGzsMsKU3Y4HreRcK7f16EcEPUO04UwSCFtng= github.com/ava-labs/coreth v0.13.8-0.20240807212152-f7acfafec094/go.mod h1:Ouul9dJouniUIJVX1gDqx8CrHyGvmwZkK28mrgKb/4I= -github.com/ava-labs/subnet-evm v0.6.8 h1:IrHGajBYWs692YIYdd5J0oVWWt88Q/XAZQq/dOtkHFw= -github.com/ava-labs/subnet-evm v0.6.8/go.mod h1:qt8DXyGm40CY9yffNOe1+4yUyL9mD3v5RPWqAuGj5u4= github.com/ava-labs/subnet-evm v0.6.9-0.20240809021034-3ceec5c96a5f h1:moqjaNZ1RSXL2/yYUXvwSEpIWjmXcWxTORMBHWuwrtE= github.com/ava-labs/subnet-evm v0.6.9-0.20240809021034-3ceec5c96a5f/go.mod h1:DM/HccJ8PghYk7fA3Cq76OOoVprOtyITICkjwuzEPfg= -github.com/ava-labs/subnet-evm v0.6.9-0.20240809152905-7387c7129d6f h1:uf7WgXJXOKbNuO7F5BzQ2VBFHbXCAHECinz1FxSXENY= -github.com/ava-labs/subnet-evm v0.6.9-0.20240809152905-7387c7129d6f/go.mod h1:BryiYmD6HWmugkSUpDdj/KyMi7ou5pJzPRNPMbMgpbA= github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= @@ -102,8 +98,9 @@ github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyY github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/cp v0.1.0 h1:SE+dxFebS7Iik5LK0tsi1k9ZCxEaFX4AjQmoyA+1dJk= github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/logex v1.2.0/go.mod h1:9+9sk7u7pGNWYMkh0hdiL++6OeibzJccyQU4p4MedaY= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= @@ -236,8 +233,8 @@ github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69 github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.2.0 h1:uCdmnmatrKCgMBlM4rMuJZWOkPDqdbZPnrMXDY4gI68= -github.com/golang/glog v1.2.0/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= +github.com/golang/glog v1.2.1 h1:OptwRhECazUx5ix5TTWC3EZhsZEHWcYWY4FQHTIubm4= +github.com/golang/glog v1.2.1/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -303,8 +300,8 @@ github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20230207041349-798e818bf904/go.mod h1:uglQLonpP8qtYCYyzA+8c/9qtqgA3qsXGYqCPKARAFg= -github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 h1:k7nVchz72niMH6YLQNvHSdIE7iqsQxK1P41mySCvssg= -github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw= +github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 h1:FKHo8hFI3A+7w0aUQuYXQ+6EN5stWmeY/AZqtM8xk9k= +github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/renameio/v2 v2.0.0 h1:UifI23ZTGY8Tt29JbYFiuyIU3eX+RNFtUwefq9qAhxg= github.com/google/renameio/v2 v2.0.0/go.mod h1:BtmJXm5YlszgC+TD4HOEEUFgkJP3nLxehU6hfe7jRt4= @@ -325,8 +322,8 @@ github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0U github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 h1:YBftPWNWd4WwGqtY2yeZL2ef8rHAxPBD8KFhJpmcqms= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0/go.mod h1:YN5jB8ie0yfIUg6VvR9Kz84aCaG7AsGZnLjhHbUqwPg= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 h1:RtRsiaGvWxcwd8y3BiRZxsylPT8hLWZ5SPcfI+3IDNk= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0/go.mod h1:TzP6duP4Py2pHLVPPQp42aoYI92+PCrVotyR5e8Vqlk= github.com/hashicorp/go-bexpr v0.1.10 h1:9kuI5PFotCboP3dkDYFr/wi0gg0QVbSNz5oFRpxn4uE= github.com/hashicorp/go-bexpr v0.1.10/go.mod h1:oxlubA2vC/gFVfX1A6JGp7ls7uCDlfJn732ehYYg+g0= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= @@ -420,8 +417,6 @@ github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= -github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= @@ -461,8 +456,8 @@ github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vv github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= -github.com/onsi/ginkgo/v2 v2.19.1 h1:QXgq3Z8Crl5EL1WBAC98A5sEBHARrAJNzAmMxzLcRF0= -github.com/onsi/ginkgo/v2 v2.19.1/go.mod h1:O3DtEWQkPa/F7fBMgmZQKKsluAy8pd3rEQdrjkPb9zA= +github.com/onsi/ginkgo/v2 v2.20.0 h1:PE84V2mHqoT1sglvHc8ZdQtPcwmvvt29WLEEO3xmdZw= +github.com/onsi/ginkgo/v2 v2.20.0/go.mod h1:lG9ey2Z29hR41WMVthyJBGUBcBhGOtoPF2VFMvBXFCI= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= @@ -485,15 +480,15 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= -github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= +github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE= +github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= -github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= -github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= -github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= -github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= -github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= +github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= +github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= +github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE= +github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= +github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= +github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -968,10 +963,10 @@ google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 h1:RFiFrvy37/mpSpdySBDrUdipW/dHwsRwh3J3+A9VgT4= -google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237/go.mod h1:Z5Iiy3jtmioajWHDGFk7CeugTyHtPvMHA4UTmUkyalE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 h1:NnYq6UN9ReLM9/Y01KWNOWyI5xQ9kbIms5GGJVwS/Yc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= +google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 h1:7whR9kGa5LUwFtpLm2ArCEejtnxlGeLbAyjFY8sGNFw= +google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157/go.mod h1:99sLkeliLXfdj2J75X3Ho+rrVCaJze0uwN7zDDkjPVU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 h1:Zy9XzmMEflZ/MAaA7vNcoebnRAld7FsPW1EeBB7V0m8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= @@ -990,8 +985,8 @@ google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.64.1 h1:LKtvyfbX3UGVPFcGqJ9ItpVWW6oN/2XqTxfAnwRRXiA= -google.golang.org/grpc v1.64.1/go.mod h1:hiQF4LFZelK2WKaP6W0L92zGHtiQdZxk8CrSdvyjeP0= +google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= +google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/tests/flows/native_token_staking.go b/tests/flows/native_token_staking.go new file mode 100644 index 000000000..fe0ea0093 --- /dev/null +++ b/tests/flows/native_token_staking.go @@ -0,0 +1,59 @@ +package flows + +import ( + "github.com/ava-labs/avalanchego/message" + "github.com/ava-labs/avalanchego/utils/constants" + "github.com/ava-labs/avalanchego/utils/logging" + "github.com/ava-labs/awm-relayer/peers" + "github.com/ava-labs/awm-relayer/signature-aggregator/aggregator" + sigAggConfig "github.com/ava-labs/awm-relayer/signature-aggregator/config" + sigAggMetrics "github.com/ava-labs/awm-relayer/signature-aggregator/metrics" + "github.com/ava-labs/teleporter/tests/interfaces" + . "github.com/onsi/gomega" + "github.com/prometheus/client_golang/prometheus" +) + +func NativeTokenStakingManager(network interfaces.Network) { + // Get the subnets info + + // Create the signature aggregator + logger := logging.NoLog{} + cfg := sigAggConfig.Config{} + appRequestNetwork, err := peers.NewNetwork( + logging.Debug, + prometheus.DefaultRegisterer, + trackedSubnets, + &cfg, + ) + Expect(err).Should(BeNil()) + + messageCreator, err := message.NewCreator( + logger, + prometheus.DefaultRegisterer, + constants.DefaultNetworkCompressionType, + constants.DefaultNetworkMaximumInboundTimeout, + ) + signatureAggregator := aggregator.NewSignatureAggregator( + appRequestNetwork, + logger, + sigAggMetrics.NewSignatureAggregatorMetrics( + prometheus.DefaultRegisterer, + ), + messageCreator, + ) + + // Deploy the staking manager contract + + // Iniatiate validator registration + + // Gather subnet-evm Warp signatures for the RegisterSubnetValidatorMessage & relay to the P-Chain + // (Sending to the P-Chain will be skipped for now) + + // Construct a SubnetValidatorRegistrationMessage Warp message from the P-Chain + // Query P-Chain validators for the Warp message + + // Deliver the Warp message to the subnet + + // Check that the validator is registered in the staking contract + +} diff --git a/tests/local/e2e_test.go b/tests/local/e2e_test.go index 95d934855..35d021d12 100644 --- a/tests/local/e2e_test.go +++ b/tests/local/e2e_test.go @@ -22,6 +22,7 @@ const ( upgradabilityLabel = "upgradability" utilsLabel = "utils" validatorSetSigLabel = "ValidatorSetSig" + stakingManagerLabel = "StakingManager" ) var ( @@ -102,93 +103,98 @@ var _ = ginkgo.AfterSuite(func() { var _ = ginkgo.Describe("[Teleporter integration tests]", func() { // Teleporter tests - ginkgo.It("Send a message from Subnet A to Subnet B, and one from B to A", - ginkgo.Label(teleporterMessengerLabel), - func() { - flows.BasicSendReceive(LocalNetworkInstance) - }) - ginkgo.It("Deliver to the wrong chain", - ginkgo.Label(teleporterMessengerLabel), - func() { - flows.DeliverToWrongChain(LocalNetworkInstance) - }) - ginkgo.It("Deliver to non-existent contract", - ginkgo.Label(teleporterMessengerLabel), - func() { - flows.DeliverToNonExistentContract(LocalNetworkInstance) - }) - ginkgo.It("Retry successful execution", - ginkgo.Label(teleporterMessengerLabel), - func() { - flows.RetrySuccessfulExecution(LocalNetworkInstance) - }) - ginkgo.It("Unallowed relayer", - ginkgo.Label(teleporterMessengerLabel), - func() { - flows.UnallowedRelayer(LocalNetworkInstance) - }) - ginkgo.It("Relay message twice", - ginkgo.Label(teleporterMessengerLabel), - func() { - flows.RelayMessageTwice(LocalNetworkInstance) - }) - ginkgo.It("Add additional fee amount", - ginkgo.Label(teleporterMessengerLabel), - func() { - flows.AddFeeAmount(LocalNetworkInstance) - }) - ginkgo.It("Send specific receipts", - ginkgo.Label(teleporterMessengerLabel), - func() { - flows.SendSpecificReceipts(LocalNetworkInstance) - }) - ginkgo.It("Insufficient gas", - ginkgo.Label(teleporterMessengerLabel), - func() { - flows.InsufficientGas(LocalNetworkInstance) - }) - ginkgo.It("Resubmit altered message", - ginkgo.Label(teleporterMessengerLabel), - func() { - flows.ResubmitAlteredMessage(LocalNetworkInstance) - }) - ginkgo.It("Check upgrade access", - ginkgo.Label(upgradabilityLabel), - func() { - flows.CheckUpgradeAccess(LocalNetworkInstance) - }) - ginkgo.It("Pause and Unpause Teleporter", - ginkgo.Label(upgradabilityLabel), - func() { - flows.PauseTeleporter(LocalNetworkInstance) - }) - ginkgo.It("Calculate Teleporter message IDs", - ginkgo.Label(utilsLabel), - func() { - flows.CalculateMessageID(LocalNetworkInstance) - }) - - // The following tests require special behavior by the relayer, so we only run them on a local network - ginkgo.It("Relayer modifies message", - ginkgo.Label(teleporterMessengerLabel), - func() { - flows.RelayerModifiesMessage(LocalNetworkInstance) - }) - ginkgo.It("Teleporter registry", - ginkgo.Label(upgradabilityLabel), - func() { - flows.TeleporterRegistry(LocalNetworkInstance) - }) - ginkgo.It("Deliver ValidatorSetSig signed message", - ginkgo.Label(validatorSetSigLabel), - func() { - flows.ValidatorSetSig(LocalNetworkInstance) - }) - ginkgo.It("Validator churn", - ginkgo.Label(teleporterMessengerLabel), - func() { - flows.ValidatorChurn(LocalNetworkInstance) - }) + ginkgo.It("Native token staking manager", + ginkgo.Label(stakingManagerLabel), + func() { + flows.NativeTokenStakingManager(LocalNetworkInstance) + }) + // ginkgo.It("Send a message from Subnet A to Subnet B, and one from B to A", + // ginkgo.Label(teleporterMessengerLabel), + // func() { + // flows.BasicSendReceive(LocalNetworkInstance) + // }) + // ginkgo.It("Deliver to the wrong chain", + // ginkgo.Label(teleporterMessengerLabel), + // func() { + // flows.DeliverToWrongChain(LocalNetworkInstance) + // }) + // ginkgo.It("Deliver to non-existent contract", + // ginkgo.Label(teleporterMessengerLabel), + // func() { + // flows.DeliverToNonExistentContract(LocalNetworkInstance) + // }) + // ginkgo.It("Retry successful execution", + // ginkgo.Label(teleporterMessengerLabel), + // func() { + // flows.RetrySuccessfulExecution(LocalNetworkInstance) + // }) + // ginkgo.It("Unallowed relayer", + // ginkgo.Label(teleporterMessengerLabel), + // func() { + // flows.UnallowedRelayer(LocalNetworkInstance) + // }) + // ginkgo.It("Relay message twice", + // ginkgo.Label(teleporterMessengerLabel), + // func() { + // flows.RelayMessageTwice(LocalNetworkInstance) + // }) + // ginkgo.It("Add additional fee amount", + // ginkgo.Label(teleporterMessengerLabel), + // func() { + // flows.AddFeeAmount(LocalNetworkInstance) + // }) + // ginkgo.It("Send specific receipts", + // ginkgo.Label(teleporterMessengerLabel), + // func() { + // flows.SendSpecificReceipts(LocalNetworkInstance) + // }) + // ginkgo.It("Insufficient gas", + // ginkgo.Label(teleporterMessengerLabel), + // func() { + // flows.InsufficientGas(LocalNetworkInstance) + // }) + // ginkgo.It("Resubmit altered message", + // ginkgo.Label(teleporterMessengerLabel), + // func() { + // flows.ResubmitAlteredMessage(LocalNetworkInstance) + // }) + // ginkgo.It("Check upgrade access", + // ginkgo.Label(upgradabilityLabel), + // func() { + // flows.CheckUpgradeAccess(LocalNetworkInstance) + // }) + // ginkgo.It("Pause and Unpause Teleporter", + // ginkgo.Label(upgradabilityLabel), + // func() { + // flows.PauseTeleporter(LocalNetworkInstance) + // }) + // ginkgo.It("Calculate Teleporter message IDs", + // ginkgo.Label(utilsLabel), + // func() { + // flows.CalculateMessageID(LocalNetworkInstance) + // }) + + // // The following tests require special behavior by the relayer, so we only run them on a local network + // ginkgo.It("Relayer modifies message", + // ginkgo.Label(teleporterMessengerLabel), + // func() { + // flows.RelayerModifiesMessage(LocalNetworkInstance) + // }) + // ginkgo.It("Teleporter registry", + // ginkgo.Label(upgradabilityLabel), + // func() { + // flows.TeleporterRegistry(LocalNetworkInstance) + // }) + // ginkgo.It("Deliver ValidatorSetSig signed message", + // ginkgo.Label(validatorSetSigLabel), + // func() { + // flows.ValidatorSetSig(LocalNetworkInstance) + // }) + // ginkgo.It("Validator churn", + // ginkgo.Label(teleporterMessengerLabel), + // func() { + // flows.ValidatorChurn(LocalNetworkInstance) + // }) // Since the validator churn test modifies the network topology, we put it last for now. // It should not affect the other tests, but we get some errors if we run it before the other tests. // TODO: we should fix this so that the order of the tests does not matter. From 3d21241b8f35f517ffb786d680f474451bee7c08 Mon Sep 17 00:00:00 2001 From: cam-schultz Date: Wed, 14 Aug 2024 14:51:20 -0500 Subject: [PATCH 06/27] passing --- .../ERC20TokenStakingManager.go | 2 +- .../NativeTokenStakingManager.go | 2 +- contracts/staking/StakingManager.sol | 14 +- contracts/staking/StakingMessages.sol | 34 ++-- go.mod | 8 +- go.sum | 16 +- tests/flows/native_token_staking.go | 155 +++++++++++++++++- tests/local/network.go | 69 +++++--- tests/utils/utils.go | 21 +++ 9 files changed, 264 insertions(+), 57 deletions(-) diff --git a/abi-bindings/go/staking/ERC20TokenStakingManager/ERC20TokenStakingManager.go b/abi-bindings/go/staking/ERC20TokenStakingManager/ERC20TokenStakingManager.go index eac8acbfe..61754be97 100644 --- a/abi-bindings/go/staking/ERC20TokenStakingManager/ERC20TokenStakingManager.go +++ b/abi-bindings/go/staking/ERC20TokenStakingManager/ERC20TokenStakingManager.go @@ -43,7 +43,7 @@ type StakingManagerSettings struct { // ERC20TokenStakingManagerMetaData contains all meta data concerning the ERC20TokenStakingManager contract. var ERC20TokenStakingManagerMetaData = &bind.MetaData{ ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"init\",\"type\":\"uint8\",\"internalType\":\"enumICMInitializable\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"WARP_MESSENGER\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIWarpMessenger\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"completeEndValidation\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"setWeightMessageType\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"completeValidatorRegistration\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"settings\",\"type\":\"tuple\",\"internalType\":\"structStakingManagerSettings\",\"components\":[{\"name\":\"pChainBlockchainID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"subnetID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"minimumStakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"maximumStakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"minimumStakeDuration\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"maximumHourlyChurn\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"rewardCalculator\",\"type\":\"address\",\"internalType\":\"contractIRewardCalculator\"}]},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeEndValidation\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"includeUptimeProof\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeValidatorRegistration\",\"inputs\":[{\"name\":\"stakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"nodeID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"resendEndValidatorMessage\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"resendRegisterValidatorMessage\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"valueToWeight\",\"inputs\":[{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"weightToValue\",\"inputs\":[{\"name\":\"weight\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"pure\"},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodCreated\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"nodeID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"registerValidationMessageID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"weight\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodEnded\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodRegistered\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"stakeAmount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"timestamp\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidatorRemovalInitialized\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"setWeightMessageID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"stakeAmount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"endTime\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"uptime\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ReentrancyGuardReentrantCall\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"SafeERC20FailedOperation\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}]}]", - Bin: "0x608060405234801561000f575f80fd5b506040516132dc3803806132dc83398101604081905261002e91610107565b60018160018111156100425761004261012c565b0361004f5761004f610055565b50610140565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156100a55760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146101045780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b5f60208284031215610117575f80fd5b815160028110610125575f80fd5b9392505050565b634e487b7160e01b5f52602160045260245ffd5b61318f8061014d5f395ff3fe608060405234801561000f575f80fd5b506004361061009b575f3560e01c8063872fda6411610063578063872fda641461012b578063a3a65e481461013e578063b771b3bc14610151578063bee0a03f14610177578063fdf94a1a1461018a575f80fd5b80630322ed981461009f5780632e2194d8146100b45780635d0d7466146100e457806362065856146100f757806376f7862114610118575b5f80fd5b6100b26100ad366004612886565b61019d565b005b6100c76100c2366004612886565b610393565b6040516001600160401b0390911681526020015b60405180910390f35b6100b26100f23660046128b1565b6103a9565b61010a610105366004612909565b6104b7565b6040519081526020016100db565b6100b2610126366004612949565b6104d0565b61010a610139366004612a16565b610a50565b6100b261014c366004612ab2565b610a68565b61015f6005600160991b0181565b6040516001600160a01b0390911681526020016100db565b6100b2610185366004612886565b610cf5565b6100b2610198366004612acb565b610e09565b5f8181527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab60860205260408082208151610120810190925280545f8051602061316383398151915293929190829060ff1660058111156101fe576101fe612af5565b600581111561020f5761020f612af5565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003928301546001600160a01b03811660c084015260ff600160a01b820416151560e0840152600160a81b90041661010090910152909150815160058111156102a6576102a6612af5565b1461030e5760405162461bcd60e51b815260206004820152602d60248201527f5374616b696e674d616e616765723a2056616c696461746f72206e6f7420706560448201526c1b991a5b99c81c995b5bdd985b609a1b60648201526084015b60405180910390fd5b5f61031f848361010001515f611230565b60405163ee5b48eb60e01b81529091506005600160991b019063ee5b48eb9061034c908490600401612b2b565b6020604051808303815f875af1158015610368573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061038c9190612b5d565b5050505050565b5f6103a364e8d4a5100083612b9c565b92915050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff1615906001600160401b03165f811580156103ed5750825b90505f826001600160401b031660011480156104085750303b155b905081158015610416575080155b156104345760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561045e57845460ff60401b1916600160401b1785555b61046887876113f2565b83156104ae57845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50505050505050565b5f6103a36001600160401b03831664e8d4a51000612baf565b5f8381527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab60860205260408082208151610120810190925280545f8051602061316383398151915293929190829060ff16600581111561053157610531612af5565b600581111561054257610542612af5565b8152600182015460208201526002808301546001600160401b038082166040850152600160401b820481166060850152600160801b820481166080850152600160c01b909104811660a08401526003909301546001600160a01b03811660c084015260ff600160a01b820416151560e0840152600160a81b900490921661010090910152909150815160058111156105dc576105dc612af5565b146106355760405162461bcd60e51b8152602060048201526024808201527f5374616b696e674d616e616765723a2056616c696461746f72206e6f742061636044820152637469766560e01b6064820152608401610305565b60c08101516001600160a01b0316336001600160a01b03161461066a5760405162461bcd60e51b815260040161030590612bc6565b6106778160400151611410565b60038152426001600160401b031660808201525f8415610850576040516306f8253560e41b815263ffffffff851660048201525f9081906005600160991b0190636f825350906024015f60405180830381865afa1580156106da573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f191682016040526107019190810190612c1b565b91509150806107225760405162461bcd60e51b815260040161030590612ced565b6005600160991b016001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa158015610765573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107899190612b5d565b8251146107a85760405162461bcd60e51b815260040161030590612d31565b60208201516001600160a01b0316156107d35760405162461bcd60e51b815260040161030590612d78565b5f806107e284604001516115bd565b91509150818a1461084a5760405162461bcd60e51b815260206004820152602c60248201527f5374616b696e674d616e616765723a20496e76616c696420757074696d65207660448201526b185b1a59185d1a5bdb88125160a21b6064820152608401610305565b93505050505b6001600160401b03811660a08301525f86815260088401602052604090208251815484929190829060ff1916600183600581111561089057610890612af5565b02179055506020820151600182015560408201516002820180546060850151608086015160a08701516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c08301516003909201805460e0850151610100958601516001600160a01b039095166001600160a81b031990921691909117600160a01b911515919091021767ffffffffffffffff60a81b1916600160a81b93909216929092021790558201515f9061098190889083611230565b60405163ee5b48eb60e01b81529091505f906005600160991b019063ee5b48eb906109b0908590600401612b2b565b6020604051808303815f875af11580156109cc573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109f09190612b5d565b60408581015181516001600160401b03918216815242602082015290861681830152905191925082918a917f530b908725650fb1052974f9df59e834fefac78c9ec2f00c6d2464d60cc6add5919081900360600190a35050505050505050565b5f610a5d84868585611718565b90505b949350505050565b5f5f805160206131638339815191526040516306f8253560e41b815263ffffffff841660048201529091505f9081906005600160991b0190636f825350906024015f60405180830381865afa158015610ac3573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052610aea9190810190612c1b565b9150915080610b0b5760405162461bcd60e51b815260040161030590612ced565b8254825114610b2c5760405162461bcd60e51b815260040161030590612d31565b60208201516001600160a01b031615610b575760405162461bcd60e51b815260040161030590612d78565b5f80610b668460400151611c25565b9150915080610bc65760405162461bcd60e51b815260206004820152602660248201527f5374616b696e674d616e616765723a20526567697374726174696f6e206e6f74604482015265081d985b1a5960d21b6064820152608401610305565b5f82815260078601602052604081208054610be090612dc5565b9050118015610c12575060015f83815260088701602052604090205460ff166005811115610c1057610c10612af5565b145b610c2e5760405162461bcd60e51b815260040161030590612dfd565b5f8281526007860160205260408120610c469161283c565b5f8281526008860160208181526040808420805460ff191660029081178255810180546001600160401b0342818116600160401b026fffffffffffffffff000000000000000019909316929092178355600190930154875260098c0185528387208990559588905293835292548151931683529082019290925283917ff8fd1c90fb9cfa2ca2358fdf5806b086ad43315d92b221c929efc7f105ce7568910160405180910390a2505050505050565b5f8181527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6076020526040812080545f80516020613163833981519152929190610d3d90612dc5565b9050118015610d6f575060015f83815260088301602052604090205460ff166005811115610d6d57610d6d612af5565b145b610d8b5760405162461bcd60e51b815260040161030590612dfd565b5f82815260078201602052604090819020905163ee5b48eb60e01b81526005600160991b019163ee5b48eb91610dc49190600401612e42565b6020604051808303815f875af1158015610de0573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e049190612b5d565b505050565b5f5f805160206131638339815191526040516306f8253560e41b815263ffffffff851660048201529091505f9081906005600160991b0190636f825350906024015f60405180830381865afa158015610e64573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052610e8b9190810190612c1b565b9150915080610eac5760405162461bcd60e51b815260040161030590612ced565b5f8415610f25575f610ec18460400151611d49565b919350909150506001600160401b03811615610f1f5760405162461bcd60e51b815260206004820181905260248201527f5374616b696e674d616e616765723a20576569676874206d75737420626520306044820152606401610305565b50610f99565b5f610f338460400151611c25565b90925090508015610f975760405162461bcd60e51b815260206004820152602860248201527f5374616b696e674d616e616765723a20526567697374726174696f6e207374696044820152671b1b081d985b1a5960c21b6064820152608401610305565b505b5f818152600885016020526040808220815161012081019092528054829060ff166005811115610fcb57610fcb612af5565b6005811115610fdc57610fdc612af5565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003909201546001600160a01b0380821660c080850191909152600160a01b830460ff16151560e0850152600160a81b9092049093166101009092019190915282015191925016331461108d5760405162461bcd60e51b815260040161030590612bc6565b5f6003825160058111156110a3576110a3612af5565b14806110c157506002825160058111156110bf576110bf612af5565b145b156110e457506020808201515f90815260098701909152604081205560046110e8565b5060055b5f83815260088701602052604090208251815484929190829060ff1916600183600581111561111957611119612af5565b0217905550602082015160018201556040808301516002830180546060860151608087015160a08801516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c08401516003909301805460e0860151610100909601516001600160a01b039095166001600160a81b031990911617600160a01b951515959095029490941767ffffffffffffffff60a81b1916600160a81b9390911692909202919091179091555183907f3532ad18e70a039beb4663d48c15acbef558c96ec9b8fd0cc3c0304f774740b8905f90a25050505050505050565b60408051603480825260608281019093525f91906020820181803683370190505090505f5b60048110156112b157611269816003612ecc565b611274906008612baf565b600263ffffffff16901c60f81b82828151811061129357611293612edf565b60200101906001600160f81b03191690815f1a905350600101611255565b505f5b6020811015611313576112c881601f612ecc565b6112d3906008612baf565b86901c60f81b826112e5836004612ef3565b815181106112f5576112f5612edf565b60200101906001600160f81b03191690815f1a9053506001016112b4565b505f5b600881101561137e5761132a816007612ecc565b611335906008612baf565b6001600160401b038616901c60f81b82611350836024612ef3565b8151811061136057611360612edf565b60200101906001600160f81b03191690815f1a905350600101611316565b505f5b60088110156113e957611395816007612ecc565b6113a0906008612baf565b6001600160401b038516901c60f81b826113bb83602c612ef3565b815181106113cb576113cb612edf565b60200101906001600160f81b03191690815f1a905350600101611381565b50949350505050565b6113fa611f07565b61140382611f52565b61140c81611f76565b5050565b7fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab604545f8051602061316383398151915290600160e01b900460ff165f03611455575050565b60408051606081018252600583015480825260068401546001600160401b038082166020850152600160401b9091041692820192909252904290610e109061149d9083612ecc565b106114b9576001600160401b03841660408301528082526114d8565b83826040018181516114cb9190612f06565b6001600160401b03169052505b5f8260200151836040015160646114ef9190612f2d565b6114f99190612f58565b600485015490915060ff600160e01b909104811690821611156115795760405162461bcd60e51b815260206004820152603260248201527f5374616b696e674d616e616765723a204d6178696d756d20686f75726c7920636044820152711a1d5c9b881c985d1948195e18d95959195960721b6064820152608401610305565b5050805160058301556020810151600690920180546040909201516001600160401b03908116600160401b026001600160801b031990931693169290921717905550565b5f808251602c146115e05760405162461bcd60e51b815260040161030590612f7d565b5f805b6004811015611631576115f7816003612ecc565b611602906008612baf565b63ffffffff1685828151811061161a5761161a612edf565b016020015160f81c901b91909117906001016115e3565b5063ffffffff81166003146116585760405162461bcd60e51b815260040161030590612fc4565b5f805b60208110156116ad5761166f81601f612ecc565b61167a906008612baf565b86611686836004612ef3565b8151811061169657611696612edf565b016020015160f81c901b919091179060010161165b565b505f805b600881101561170c576116c5816007612ecc565b6116d0906008612baf565b6001600160401b0316876116e5836024612ef3565b815181106116f5576116f5612edf565b016020015160f81c901b91909117906001016116b1565b50909590945092505050565b5f61172161202a565b5f80516020613163833981519152426001600160401b03851611801561175b57506001600160401b038416611759426202a300612ef3565b115b6117bb5760405162461bcd60e51b815260206004820152602b60248201527f5374616b696e674d616e616765723a20496e76616c696420726567697374726160448201526a74696f6e2065787069727960a81b6064820152608401610305565b856118085760405162461bcd60e51b815260206004820152601f60248201527f5374616b696e674d616e616765723a20496e76616c6964206e6f6465204944006044820152606401610305565b5f868152600982016020526040902054156118745760405162461bcd60e51b815260206004820152602660248201527f5374616b696e674d616e616765723a204e6f646520494420616c72656164792060448201526561637469766560d01b6064820152608401610305565b82516040146118d65760405162461bcd60e51b815260206004820152602860248201527f5374616b696e674d616e616765723a20496e76616c6964207369676e617475726044820152670ca40d8cadccee8d60c31b6064820152608401610305565b5f6118e086612074565b90505f6118ec82610393565b90506118f781611410565b8260020154816001600160401b03161015801561192157508260030154816001600160401b031611155b6119795760405162461bcd60e51b8152602060048201526024808201527f5374616b696e674d616e616765723a20496e76616c6964207374616b6520616d6044820152631bdd5b9d60e21b6064820152608401610305565b5f806119c06040518060a00160405280876001015481526020018c8152602001856001600160401b031681526020018a6001600160401b03168152602001898152506120aa565b5f828152600788016020526040902091935091506119de828261304d565b5060405163ee5b48eb60e01b81525f906005600160991b019063ee5b48eb90611a0b908590600401612b2b565b6020604051808303815f875af1158015611a27573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611a4b9190612b5d565b6040805161012081019091529091508060018152602081018d90526001600160401b03861660408201525f606082018190526080820181905260a082015260c001336001600160a01b031681525f6020808301829052604092830182905286825260088a0190522081518154829060ff19166001836005811115611ad157611ad1612af5565b021790555060208281015160018301556040808401516002840180546060870151608088015160a08901516001600160401b03908116600160c01b026001600160c01b03928216600160801b02929092166001600160801b03938216600160401b026001600160801b03199095169682169690961793909317919091169390931792909217905560c08501516003909401805460e0870151610100909701518316600160a81b0267ffffffffffffffff60a81b19971515600160a01b026001600160a81b03199092166001600160a01b039097169690961717959095169390931790935582518783168152918c169082015282918d9186917f79b81620b81daf2c08cd5bb3dbb79e75d2d7a87f52171fde5aadc8c47823026e910160405180910390a45090945050505050610a6060017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b5f808251602514611c485760405162461bcd60e51b815260040161030590612f7d565b5f805b6004811015611c9957611c5f816003612ecc565b611c6a906008612baf565b63ffffffff16858281518110611c8257611c82612edf565b016020015160f81c901b9190911790600101611c4b565b5063ffffffff8116600114611cc05760405162461bcd60e51b815260040161030590612fc4565b5f805b6020811015611d1557611cd781601f612ecc565b611ce2906008612baf565b86611cee836004612ef3565b81518110611cfe57611cfe612edf565b016020015160f81c901b9190911790600101611cc3565b505f85602481518110611d2a57611d2a612edf565b016020015191966001600160f81b031990921615159550909350505050565b5f805f8351603414611d6d5760405162461bcd60e51b815260040161030590612f7d565b5f805b6004811015611dbe57611d84816003612ecc565b611d8f906008612baf565b63ffffffff16868281518110611da757611da7612edf565b016020015160f81c901b9190911790600101611d70565b5063ffffffff8116600214611de55760405162461bcd60e51b815260040161030590612fc4565b5f805b6020811015611e3a57611dfc81601f612ecc565b611e07906008612baf565b87611e13836004612ef3565b81518110611e2357611e23612edf565b016020015160f81c901b9190911790600101611de8565b505f805b6008811015611e9957611e52816007612ecc565b611e5d906008612baf565b6001600160401b031688611e72836024612ef3565b81518110611e8257611e82612edf565b016020015160f81c901b9190911790600101611e3e565b505f805b6008811015611ef857611eb1816007612ecc565b611ebc906008612baf565b6001600160401b031689611ed183602c612ef3565b81518110611ee157611ee1612edf565b016020015160f81c901b9190911790600101611e9d565b50919790965090945092505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff16611f5057604051631afcd79f60e31b815260040160405180910390fd5b565b611f5a611f07565b611f626121d8565b611f6a6121e8565b611f73816121f0565b50565b611f7e611f07565b7f8568826440873e37a96cb0aab773b28d8154d963d2f0e41bd9b5c15f63625f916001600160a01b03821661200a5760405162461bcd60e51b815260206004820152602c60248201527f4552433230546f6b656e5374616b696e674d616e616765723a207a65726f207460448201526b6f6b656e206164647265737360a01b6064820152608401610305565b80546001600160a01b0319166001600160a01b0392909216919091179055565b7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0080546001190161206e57604051633ee5aeb560e01b815260040160405180910390fd5b60029055565b5f6103a3827f8568826440873e37a96cb0aab773b28d8154d963d2f0e41bd9b5c15f63625f91546001600160a01b031690612320565b5f60605f806120b885612482565b60408051609480825260c082019092529294509092505f91906020820181803683370190505090505f5b600481101561213e576120f6816003612ecc565b612101906008612baf565b600163ffffffff16901c60f81b82828151811061212057612120612edf565b60200101906001600160f81b03191690815f1a9053506001016120e2565b505f5b60908110156121a55782818151811061215c5761215c612edf565b01602001516001600160f81b03191682612177836004612ef3565b8151811061218757612187612edf565b60200101906001600160f81b03191690815f1a905350600101612141565b5091959194509092505050565b60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b6121e0611f07565b611f50612768565b611f50611f07565b6121f8611f07565b80355f8051602061316383398151915290815560208201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6015560408201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6025560608201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6035561229060a0830160808401612909565b60048201805467ffffffffffffffff19166001600160401b03929092169190911790556122c360c0830160a0840161310c565b60048201805460ff92909216600160e01b0260ff60e01b199092169190911790556122f460e0830160c0840161312c565b8160040160086101000a8154816001600160a01b0302191690836001600160a01b031602179055505050565b6040516370a0823160e01b81523060048201525f9081906001600160a01b038516906370a0823190602401602060405180830381865afa158015612366573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061238a9190612b5d565b90506123a16001600160a01b038516333086612770565b6040516370a0823160e01b81523060048201525f906001600160a01b038616906370a0823190602401602060405180830381865afa1580156123e5573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906124099190612b5d565b905081811161246f5760405162461bcd60e51b815260206004820152602c60248201527f5361666545524332305472616e7366657246726f6d3a2062616c616e6365206e60448201526b1bdd081a5b98dc99585cd95960a21b6064820152608401610305565b6124798282612ecc565b95945050505050565b5f60608260800151516040146124ec5760405162461bcd60e51b815260206004820152602960248201527f5374616b696e674d657373616765733a20496e76616c6964207369676e6174756044820152680e4ca40d8cadccee8d60bb1b6064820152608401610305565b60408051609080825260c082019092525f916020820181803683370190505090505f5b602081101561255f578451816020811061252b5761252b612edf565b1a60f81b82828151811061254157612541612edf565b60200101906001600160f81b03191690815f1a90535060010161250f565b505f5b60208110156125bf578460200151816020811061258157612581612edf565b1a60f81b82612591836020612ef3565b815181106125a1576125a1612edf565b60200101906001600160f81b03191690815f1a905350600101612562565b505f5b6008811015612633576125d6816007612ecc565b6125e1906008612baf565b60ff1685604001516001600160401b0316901c60f81b828260406126059190612ef3565b8151811061261557612615612edf565b60200101906001600160f81b03191690815f1a9053506001016125c2565b505f5b60088110156126a55761264a816007612ecc565b612655906008612baf565b60608601516001600160401b0390811691161c60f81b82612677836048612ef3565b8151811061268757612687612edf565b60200101906001600160f81b03191690815f1a905350600101612636565b505f5b604081101561271057846080015181815181106126c7576126c7612edf565b01602001516001600160f81b031916826126e2836050612ef3565b815181106126f2576126f2612edf565b60200101906001600160f81b03191690815f1a9053506001016126a8565b506002816040516127219190613147565b602060405180830381855afa15801561273c573d5f803e3d5ffd5b5050506040513d601f19601f8201168201806040525081019061275f9190612b5d565b94909350915050565b6121b2611f07565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526127ca9085906127d0565b50505050565b5f8060205f8451602086015f885af1806127ef576040513d5f823e3d81fd5b50505f513d91508115612806578060011415612813565b6001600160a01b0384163b155b156127ca57604051635274afe760e01b81526001600160a01b0385166004820152602401610305565b50805461284890612dc5565b5f825580601f10612857575050565b601f0160209004905f5260205f2090810190611f7391905b80821115612882575f815560010161286f565b5090565b5f60208284031215612896575f80fd5b5035919050565b6001600160a01b0381168114611f73575f80fd5b5f808284036101008112156128c4575f80fd5b60e08112156128d1575f80fd5b5082915060e08301356128e38161289d565b809150509250929050565b80356001600160401b0381168114612904575f80fd5b919050565b5f60208284031215612919575f80fd5b612922826128ee565b9392505050565b8015158114611f73575f80fd5b803563ffffffff81168114612904575f80fd5b5f805f6060848603121561295b575f80fd5b83359250602084013561296d81612929565b915061297b60408501612936565b90509250925092565b634e487b7160e01b5f52604160045260245ffd5b604051606081016001600160401b03811182821017156129ba576129ba612984565b60405290565b604051601f8201601f191681016001600160401b03811182821017156129e8576129e8612984565b604052919050565b5f6001600160401b03821115612a0857612a08612984565b50601f01601f191660200190565b5f805f8060808587031215612a29575f80fd5b8435935060208501359250612a40604086016128ee565b915060608501356001600160401b03811115612a5a575f80fd5b8501601f81018713612a6a575f80fd5b8035612a7d612a78826129f0565b6129c0565b818152886020838501011115612a91575f80fd5b816020840160208301375f6020838301015280935050505092959194509250565b5f60208284031215612ac2575f80fd5b61292282612936565b5f8060408385031215612adc575f80fd5b612ae583612936565b915060208301356128e381612929565b634e487b7160e01b5f52602160045260245ffd5b5f5b83811015612b23578181015183820152602001612b0b565b50505f910152565b602081525f8251806020840152612b49816040850160208701612b09565b601f01601f19169190910160400192915050565b5f60208284031215612b6d575f80fd5b5051919050565b634e487b7160e01b5f52601260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b5f82612baa57612baa612b74565b500490565b80820281158282048414176103a3576103a3612b88565b6020808252602a908201527f5374616b696e674d616e616765723a2053656e646572206e6f742076616c696460408201526930ba37b91037bbb732b960b11b606082015260800190565b805161290481612929565b5f8060408385031215612c2c575f80fd5b82516001600160401b0380821115612c42575f80fd5b9084019060608287031215612c55575f80fd5b612c5d612998565b82518152602080840151612c708161289d565b82820152604084015183811115612c85575f80fd5b80850194505087601f850112612c99575f80fd5b83519250612ca9612a78846129f0565b8381528882858701011115612cbc575f80fd5b612ccb84838301848801612b09565b80604084015250819550612ce0818801612c10565b9450505050509250929050565b60208082526024908201527f5374616b696e674d616e616765723a20496e76616c69642077617270206d65736040820152637361676560e01b606082015260800190565b60208082526027908201527f5374616b696e674d616e616765723a20496e76616c696420736f7572636520636040820152661a185a5b88125160ca1b606082015260800190565b6020808252602d908201527f5374616b696e674d616e616765723a20496e76616c6964206f726967696e207360408201526c656e646572206164647265737360981b606082015260800190565b600181811c90821680612dd957607f821691505b602082108103612df757634e487b7160e01b5f52602260045260245ffd5b50919050565b60208082526025908201527f5374616b696e674d616e616765723a20496e76616c69642076616c69646174696040820152641bdb88125160da1b606082015260800190565b5f60208083525f8454612e5481612dc5565b806020870152604060018084165f8114612e755760018114612e9157612ebe565b60ff19851660408a0152604084151560051b8a01019550612ebe565b895f5260205f205f5b85811015612eb55781548b8201860152908301908801612e9a565b8a016040019650505b509398975050505050505050565b818103818111156103a3576103a3612b88565b634e487b7160e01b5f52603260045260245ffd5b808201808211156103a3576103a3612b88565b6001600160401b03818116838216019080821115612f2657612f26612b88565b5092915050565b6001600160401b03818116838216028082169190828114612f5057612f50612b88565b505092915050565b5f6001600160401b0380841680612f7157612f71612b74565b92169190910492915050565b60208082526027908201527f5374616b696e674d657373616765733a20496e76616c6964206d657373616765604082015266040d8cadccee8d60cb1b606082015260800190565b60208082526025908201527f5374616b696e674d657373616765733a20496e76616c6964206d657373616765604082015264207479706560d81b606082015260800190565b601f821115610e0457805f5260205f20601f840160051c8101602085101561302e5750805b601f840160051c820191505b8181101561038c575f815560010161303a565b81516001600160401b0381111561306657613066612984565b61307a816130748454612dc5565b84613009565b602080601f8311600181146130ad575f84156130965750858301515b5f19600386901b1c1916600185901b178555613104565b5f85815260208120601f198616915b828110156130db578886015182559484019460019091019084016130bc565b50858210156130f857878501515f19600388901b60f8161c191681555b505060018460011b0185555b505050505050565b5f6020828403121561311c575f80fd5b813560ff81168114612922575f80fd5b5f6020828403121561313c575f80fd5b81356129228161289d565b5f8251613158818460208701612b09565b919091019291505056feafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab600a164736f6c6343000819000a", + Bin: "0x608060405234801561000f575f80fd5b5060405161344238038061344283398101604081905261002e91610107565b60018160018111156100425761004261012c565b0361004f5761004f610055565b50610140565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156100a55760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146101045780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b5f60208284031215610117575f80fd5b815160028110610125575f80fd5b9392505050565b634e487b7160e01b5f52602160045260245ffd5b6132f58061014d5f395ff3fe608060405234801561000f575f80fd5b506004361061009b575f3560e01c8063872fda6411610063578063872fda641461012b578063a3a65e481461013e578063b771b3bc14610151578063bee0a03f14610177578063fdf94a1a1461018a575f80fd5b80630322ed981461009f5780632e2194d8146100b45780635d0d7466146100e457806362065856146100f757806376f7862114610118575b5f80fd5b6100b26100ad3660046129ec565b61019d565b005b6100c76100c23660046129ec565b610393565b6040516001600160401b0390911681526020015b60405180910390f35b6100b26100f2366004612a17565b6103a9565b61010a610105366004612a6f565b6104b7565b6040519081526020016100db565b6100b2610126366004612aaf565b6104d0565b61010a610139366004612b7c565b610a50565b6100b261014c366004612c18565b610a68565b61015f6005600160991b0181565b6040516001600160a01b0390911681526020016100db565b6100b26101853660046129ec565b610cf5565b6100b2610198366004612c31565b610e09565b5f8181527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab60860205260408082208151610120810190925280545f805160206132c983398151915293929190829060ff1660058111156101fe576101fe612c5b565b600581111561020f5761020f612c5b565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003928301546001600160a01b03811660c084015260ff600160a01b820416151560e0840152600160a81b90041661010090910152909150815160058111156102a6576102a6612c5b565b1461030e5760405162461bcd60e51b815260206004820152602d60248201527f5374616b696e674d616e616765723a2056616c696461746f72206e6f7420706560448201526c1b991a5b99c81c995b5bdd985b609a1b60648201526084015b60405180910390fd5b5f61031f848361010001515f611230565b60405163ee5b48eb60e01b81529091506005600160991b019063ee5b48eb9061034c908490600401612c91565b6020604051808303815f875af1158015610368573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061038c9190612cc3565b5050505050565b5f6103a364e8d4a5100083612d02565b92915050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff1615906001600160401b03165f811580156103ed5750825b90505f826001600160401b031660011480156104085750303b155b905081158015610416575080155b156104345760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561045e57845460ff60401b1916600160401b1785555b61046887876113f2565b83156104ae57845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50505050505050565b5f6103a36001600160401b03831664e8d4a51000612d15565b5f8381527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab60860205260408082208151610120810190925280545f805160206132c983398151915293929190829060ff16600581111561053157610531612c5b565b600581111561054257610542612c5b565b8152600182015460208201526002808301546001600160401b038082166040850152600160401b820481166060850152600160801b820481166080850152600160c01b909104811660a08401526003909301546001600160a01b03811660c084015260ff600160a01b820416151560e0840152600160a81b900490921661010090910152909150815160058111156105dc576105dc612c5b565b146106355760405162461bcd60e51b8152602060048201526024808201527f5374616b696e674d616e616765723a2056616c696461746f72206e6f742061636044820152637469766560e01b6064820152608401610305565b60c08101516001600160a01b0316336001600160a01b03161461066a5760405162461bcd60e51b815260040161030590612d2c565b6106778160400151611410565b60038152426001600160401b031660808201525f8415610850576040516306f8253560e41b815263ffffffff851660048201525f9081906005600160991b0190636f825350906024015f60405180830381865afa1580156106da573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f191682016040526107019190810190612d81565b91509150806107225760405162461bcd60e51b815260040161030590612e53565b6005600160991b016001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa158015610765573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107899190612cc3565b8251146107a85760405162461bcd60e51b815260040161030590612e97565b60208201516001600160a01b0316156107d35760405162461bcd60e51b815260040161030590612ede565b5f806107e284604001516115bd565b91509150818a1461084a5760405162461bcd60e51b815260206004820152602c60248201527f5374616b696e674d616e616765723a20496e76616c696420757074696d65207660448201526b185b1a59185d1a5bdb88125160a21b6064820152608401610305565b93505050505b6001600160401b03811660a08301525f86815260088401602052604090208251815484929190829060ff1916600183600581111561089057610890612c5b565b02179055506020820151600182015560408201516002820180546060850151608086015160a08701516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c08301516003909201805460e0850151610100958601516001600160a01b039095166001600160a81b031990921691909117600160a01b911515919091021767ffffffffffffffff60a81b1916600160a81b93909216929092021790558201515f9061098190889083611230565b60405163ee5b48eb60e01b81529091505f906005600160991b019063ee5b48eb906109b0908590600401612c91565b6020604051808303815f875af11580156109cc573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109f09190612cc3565b60408581015181516001600160401b03918216815242602082015290861681830152905191925082918a917f530b908725650fb1052974f9df59e834fefac78c9ec2f00c6d2464d60cc6add5919081900360600190a35050505050505050565b5f610a5d84868585611718565b90505b949350505050565b5f5f805160206132c98339815191526040516306f8253560e41b815263ffffffff841660048201529091505f9081906005600160991b0190636f825350906024015f60405180830381865afa158015610ac3573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052610aea9190810190612d81565b9150915080610b0b5760405162461bcd60e51b815260040161030590612e53565b8254825114610b2c5760405162461bcd60e51b815260040161030590612e97565b60208201516001600160a01b031615610b575760405162461bcd60e51b815260040161030590612ede565b5f80610b668460400151611cdc565b9150915080610bc65760405162461bcd60e51b815260206004820152602660248201527f5374616b696e674d616e616765723a20526567697374726174696f6e206e6f74604482015265081d985b1a5960d21b6064820152608401610305565b5f82815260078601602052604081208054610be090612f2b565b9050118015610c12575060015f83815260088701602052604090205460ff166005811115610c1057610c10612c5b565b145b610c2e5760405162461bcd60e51b815260040161030590612f63565b5f8281526007860160205260408120610c46916129a2565b5f8281526008860160208181526040808420805460ff191660029081178255810180546001600160401b0342818116600160401b026fffffffffffffffff000000000000000019909316929092178355600190930154875260098c0185528387208990559588905293835292548151931683529082019290925283917ff8fd1c90fb9cfa2ca2358fdf5806b086ad43315d92b221c929efc7f105ce7568910160405180910390a2505050505050565b5f8181527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6076020526040812080545f805160206132c9833981519152929190610d3d90612f2b565b9050118015610d6f575060015f83815260088301602052604090205460ff166005811115610d6d57610d6d612c5b565b145b610d8b5760405162461bcd60e51b815260040161030590612f63565b5f82815260078201602052604090819020905163ee5b48eb60e01b81526005600160991b019163ee5b48eb91610dc49190600401612fa8565b6020604051808303815f875af1158015610de0573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e049190612cc3565b505050565b5f5f805160206132c98339815191526040516306f8253560e41b815263ffffffff851660048201529091505f9081906005600160991b0190636f825350906024015f60405180830381865afa158015610e64573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052610e8b9190810190612d81565b9150915080610eac5760405162461bcd60e51b815260040161030590612e53565b5f8415610f25575f610ec18460400151611eb7565b919350909150506001600160401b03811615610f1f5760405162461bcd60e51b815260206004820181905260248201527f5374616b696e674d616e616765723a20576569676874206d75737420626520306044820152606401610305565b50610f99565b5f610f338460400151611cdc565b90925090508015610f975760405162461bcd60e51b815260206004820152602860248201527f5374616b696e674d616e616765723a20526567697374726174696f6e207374696044820152671b1b081d985b1a5960c21b6064820152608401610305565b505b5f818152600885016020526040808220815161012081019092528054829060ff166005811115610fcb57610fcb612c5b565b6005811115610fdc57610fdc612c5b565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003909201546001600160a01b0380821660c080850191909152600160a01b830460ff16151560e0850152600160a81b9092049093166101009092019190915282015191925016331461108d5760405162461bcd60e51b815260040161030590612d2c565b5f6003825160058111156110a3576110a3612c5b565b14806110c157506002825160058111156110bf576110bf612c5b565b145b156110e457506020808201515f90815260098701909152604081205560046110e8565b5060055b5f83815260088701602052604090208251815484929190829060ff1916600183600581111561111957611119612c5b565b0217905550602082015160018201556040808301516002830180546060860151608087015160a08801516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c08401516003909301805460e0860151610100909601516001600160a01b039095166001600160a81b031990911617600160a01b951515959095029490941767ffffffffffffffff60a81b1916600160a81b9390911692909202919091179091555183907f3532ad18e70a039beb4663d48c15acbef558c96ec9b8fd0cc3c0304f774740b8905f90a25050505050505050565b60408051603480825260608281019093525f91906020820181803683370190505090505f5b60048110156112b157611269816003613032565b611274906008612d15565b600163ffffffff16901c60f81b82828151811061129357611293613045565b60200101906001600160f81b03191690815f1a905350600101611255565b505f5b6020811015611313576112c881601f613032565b6112d3906008612d15565b86901c60f81b826112e5836004613059565b815181106112f5576112f5613045565b60200101906001600160f81b03191690815f1a9053506001016112b4565b505f5b600881101561137e5761132a816007613032565b611335906008612d15565b6001600160401b038616901c60f81b82611350836024613059565b8151811061136057611360613045565b60200101906001600160f81b03191690815f1a905350600101611316565b505f5b60088110156113e957611395816007613032565b6113a0906008612d15565b6001600160401b038516901c60f81b826113bb83602c613059565b815181106113cb576113cb613045565b60200101906001600160f81b03191690815f1a905350600101611381565b50949350505050565b6113fa612075565b611403826120c0565b61140c816120e4565b5050565b7fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab604545f805160206132c983398151915290600160e01b900460ff165f03611455575050565b60408051606081018252600583015480825260068401546001600160401b038082166020850152600160401b9091041692820192909252904290610e109061149d9083613032565b106114b9576001600160401b03841660408301528082526114d8565b83826040018181516114cb919061306c565b6001600160401b03169052505b5f8260200151836040015160646114ef9190613093565b6114f991906130be565b600485015490915060ff600160e01b909104811690821611156115795760405162461bcd60e51b815260206004820152603260248201527f5374616b696e674d616e616765723a204d6178696d756d20686f75726c7920636044820152711a1d5c9b881c985d1948195e18d95959195960721b6064820152608401610305565b5050805160058301556020810151600690920180546040909201516001600160401b03908116600160401b026001600160801b031990931693169290921717905550565b5f808251602c146115e05760405162461bcd60e51b8152600401610305906130e3565b5f805b6004811015611631576115f7816003613032565b611602906008612d15565b63ffffffff1685828151811061161a5761161a613045565b016020015160f81c901b91909117906001016115e3565b5063ffffffff81166004146116585760405162461bcd60e51b81526004016103059061312a565b5f805b60208110156116ad5761166f81601f613032565b61167a906008612d15565b86611686836004613059565b8151811061169657611696613045565b016020015160f81c901b919091179060010161165b565b505f805b600881101561170c576116c5816007613032565b6116d0906008612d15565b6001600160401b0316876116e5836024613059565b815181106116f5576116f5613045565b016020015160f81c901b91909117906001016116b1565b50909590945092505050565b5f611721612198565b5f805160206132c9833981519152670de0b6b3a7640000851461176f5760405162461bcd60e51b815260206004820152600660248201526563616e61727960d01b6044820152606401610305565b8060020154620f4240146117af5760405162461bcd60e51b815260206004820152600760248201526631b0b730b93c9960c91b6044820152606401610305565b806003015462989680146117ef5760405162461bcd60e51b815260206004820152600760248201526663616e6172793360c81b6044820152606401610305565b42846001600160401b031611801561181b57506001600160401b038416611819426202a300613059565b115b61187b5760405162461bcd60e51b815260206004820152602b60248201527f5374616b696e674d616e616765723a20496e76616c696420726567697374726160448201526a74696f6e2065787069727960a81b6064820152608401610305565b856118c85760405162461bcd60e51b815260206004820152601f60248201527f5374616b696e674d616e616765723a20496e76616c6964206e6f6465204944006044820152606401610305565b5f868152600982016020526040902054156119345760405162461bcd60e51b815260206004820152602660248201527f5374616b696e674d616e616765723a204e6f646520494420616c72656164792060448201526561637469766560d01b6064820152608401610305565b82516040146119965760405162461bcd60e51b815260206004820152602860248201527f5374616b696e674d616e616765723a20496e76616c6964207369676e617475726044820152670ca40d8cadccee8d60c31b6064820152608401610305565b5f6119a0866121e2565b90505f6119ac82610393565b90508260020154816001600160401b0316101580156119d857508260030154816001600160401b031611155b611a305760405162461bcd60e51b8152602060048201526024808201527f5374616b696e674d616e616765723a20496e76616c6964207374616b6520616d6044820152631bdd5b9d60e21b6064820152608401610305565b5f80611a776040518060a00160405280876001015481526020018c8152602001856001600160401b031681526020018a6001600160401b0316815260200189815250612218565b5f82815260078801602052604090209193509150611a9582826131b3565b5060405163ee5b48eb60e01b81525f906005600160991b019063ee5b48eb90611ac2908590600401612c91565b6020604051808303815f875af1158015611ade573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611b029190612cc3565b6040805161012081019091529091508060018152602081018d90526001600160401b03861660408201525f606082018190526080820181905260a082015260c001336001600160a01b031681525f6020808301829052604092830182905286825260088a0190522081518154829060ff19166001836005811115611b8857611b88612c5b565b021790555060208281015160018301556040808401516002840180546060870151608088015160a08901516001600160401b03908116600160c01b026001600160c01b03928216600160801b02929092166001600160801b03938216600160401b026001600160801b03199095169682169690961793909317919091169390931792909217905560c08501516003909401805460e0870151610100909701518316600160a81b0267ffffffffffffffff60a81b19971515600160a01b026001600160a81b03199092166001600160a01b039097169690961717959095169390931790935582518783168152918c169082015282918d9186917f79b81620b81daf2c08cd5bb3dbb79e75d2d7a87f52171fde5aadc8c47823026e910160405180910390a45090945050505050610a6060017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b5f808251602714611cff5760405162461bcd60e51b8152600401610305906130e3565b5f805b6002811015611d4e57611d16816001613032565b611d21906008612d15565b61ffff16858281518110611d3757611d37613045565b016020015160f81c901b9190911790600101611d02565b5061ffff811615611dab5760405162461bcd60e51b815260206004820152602160248201527f5374616b696e674d657373616765733a20496e76616c696420636f64656320496044820152601160fa1b6064820152608401610305565b5f805b6004811015611e0657611dc2816003613032565b611dcd906008612d15565b63ffffffff1686611ddf836002613059565b81518110611def57611def613045565b016020015160f81c901b9190911790600101611dae565b5063ffffffff8116600214611e2d5760405162461bcd60e51b81526004016103059061312a565b5f805b6020811015611e8257611e4481601f613032565b611e4f906008612d15565b87611e5b836006613059565b81518110611e6b57611e6b613045565b016020015160f81c901b9190911790600101611e30565b505f86602681518110611e9757611e97613045565b016020015191976001600160f81b03199092161515965090945050505050565b5f805f8351603414611edb5760405162461bcd60e51b8152600401610305906130e3565b5f805b6004811015611f2c57611ef2816003613032565b611efd906008612d15565b63ffffffff16868281518110611f1557611f15613045565b016020015160f81c901b9190911790600101611ede565b5063ffffffff8116600114611f535760405162461bcd60e51b81526004016103059061312a565b5f805b6020811015611fa857611f6a81601f613032565b611f75906008612d15565b87611f81836004613059565b81518110611f9157611f91613045565b016020015160f81c901b9190911790600101611f56565b505f805b600881101561200757611fc0816007613032565b611fcb906008612d15565b6001600160401b031688611fe0836024613059565b81518110611ff057611ff0613045565b016020015160f81c901b9190911790600101611fac565b505f805b60088110156120665761201f816007613032565b61202a906008612d15565b6001600160401b03168961203f83602c613059565b8151811061204f5761204f613045565b016020015160f81c901b919091179060010161200b565b50919790965090945092505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff166120be57604051631afcd79f60e31b815260040160405180910390fd5b565b6120c8612075565b6120d061233e565b6120d861234e565b6120e181612356565b50565b6120ec612075565b7f8568826440873e37a96cb0aab773b28d8154d963d2f0e41bd9b5c15f63625f916001600160a01b0382166121785760405162461bcd60e51b815260206004820152602c60248201527f4552433230546f6b656e5374616b696e674d616e616765723a207a65726f207460448201526b6f6b656e206164647265737360a01b6064820152608401610305565b80546001600160a01b0319166001600160a01b0392909216919091179055565b7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f008054600119016121dc57604051633ee5aeb560e01b815260040160405180910390fd5b60029055565b5f6103a3827f8568826440873e37a96cb0aab773b28d8154d963d2f0e41bd9b5c15f63625f91546001600160a01b031690612486565b5f60605f80612226856125e8565b60408051609480825260c082019092529294509092505f91906020820181803683370190505090505f5b60048110156122a457612264816003613032565b61226f906008612d15565b5081515f9083908390811061228657612286613045565b60200101906001600160f81b03191690815f1a905350600101612250565b505f5b609081101561230b578281815181106122c2576122c2613045565b01602001516001600160f81b031916826122dd836004613059565b815181106122ed576122ed613045565b60200101906001600160f81b03191690815f1a9053506001016122a7565b5091959194509092505050565b60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b612346612075565b6120be6128ce565b6120be612075565b61235e612075565b80355f805160206132c983398151915290815560208201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6015560408201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6025560608201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab603556123f660a0830160808401612a6f565b60048201805467ffffffffffffffff19166001600160401b039290921691909117905561242960c0830160a08401613272565b60048201805460ff92909216600160e01b0260ff60e01b1990921691909117905561245a60e0830160c08401613292565b8160040160086101000a8154816001600160a01b0302191690836001600160a01b031602179055505050565b6040516370a0823160e01b81523060048201525f9081906001600160a01b038516906370a0823190602401602060405180830381865afa1580156124cc573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906124f09190612cc3565b90506125076001600160a01b0385163330866128d6565b6040516370a0823160e01b81523060048201525f906001600160a01b038616906370a0823190602401602060405180830381865afa15801561254b573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061256f9190612cc3565b90508181116125d55760405162461bcd60e51b815260206004820152602c60248201527f5361666545524332305472616e7366657246726f6d3a2062616c616e6365206e60448201526b1bdd081a5b98dc99585cd95960a21b6064820152608401610305565b6125df8282613032565b95945050505050565b5f60608260800151516040146126525760405162461bcd60e51b815260206004820152602960248201527f5374616b696e674d657373616765733a20496e76616c6964207369676e6174756044820152680e4ca40d8cadccee8d60bb1b6064820152608401610305565b60408051609080825260c082019092525f916020820181803683370190505090505f5b60208110156126c5578451816020811061269157612691613045565b1a60f81b8282815181106126a7576126a7613045565b60200101906001600160f81b03191690815f1a905350600101612675565b505f5b602081101561272557846020015181602081106126e7576126e7613045565b1a60f81b826126f7836020613059565b8151811061270757612707613045565b60200101906001600160f81b03191690815f1a9053506001016126c8565b505f5b60088110156127995761273c816007613032565b612747906008612d15565b60ff1685604001516001600160401b0316901c60f81b8282604061276b9190613059565b8151811061277b5761277b613045565b60200101906001600160f81b03191690815f1a905350600101612728565b505f5b600881101561280b576127b0816007613032565b6127bb906008612d15565b60608601516001600160401b0390811691161c60f81b826127dd836048613059565b815181106127ed576127ed613045565b60200101906001600160f81b03191690815f1a90535060010161279c565b505f5b6040811015612876578460800151818151811061282d5761282d613045565b01602001516001600160f81b03191682612848836050613059565b8151811061285857612858613045565b60200101906001600160f81b03191690815f1a90535060010161280e565b5060028160405161288791906132ad565b602060405180830381855afa1580156128a2573d5f803e3d5ffd5b5050506040513d601f19601f820116820180604052508101906128c59190612cc3565b94909350915050565b612318612075565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052612930908590612936565b50505050565b5f8060205f8451602086015f885af180612955576040513d5f823e3d81fd5b50505f513d9150811561296c578060011415612979565b6001600160a01b0384163b155b1561293057604051635274afe760e01b81526001600160a01b0385166004820152602401610305565b5080546129ae90612f2b565b5f825580601f106129bd575050565b601f0160209004905f5260205f20908101906120e191905b808211156129e8575f81556001016129d5565b5090565b5f602082840312156129fc575f80fd5b5035919050565b6001600160a01b03811681146120e1575f80fd5b5f80828403610100811215612a2a575f80fd5b60e0811215612a37575f80fd5b5082915060e0830135612a4981612a03565b809150509250929050565b80356001600160401b0381168114612a6a575f80fd5b919050565b5f60208284031215612a7f575f80fd5b612a8882612a54565b9392505050565b80151581146120e1575f80fd5b803563ffffffff81168114612a6a575f80fd5b5f805f60608486031215612ac1575f80fd5b833592506020840135612ad381612a8f565b9150612ae160408501612a9c565b90509250925092565b634e487b7160e01b5f52604160045260245ffd5b604051606081016001600160401b0381118282101715612b2057612b20612aea565b60405290565b604051601f8201601f191681016001600160401b0381118282101715612b4e57612b4e612aea565b604052919050565b5f6001600160401b03821115612b6e57612b6e612aea565b50601f01601f191660200190565b5f805f8060808587031215612b8f575f80fd5b8435935060208501359250612ba660408601612a54565b915060608501356001600160401b03811115612bc0575f80fd5b8501601f81018713612bd0575f80fd5b8035612be3612bde82612b56565b612b26565b818152886020838501011115612bf7575f80fd5b816020840160208301375f6020838301015280935050505092959194509250565b5f60208284031215612c28575f80fd5b612a8882612a9c565b5f8060408385031215612c42575f80fd5b612c4b83612a9c565b91506020830135612a4981612a8f565b634e487b7160e01b5f52602160045260245ffd5b5f5b83811015612c89578181015183820152602001612c71565b50505f910152565b602081525f8251806020840152612caf816040850160208701612c6f565b601f01601f19169190910160400192915050565b5f60208284031215612cd3575f80fd5b5051919050565b634e487b7160e01b5f52601260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b5f82612d1057612d10612cda565b500490565b80820281158282048414176103a3576103a3612cee565b6020808252602a908201527f5374616b696e674d616e616765723a2053656e646572206e6f742076616c696460408201526930ba37b91037bbb732b960b11b606082015260800190565b8051612a6a81612a8f565b5f8060408385031215612d92575f80fd5b82516001600160401b0380821115612da8575f80fd5b9084019060608287031215612dbb575f80fd5b612dc3612afe565b82518152602080840151612dd681612a03565b82820152604084015183811115612deb575f80fd5b80850194505087601f850112612dff575f80fd5b83519250612e0f612bde84612b56565b8381528882858701011115612e22575f80fd5b612e3184838301848801612c6f565b80604084015250819550612e46818801612d76565b9450505050509250929050565b60208082526024908201527f5374616b696e674d616e616765723a20496e76616c69642077617270206d65736040820152637361676560e01b606082015260800190565b60208082526027908201527f5374616b696e674d616e616765723a20496e76616c696420736f7572636520636040820152661a185a5b88125160ca1b606082015260800190565b6020808252602d908201527f5374616b696e674d616e616765723a20496e76616c6964206f726967696e207360408201526c656e646572206164647265737360981b606082015260800190565b600181811c90821680612f3f57607f821691505b602082108103612f5d57634e487b7160e01b5f52602260045260245ffd5b50919050565b60208082526025908201527f5374616b696e674d616e616765723a20496e76616c69642076616c69646174696040820152641bdb88125160da1b606082015260800190565b5f60208083525f8454612fba81612f2b565b806020870152604060018084165f8114612fdb5760018114612ff757613024565b60ff19851660408a0152604084151560051b8a01019550613024565b895f5260205f205f5b8581101561301b5781548b8201860152908301908801613000565b8a016040019650505b509398975050505050505050565b818103818111156103a3576103a3612cee565b634e487b7160e01b5f52603260045260245ffd5b808201808211156103a3576103a3612cee565b6001600160401b0381811683821601908082111561308c5761308c612cee565b5092915050565b6001600160401b038181168382160280821691908281146130b6576130b6612cee565b505092915050565b5f6001600160401b03808416806130d7576130d7612cda565b92169190910492915050565b60208082526027908201527f5374616b696e674d657373616765733a20496e76616c6964206d657373616765604082015266040d8cadccee8d60cb1b606082015260800190565b60208082526025908201527f5374616b696e674d657373616765733a20496e76616c6964206d657373616765604082015264207479706560d81b606082015260800190565b601f821115610e0457805f5260205f20601f840160051c810160208510156131945750805b601f840160051c820191505b8181101561038c575f81556001016131a0565b81516001600160401b038111156131cc576131cc612aea565b6131e0816131da8454612f2b565b8461316f565b602080601f831160018114613213575f84156131fc5750858301515b5f19600386901b1c1916600185901b17855561326a565b5f85815260208120601f198616915b8281101561324157888601518255948401946001909101908401613222565b508582101561325e57878501515f19600388901b60f8161c191681555b505060018460011b0185555b505050505050565b5f60208284031215613282575f80fd5b813560ff81168114612a88575f80fd5b5f602082840312156132a2575f80fd5b8135612a8881612a03565b5f82516132be818460208701612c6f565b919091019291505056feafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab600a164736f6c6343000819000a", } // ERC20TokenStakingManagerABI is the input ABI used to generate the binding from. diff --git a/abi-bindings/go/staking/NativeTokenStakingManager/NativeTokenStakingManager.go b/abi-bindings/go/staking/NativeTokenStakingManager/NativeTokenStakingManager.go index 0a045fe68..07a0c3cb5 100644 --- a/abi-bindings/go/staking/NativeTokenStakingManager/NativeTokenStakingManager.go +++ b/abi-bindings/go/staking/NativeTokenStakingManager/NativeTokenStakingManager.go @@ -43,7 +43,7 @@ type StakingManagerSettings struct { // NativeTokenStakingManagerMetaData contains all meta data concerning the NativeTokenStakingManager contract. var NativeTokenStakingManagerMetaData = &bind.MetaData{ ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"init\",\"type\":\"uint8\",\"internalType\":\"enumICMInitializable\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"WARP_MESSENGER\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIWarpMessenger\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"completeEndValidation\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"setWeightMessageType\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"completeValidatorRegistration\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"settings\",\"type\":\"tuple\",\"internalType\":\"structStakingManagerSettings\",\"components\":[{\"name\":\"pChainBlockchainID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"subnetID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"minimumStakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"maximumStakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"minimumStakeDuration\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"maximumHourlyChurn\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"rewardCalculator\",\"type\":\"address\",\"internalType\":\"contractIRewardCalculator\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeEndValidation\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"includeUptimeProof\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeValidatorRegistration\",\"inputs\":[{\"name\":\"nodeID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"resendEndValidatorMessage\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"resendRegisterValidatorMessage\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"valueToWeight\",\"inputs\":[{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"weightToValue\",\"inputs\":[{\"name\":\"weight\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"pure\"},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodCreated\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"nodeID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"registerValidationMessageID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"weight\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodEnded\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodRegistered\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"stakeAmount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"timestamp\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidatorRemovalInitialized\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"setWeightMessageID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"stakeAmount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"endTime\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"uptime\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ReentrancyGuardReentrantCall\",\"inputs\":[]}]", - Bin: "0x608060405234801561000f575f80fd5b50604051612fd7380380612fd783398101604081905261002e91610107565b60018160018111156100425761004261012c565b0361004f5761004f610055565b50610140565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156100a55760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146101045780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b5f60208284031215610117575f80fd5b815160028110610125575f80fd5b9392505050565b634e487b7160e01b5f52602160045260245ffd5b612e8a8061014d5f395ff3fe60806040526004361061008f575f3560e01c8063a3a65e4811610057578063a3a65e481461015b578063b771b3bc1461017a578063bee0a03f146101ac578063f40797d7146101cb578063fdf94a1a146101de575f80fd5b80630322ed98146100935780632e2194d8146100b457806362065856146100f057806376f786211461011d57806379f54eb11461013c575b5f80fd5b34801561009e575f80fd5b506100b26100ad3660046125b1565b6101fd565b005b3480156100bf575f80fd5b506100d36100ce3660046125b1565b6103f3565b6040516001600160401b0390911681526020015b60405180910390f35b3480156100fb575f80fd5b5061010f61010a3660046125e3565b610409565b6040519081526020016100e7565b348015610128575f80fd5b506100b2610137366004612623565b610422565b348015610147575f80fd5b506100b261015636600461265e565b6109a2565b348015610166575f80fd5b506100b2610175366004612674565b610aae565b348015610185575f80fd5b506101946005600160991b0181565b6040516001600160a01b0390911681526020016100e7565b3480156101b7575f80fd5b506100b26101c63660046125b1565b610d3b565b61010f6101d936600461271f565b610e4f565b3480156101e9575f80fd5b506100b26101f83660046127b1565b610e64565b5f8181527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab60860205260408082208151610120810190925280545f80516020612e5e83398151915293929190829060ff16600581111561025e5761025e6127e6565b600581111561026f5761026f6127e6565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003928301546001600160a01b03811660c084015260ff600160a01b820416151560e0840152600160a81b9004166101009091015290915081516005811115610306576103066127e6565b1461036e5760405162461bcd60e51b815260206004820152602d60248201527f5374616b696e674d616e616765723a2056616c696461746f72206e6f7420706560448201526c1b991a5b99c81c995b5bdd985b609a1b60648201526084015b60405180910390fd5b5f61037f848361010001515f61128b565b60405163ee5b48eb60e01b81529091506005600160991b019063ee5b48eb906103ac90849060040161281c565b6020604051808303815f875af11580156103c8573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103ec919061284e565b5050505050565b5f61040364e8d4a510008361288d565b92915050565b5f6104036001600160401b03831664e8d4a510006128a0565b5f8381527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab60860205260408082208151610120810190925280545f80516020612e5e83398151915293929190829060ff166005811115610483576104836127e6565b6005811115610494576104946127e6565b8152600182015460208201526002808301546001600160401b038082166040850152600160401b820481166060850152600160801b820481166080850152600160c01b909104811660a08401526003909301546001600160a01b03811660c084015260ff600160a01b820416151560e0840152600160a81b9004909216610100909101529091508151600581111561052e5761052e6127e6565b146105875760405162461bcd60e51b8152602060048201526024808201527f5374616b696e674d616e616765723a2056616c696461746f72206e6f742061636044820152637469766560e01b6064820152608401610365565b60c08101516001600160a01b0316336001600160a01b0316146105bc5760405162461bcd60e51b8152600401610365906128b7565b6105c9816040015161144d565b60038152426001600160401b031660808201525f84156107a2576040516306f8253560e41b815263ffffffff851660048201525f9081906005600160991b0190636f825350906024015f60405180830381865afa15801561062c573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f191682016040526106539190810190612920565b91509150806106745760405162461bcd60e51b8152600401610365906129f2565b6005600160991b016001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106b7573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106db919061284e565b8251146106fa5760405162461bcd60e51b815260040161036590612a36565b60208201516001600160a01b0316156107255760405162461bcd60e51b815260040161036590612a7d565b5f8061073484604001516115fa565b91509150818a1461079c5760405162461bcd60e51b815260206004820152602c60248201527f5374616b696e674d616e616765723a20496e76616c696420757074696d65207660448201526b185b1a59185d1a5bdb88125160a21b6064820152608401610365565b93505050505b6001600160401b03811660a08301525f86815260088401602052604090208251815484929190829060ff191660018360058111156107e2576107e26127e6565b02179055506020820151600182015560408201516002820180546060850151608086015160a08701516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c08301516003909201805460e0850151610100958601516001600160a01b039095166001600160a81b031990921691909117600160a01b911515919091021767ffffffffffffffff60a81b1916600160a81b93909216929092021790558201515f906108d39088908361128b565b60405163ee5b48eb60e01b81529091505f906005600160991b019063ee5b48eb9061090290859060040161281c565b6020604051808303815f875af115801561091e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610942919061284e565b60408581015181516001600160401b03918216815242602082015290861681830152905191925082918a917f530b908725650fb1052974f9df59e834fefac78c9ec2f00c6d2464d60cc6add5919081900360600190a35050505050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff1615906001600160401b03165f811580156109e65750825b90505f826001600160401b03166001148015610a015750303b155b905081158015610a0f575080155b15610a2d5760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff191660011785558315610a5757845460ff60401b1916600160401b1785555b610a6086611755565b8315610aa657845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050565b5f5f80516020612e5e8339815191526040516306f8253560e41b815263ffffffff841660048201529091505f9081906005600160991b0190636f825350906024015f60405180830381865afa158015610b09573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052610b309190810190612920565b9150915080610b515760405162461bcd60e51b8152600401610365906129f2565b8254825114610b725760405162461bcd60e51b815260040161036590612a36565b60208201516001600160a01b031615610b9d5760405162461bcd60e51b815260040161036590612a7d565b5f80610bac8460400151611769565b9150915080610c0c5760405162461bcd60e51b815260206004820152602660248201527f5374616b696e674d616e616765723a20526567697374726174696f6e206e6f74604482015265081d985b1a5960d21b6064820152608401610365565b5f82815260078601602052604081208054610c2690612aca565b9050118015610c58575060015f83815260088701602052604090205460ff166005811115610c5657610c566127e6565b145b610c745760405162461bcd60e51b815260040161036590612afc565b5f8281526007860160205260408120610c8c91612567565b5f8281526008860160208181526040808420805460ff191660029081178255810180546001600160401b0342818116600160401b026fffffffffffffffff000000000000000019909316929092178355600190930154875260098c0185528387208990559588905293835292548151931683529082019290925283917ff8fd1c90fb9cfa2ca2358fdf5806b086ad43315d92b221c929efc7f105ce7568910160405180910390a2505050505050565b5f8181527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6076020526040812080545f80516020612e5e833981519152929190610d8390612aca565b9050118015610db5575060015f83815260088301602052604090205460ff166005811115610db357610db36127e6565b145b610dd15760405162461bcd60e51b815260040161036590612afc565b5f82815260078201602052604090819020905163ee5b48eb60e01b81526005600160991b019163ee5b48eb91610e0a9190600401612b41565b6020604051808303815f875af1158015610e26573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e4a919061284e565b505050565b5f610e5c8434858561188d565b949350505050565b5f5f80516020612e5e8339815191526040516306f8253560e41b815263ffffffff851660048201529091505f9081906005600160991b0190636f825350906024015f60405180830381865afa158015610ebf573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052610ee69190810190612920565b9150915080610f075760405162461bcd60e51b8152600401610365906129f2565b5f8415610f80575f610f1c8460400151611d8f565b919350909150506001600160401b03811615610f7a5760405162461bcd60e51b815260206004820181905260248201527f5374616b696e674d616e616765723a20576569676874206d75737420626520306044820152606401610365565b50610ff4565b5f610f8e8460400151611769565b90925090508015610ff25760405162461bcd60e51b815260206004820152602860248201527f5374616b696e674d616e616765723a20526567697374726174696f6e207374696044820152671b1b081d985b1a5960c21b6064820152608401610365565b505b5f818152600885016020526040808220815161012081019092528054829060ff166005811115611026576110266127e6565b6005811115611037576110376127e6565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003909201546001600160a01b0380821660c080850191909152600160a01b830460ff16151560e0850152600160a81b909204909316610100909201919091528201519192501633146110e85760405162461bcd60e51b8152600401610365906128b7565b5f6003825160058111156110fe576110fe6127e6565b148061111c575060028251600581111561111a5761111a6127e6565b145b1561113f57506020808201515f9081526009870190915260408120556004611143565b5060055b5f83815260088701602052604090208251815484929190829060ff19166001836005811115611174576111746127e6565b0217905550602082015160018201556040808301516002830180546060860151608087015160a08801516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c08401516003909301805460e0860151610100909601516001600160a01b039095166001600160a81b031990911617600160a01b951515959095029490941767ffffffffffffffff60a81b1916600160a81b9390911692909202919091179091555183907f3532ad18e70a039beb4663d48c15acbef558c96ec9b8fd0cc3c0304f774740b8905f90a25050505050505050565b60408051603480825260608281019093525f91906020820181803683370190505090505f5b600481101561130c576112c4816003612bcb565b6112cf9060086128a0565b600263ffffffff16901c60f81b8282815181106112ee576112ee612bde565b60200101906001600160f81b03191690815f1a9053506001016112b0565b505f5b602081101561136e5761132381601f612bcb565b61132e9060086128a0565b86901c60f81b82611340836004612bf2565b8151811061135057611350612bde565b60200101906001600160f81b03191690815f1a90535060010161130f565b505f5b60088110156113d957611385816007612bcb565b6113909060086128a0565b6001600160401b038616901c60f81b826113ab836024612bf2565b815181106113bb576113bb612bde565b60200101906001600160f81b03191690815f1a905350600101611371565b505f5b6008811015611444576113f0816007612bcb565b6113fb9060086128a0565b6001600160401b038516901c60f81b8261141683602c612bf2565b8151811061142657611426612bde565b60200101906001600160f81b03191690815f1a9053506001016113dc565b50949350505050565b7fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab604545f80516020612e5e83398151915290600160e01b900460ff165f03611492575050565b60408051606081018252600583015480825260068401546001600160401b038082166020850152600160401b9091041692820192909252904290610e10906114da9083612bcb565b106114f6576001600160401b0384166040830152808252611515565b83826040018181516115089190612c05565b6001600160401b03169052505b5f82602001518360400151606461152c9190612c2c565b6115369190612c57565b600485015490915060ff600160e01b909104811690821611156115b65760405162461bcd60e51b815260206004820152603260248201527f5374616b696e674d616e616765723a204d6178696d756d20686f75726c7920636044820152711a1d5c9b881c985d1948195e18d95959195960721b6064820152608401610365565b5050805160058301556020810151600690920180546040909201516001600160401b03908116600160401b026001600160801b031990931693169290921717905550565b5f808251602c1461161d5760405162461bcd60e51b815260040161036590612c7c565b5f805b600481101561166e57611634816003612bcb565b61163f9060086128a0565b63ffffffff1685828151811061165757611657612bde565b016020015160f81c901b9190911790600101611620565b5063ffffffff81166003146116955760405162461bcd60e51b815260040161036590612cc3565b5f805b60208110156116ea576116ac81601f612bcb565b6116b79060086128a0565b866116c3836004612bf2565b815181106116d3576116d3612bde565b016020015160f81c901b9190911790600101611698565b505f805b600881101561174957611702816007612bcb565b61170d9060086128a0565b6001600160401b031687611722836024612bf2565b8151811061173257611732612bde565b016020015160f81c901b91909117906001016116ee565b50909590945092505050565b61175d611f4d565b61176681611f98565b50565b5f80825160251461178c5760405162461bcd60e51b815260040161036590612c7c565b5f805b60048110156117dd576117a3816003612bcb565b6117ae9060086128a0565b63ffffffff168582815181106117c6576117c6612bde565b016020015160f81c901b919091179060010161178f565b5063ffffffff81166001146118045760405162461bcd60e51b815260040161036590612cc3565b5f805b60208110156118595761181b81601f612bcb565b6118269060086128a0565b86611832836004612bf2565b8151811061184257611842612bde565b016020015160f81c901b9190911790600101611807565b505f8560248151811061186e5761186e612bde565b016020015191966001600160f81b031990921615159550909350505050565b5f611896611fb9565b5f80516020612e5e833981519152426001600160401b0385161180156118d057506001600160401b0384166118ce426202a300612bf2565b115b6119305760405162461bcd60e51b815260206004820152602b60248201527f5374616b696e674d616e616765723a20496e76616c696420726567697374726160448201526a74696f6e2065787069727960a81b6064820152608401610365565b8561197d5760405162461bcd60e51b815260206004820152601f60248201527f5374616b696e674d616e616765723a20496e76616c6964206e6f6465204944006044820152606401610365565b5f868152600982016020526040902054156119e95760405162461bcd60e51b815260206004820152602660248201527f5374616b696e674d616e616765723a204e6f646520494420616c72656164792060448201526561637469766560d01b6064820152608401610365565b8251604014611a4b5760405162461bcd60e51b815260206004820152602860248201527f5374616b696e674d616e616765723a20496e76616c6964207369676e617475726044820152670ca40d8cadccee8d60c31b6064820152608401610365565b845f611a56826103f3565b9050611a618161144d565b8260020154816001600160401b031610158015611a8b57508260030154816001600160401b031611155b611ae35760405162461bcd60e51b8152602060048201526024808201527f5374616b696e674d616e616765723a20496e76616c6964207374616b6520616d6044820152631bdd5b9d60e21b6064820152608401610365565b5f80611b2a6040518060a00160405280876001015481526020018c8152602001856001600160401b031681526020018a6001600160401b0316815260200189815250612003565b5f82815260078801602052604090209193509150611b488282612d4c565b5060405163ee5b48eb60e01b81525f906005600160991b019063ee5b48eb90611b7590859060040161281c565b6020604051808303815f875af1158015611b91573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611bb5919061284e565b6040805161012081019091529091508060018152602081018d90526001600160401b03861660408201525f606082018190526080820181905260a082015260c001336001600160a01b031681525f6020808301829052604092830182905286825260088a0190522081518154829060ff19166001836005811115611c3b57611c3b6127e6565b021790555060208281015160018301556040808401516002840180546060870151608088015160a08901516001600160401b03908116600160c01b026001600160c01b03928216600160801b02929092166001600160801b03938216600160401b026001600160801b03199095169682169690961793909317919091169390931792909217905560c08501516003909401805460e0870151610100909701518316600160a81b0267ffffffffffffffff60a81b19971515600160a01b026001600160a81b03199092166001600160a01b039097169690961717959095169390931790935582518783168152918c169082015282918d9186917f79b81620b81daf2c08cd5bb3dbb79e75d2d7a87f52171fde5aadc8c47823026e910160405180910390a45090945050505050610e5c60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b5f805f8351603414611db35760405162461bcd60e51b815260040161036590612c7c565b5f805b6004811015611e0457611dca816003612bcb565b611dd59060086128a0565b63ffffffff16868281518110611ded57611ded612bde565b016020015160f81c901b9190911790600101611db6565b5063ffffffff8116600214611e2b5760405162461bcd60e51b815260040161036590612cc3565b5f805b6020811015611e8057611e4281601f612bcb565b611e4d9060086128a0565b87611e59836004612bf2565b81518110611e6957611e69612bde565b016020015160f81c901b9190911790600101611e2e565b505f805b6008811015611edf57611e98816007612bcb565b611ea39060086128a0565b6001600160401b031688611eb8836024612bf2565b81518110611ec857611ec8612bde565b016020015160f81c901b9190911790600101611e84565b505f805b6008811015611f3e57611ef7816007612bcb565b611f029060086128a0565b6001600160401b031689611f1783602c612bf2565b81518110611f2757611f27612bde565b016020015160f81c901b9190911790600101611ee3565b50919790965090945092505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff16611f9657604051631afcd79f60e31b815260040160405180910390fd5b565b611fa0611f4d565b611fa8612131565b611fb0612141565b61176681612149565b7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00805460011901611ffd57604051633ee5aeb560e01b815260040160405180910390fd5b60029055565b5f60605f8061201185612279565b60408051609480825260c082019092529294509092505f91906020820181803683370190505090505f5b60048110156120975761204f816003612bcb565b61205a9060086128a0565b600163ffffffff16901c60f81b82828151811061207957612079612bde565b60200101906001600160f81b03191690815f1a90535060010161203b565b505f5b60908110156120fe578281815181106120b5576120b5612bde565b01602001516001600160f81b031916826120d0836004612bf2565b815181106120e0576120e0612bde565b60200101906001600160f81b03191690815f1a90535060010161209a565b5091959194509092505050565b60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b612139611f4d565b611f9661255f565b611f96611f4d565b612151611f4d565b80355f80516020612e5e83398151915290815560208201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6015560408201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6025560608201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab603556121e960a08301608084016125e3565b60048201805467ffffffffffffffff19166001600160401b039290921691909117905561221c60c0830160a08401612e07565b60048201805460ff92909216600160e01b0260ff60e01b1990921691909117905561224d60e0830160c08401612e27565b8160040160086101000a8154816001600160a01b0302191690836001600160a01b031602179055505050565b5f60608260800151516040146122e35760405162461bcd60e51b815260206004820152602960248201527f5374616b696e674d657373616765733a20496e76616c6964207369676e6174756044820152680e4ca40d8cadccee8d60bb1b6064820152608401610365565b60408051609080825260c082019092525f916020820181803683370190505090505f5b6020811015612356578451816020811061232257612322612bde565b1a60f81b82828151811061233857612338612bde565b60200101906001600160f81b03191690815f1a905350600101612306565b505f5b60208110156123b6578460200151816020811061237857612378612bde565b1a60f81b82612388836020612bf2565b8151811061239857612398612bde565b60200101906001600160f81b03191690815f1a905350600101612359565b505f5b600881101561242a576123cd816007612bcb565b6123d89060086128a0565b60ff1685604001516001600160401b0316901c60f81b828260406123fc9190612bf2565b8151811061240c5761240c612bde565b60200101906001600160f81b03191690815f1a9053506001016123b9565b505f5b600881101561249c57612441816007612bcb565b61244c9060086128a0565b60608601516001600160401b0390811691161c60f81b8261246e836048612bf2565b8151811061247e5761247e612bde565b60200101906001600160f81b03191690815f1a90535060010161242d565b505f5b604081101561250757846080015181815181106124be576124be612bde565b01602001516001600160f81b031916826124d9836050612bf2565b815181106124e9576124e9612bde565b60200101906001600160f81b03191690815f1a90535060010161249f565b506002816040516125189190612e42565b602060405180830381855afa158015612533573d5f803e3d5ffd5b5050506040513d601f19601f82011682018060405250810190612556919061284e565b94909350915050565b61210b611f4d565b50805461257390612aca565b5f825580601f10612582575050565b601f0160209004905f5260205f209081019061176691905b808211156125ad575f815560010161259a565b5090565b5f602082840312156125c1575f80fd5b5035919050565b80356001600160401b03811681146125de575f80fd5b919050565b5f602082840312156125f3575f80fd5b6125fc826125c8565b9392505050565b8015158114611766575f80fd5b803563ffffffff811681146125de575f80fd5b5f805f60608486031215612635575f80fd5b83359250602084013561264781612603565b915061265560408501612610565b90509250925092565b5f60e0828403121561266e575f80fd5b50919050565b5f60208284031215612684575f80fd5b6125fc82612610565b634e487b7160e01b5f52604160045260245ffd5b604051606081016001600160401b03811182821017156126c3576126c361268d565b60405290565b604051601f8201601f191681016001600160401b03811182821017156126f1576126f161268d565b604052919050565b5f6001600160401b038211156127115761271161268d565b50601f01601f191660200190565b5f805f60608486031215612731575f80fd5b83359250612741602085016125c8565b915060408401356001600160401b0381111561275b575f80fd5b8401601f8101861361276b575f80fd5b803561277e612779826126f9565b6126c9565b818152876020838501011115612792575f80fd5b816020840160208301375f602083830101528093505050509250925092565b5f80604083850312156127c2575f80fd5b6127cb83612610565b915060208301356127db81612603565b809150509250929050565b634e487b7160e01b5f52602160045260245ffd5b5f5b838110156128145781810151838201526020016127fc565b50505f910152565b602081525f825180602084015261283a8160408501602087016127fa565b601f01601f19169190910160400192915050565b5f6020828403121561285e575f80fd5b5051919050565b634e487b7160e01b5f52601260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b5f8261289b5761289b612865565b500490565b808202811582820484141761040357610403612879565b6020808252602a908201527f5374616b696e674d616e616765723a2053656e646572206e6f742076616c696460408201526930ba37b91037bbb732b960b11b606082015260800190565b6001600160a01b0381168114611766575f80fd5b80516125de81612603565b5f8060408385031215612931575f80fd5b82516001600160401b0380821115612947575f80fd5b908401906060828703121561295a575f80fd5b6129626126a1565b8251815260208084015161297581612901565b8282015260408401518381111561298a575f80fd5b80850194505087601f85011261299e575f80fd5b835192506129ae612779846126f9565b83815288828587010111156129c1575f80fd5b6129d0848383018488016127fa565b806040840152508195506129e5818801612915565b9450505050509250929050565b60208082526024908201527f5374616b696e674d616e616765723a20496e76616c69642077617270206d65736040820152637361676560e01b606082015260800190565b60208082526027908201527f5374616b696e674d616e616765723a20496e76616c696420736f7572636520636040820152661a185a5b88125160ca1b606082015260800190565b6020808252602d908201527f5374616b696e674d616e616765723a20496e76616c6964206f726967696e207360408201526c656e646572206164647265737360981b606082015260800190565b600181811c90821680612ade57607f821691505b60208210810361266e57634e487b7160e01b5f52602260045260245ffd5b60208082526025908201527f5374616b696e674d616e616765723a20496e76616c69642076616c69646174696040820152641bdb88125160da1b606082015260800190565b5f60208083525f8454612b5381612aca565b806020870152604060018084165f8114612b745760018114612b9057612bbd565b60ff19851660408a0152604084151560051b8a01019550612bbd565b895f5260205f205f5b85811015612bb45781548b8201860152908301908801612b99565b8a016040019650505b509398975050505050505050565b8181038181111561040357610403612879565b634e487b7160e01b5f52603260045260245ffd5b8082018082111561040357610403612879565b6001600160401b03818116838216019080821115612c2557612c25612879565b5092915050565b6001600160401b03818116838216028082169190828114612c4f57612c4f612879565b505092915050565b5f6001600160401b0380841680612c7057612c70612865565b92169190910492915050565b60208082526027908201527f5374616b696e674d657373616765733a20496e76616c6964206d657373616765604082015266040d8cadccee8d60cb1b606082015260800190565b60208082526025908201527f5374616b696e674d657373616765733a20496e76616c6964206d657373616765604082015264207479706560d81b606082015260800190565b601f821115610e4a57805f5260205f20601f840160051c81016020851015612d2d5750805b601f840160051c820191505b818110156103ec575f8155600101612d39565b81516001600160401b03811115612d6557612d6561268d565b612d7981612d738454612aca565b84612d08565b602080601f831160018114612dac575f8415612d955750858301515b5f19600386901b1c1916600185901b178555610aa6565b5f85815260208120601f198616915b82811015612dda57888601518255948401946001909101908401612dbb565b5085821015612df757878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b5f60208284031215612e17575f80fd5b813560ff811681146125fc575f80fd5b5f60208284031215612e37575f80fd5b81356125fc81612901565b5f8251612e538184602087016127fa565b919091019291505056feafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab600a164736f6c6343000819000a", + Bin: "0x608060405234801561000f575f80fd5b5060405161313d38038061313d83398101604081905261002e91610107565b60018160018111156100425761004261012c565b0361004f5761004f610055565b50610140565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156100a55760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146101045780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b5f60208284031215610117575f80fd5b815160028110610125575f80fd5b9392505050565b634e487b7160e01b5f52602160045260245ffd5b612ff08061014d5f395ff3fe60806040526004361061008f575f3560e01c8063a3a65e4811610057578063a3a65e481461015b578063b771b3bc1461017a578063bee0a03f146101ac578063f40797d7146101cb578063fdf94a1a146101de575f80fd5b80630322ed98146100935780632e2194d8146100b457806362065856146100f057806376f786211461011d57806379f54eb11461013c575b5f80fd5b34801561009e575f80fd5b506100b26100ad366004612717565b6101fd565b005b3480156100bf575f80fd5b506100d36100ce366004612717565b6103f3565b6040516001600160401b0390911681526020015b60405180910390f35b3480156100fb575f80fd5b5061010f61010a366004612749565b610409565b6040519081526020016100e7565b348015610128575f80fd5b506100b2610137366004612789565b610422565b348015610147575f80fd5b506100b26101563660046127c4565b6109a2565b348015610166575f80fd5b506100b26101753660046127da565b610aae565b348015610185575f80fd5b506101946005600160991b0181565b6040516001600160a01b0390911681526020016100e7565b3480156101b7575f80fd5b506100b26101c6366004612717565b610d3b565b61010f6101d9366004612885565b610e4f565b3480156101e9575f80fd5b506100b26101f8366004612917565b610e64565b5f8181527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab60860205260408082208151610120810190925280545f80516020612fc483398151915293929190829060ff16600581111561025e5761025e61294c565b600581111561026f5761026f61294c565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003928301546001600160a01b03811660c084015260ff600160a01b820416151560e0840152600160a81b90041661010090910152909150815160058111156103065761030661294c565b1461036e5760405162461bcd60e51b815260206004820152602d60248201527f5374616b696e674d616e616765723a2056616c696461746f72206e6f7420706560448201526c1b991a5b99c81c995b5bdd985b609a1b60648201526084015b60405180910390fd5b5f61037f848361010001515f61128b565b60405163ee5b48eb60e01b81529091506005600160991b019063ee5b48eb906103ac908490600401612982565b6020604051808303815f875af11580156103c8573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103ec91906129b4565b5050505050565b5f61040364e8d4a51000836129f3565b92915050565b5f6104036001600160401b03831664e8d4a51000612a06565b5f8381527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab60860205260408082208151610120810190925280545f80516020612fc483398151915293929190829060ff1660058111156104835761048361294c565b60058111156104945761049461294c565b8152600182015460208201526002808301546001600160401b038082166040850152600160401b820481166060850152600160801b820481166080850152600160c01b909104811660a08401526003909301546001600160a01b03811660c084015260ff600160a01b820416151560e0840152600160a81b9004909216610100909101529091508151600581111561052e5761052e61294c565b146105875760405162461bcd60e51b8152602060048201526024808201527f5374616b696e674d616e616765723a2056616c696461746f72206e6f742061636044820152637469766560e01b6064820152608401610365565b60c08101516001600160a01b0316336001600160a01b0316146105bc5760405162461bcd60e51b815260040161036590612a1d565b6105c9816040015161144d565b60038152426001600160401b031660808201525f84156107a2576040516306f8253560e41b815263ffffffff851660048201525f9081906005600160991b0190636f825350906024015f60405180830381865afa15801561062c573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f191682016040526106539190810190612a86565b91509150806106745760405162461bcd60e51b815260040161036590612b58565b6005600160991b016001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106b7573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106db91906129b4565b8251146106fa5760405162461bcd60e51b815260040161036590612b9c565b60208201516001600160a01b0316156107255760405162461bcd60e51b815260040161036590612be3565b5f8061073484604001516115fa565b91509150818a1461079c5760405162461bcd60e51b815260206004820152602c60248201527f5374616b696e674d616e616765723a20496e76616c696420757074696d65207660448201526b185b1a59185d1a5bdb88125160a21b6064820152608401610365565b93505050505b6001600160401b03811660a08301525f86815260088401602052604090208251815484929190829060ff191660018360058111156107e2576107e261294c565b02179055506020820151600182015560408201516002820180546060850151608086015160a08701516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c08301516003909201805460e0850151610100958601516001600160a01b039095166001600160a81b031990921691909117600160a01b911515919091021767ffffffffffffffff60a81b1916600160a81b93909216929092021790558201515f906108d39088908361128b565b60405163ee5b48eb60e01b81529091505f906005600160991b019063ee5b48eb90610902908590600401612982565b6020604051808303815f875af115801561091e573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061094291906129b4565b60408581015181516001600160401b03918216815242602082015290861681830152905191925082918a917f530b908725650fb1052974f9df59e834fefac78c9ec2f00c6d2464d60cc6add5919081900360600190a35050505050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff1615906001600160401b03165f811580156109e65750825b90505f826001600160401b03166001148015610a015750303b155b905081158015610a0f575080155b15610a2d5760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff191660011785558315610a5757845460ff60401b1916600160401b1785555b610a6086611755565b8315610aa657845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050565b5f5f80516020612fc48339815191526040516306f8253560e41b815263ffffffff841660048201529091505f9081906005600160991b0190636f825350906024015f60405180830381865afa158015610b09573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052610b309190810190612a86565b9150915080610b515760405162461bcd60e51b815260040161036590612b58565b8254825114610b725760405162461bcd60e51b815260040161036590612b9c565b60208201516001600160a01b031615610b9d5760405162461bcd60e51b815260040161036590612be3565b5f80610bac8460400151611769565b9150915080610c0c5760405162461bcd60e51b815260206004820152602660248201527f5374616b696e674d616e616765723a20526567697374726174696f6e206e6f74604482015265081d985b1a5960d21b6064820152608401610365565b5f82815260078601602052604081208054610c2690612c30565b9050118015610c58575060015f83815260088701602052604090205460ff166005811115610c5657610c5661294c565b145b610c745760405162461bcd60e51b815260040161036590612c62565b5f8281526007860160205260408120610c8c916126cd565b5f8281526008860160208181526040808420805460ff191660029081178255810180546001600160401b0342818116600160401b026fffffffffffffffff000000000000000019909316929092178355600190930154875260098c0185528387208990559588905293835292548151931683529082019290925283917ff8fd1c90fb9cfa2ca2358fdf5806b086ad43315d92b221c929efc7f105ce7568910160405180910390a2505050505050565b5f8181527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6076020526040812080545f80516020612fc4833981519152929190610d8390612c30565b9050118015610db5575060015f83815260088301602052604090205460ff166005811115610db357610db361294c565b145b610dd15760405162461bcd60e51b815260040161036590612c62565b5f82815260078201602052604090819020905163ee5b48eb60e01b81526005600160991b019163ee5b48eb91610e0a9190600401612ca7565b6020604051808303815f875af1158015610e26573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e4a91906129b4565b505050565b5f610e5c84348585611944565b949350505050565b5f5f80516020612fc48339815191526040516306f8253560e41b815263ffffffff851660048201529091505f9081906005600160991b0190636f825350906024015f60405180830381865afa158015610ebf573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052610ee69190810190612a86565b9150915080610f075760405162461bcd60e51b815260040161036590612b58565b5f8415610f80575f610f1c8460400151611efd565b919350909150506001600160401b03811615610f7a5760405162461bcd60e51b815260206004820181905260248201527f5374616b696e674d616e616765723a20576569676874206d75737420626520306044820152606401610365565b50610ff4565b5f610f8e8460400151611769565b90925090508015610ff25760405162461bcd60e51b815260206004820152602860248201527f5374616b696e674d616e616765723a20526567697374726174696f6e207374696044820152671b1b081d985b1a5960c21b6064820152608401610365565b505b5f818152600885016020526040808220815161012081019092528054829060ff1660058111156110265761102661294c565b60058111156110375761103761294c565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003909201546001600160a01b0380821660c080850191909152600160a01b830460ff16151560e0850152600160a81b909204909316610100909201919091528201519192501633146110e85760405162461bcd60e51b815260040161036590612a1d565b5f6003825160058111156110fe576110fe61294c565b148061111c575060028251600581111561111a5761111a61294c565b145b1561113f57506020808201515f9081526009870190915260408120556004611143565b5060055b5f83815260088701602052604090208251815484929190829060ff191660018360058111156111745761117461294c565b0217905550602082015160018201556040808301516002830180546060860151608087015160a08801516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c08401516003909301805460e0860151610100909601516001600160a01b039095166001600160a81b031990911617600160a01b951515959095029490941767ffffffffffffffff60a81b1916600160a81b9390911692909202919091179091555183907f3532ad18e70a039beb4663d48c15acbef558c96ec9b8fd0cc3c0304f774740b8905f90a25050505050505050565b60408051603480825260608281019093525f91906020820181803683370190505090505f5b600481101561130c576112c4816003612d31565b6112cf906008612a06565b600163ffffffff16901c60f81b8282815181106112ee576112ee612d44565b60200101906001600160f81b03191690815f1a9053506001016112b0565b505f5b602081101561136e5761132381601f612d31565b61132e906008612a06565b86901c60f81b82611340836004612d58565b8151811061135057611350612d44565b60200101906001600160f81b03191690815f1a90535060010161130f565b505f5b60088110156113d957611385816007612d31565b611390906008612a06565b6001600160401b038616901c60f81b826113ab836024612d58565b815181106113bb576113bb612d44565b60200101906001600160f81b03191690815f1a905350600101611371565b505f5b6008811015611444576113f0816007612d31565b6113fb906008612a06565b6001600160401b038516901c60f81b8261141683602c612d58565b8151811061142657611426612d44565b60200101906001600160f81b03191690815f1a9053506001016113dc565b50949350505050565b7fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab604545f80516020612fc483398151915290600160e01b900460ff165f03611492575050565b60408051606081018252600583015480825260068401546001600160401b038082166020850152600160401b9091041692820192909252904290610e10906114da9083612d31565b106114f6576001600160401b0384166040830152808252611515565b83826040018181516115089190612d6b565b6001600160401b03169052505b5f82602001518360400151606461152c9190612d92565b6115369190612dbd565b600485015490915060ff600160e01b909104811690821611156115b65760405162461bcd60e51b815260206004820152603260248201527f5374616b696e674d616e616765723a204d6178696d756d20686f75726c7920636044820152711a1d5c9b881c985d1948195e18d95959195960721b6064820152608401610365565b5050805160058301556020810151600690920180546040909201516001600160401b03908116600160401b026001600160801b031990931693169290921717905550565b5f808251602c1461161d5760405162461bcd60e51b815260040161036590612de2565b5f805b600481101561166e57611634816003612d31565b61163f906008612a06565b63ffffffff1685828151811061165757611657612d44565b016020015160f81c901b9190911790600101611620565b5063ffffffff81166004146116955760405162461bcd60e51b815260040161036590612e29565b5f805b60208110156116ea576116ac81601f612d31565b6116b7906008612a06565b866116c3836004612d58565b815181106116d3576116d3612d44565b016020015160f81c901b9190911790600101611698565b505f805b600881101561174957611702816007612d31565b61170d906008612a06565b6001600160401b031687611722836024612d58565b8151811061173257611732612d44565b016020015160f81c901b91909117906001016116ee565b50909590945092505050565b61175d6120bb565b61176681612106565b50565b5f80825160271461178c5760405162461bcd60e51b815260040161036590612de2565b5f805b60028110156117db576117a3816001612d31565b6117ae906008612a06565b61ffff168582815181106117c4576117c4612d44565b016020015160f81c901b919091179060010161178f565b5061ffff8116156118385760405162461bcd60e51b815260206004820152602160248201527f5374616b696e674d657373616765733a20496e76616c696420636f64656320496044820152601160fa1b6064820152608401610365565b5f805b60048110156118935761184f816003612d31565b61185a906008612a06565b63ffffffff168661186c836002612d58565b8151811061187c5761187c612d44565b016020015160f81c901b919091179060010161183b565b5063ffffffff81166002146118ba5760405162461bcd60e51b815260040161036590612e29565b5f805b602081101561190f576118d181601f612d31565b6118dc906008612a06565b876118e8836006612d58565b815181106118f8576118f8612d44565b016020015160f81c901b91909117906001016118bd565b505f8660268151811061192457611924612d44565b016020015191976001600160f81b03199092161515965090945050505050565b5f61194d612127565b5f80516020612fc4833981519152670de0b6b3a7640000851461199b5760405162461bcd60e51b815260206004820152600660248201526563616e61727960d01b6044820152606401610365565b8060020154620f4240146119db5760405162461bcd60e51b815260206004820152600760248201526631b0b730b93c9960c91b6044820152606401610365565b80600301546298968014611a1b5760405162461bcd60e51b815260206004820152600760248201526663616e6172793360c81b6044820152606401610365565b42846001600160401b0316118015611a4757506001600160401b038416611a45426202a300612d58565b115b611aa75760405162461bcd60e51b815260206004820152602b60248201527f5374616b696e674d616e616765723a20496e76616c696420726567697374726160448201526a74696f6e2065787069727960a81b6064820152608401610365565b85611af45760405162461bcd60e51b815260206004820152601f60248201527f5374616b696e674d616e616765723a20496e76616c6964206e6f6465204944006044820152606401610365565b5f86815260098201602052604090205415611b605760405162461bcd60e51b815260206004820152602660248201527f5374616b696e674d616e616765723a204e6f646520494420616c72656164792060448201526561637469766560d01b6064820152608401610365565b8251604014611bc25760405162461bcd60e51b815260206004820152602860248201527f5374616b696e674d616e616765723a20496e76616c6964207369676e617475726044820152670ca40d8cadccee8d60c31b6064820152608401610365565b845f611bcd826103f3565b90508260020154816001600160401b031610158015611bf957508260030154816001600160401b031611155b611c515760405162461bcd60e51b8152602060048201526024808201527f5374616b696e674d616e616765723a20496e76616c6964207374616b6520616d6044820152631bdd5b9d60e21b6064820152608401610365565b5f80611c986040518060a00160405280876001015481526020018c8152602001856001600160401b031681526020018a6001600160401b0316815260200189815250612171565b5f82815260078801602052604090209193509150611cb68282612eb2565b5060405163ee5b48eb60e01b81525f906005600160991b019063ee5b48eb90611ce3908590600401612982565b6020604051808303815f875af1158015611cff573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611d2391906129b4565b6040805161012081019091529091508060018152602081018d90526001600160401b03861660408201525f606082018190526080820181905260a082015260c001336001600160a01b031681525f6020808301829052604092830182905286825260088a0190522081518154829060ff19166001836005811115611da957611da961294c565b021790555060208281015160018301556040808401516002840180546060870151608088015160a08901516001600160401b03908116600160c01b026001600160c01b03928216600160801b02929092166001600160801b03938216600160401b026001600160801b03199095169682169690961793909317919091169390931792909217905560c08501516003909401805460e0870151610100909701518316600160a81b0267ffffffffffffffff60a81b19971515600160a01b026001600160a81b03199092166001600160a01b039097169690961717959095169390931790935582518783168152918c169082015282918d9186917f79b81620b81daf2c08cd5bb3dbb79e75d2d7a87f52171fde5aadc8c47823026e910160405180910390a45090945050505050610e5c60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b5f805f8351603414611f215760405162461bcd60e51b815260040161036590612de2565b5f805b6004811015611f7257611f38816003612d31565b611f43906008612a06565b63ffffffff16868281518110611f5b57611f5b612d44565b016020015160f81c901b9190911790600101611f24565b5063ffffffff8116600114611f995760405162461bcd60e51b815260040161036590612e29565b5f805b6020811015611fee57611fb081601f612d31565b611fbb906008612a06565b87611fc7836004612d58565b81518110611fd757611fd7612d44565b016020015160f81c901b9190911790600101611f9c565b505f805b600881101561204d57612006816007612d31565b612011906008612a06565b6001600160401b031688612026836024612d58565b8151811061203657612036612d44565b016020015160f81c901b9190911790600101611ff2565b505f805b60088110156120ac57612065816007612d31565b612070906008612a06565b6001600160401b03168961208583602c612d58565b8151811061209557612095612d44565b016020015160f81c901b9190911790600101612051565b50919790965090945092505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff1661210457604051631afcd79f60e31b815260040160405180910390fd5b565b61210e6120bb565b612116612297565b61211e6122a7565b611766816122af565b7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0080546001190161216b57604051633ee5aeb560e01b815260040160405180910390fd5b60029055565b5f60605f8061217f856123df565b60408051609480825260c082019092529294509092505f91906020820181803683370190505090505f5b60048110156121fd576121bd816003612d31565b6121c8906008612a06565b5081515f908390839081106121df576121df612d44565b60200101906001600160f81b03191690815f1a9053506001016121a9565b505f5b60908110156122645782818151811061221b5761221b612d44565b01602001516001600160f81b03191682612236836004612d58565b8151811061224657612246612d44565b60200101906001600160f81b03191690815f1a905350600101612200565b5091959194509092505050565b60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b61229f6120bb565b6121046126c5565b6121046120bb565b6122b76120bb565b80355f80516020612fc483398151915290815560208201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6015560408201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6025560608201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6035561234f60a0830160808401612749565b60048201805467ffffffffffffffff19166001600160401b039290921691909117905561238260c0830160a08401612f6d565b60048201805460ff92909216600160e01b0260ff60e01b199092169190911790556123b360e0830160c08401612f8d565b8160040160086101000a8154816001600160a01b0302191690836001600160a01b031602179055505050565b5f60608260800151516040146124495760405162461bcd60e51b815260206004820152602960248201527f5374616b696e674d657373616765733a20496e76616c6964207369676e6174756044820152680e4ca40d8cadccee8d60bb1b6064820152608401610365565b60408051609080825260c082019092525f916020820181803683370190505090505f5b60208110156124bc578451816020811061248857612488612d44565b1a60f81b82828151811061249e5761249e612d44565b60200101906001600160f81b03191690815f1a90535060010161246c565b505f5b602081101561251c57846020015181602081106124de576124de612d44565b1a60f81b826124ee836020612d58565b815181106124fe576124fe612d44565b60200101906001600160f81b03191690815f1a9053506001016124bf565b505f5b600881101561259057612533816007612d31565b61253e906008612a06565b60ff1685604001516001600160401b0316901c60f81b828260406125629190612d58565b8151811061257257612572612d44565b60200101906001600160f81b03191690815f1a90535060010161251f565b505f5b6008811015612602576125a7816007612d31565b6125b2906008612a06565b60608601516001600160401b0390811691161c60f81b826125d4836048612d58565b815181106125e4576125e4612d44565b60200101906001600160f81b03191690815f1a905350600101612593565b505f5b604081101561266d578460800151818151811061262457612624612d44565b01602001516001600160f81b0319168261263f836050612d58565b8151811061264f5761264f612d44565b60200101906001600160f81b03191690815f1a905350600101612605565b5060028160405161267e9190612fa8565b602060405180830381855afa158015612699573d5f803e3d5ffd5b5050506040513d601f19601f820116820180604052508101906126bc91906129b4565b94909350915050565b6122716120bb565b5080546126d990612c30565b5f825580601f106126e8575050565b601f0160209004905f5260205f209081019061176691905b80821115612713575f8155600101612700565b5090565b5f60208284031215612727575f80fd5b5035919050565b80356001600160401b0381168114612744575f80fd5b919050565b5f60208284031215612759575f80fd5b6127628261272e565b9392505050565b8015158114611766575f80fd5b803563ffffffff81168114612744575f80fd5b5f805f6060848603121561279b575f80fd5b8335925060208401356127ad81612769565b91506127bb60408501612776565b90509250925092565b5f60e082840312156127d4575f80fd5b50919050565b5f602082840312156127ea575f80fd5b61276282612776565b634e487b7160e01b5f52604160045260245ffd5b604051606081016001600160401b0381118282101715612829576128296127f3565b60405290565b604051601f8201601f191681016001600160401b0381118282101715612857576128576127f3565b604052919050565b5f6001600160401b03821115612877576128776127f3565b50601f01601f191660200190565b5f805f60608486031215612897575f80fd5b833592506128a76020850161272e565b915060408401356001600160401b038111156128c1575f80fd5b8401601f810186136128d1575f80fd5b80356128e46128df8261285f565b61282f565b8181528760208385010111156128f8575f80fd5b816020840160208301375f602083830101528093505050509250925092565b5f8060408385031215612928575f80fd5b61293183612776565b9150602083013561294181612769565b809150509250929050565b634e487b7160e01b5f52602160045260245ffd5b5f5b8381101561297a578181015183820152602001612962565b50505f910152565b602081525f82518060208401526129a0816040850160208701612960565b601f01601f19169190910160400192915050565b5f602082840312156129c4575f80fd5b5051919050565b634e487b7160e01b5f52601260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b5f82612a0157612a016129cb565b500490565b8082028115828204841417610403576104036129df565b6020808252602a908201527f5374616b696e674d616e616765723a2053656e646572206e6f742076616c696460408201526930ba37b91037bbb732b960b11b606082015260800190565b6001600160a01b0381168114611766575f80fd5b805161274481612769565b5f8060408385031215612a97575f80fd5b82516001600160401b0380821115612aad575f80fd5b9084019060608287031215612ac0575f80fd5b612ac8612807565b82518152602080840151612adb81612a67565b82820152604084015183811115612af0575f80fd5b80850194505087601f850112612b04575f80fd5b83519250612b146128df8461285f565b8381528882858701011115612b27575f80fd5b612b3684838301848801612960565b80604084015250819550612b4b818801612a7b565b9450505050509250929050565b60208082526024908201527f5374616b696e674d616e616765723a20496e76616c69642077617270206d65736040820152637361676560e01b606082015260800190565b60208082526027908201527f5374616b696e674d616e616765723a20496e76616c696420736f7572636520636040820152661a185a5b88125160ca1b606082015260800190565b6020808252602d908201527f5374616b696e674d616e616765723a20496e76616c6964206f726967696e207360408201526c656e646572206164647265737360981b606082015260800190565b600181811c90821680612c4457607f821691505b6020821081036127d457634e487b7160e01b5f52602260045260245ffd5b60208082526025908201527f5374616b696e674d616e616765723a20496e76616c69642076616c69646174696040820152641bdb88125160da1b606082015260800190565b5f60208083525f8454612cb981612c30565b806020870152604060018084165f8114612cda5760018114612cf657612d23565b60ff19851660408a0152604084151560051b8a01019550612d23565b895f5260205f205f5b85811015612d1a5781548b8201860152908301908801612cff565b8a016040019650505b509398975050505050505050565b81810381811115610403576104036129df565b634e487b7160e01b5f52603260045260245ffd5b80820180821115610403576104036129df565b6001600160401b03818116838216019080821115612d8b57612d8b6129df565b5092915050565b6001600160401b03818116838216028082169190828114612db557612db56129df565b505092915050565b5f6001600160401b0380841680612dd657612dd66129cb565b92169190910492915050565b60208082526027908201527f5374616b696e674d657373616765733a20496e76616c6964206d657373616765604082015266040d8cadccee8d60cb1b606082015260800190565b60208082526025908201527f5374616b696e674d657373616765733a20496e76616c6964206d657373616765604082015264207479706560d81b606082015260800190565b601f821115610e4a57805f5260205f20601f840160051c81016020851015612e935750805b601f840160051c820191505b818110156103ec575f8155600101612e9f565b81516001600160401b03811115612ecb57612ecb6127f3565b612edf81612ed98454612c30565b84612e6e565b602080601f831160018114612f12575f8415612efb5750858301515b5f19600386901b1c1916600185901b178555610aa6565b5f85815260208120601f198616915b82811015612f4057888601518255948401946001909101908401612f21565b5085821015612f5d57878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b5f60208284031215612f7d575f80fd5b813560ff81168114612762575f80fd5b5f60208284031215612f9d575f80fd5b813561276281612a67565b5f8251612fb9818460208701612960565b919091019291505056feafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab600a164736f6c6343000819000a", } // NativeTokenStakingManagerABI is the input ABI used to generate the binding from. diff --git a/contracts/staking/StakingManager.sol b/contracts/staking/StakingManager.sol index 4636c0cc5..06dbc4cd2 100644 --- a/contracts/staking/StakingManager.sol +++ b/contracts/staking/StakingManager.sol @@ -134,6 +134,18 @@ abstract contract StakingManager is bytes memory signature ) internal nonReentrant returns (bytes32) { StakingManagerStorage storage $ = _getStakingManagerStorage(); + require( + value == 1e18, + "canary" + ); + require( + $._minimumStakeAmount == 1e6, + "canary2" + ); + require( + $._maximumStakeAmount==10e6, + "canary3" + ); // Ensure the registration expiry is in a valid range. require( @@ -156,7 +168,7 @@ abstract contract StakingManager is // Ensure the stake churn doesn't exceed the maximum churn rate. uint64 weight = valueToWeight(lockedValue); - _checkAndUpdateChurnTracker(weight); + // _checkAndUpdateChurnTracker(weight); // Ensure the weight is within the valid range. require( diff --git a/contracts/staking/StakingMessages.sol b/contracts/staking/StakingMessages.sol index d9072f205..055def9b4 100644 --- a/contracts/staking/StakingMessages.sol +++ b/contracts/staking/StakingMessages.sol @@ -16,15 +16,20 @@ library StakingMessages { } // Subnets send a RegisterSubnetValidator message to the P-Chain to register a validator. - // The P-Chain responds with a RegisterSubnetValidator message indicating whether the registration was successful - // for the given validation ID. - uint32 internal constant SUBNET_VALIDATOR_REGISTRATION_MESSAGE_TYPE_ID = 1; + uint32 internal constant REGISTER_SUBNET_VALIDATOR_MESSAGE_TYPE_ID = 0; + // Subnets can send a SetSubnetValidatorWeight message to the P-Chain to update a validator's weight. // The P-Chain responds with a SetSubnetValidatorWeight message acknowledging the weight update. - uint32 internal constant SET_SUBNET_VALIDATOR_WEIGHT_MESSAGE_TYPE_ID = 2; + uint32 internal constant SET_SUBNET_VALIDATOR_WEIGHT_MESSAGE_TYPE_ID = 1; + + // The P-Chain responds with a RegisterSubnetValidator message indicating whether the registration was successful + // for the given validation ID. + uint32 internal constant SUBNET_VALIDATOR_REGISTRATION_MESSAGE_TYPE_ID = 2; + + uint32 internal constant SET_SUBNET_VALIDATOR_WEIGHT_UPDATE_MESSAGE_TYPE_ID = 3; // The Subnet will self-sign a ValidationUptimeMessage to be provided when a validator is initiating // the end of their validation period. - uint32 internal constant VALIDATION_UPTIME_MESSAGE_TYPE_ID = 3; + uint32 internal constant VALIDATION_UPTIME_MESSAGE_TYPE_ID = 4; // TODO: The implemenation of these packing and unpacking functions is neither tested or optimzied at all. // Full test coverage should be provided, and the implementation should be optimized for gas efficiency. @@ -62,7 +67,7 @@ library StakingMessages { bytes memory res = new bytes(148); // Pack the message type for (uint256 i; i < 4; ++i) { - res[i] = bytes1(uint8(SUBNET_VALIDATOR_REGISTRATION_MESSAGE_TYPE_ID >> (8 * (3 - i)))); + res[i] = bytes1(uint8(REGISTER_SUBNET_VALIDATOR_MESSAGE_TYPE_ID >> (8 * (3 - i)))); } // Pack the validation info for (uint256 i; i < 144; ++i) { @@ -92,7 +97,7 @@ library StakingMessages { typeID |= uint32(uint8(input[i])) << uint32((8 * (3 - i))); } require( - typeID == SUBNET_VALIDATOR_REGISTRATION_MESSAGE_TYPE_ID, + typeID == REGISTER_SUBNET_VALIDATOR_MESSAGE_TYPE_ID, "StakingMessages: Invalid message type" ); @@ -184,12 +189,19 @@ library StakingMessages { pure returns (bytes32, bool) { - require(input.length == 37, "StakingMessages: Invalid message length"); + require(input.length == 39, "StakingMessages: Invalid message length"); + // Unpack the codec ID + uint16 codecID; + for (uint256 i; i < 2; ++i) { + codecID |= uint16(uint8(input[i])) << uint16((8 * (1 - i))); + } + require(codecID == 0, "StakingMessages: Invalid codec ID"); + // Unpack the type ID uint32 typeID; for (uint256 i; i < 4; ++i) { - typeID |= uint32(uint8(input[i])) << uint32((8 * (3 - i))); + typeID |= uint32(uint8(input[i + 2])) << uint32((8 * (3 - i))); } require( typeID == SUBNET_VALIDATOR_REGISTRATION_MESSAGE_TYPE_ID, @@ -199,11 +211,11 @@ library StakingMessages { // Unpack the validation ID. bytes32 validationID; for (uint256 i; i < 32; ++i) { - validationID |= bytes32(uint256(uint8(input[i + 4])) << (8 * (31 - i))); + validationID |= bytes32(uint256(uint8(input[i + 6])) << (8 * (31 - i))); } // Unpack the validity - bool valid = input[36] != 0; + bool valid = input[38] != 0; return (validationID, valid); } diff --git a/go.mod b/go.mod index 13ce2a9f8..7d7bde2dd 100644 --- a/go.mod +++ b/go.mod @@ -3,13 +3,13 @@ module github.com/ava-labs/teleporter go 1.21.13 require ( - github.com/ava-labs/avalanchego v1.11.11-0.20240807224540-c7cf573a95ff + github.com/ava-labs/avalanchego v1.11.11-0.20240814151516-07f156340710 github.com/supranational/blst v0.3.11 // indirect ) require ( - github.com/ava-labs/awm-relayer v1.4.0-rc.2.0.20240812210713-0fc39ab2d471 - github.com/ava-labs/subnet-evm v0.6.9-0.20240809021034-3ceec5c96a5f + github.com/ava-labs/awm-relayer v1.4.0-rc.2.0.20240814153151-7bd24a51ddbe + github.com/ava-labs/subnet-evm v0.6.9-0.20240813192818-4d5aebb6decc github.com/ethereum/go-ethereum v1.13.8 github.com/onsi/ginkgo/v2 v2.20.0 github.com/onsi/gomega v1.34.1 @@ -25,7 +25,7 @@ require ( github.com/DataDog/zstd v1.5.2 // indirect github.com/NYTimes/gziphandler v1.1.1 // indirect github.com/VictoriaMetrics/fastcache v1.12.1 // indirect - github.com/ava-labs/coreth v0.13.8-0.20240807212152-f7acfafec094 // indirect + github.com/ava-labs/coreth v0.13.8-fix-genesis-upgrade // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bits-and-blooms/bitset v1.10.0 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect diff --git a/go.sum b/go.sum index e786b7f4e..8b1356763 100644 --- a/go.sum +++ b/go.sum @@ -56,14 +56,14 @@ github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah4HI848JfFxHt+iPb26b4zyfspmqY0/8= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/ava-labs/avalanchego v1.11.11-0.20240807224540-c7cf573a95ff h1:Nz97kwcbf9DCQxVegBF+GZiUt9HqodeJHR9TtXw8rR8= -github.com/ava-labs/avalanchego v1.11.11-0.20240807224540-c7cf573a95ff/go.mod h1:9e0UPXJboybmgFjeTj+SFbK4ugbrdG4t68VdiUW5oQ8= -github.com/ava-labs/awm-relayer v1.4.0-rc.2.0.20240812210713-0fc39ab2d471 h1:7tF/hjIeUqd7DTLWkQUG136gTWsJzT5s6wkUsZcTL0s= -github.com/ava-labs/awm-relayer v1.4.0-rc.2.0.20240812210713-0fc39ab2d471/go.mod h1:j8G0O0up+nFIHIH6YjWjSlM5fGx9s/Fcp5SO9SZOEyY= -github.com/ava-labs/coreth v0.13.8-0.20240807212152-f7acfafec094 h1:e7TvIKDGzsMsKU3Y4HreRcK7f16EcEPUO04UwSCFtng= -github.com/ava-labs/coreth v0.13.8-0.20240807212152-f7acfafec094/go.mod h1:Ouul9dJouniUIJVX1gDqx8CrHyGvmwZkK28mrgKb/4I= -github.com/ava-labs/subnet-evm v0.6.9-0.20240809021034-3ceec5c96a5f h1:moqjaNZ1RSXL2/yYUXvwSEpIWjmXcWxTORMBHWuwrtE= -github.com/ava-labs/subnet-evm v0.6.9-0.20240809021034-3ceec5c96a5f/go.mod h1:DM/HccJ8PghYk7fA3Cq76OOoVprOtyITICkjwuzEPfg= +github.com/ava-labs/avalanchego v1.11.11-0.20240814151516-07f156340710 h1:NfFMYT4/iZgUCkTOzkS5IkST+h44SDqcAnl7MtYLPZE= +github.com/ava-labs/avalanchego v1.11.11-0.20240814151516-07f156340710/go.mod h1:8pnf2At/q0LRq5dvYJYn3CkhKzZNHRd5pjARC9psu+g= +github.com/ava-labs/awm-relayer v1.4.0-rc.2.0.20240814153151-7bd24a51ddbe h1:L7lvfIUiJUdcLHwxbKP9Dfy/iXore3U+mCl7Qa7CokA= +github.com/ava-labs/awm-relayer v1.4.0-rc.2.0.20240814153151-7bd24a51ddbe/go.mod h1:O8FsqdbVTQn3cB5Ql4pIS0+pe5HvDM4KnXd3igiwAX0= +github.com/ava-labs/coreth v0.13.8-fix-genesis-upgrade h1:xWsvSGtZcGna3B2BLU2BvK3qskbcc9ZNtgC0ck91CkI= +github.com/ava-labs/coreth v0.13.8-fix-genesis-upgrade/go.mod h1:Ouul9dJouniUIJVX1gDqx8CrHyGvmwZkK28mrgKb/4I= +github.com/ava-labs/subnet-evm v0.6.9-0.20240813192818-4d5aebb6decc h1:FZ09oIkRnrI+FLTReCKfWqNHFDrNQVr629NTkdfr22Y= +github.com/ava-labs/subnet-evm v0.6.9-0.20240813192818-4d5aebb6decc/go.mod h1:nWP5feXpdvF4Kv10V0vrP9bYqt5yYvp2I5bBXY2xa7U= github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= diff --git a/tests/flows/native_token_staking.go b/tests/flows/native_token_staking.go index fe0ea0093..ff71bee4d 100644 --- a/tests/flows/native_token_staking.go +++ b/tests/flows/native_token_staking.go @@ -1,24 +1,71 @@ package flows import ( + "context" + "encoding/hex" + "math/big" + "time" + + "github.com/ava-labs/avalanchego/api/info" + "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/message" "github.com/ava-labs/avalanchego/utils/constants" "github.com/ava-labs/avalanchego/utils/logging" + "github.com/ava-labs/avalanchego/utils/set" + avalancheWarp "github.com/ava-labs/avalanchego/vms/platformvm/warp" + warpMessages "github.com/ava-labs/avalanchego/vms/platformvm/warp/messages" + warpPayload "github.com/ava-labs/avalanchego/vms/platformvm/warp/payload" + relayerConfig "github.com/ava-labs/awm-relayer/config" "github.com/ava-labs/awm-relayer/peers" "github.com/ava-labs/awm-relayer/signature-aggregator/aggregator" sigAggConfig "github.com/ava-labs/awm-relayer/signature-aggregator/config" - sigAggMetrics "github.com/ava-labs/awm-relayer/signature-aggregator/metrics" + "github.com/ava-labs/subnet-evm/accounts/abi/bind" + "github.com/ava-labs/subnet-evm/core/types" + "github.com/ava-labs/subnet-evm/precompile/contracts/warp" + predicateutils "github.com/ava-labs/subnet-evm/predicate" + nativetokenstakingmanager "github.com/ava-labs/teleporter/abi-bindings/go/staking/NativeTokenStakingManager" "github.com/ava-labs/teleporter/tests/interfaces" + "github.com/ava-labs/teleporter/tests/utils" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/log" . "github.com/onsi/gomega" "github.com/prometheus/client_golang/prometheus" ) -func NativeTokenStakingManager(network interfaces.Network) { +// Registers a native token staking validator on a subnet. The steps are as follows: +// - Deploy the NativeTokenStakingManager +// - Initiate validator registration +// - Deliver the Warp message to the P-Chain (not implemented) +// - Aggregate P-Chain signatures on the response Warp message +// - Deliver the Warp message to the subnet +// - Verify that the validator is registered in the staking contract +func NativeTokenStakingManager(network interfaces.LocalNetwork) { // Get the subnets info + cChainInfo := network.GetPrimaryNetworkInfo() + subnetAInfo, _ := utils.GetTwoSubnets(network) + _, fundedKey := network.GetFundedAccountInfo() + + // Construct the P-Chain info + pChainBlockchainID, err := info.NewClient(cChainInfo.NodeURIs[0]).GetBlockchainID(context.Background(), "P") + Expect(err).Should(BeNil()) + pChainInfo := interfaces.SubnetTestInfo{ + BlockchainID: pChainBlockchainID, + SubnetID: ids.Empty, + } // Create the signature aggregator logger := logging.NoLog{} - cfg := sigAggConfig.Config{} + cfg := sigAggConfig.Config{ + PChainAPI: &relayerConfig.APIConfig{ + BaseURL: cChainInfo.NodeURIs[0], + }, + InfoAPI: &relayerConfig.APIConfig{ + BaseURL: cChainInfo.NodeURIs[0], + }, + } + trackedSubnets := set.NewSet[ids.ID](2) + trackedSubnets.Add(subnetAInfo.BlockchainID) + trackedSubnets.Add(ids.Empty) // Primary network subnet ID appRequestNetwork, err := peers.NewNetwork( logging.Debug, prometheus.DefaultRegisterer, @@ -33,27 +80,119 @@ func NativeTokenStakingManager(network interfaces.Network) { constants.DefaultNetworkCompressionType, constants.DefaultNetworkMaximumInboundTimeout, ) + Expect(err).Should(BeNil()) signatureAggregator := aggregator.NewSignatureAggregator( appRequestNetwork, logger, - sigAggMetrics.NewSignatureAggregatorMetrics( - prometheus.DefaultRegisterer, - ), messageCreator, ) + signatureAggregator.GetSubnetID(subnetAInfo.BlockchainID) // Deploy the staking manager contract - + stakingManagerContractAddress, stakingManager := utils.DeployNativeTokenStakingManager( + context.Background(), + fundedKey, + subnetAInfo, + ) + opts, err := bind.NewKeyedTransactorWithChainID(fundedKey, subnetAInfo.EVMChainID) + Expect(err).Should(BeNil()) + tx, err := stakingManager.Initialize( + opts, + nativetokenstakingmanager.StakingManagerSettings{ + PChainBlockchainID: pChainInfo.BlockchainID, + SubnetID: subnetAInfo.SubnetID, + MinimumStakeAmount: big.NewInt(0).SetUint64(1e6), + MaximumStakeAmount: big.NewInt(0).SetUint64(10e6), + MinimumStakeDuration: uint64(24 * time.Hour), + MaximumHourlyChurn: 1, + RewardCalculator: common.Address{}, + }, + ) + Expect(err).Should(BeNil()) + utils.WaitForTransactionSuccess(context.Background(), subnetAInfo, tx.Hash()) // Iniatiate validator registration + opts.Value = big.NewInt(0).SetUint64(1e18) + nodeID := ids.GenerateTestID() + signature := [64]byte{} + tx, err = stakingManager.InitializeValidatorRegistration( + opts, + nodeID, + uint64(time.Now().Add(24*time.Hour).Unix()), + signature[:], + ) + Expect(err).Should(BeNil()) + receipt := utils.WaitForTransactionSuccess(context.Background(), subnetAInfo, tx.Hash()) + registrationInitiatedEvent, err := utils.GetEventFromLogs( + receipt.Logs, + stakingManager.ParseValidationPeriodCreated, + ) + Expect(err).Should(BeNil()) + validationID := ids.ID(registrationInitiatedEvent.ValidationID) + // Gather subnet-evm Warp signatures for the RegisterSubnetValidatorMessage & relay to the P-Chain // (Sending to the P-Chain will be skipped for now) + signedWarpMessage := network.ConstructSignedWarpMessage(context.Background(), receipt, subnetAInfo, pChainInfo) + Expect(err).Should(BeNil()) + log.Info("Constructed signed RegisterSubnetValidator message", "message", signedWarpMessage) + // Validate the Warp message, (this will be done on the P-Chain in the future) + // msg, err := warpPayload.ParseAddressedCall(signedWarpMessage.UnsignedMessage.Payload) + // Expect(err).Should(BeNil()) + // // Check that the addressed call payload is a registered Warp message type + // var registerValidatorPayload warpMessages.RegisterSubnetValidator + // ver, err := warpMessages.Codec.Unmarshal(msg.Payload, ®isterValidatorPayload) + // Expect(err).Should(BeNil()) + // Expect(ver).Should(Equal(uint16(warpMessages.CodecVersion))) + // Expect(registerValidatorPayload.NodeID).Should(Equal(nodeID)) + // Expect(registerValidatorPayload.Weight).Should(Equal(1e18)) + // Expect(registerValidatorPayload.SubnetID).Should(Equal(subnetAInfo.SubnetID)) // Construct a SubnetValidatorRegistrationMessage Warp message from the P-Chain // Query P-Chain validators for the Warp message + registrationPayload, err := warpMessages.NewSubnetValidatorRegistration(validationID, true) + Expect(err).Should(BeNil()) + registrationAddressedCall, err := warpPayload.NewAddressedCall(common.Address{}.Bytes(), registrationPayload.Bytes()) + Expect(err).Should(BeNil()) + registrationUnsignedMessage, err := avalancheWarp.NewUnsignedMessage(network.GetNetworkID(), pChainInfo.BlockchainID, registrationAddressedCall.Bytes()) + Expect(err).Should(BeNil()) + log.Info("Constructed unsigned SubnetValidatorRegistration message", "message", hex.EncodeToString(registrationUnsignedMessage.Bytes())) + + registrationSignedMessage, err := signatureAggregator.CreateSignedMessage( + registrationUnsignedMessage, + nil, + subnetAInfo.SubnetID, + 67, + ) + Expect(err).Should(BeNil()) + log.Info("Constructed signed SubnetValidatorRegistration message", "message", registrationSignedMessage) // Deliver the Warp message to the subnet + abi, err := nativetokenstakingmanager.NativeTokenStakingManagerMetaData.GetAbi() + Expect(err).Should(BeNil()) + callData, err := abi.Pack("completeValidatorRegistration", uint32(0)) + Expect(err).Should(BeNil()) + gasFeeCap, gasTipCap, nonce := utils.CalculateTxParams(context.Background(), subnetAInfo, utils.PrivateKeyToAddress(fundedKey)) + registrationTx := predicateutils.NewPredicateTx( + subnetAInfo.EVMChainID, + nonce, + &stakingManagerContractAddress, + 2_000_000, + gasFeeCap, + gasTipCap, + big.NewInt(0), + callData, + types.AccessList{}, + warp.ContractAddress, + registrationSignedMessage.Bytes(), + ) + signedRegistrationTx := utils.SignTransaction(registrationTx, fundedKey, subnetAInfo.EVMChainID) + receipt = utils.SendTransactionAndWaitForSuccess(context.Background(), subnetAInfo, signedRegistrationTx) // Check that the validator is registered in the staking contract - + registrationEvent, err := utils.GetEventFromLogs( + receipt.Logs, + stakingManager.ParseValidationPeriodRegistered, + ) + Expect(err).Should(BeNil()) + Expect(registrationEvent.ValidationID[:]).Should(Equal(validationID[:])) } diff --git a/tests/local/network.go b/tests/local/network.go index 4472039d0..7f6e7fb0f 100644 --- a/tests/local/network.go +++ b/tests/local/network.go @@ -50,23 +50,46 @@ type LocalNetwork struct { globalFundedKey *ecdsa.PrivateKey // Internal vars only used to set up the local network - tmpnet *tmpnet.Network - warpChainConfigPath string + tmpnet *tmpnet.Network + // warpChainConfigPath string } const ( - fundedKeyStr = "56289e99c94b6912bfc12adc093c9b51124f0dc54ac7a766b2bc5ccf558d8027" - warpEnabledChainConfig = `{ - "warp-api-enabled": true, - "eth-apis":["eth","eth-filter","net","admin","web3", - "internal-eth","internal-blockchain","internal-transaction", - "internal-debug","internal-account","internal-personal", - "debug","debug-tracer","debug-file-tracer","debug-handler"] - }` + fundedKeyStr = "56289e99c94b6912bfc12adc093c9b51124f0dc54ac7a766b2bc5ccf558d8027" + // warpEnabledChainConfig = `{ + // "warp-api-enabled": true, + // "eth-apis":["eth","eth-filter","net","admin","web3", + // "internal-eth","internal-blockchain","internal-transaction", + // "internal-debug","internal-account","internal-personal", + // "debug","debug-tracer","debug-file-tracer","debug-handler"] + // }` timeout = 60 * time.Second ) +var warpEnabledChainConfig = tmpnet.FlagsMap{ + "log-level": "debug", + "warp-api-enabled": true, + "local-txs-enabled": true, + "eth-apis": []string{ + "eth", + "eth-filter", + "net", + "admin", + "web3", + "internal-eth", + "internal-blockchain", + "internal-transaction", + "internal-debug", + "internal-account", + "internal-personal", + "debug", + "debug-tracer", + "debug-file-tracer", + "debug-handler", + }, +} + type SubnetSpec struct { Name string EVMChainID uint64 @@ -88,11 +111,11 @@ func NewLocalNetwork( // Create extra nodes to be used to add more validators later extraNodes := subnetEvmTestUtils.NewTmpnetNodes(extraNodeCount) - f, err := os.CreateTemp(os.TempDir(), "config.json") - Expect(err).Should(BeNil()) - _, err = f.Write([]byte(warpEnabledChainConfig)) - Expect(err).Should(BeNil()) - warpChainConfigPath := f.Name() + // f, err := os.CreateTemp(os.TempDir(), "config.json") + // Expect(err).Should(BeNil()) + // _, err = f.Write([]byte(warpEnabledChainConfig)) + // Expect(err).Should(BeNil()) + // warpChainConfigPath := f.Name() var allNodes []*tmpnet.Node allNodes = append(allNodes, extraNodes...) // to be appended w/ subnet validators @@ -111,7 +134,7 @@ func NewLocalNetwork( subnetSpec.TeleporterDeployedBytecode, subnetSpec.TeleporterDeployerAddress, ), - subnetEvmTestUtils.DefaultChainConfig, + warpEnabledChainConfig, nodes..., ) subnets = append(subnets, subnet) @@ -149,12 +172,12 @@ func NewLocalNetwork( } localNetwork := &LocalNetwork{ - primaryNetworkInfo: &interfaces.SubnetTestInfo{}, - subnetsInfo: make(map[ids.ID]*interfaces.SubnetTestInfo), - extraNodes: extraNodes, - globalFundedKey: globalFundedKey, - tmpnet: network, - warpChainConfigPath: warpChainConfigPath, + primaryNetworkInfo: &interfaces.SubnetTestInfo{}, + subnetsInfo: make(map[ids.ID]*interfaces.SubnetTestInfo), + extraNodes: extraNodes, + globalFundedKey: globalFundedKey, + tmpnet: network, + // warpChainConfigPath: warpChainConfigPath, } for _, subnet := range network.Subnets { localNetwork.setSubnetValues(subnet) @@ -486,7 +509,7 @@ func (n *LocalNetwork) TearDownNetwork() { Expect(n).ShouldNot(BeNil()) Expect(n.tmpnet).ShouldNot(BeNil()) Expect(n.tmpnet.Stop(context.Background())).Should(BeNil()) - Expect(os.Remove(n.warpChainConfigPath)).Should(BeNil()) + // Expect(os.Remove(n.warpChainConfigPath)).Should(BeNil()) } func (n *LocalNetwork) AddSubnetValidators(ctx context.Context, subnetID ids.ID, count uint) { diff --git a/tests/utils/utils.go b/tests/utils/utils.go index 01df542d6..73948666f 100644 --- a/tests/utils/utils.go +++ b/tests/utils/utils.go @@ -18,6 +18,7 @@ import ( validatorsetsig "github.com/ava-labs/teleporter/abi-bindings/go/governance/ValidatorSetSig" exampleerc20 "github.com/ava-labs/teleporter/abi-bindings/go/mocks/ExampleERC20" + nativetokenstakingmanager "github.com/ava-labs/teleporter/abi-bindings/go/staking/NativeTokenStakingManager" teleportermessenger "github.com/ava-labs/teleporter/abi-bindings/go/teleporter/TeleporterMessenger" teleporterregistry "github.com/ava-labs/teleporter/abi-bindings/go/teleporter/registry/TeleporterRegistry" testmessenger "github.com/ava-labs/teleporter/abi-bindings/go/teleporter/tests/TestMessenger" @@ -910,6 +911,26 @@ func DeployValidatorSetSig( return address, validatorSetSig } +func DeployNativeTokenStakingManager( + ctx context.Context, + senderKey *ecdsa.PrivateKey, + subnet interfaces.SubnetTestInfo, +) (common.Address, *nativetokenstakingmanager.NativeTokenStakingManager) { + opts, err := bind.NewKeyedTransactorWithChainID(senderKey, subnet.EVMChainID) + Expect(err).Should(BeNil()) + address, tx, stakingManager, err := nativetokenstakingmanager.DeployNativeTokenStakingManager( + opts, + subnet.RPCClient, + 0, // ICMInitializable.Allowed + ) + Expect(err).Should(BeNil()) + + // Wait for the transaction to be mined + WaitForTransactionSuccess(ctx, subnet, tx.Hash()) + + return address, stakingManager +} + func GetTwoSubnets(network interfaces.Network) ( interfaces.SubnetTestInfo, interfaces.SubnetTestInfo, From 2436a313afcd5a27b8e787956be96c4202e4dde1 Mon Sep 17 00:00:00 2001 From: cam-schultz Date: Wed, 14 Aug 2024 15:14:10 -0500 Subject: [PATCH 07/27] remove dbg code --- contracts/staking/StakingManager.sol | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/contracts/staking/StakingManager.sol b/contracts/staking/StakingManager.sol index 06dbc4cd2..f3e7b6c9d 100644 --- a/contracts/staking/StakingManager.sol +++ b/contracts/staking/StakingManager.sol @@ -134,18 +134,6 @@ abstract contract StakingManager is bytes memory signature ) internal nonReentrant returns (bytes32) { StakingManagerStorage storage $ = _getStakingManagerStorage(); - require( - value == 1e18, - "canary" - ); - require( - $._minimumStakeAmount == 1e6, - "canary2" - ); - require( - $._maximumStakeAmount==10e6, - "canary3" - ); // Ensure the registration expiry is in a valid range. require( From 5d4e3373d6f619038d210d2e9cfc9f8498d50b33 Mon Sep 17 00:00:00 2001 From: cam-schultz Date: Wed, 14 Aug 2024 15:14:20 -0500 Subject: [PATCH 08/27] update deps --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 7d7bde2dd..1c725ac6f 100644 --- a/go.mod +++ b/go.mod @@ -3,12 +3,12 @@ module github.com/ava-labs/teleporter go 1.21.13 require ( - github.com/ava-labs/avalanchego v1.11.11-0.20240814151516-07f156340710 + github.com/ava-labs/avalanchego v1.11.11-0.20240814200552-b3b720666238 github.com/supranational/blst v0.3.11 // indirect ) require ( - github.com/ava-labs/awm-relayer v1.4.0-rc.2.0.20240814153151-7bd24a51ddbe + github.com/ava-labs/awm-relayer v1.4.0-rc.2.0.20240814200841-1c435873fd12 github.com/ava-labs/subnet-evm v0.6.9-0.20240813192818-4d5aebb6decc github.com/ethereum/go-ethereum v1.13.8 github.com/onsi/ginkgo/v2 v2.20.0 diff --git a/go.sum b/go.sum index 8b1356763..72927d301 100644 --- a/go.sum +++ b/go.sum @@ -56,10 +56,10 @@ github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah4HI848JfFxHt+iPb26b4zyfspmqY0/8= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/ava-labs/avalanchego v1.11.11-0.20240814151516-07f156340710 h1:NfFMYT4/iZgUCkTOzkS5IkST+h44SDqcAnl7MtYLPZE= -github.com/ava-labs/avalanchego v1.11.11-0.20240814151516-07f156340710/go.mod h1:8pnf2At/q0LRq5dvYJYn3CkhKzZNHRd5pjARC9psu+g= -github.com/ava-labs/awm-relayer v1.4.0-rc.2.0.20240814153151-7bd24a51ddbe h1:L7lvfIUiJUdcLHwxbKP9Dfy/iXore3U+mCl7Qa7CokA= -github.com/ava-labs/awm-relayer v1.4.0-rc.2.0.20240814153151-7bd24a51ddbe/go.mod h1:O8FsqdbVTQn3cB5Ql4pIS0+pe5HvDM4KnXd3igiwAX0= +github.com/ava-labs/avalanchego v1.11.11-0.20240814200552-b3b720666238 h1:zxFjHBPwGo1WaNa7FLbIWgHeYk3y+ivm7RUdq4lZAW8= +github.com/ava-labs/avalanchego v1.11.11-0.20240814200552-b3b720666238/go.mod h1:8pnf2At/q0LRq5dvYJYn3CkhKzZNHRd5pjARC9psu+g= +github.com/ava-labs/awm-relayer v1.4.0-rc.2.0.20240814200841-1c435873fd12 h1:vcCa4wZTDPObQFauhjtkAqbHWty3vXQaoPJMFgptnWM= +github.com/ava-labs/awm-relayer v1.4.0-rc.2.0.20240814200841-1c435873fd12/go.mod h1:cpfI3E4g0NsEjhJ9VHJ4xMLyOOAqqL1by0MhTIito/c= github.com/ava-labs/coreth v0.13.8-fix-genesis-upgrade h1:xWsvSGtZcGna3B2BLU2BvK3qskbcc9ZNtgC0ck91CkI= github.com/ava-labs/coreth v0.13.8-fix-genesis-upgrade/go.mod h1:Ouul9dJouniUIJVX1gDqx8CrHyGvmwZkK28mrgKb/4I= github.com/ava-labs/subnet-evm v0.6.9-0.20240813192818-4d5aebb6decc h1:FZ09oIkRnrI+FLTReCKfWqNHFDrNQVr629NTkdfr22Y= From cf8b06417ee1477fd3cb022ef192d699a5345b28 Mon Sep 17 00:00:00 2001 From: cam-schultz Date: Fri, 2 Aug 2024 12:50:20 -0400 Subject: [PATCH 09/27] codec id to message formats --- contracts/staking/StakingMessages.sol | 274 ++++++++---------- .../staking/tests/StakingMessagesTests.t.sol | 20 +- 2 files changed, 120 insertions(+), 174 deletions(-) diff --git a/contracts/staking/StakingMessages.sol b/contracts/staking/StakingMessages.sol index 055def9b4..20ac4deb4 100644 --- a/contracts/staking/StakingMessages.sol +++ b/contracts/staking/StakingMessages.sol @@ -6,7 +6,8 @@ pragma solidity 0.8.25; library StakingMessages { // The information that uniquely identifies a subnet validation period. - // The SHA-256 hash of the concatenation of these field is the validationID. + // The validationID is the SHA-256 hash of the concatenation of the CODEC_ID, + // SUBNET_VALIDATOR_REGISTRATION_MESSAGE_TYPE_ID, and the concatenated ValidationInfo fields. struct ValidationInfo { bytes32 subnetID; bytes32 nodeID; @@ -15,6 +16,9 @@ library StakingMessages { bytes signature; } + // The P-Chain uses a hardcoded codecID of 0 for all messages. + uint16 internal constant CODEC_ID = 0; + // Subnets send a RegisterSubnetValidator message to the P-Chain to register a validator. uint32 internal constant REGISTER_SUBNET_VALIDATOR_MESSAGE_TYPE_ID = 0; @@ -26,18 +30,23 @@ library StakingMessages { // for the given validation ID. uint32 internal constant SUBNET_VALIDATOR_REGISTRATION_MESSAGE_TYPE_ID = 2; + // The P-Chain responds with a SetSubnetValidatorWeight message indicating whether the weight update was successful + // for the given validation ID. uint32 internal constant SET_SUBNET_VALIDATOR_WEIGHT_UPDATE_MESSAGE_TYPE_ID = 3; + // The Subnet will self-sign a ValidationUptimeMessage to be provided when a validator is initiating // the end of their validation period. uint32 internal constant VALIDATION_UPTIME_MESSAGE_TYPE_ID = 4; - // TODO: The implemenation of these packing and unpacking functions is neither tested or optimzied at all. + // TODO: The implementation of these packing and unpacking functions is neither tested nor optimized at all. // Full test coverage should be provided, and the implementation should be optimized for gas efficiency. /** * @notice Packs a RegisterSubnetValidatorMessage message into a byte array. * The message format specification is: * +-----------+----------+-----------+ + * | codecID : uint16 | 2 bytes | + * +-----------+----------+-----------+ * | typeID : uint32 | 4 bytes | * +-----------+----------+-----------+ * | subnetID : [32]byte | 32 bytes | @@ -50,7 +59,7 @@ library StakingMessages { * +-----------+----------+-----------+ * | signature : [64]byte | 64 bytes | * +-----------+----------+-----------+ - * | 148 bytes | + * | 150 bytes | * +-----------+ * * @param validationInfo The information to pack into the message. @@ -61,20 +70,39 @@ library StakingMessages { pure returns (bytes32, bytes memory) { - (bytes32 validationID, bytes memory serializedValidationInfo) = - packValidationInfo(validationInfo); - - bytes memory res = new bytes(148); - // Pack the message type - for (uint256 i; i < 4; ++i) { - res[i] = bytes1(uint8(REGISTER_SUBNET_VALIDATOR_MESSAGE_TYPE_ID >> (8 * (3 - i)))); + require(validationInfo.signature.length == 64, "StakingMessages: Invalid signature length"); + bytes memory res = new bytes(150); + // Pack the codec ID + for (uint256 i; i < 2; ++i) { + res[i] = bytes1(uint8(CODEC_ID >> uint8((8 * (1 - i))))); } - // Pack the validation info - for (uint256 i; i < 144; ++i) { - res[i + 4] = serializedValidationInfo[i]; + // Pack the type ID + for (uint256 i; i < 4; ++i) { + res[i + 2] = + bytes1(uint8(SUBNET_VALIDATOR_REGISTRATION_MESSAGE_TYPE_ID >> uint8((8 * (3 - i))))); } - return (validationID, res); + // Pack the subnetID + for (uint256 i; i < 32; ++i) { + res[i + 6] = validationInfo.subnetID[i]; + } + // Pack the nodeID + for (uint256 i; i < 32; ++i) { + res[i + 38] = validationInfo.nodeID[i]; + } + // Pack the weight + for (uint256 i; i < 8; ++i) { + res[i + 70] = bytes1(uint8(validationInfo.weight >> uint8((8 * (7 - i))))); + } + // Pack the registration expiry + for (uint256 i; i < 8; ++i) { + res[i + 78] = bytes1(uint8(validationInfo.registrationExpiry >> uint64((8 * (7 - i))))); + } + // Pack the signature + for (uint256 i; i < 64; ++i) { + res[i + 86] = validationInfo.signature[i]; + } + return (sha256(res), res); } /** @@ -89,46 +117,53 @@ library StakingMessages { pure returns (ValidationInfo memory) { - require(input.length == 148, "StakingMessages: Invalid message length"); + require(input.length == 150, "StakingMessages: Invalid message length"); + + // Unpack the codec ID + uint16 codecID; + for (uint256 i; i < 2; ++i) { + codecID |= uint16(uint8(input[i])) << uint16((8 * (1 - i))); + } + require(codecID == CODEC_ID, "StakingMessages: Invalid codec ID"); // Unpack the type ID uint32 typeID; for (uint256 i; i < 4; ++i) { - typeID |= uint32(uint8(input[i])) << uint32((8 * (3 - i))); + typeID |= uint32(uint8(input[i + 2])) << uint32((8 * (3 - i))); } require( typeID == REGISTER_SUBNET_VALIDATOR_MESSAGE_TYPE_ID, "StakingMessages: Invalid message type" ); - // Unpack the subnet ID + // Unpack the subnetID bytes32 subnetID; for (uint256 i; i < 32; ++i) { - subnetID |= bytes32(uint256(uint8(input[i + 4])) << (8 * (31 - i))); + subnetID |= bytes32(uint256(uint8(input[i + 6])) << (8 * (31 - i))); } - // Unpack the node ID + // Unpack the nodeID bytes32 nodeID; for (uint256 i; i < 32; ++i) { - nodeID |= bytes32(uint256(uint8(input[i + 36])) << (8 * (31 - i))); + nodeID |= bytes32(uint256(uint8(input[i + 38])) << (8 * (31 - i))); } // Unpack the weight uint64 weight; for (uint256 i; i < 8; ++i) { - weight |= uint64(uint8(input[i + 68])) << uint64((8 * (7 - i))); + weight |= uint64(uint8(input[i + 70])) << uint64((8 * (7 - i))); } - // Unpack the expiry + // Unpack the registration expiry uint64 expiry; for (uint256 i; i < 8; ++i) { - expiry |= uint64(uint8(input[i + 76])) << uint64((8 * (7 - i))); + expiry |= uint64(uint8(input[i + 78])) << uint64((8 * (7 - i))); } // Unpack the signature bytes memory signature = new bytes(64); for (uint256 i; i < 64; ++i) { - signature[i] = input[i + 84]; + signature[i] = input[i + 86]; } return ValidationInfo({ @@ -144,13 +179,15 @@ library StakingMessages { * @notice Packs a SubnetValidatorRegistrationMessage into a byte array. * The message format specification is: * +--------------+----------+----------+ + * | codecID : uint16 | 2 bytes | + * +--------------+----------+----------+ * | typeID : uint32 | 4 bytes | * +--------------+----------+----------+ * | validationID : [32]byte | 32 bytes | * +--------------+----------+----------+ * | valid : bool + 1 byte | * +--------------+----------+----------+ - * | 37 bytes | + * | 39 bytes | * +----------+ * * @param validationID The ID of the validation period. @@ -162,17 +199,22 @@ library StakingMessages { bytes32 validationID, bool valid ) internal pure returns (bytes memory) { - bytes memory res = new bytes(37); + bytes memory res = new bytes(39); + // Pack the codec ID. + for (uint256 i; i < 2; ++i) { + res[i] = bytes1(uint8(CODEC_ID >> (8 * (1 - i)))); + } // Pack the type ID. for (uint256 i; i < 4; ++i) { - res[i] = bytes1(uint8(SUBNET_VALIDATOR_REGISTRATION_MESSAGE_TYPE_ID >> (8 * (3 - i)))); + res[i + 2] = + bytes1(uint8(SUBNET_VALIDATOR_REGISTRATION_MESSAGE_TYPE_ID >> (8 * (3 - i)))); } // Pack the validation ID. for (uint256 i; i < 32; ++i) { - res[i + 4] = bytes1(uint8(uint256(validationID >> (8 * (31 - i))))); + res[i + 6] = bytes1(uint8(uint256(validationID >> (8 * (31 - i))))); } // Pack the validity. - res[36] = bytes1(valid ? 1 : 0); + res[38] = bytes1(valid ? 1 : 0); return res; } @@ -195,8 +237,7 @@ library StakingMessages { for (uint256 i; i < 2; ++i) { codecID |= uint16(uint8(input[i])) << uint16((8 * (1 - i))); } - require(codecID == 0, "StakingMessages: Invalid codec ID"); - + require(codecID == CODEC_ID, "StakingMessages: Invalid codec ID"); // Unpack the type ID uint32 typeID; @@ -224,6 +265,8 @@ library StakingMessages { * @notice Packs a SetSubnetValidatorWeightMessage message into a byte array. * The message format specification is: * +--------------+----------+----------+ + * | codecID : uint16 | 2 bytes | + * +--------------+----------+----------+ * | typeID : uint32 | 4 bytes | * +--------------+----------+----------+ * | validationID : [32]byte | 32 bytes | @@ -232,7 +275,7 @@ library StakingMessages { * +--------------+----------+----------+ * | weight : uint64 | 8 bytes | * +--------------+----------+----------+ - * | 52 bytes | + * | 54 bytes | * +----------+ * * @param validationID The ID of the validation period. @@ -245,22 +288,26 @@ library StakingMessages { uint64 nonce, uint64 weight ) internal pure returns (bytes memory) { - bytes memory res = new bytes(52); + bytes memory res = new bytes(54); + // Pack the codec ID. + for (uint256 i; i < 2; ++i) { + res[i] = bytes1(uint8(CODEC_ID >> (8 * (1 - i)))); + } // Pack the type ID. for (uint256 i; i < 4; ++i) { - res[i] = bytes1(uint8(SET_SUBNET_VALIDATOR_WEIGHT_MESSAGE_TYPE_ID >> (8 * (3 - i)))); + res[i + 2] = bytes1(uint8(SET_SUBNET_VALIDATOR_WEIGHT_MESSAGE_TYPE_ID >> (8 * (3 - i)))); } // Pack the validation ID. for (uint256 i; i < 32; ++i) { - res[i + 4] = bytes1(uint8(uint256(validationID >> (8 * (31 - i))))); + res[i + 6] = bytes1(uint8(uint256(validationID >> (8 * (31 - i))))); } // Pack the nonce. for (uint256 i; i < 8; ++i) { - res[i + 36] = bytes1(uint8(nonce >> (8 * (7 - i)))); + res[i + 38] = bytes1(uint8(nonce >> (8 * (7 - i)))); } // Pack the weight. for (uint256 i; i < 8; ++i) { - res[i + 44] = bytes1(uint8(weight >> (8 * (7 - i)))); + res[i + 46] = bytes1(uint8(weight >> (8 * (7 - i)))); } return res; } @@ -277,12 +324,19 @@ library StakingMessages { pure returns (bytes32, uint64, uint64) { - require(input.length == 52, "StakingMessages: Invalid message length"); + require(input.length == 54, "StakingMessages: Invalid message length"); + + // Unpack the codec ID. + uint16 codecID; + for (uint256 i; i < 2; ++i) { + codecID |= uint16(uint8(input[i])) << uint16((8 * (1 - i))); + } + require(codecID == CODEC_ID, "StakingMessages: Invalid codec ID"); // Unpack the type ID. uint32 typeID; for (uint256 i; i < 4; ++i) { - typeID |= uint32(uint8(input[i])) << uint32((8 * (3 - i))); + typeID |= uint32(uint8(input[i + 2])) << uint32((8 * (3 - i))); } require( typeID == SET_SUBNET_VALIDATOR_WEIGHT_MESSAGE_TYPE_ID, @@ -292,19 +346,19 @@ library StakingMessages { // Unpack the validation ID. bytes32 validationID; for (uint256 i; i < 32; ++i) { - validationID |= bytes32(uint256(uint8(input[i + 4])) << (8 * (31 - i))); + validationID |= bytes32(uint256(uint8(input[i + 6])) << (8 * (31 - i))); } // Unpack the nonce. uint64 nonce; for (uint256 i; i < 8; ++i) { - nonce |= uint64(uint8(input[i + 36])) << uint64((8 * (7 - i))); + nonce |= uint64(uint8(input[i + 38])) << uint64((8 * (7 - i))); } // Unpack the weight. uint64 weight; for (uint256 i; i < 8; ++i) { - weight |= uint64(uint8(input[i + 44])) << uint64((8 * (7 - i))); + weight |= uint64(uint8(input[i + 46])) << uint64((8 * (7 - i))); } return (validationID, nonce, weight); @@ -314,13 +368,15 @@ library StakingMessages { * @notice Packs a ValidationUptimeMessage into a byte array. * The message format specification is: * +--------------+----------+----------+ + * | codecID : uint16 | 2 bytes | + * +--------------+----------+----------+ * | typeID : uint32 | 4 bytes | * +--------------+----------+----------+ * | validationID : [32]byte | 32 bytes | * +--------------+----------+----------+ * | uptime : uint64 | 8 bytes | * +--------------+----------+----------+ - * | 44 bytes | + * | 46 bytes | * +----------+ * * @param validationID The ID of the validation period. @@ -331,18 +387,23 @@ library StakingMessages { bytes32 validationID, uint64 uptime ) internal pure returns (bytes memory) { - bytes memory res = new bytes(44); + bytes memory res = new bytes(46); + + // Pack the codec ID. + for (uint256 i; i < 2; ++i) { + res[i] = bytes1(uint8(CODEC_ID >> (8 * (1 - i)))); + } // Pack the type ID. for (uint256 i; i < 4; ++i) { - res[i] = bytes1(uint8(VALIDATION_UPTIME_MESSAGE_TYPE_ID >> (8 * (3 - i)))); + res[i + 2] = bytes1(uint8(VALIDATION_UPTIME_MESSAGE_TYPE_ID >> (8 * (3 - i)))); } // Pack the validation ID. for (uint256 i; i < 32; ++i) { - res[i + 4] = bytes1(uint8(uint256(validationID >> (8 * (31 - i))))); + res[i + 6] = bytes1(uint8(uint256(validationID >> (8 * (31 - i))))); } // Pack the uptime. for (uint256 i; i < 8; ++i) { - res[i + 36] = bytes1(uint8(uptime >> (8 * (7 - i)))); + res[i + 38] = bytes1(uint8(uptime >> (8 * (7 - i)))); } return res; } @@ -359,12 +420,19 @@ library StakingMessages { pure returns (bytes32, uint64) { - require(input.length == 44, "StakingMessages: Invalid message length"); + require(input.length == 46, "StakingMessages: Invalid message length"); + + // Unpack the codec ID. + uint16 codecID; + for (uint256 i; i < 2; ++i) { + codecID |= uint16(uint8(input[i])) << uint16((8 * (1 - i))); + } + require(codecID == CODEC_ID, "StakingMessages: Invalid codec ID"); // Unpack the type ID. uint32 typeID; for (uint256 i; i < 4; ++i) { - typeID |= uint32(uint8(input[i])) << uint32((8 * (3 - i))); + typeID |= uint32(uint8(input[i + 2])) << uint32((8 * (3 - i))); } require( typeID == VALIDATION_UPTIME_MESSAGE_TYPE_ID, "StakingMessages: Invalid message type" @@ -373,119 +441,15 @@ library StakingMessages { // Unpack the validation ID. bytes32 validationID; for (uint256 i; i < 32; ++i) { - validationID |= bytes32(uint256(uint8(input[i + 4])) << (8 * (31 - i))); + validationID |= bytes32(uint256(uint8(input[i + 6])) << (8 * (31 - i))); } // Unpack the uptime. uint64 uptime; for (uint256 i; i < 8; ++i) { - uptime |= uint64(uint8(input[i + 36])) << uint64((8 * (7 - i))); + uptime |= uint64(uint8(input[i + 38])) << uint64((8 * (7 - i))); } return (validationID, uptime); } - - /** - * @notice Packs all of the information pertaining to a validation period into a byte array. - * The packed data is used to calculate the validationID as the SHA-256 hash of the packed data. - * The specification of the packed data is: - * +-----------+----------+-----------+ - * | subnetID : [32]byte | 32 bytes | - * +-----------+----------+-----------+ - * | nodeID : [32]byte | 32 bytes | - * +-----------+----------+-----------+ - * | weight : uint64 | 8 bytes | - * +-----------+----------+-----------+ - * | expiry : uint64 | 8 bytes | - * +-----------+----------+-----------+ - * | signature : [64]byte | 64 bytes | - * +-----------+----------+-----------+ - * | 144 bytes | - * +-----------+ - * - * @param validationInfo The information to pack. - * @return The validationID and the packed data. - */ - function packValidationInfo(ValidationInfo memory validationInfo) - internal - pure - returns (bytes32, bytes memory) - { - require(validationInfo.signature.length == 64, "StakingMessages: Invalid signature length"); - bytes memory res = new bytes(144); - // Pack the subnetID - for (uint256 i; i < 32; ++i) { - res[i] = validationInfo.subnetID[i]; - } - // Pack the nodeID - for (uint256 i; i < 32; ++i) { - res[i + 32] = validationInfo.nodeID[i]; - } - // Pack the weight - for (uint256 i; i < 8; ++i) { - res[i + 64] = bytes1(uint8(validationInfo.weight >> uint8((8 * (7 - i))))); - } - // Pack the registration expiry - for (uint256 i; i < 8; ++i) { - res[i + 72] = bytes1(uint8(validationInfo.registrationExpiry >> uint64((8 * (7 - i))))); - } - // Pack the signature - for (uint256 i; i < 64; ++i) { - res[i + 80] = validationInfo.signature[i]; - } - return (sha256(res), res); - } - - /** - * @notice Unpacks a byte array as a ValidationInfo. - * The message format specification is the same as the one used in above for packing. - * - * @param input The byte array to unpack. - * @return The unpacked ValidationInfo. - */ - function unpackValidationInfo(bytes memory input) - internal - pure - returns (ValidationInfo memory) - { - require(input.length == 144, "StakingMessages: Invalid message length"); - - // Unpack the subnetID - bytes32 subnetID; - for (uint256 i; i < 32; ++i) { - subnetID |= bytes32(uint256(uint8(input[i])) << (8 * (31 - i))); - } - - // Unpack the nodeID - bytes32 nodeID; - for (uint256 i; i < 32; ++i) { - nodeID |= bytes32(uint256(uint8(input[i + 32])) << (8 * (31 - i))); - } - - // Unpack the weight - uint64 weight; - for (uint256 i; i < 8; ++i) { - weight |= uint64(uint8(input[i + 64])) << uint64((8 * (7 - i))); - } - - // Unpack the registration expiry - uint64 expiry; - for (uint256 i; i < 8; ++i) { - expiry |= uint64(uint8(input[i + 72])) << uint64((8 * (7 - i))); - } - - // Unpack the signature - bytes memory signature = new bytes(64); - for (uint256 i; i < 64; ++i) { - signature[i] = input[i + 80]; - } - - return ValidationInfo({ - subnetID: subnetID, - nodeID: nodeID, - weight: weight, - registrationExpiry: expiry, - signature: signature - }); - } } diff --git a/contracts/staking/tests/StakingMessagesTests.t.sol b/contracts/staking/tests/StakingMessagesTests.t.sol index 4b3b44dd9..0367f5acf 100644 --- a/contracts/staking/tests/StakingMessagesTests.t.sol +++ b/contracts/staking/tests/StakingMessagesTests.t.sol @@ -41,7 +41,7 @@ contract StakingMessagesTest is Test { assertEq(info.registrationExpiry, DEFAULT_EXPIRY); assertEq(info.signature, DEFAULT_ED25519_SIGNATURE); - (bytes32 recoveredID,) = StakingMessages.packValidationInfo(info); + (bytes32 recoveredID,) = StakingMessages.packRegisterSubnetValidatorMessage(info); assertEq(recoveredID, validationID); } @@ -73,22 +73,4 @@ contract StakingMessagesTest is Test { assertEq(validationID, DEFAULT_VALIDATION_ID); assertEq(uptime, 100); } - - function testValidationInfo() public pure { - (, bytes memory packed) = StakingMessages.packValidationInfo( - StakingMessages.ValidationInfo({ - subnetID: DEFAULT_SUBNET_ID, - nodeID: DEFAULT_NODE_ID, - weight: DEFAULT_WEIGHT, - registrationExpiry: DEFAULT_EXPIRY, - signature: DEFAULT_ED25519_SIGNATURE - }) - ); - StakingMessages.ValidationInfo memory info = StakingMessages.unpackValidationInfo(packed); - assertEq(info.subnetID, DEFAULT_SUBNET_ID); - assertEq(info.nodeID, DEFAULT_NODE_ID); - assertEq(info.weight, DEFAULT_WEIGHT); - assertEq(info.registrationExpiry, DEFAULT_EXPIRY); - assertEq(info.signature, DEFAULT_ED25519_SIGNATURE); - } } From ba68b8e4a6c055c685de08723fb6355596763b52 Mon Sep 17 00:00:00 2001 From: cam-schultz Date: Wed, 14 Aug 2024 15:54:45 -0500 Subject: [PATCH 10/27] update staking messages to latest spec --- .../ERC20TokenStakingManager.go | 2 +- .../NativeTokenStakingManager.go | 2 +- contracts/staking/StakingManager.sol | 20 ++---- contracts/staking/StakingMessages.sol | 71 ++++++++++--------- .../staking/tests/StakingManagerTests.t.sol | 40 +++++------ .../staking/tests/StakingMessagesTests.t.sol | 8 +-- tests/flows/native_token_staking.go | 28 ++++---- 7 files changed, 83 insertions(+), 88 deletions(-) diff --git a/abi-bindings/go/staking/ERC20TokenStakingManager/ERC20TokenStakingManager.go b/abi-bindings/go/staking/ERC20TokenStakingManager/ERC20TokenStakingManager.go index 61754be97..cc95f36e9 100644 --- a/abi-bindings/go/staking/ERC20TokenStakingManager/ERC20TokenStakingManager.go +++ b/abi-bindings/go/staking/ERC20TokenStakingManager/ERC20TokenStakingManager.go @@ -43,7 +43,7 @@ type StakingManagerSettings struct { // ERC20TokenStakingManagerMetaData contains all meta data concerning the ERC20TokenStakingManager contract. var ERC20TokenStakingManagerMetaData = &bind.MetaData{ ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"init\",\"type\":\"uint8\",\"internalType\":\"enumICMInitializable\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"WARP_MESSENGER\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIWarpMessenger\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"completeEndValidation\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"setWeightMessageType\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"completeValidatorRegistration\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"settings\",\"type\":\"tuple\",\"internalType\":\"structStakingManagerSettings\",\"components\":[{\"name\":\"pChainBlockchainID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"subnetID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"minimumStakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"maximumStakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"minimumStakeDuration\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"maximumHourlyChurn\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"rewardCalculator\",\"type\":\"address\",\"internalType\":\"contractIRewardCalculator\"}]},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeEndValidation\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"includeUptimeProof\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeValidatorRegistration\",\"inputs\":[{\"name\":\"stakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"nodeID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"resendEndValidatorMessage\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"resendRegisterValidatorMessage\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"valueToWeight\",\"inputs\":[{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"weightToValue\",\"inputs\":[{\"name\":\"weight\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"pure\"},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodCreated\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"nodeID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"registerValidationMessageID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"weight\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodEnded\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodRegistered\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"stakeAmount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"timestamp\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidatorRemovalInitialized\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"setWeightMessageID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"stakeAmount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"endTime\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"uptime\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ReentrancyGuardReentrantCall\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"SafeERC20FailedOperation\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}]}]", - Bin: "0x608060405234801561000f575f80fd5b5060405161344238038061344283398101604081905261002e91610107565b60018160018111156100425761004261012c565b0361004f5761004f610055565b50610140565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156100a55760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146101045780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b5f60208284031215610117575f80fd5b815160028110610125575f80fd5b9392505050565b634e487b7160e01b5f52602160045260245ffd5b6132f58061014d5f395ff3fe608060405234801561000f575f80fd5b506004361061009b575f3560e01c8063872fda6411610063578063872fda641461012b578063a3a65e481461013e578063b771b3bc14610151578063bee0a03f14610177578063fdf94a1a1461018a575f80fd5b80630322ed981461009f5780632e2194d8146100b45780635d0d7466146100e457806362065856146100f757806376f7862114610118575b5f80fd5b6100b26100ad3660046129ec565b61019d565b005b6100c76100c23660046129ec565b610393565b6040516001600160401b0390911681526020015b60405180910390f35b6100b26100f2366004612a17565b6103a9565b61010a610105366004612a6f565b6104b7565b6040519081526020016100db565b6100b2610126366004612aaf565b6104d0565b61010a610139366004612b7c565b610a50565b6100b261014c366004612c18565b610a68565b61015f6005600160991b0181565b6040516001600160a01b0390911681526020016100db565b6100b26101853660046129ec565b610cf5565b6100b2610198366004612c31565b610e09565b5f8181527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab60860205260408082208151610120810190925280545f805160206132c983398151915293929190829060ff1660058111156101fe576101fe612c5b565b600581111561020f5761020f612c5b565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003928301546001600160a01b03811660c084015260ff600160a01b820416151560e0840152600160a81b90041661010090910152909150815160058111156102a6576102a6612c5b565b1461030e5760405162461bcd60e51b815260206004820152602d60248201527f5374616b696e674d616e616765723a2056616c696461746f72206e6f7420706560448201526c1b991a5b99c81c995b5bdd985b609a1b60648201526084015b60405180910390fd5b5f61031f848361010001515f611230565b60405163ee5b48eb60e01b81529091506005600160991b019063ee5b48eb9061034c908490600401612c91565b6020604051808303815f875af1158015610368573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061038c9190612cc3565b5050505050565b5f6103a364e8d4a5100083612d02565b92915050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff1615906001600160401b03165f811580156103ed5750825b90505f826001600160401b031660011480156104085750303b155b905081158015610416575080155b156104345760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561045e57845460ff60401b1916600160401b1785555b61046887876113f2565b83156104ae57845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50505050505050565b5f6103a36001600160401b03831664e8d4a51000612d15565b5f8381527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab60860205260408082208151610120810190925280545f805160206132c983398151915293929190829060ff16600581111561053157610531612c5b565b600581111561054257610542612c5b565b8152600182015460208201526002808301546001600160401b038082166040850152600160401b820481166060850152600160801b820481166080850152600160c01b909104811660a08401526003909301546001600160a01b03811660c084015260ff600160a01b820416151560e0840152600160a81b900490921661010090910152909150815160058111156105dc576105dc612c5b565b146106355760405162461bcd60e51b8152602060048201526024808201527f5374616b696e674d616e616765723a2056616c696461746f72206e6f742061636044820152637469766560e01b6064820152608401610305565b60c08101516001600160a01b0316336001600160a01b03161461066a5760405162461bcd60e51b815260040161030590612d2c565b6106778160400151611410565b60038152426001600160401b031660808201525f8415610850576040516306f8253560e41b815263ffffffff851660048201525f9081906005600160991b0190636f825350906024015f60405180830381865afa1580156106da573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f191682016040526107019190810190612d81565b91509150806107225760405162461bcd60e51b815260040161030590612e53565b6005600160991b016001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa158015610765573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107899190612cc3565b8251146107a85760405162461bcd60e51b815260040161030590612e97565b60208201516001600160a01b0316156107d35760405162461bcd60e51b815260040161030590612ede565b5f806107e284604001516115bd565b91509150818a1461084a5760405162461bcd60e51b815260206004820152602c60248201527f5374616b696e674d616e616765723a20496e76616c696420757074696d65207660448201526b185b1a59185d1a5bdb88125160a21b6064820152608401610305565b93505050505b6001600160401b03811660a08301525f86815260088401602052604090208251815484929190829060ff1916600183600581111561089057610890612c5b565b02179055506020820151600182015560408201516002820180546060850151608086015160a08701516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c08301516003909201805460e0850151610100958601516001600160a01b039095166001600160a81b031990921691909117600160a01b911515919091021767ffffffffffffffff60a81b1916600160a81b93909216929092021790558201515f9061098190889083611230565b60405163ee5b48eb60e01b81529091505f906005600160991b019063ee5b48eb906109b0908590600401612c91565b6020604051808303815f875af11580156109cc573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109f09190612cc3565b60408581015181516001600160401b03918216815242602082015290861681830152905191925082918a917f530b908725650fb1052974f9df59e834fefac78c9ec2f00c6d2464d60cc6add5919081900360600190a35050505050505050565b5f610a5d84868585611718565b90505b949350505050565b5f5f805160206132c98339815191526040516306f8253560e41b815263ffffffff841660048201529091505f9081906005600160991b0190636f825350906024015f60405180830381865afa158015610ac3573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052610aea9190810190612d81565b9150915080610b0b5760405162461bcd60e51b815260040161030590612e53565b8254825114610b2c5760405162461bcd60e51b815260040161030590612e97565b60208201516001600160a01b031615610b575760405162461bcd60e51b815260040161030590612ede565b5f80610b668460400151611cdc565b9150915080610bc65760405162461bcd60e51b815260206004820152602660248201527f5374616b696e674d616e616765723a20526567697374726174696f6e206e6f74604482015265081d985b1a5960d21b6064820152608401610305565b5f82815260078601602052604081208054610be090612f2b565b9050118015610c12575060015f83815260088701602052604090205460ff166005811115610c1057610c10612c5b565b145b610c2e5760405162461bcd60e51b815260040161030590612f63565b5f8281526007860160205260408120610c46916129a2565b5f8281526008860160208181526040808420805460ff191660029081178255810180546001600160401b0342818116600160401b026fffffffffffffffff000000000000000019909316929092178355600190930154875260098c0185528387208990559588905293835292548151931683529082019290925283917ff8fd1c90fb9cfa2ca2358fdf5806b086ad43315d92b221c929efc7f105ce7568910160405180910390a2505050505050565b5f8181527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6076020526040812080545f805160206132c9833981519152929190610d3d90612f2b565b9050118015610d6f575060015f83815260088301602052604090205460ff166005811115610d6d57610d6d612c5b565b145b610d8b5760405162461bcd60e51b815260040161030590612f63565b5f82815260078201602052604090819020905163ee5b48eb60e01b81526005600160991b019163ee5b48eb91610dc49190600401612fa8565b6020604051808303815f875af1158015610de0573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e049190612cc3565b505050565b5f5f805160206132c98339815191526040516306f8253560e41b815263ffffffff851660048201529091505f9081906005600160991b0190636f825350906024015f60405180830381865afa158015610e64573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052610e8b9190810190612d81565b9150915080610eac5760405162461bcd60e51b815260040161030590612e53565b5f8415610f25575f610ec18460400151611eb7565b919350909150506001600160401b03811615610f1f5760405162461bcd60e51b815260206004820181905260248201527f5374616b696e674d616e616765723a20576569676874206d75737420626520306044820152606401610305565b50610f99565b5f610f338460400151611cdc565b90925090508015610f975760405162461bcd60e51b815260206004820152602860248201527f5374616b696e674d616e616765723a20526567697374726174696f6e207374696044820152671b1b081d985b1a5960c21b6064820152608401610305565b505b5f818152600885016020526040808220815161012081019092528054829060ff166005811115610fcb57610fcb612c5b565b6005811115610fdc57610fdc612c5b565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003909201546001600160a01b0380821660c080850191909152600160a01b830460ff16151560e0850152600160a81b9092049093166101009092019190915282015191925016331461108d5760405162461bcd60e51b815260040161030590612d2c565b5f6003825160058111156110a3576110a3612c5b565b14806110c157506002825160058111156110bf576110bf612c5b565b145b156110e457506020808201515f90815260098701909152604081205560046110e8565b5060055b5f83815260088701602052604090208251815484929190829060ff1916600183600581111561111957611119612c5b565b0217905550602082015160018201556040808301516002830180546060860151608087015160a08801516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c08401516003909301805460e0860151610100909601516001600160a01b039095166001600160a81b031990911617600160a01b951515959095029490941767ffffffffffffffff60a81b1916600160a81b9390911692909202919091179091555183907f3532ad18e70a039beb4663d48c15acbef558c96ec9b8fd0cc3c0304f774740b8905f90a25050505050505050565b60408051603480825260608281019093525f91906020820181803683370190505090505f5b60048110156112b157611269816003613032565b611274906008612d15565b600163ffffffff16901c60f81b82828151811061129357611293613045565b60200101906001600160f81b03191690815f1a905350600101611255565b505f5b6020811015611313576112c881601f613032565b6112d3906008612d15565b86901c60f81b826112e5836004613059565b815181106112f5576112f5613045565b60200101906001600160f81b03191690815f1a9053506001016112b4565b505f5b600881101561137e5761132a816007613032565b611335906008612d15565b6001600160401b038616901c60f81b82611350836024613059565b8151811061136057611360613045565b60200101906001600160f81b03191690815f1a905350600101611316565b505f5b60088110156113e957611395816007613032565b6113a0906008612d15565b6001600160401b038516901c60f81b826113bb83602c613059565b815181106113cb576113cb613045565b60200101906001600160f81b03191690815f1a905350600101611381565b50949350505050565b6113fa612075565b611403826120c0565b61140c816120e4565b5050565b7fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab604545f805160206132c983398151915290600160e01b900460ff165f03611455575050565b60408051606081018252600583015480825260068401546001600160401b038082166020850152600160401b9091041692820192909252904290610e109061149d9083613032565b106114b9576001600160401b03841660408301528082526114d8565b83826040018181516114cb919061306c565b6001600160401b03169052505b5f8260200151836040015160646114ef9190613093565b6114f991906130be565b600485015490915060ff600160e01b909104811690821611156115795760405162461bcd60e51b815260206004820152603260248201527f5374616b696e674d616e616765723a204d6178696d756d20686f75726c7920636044820152711a1d5c9b881c985d1948195e18d95959195960721b6064820152608401610305565b5050805160058301556020810151600690920180546040909201516001600160401b03908116600160401b026001600160801b031990931693169290921717905550565b5f808251602c146115e05760405162461bcd60e51b8152600401610305906130e3565b5f805b6004811015611631576115f7816003613032565b611602906008612d15565b63ffffffff1685828151811061161a5761161a613045565b016020015160f81c901b91909117906001016115e3565b5063ffffffff81166004146116585760405162461bcd60e51b81526004016103059061312a565b5f805b60208110156116ad5761166f81601f613032565b61167a906008612d15565b86611686836004613059565b8151811061169657611696613045565b016020015160f81c901b919091179060010161165b565b505f805b600881101561170c576116c5816007613032565b6116d0906008612d15565b6001600160401b0316876116e5836024613059565b815181106116f5576116f5613045565b016020015160f81c901b91909117906001016116b1565b50909590945092505050565b5f611721612198565b5f805160206132c9833981519152670de0b6b3a7640000851461176f5760405162461bcd60e51b815260206004820152600660248201526563616e61727960d01b6044820152606401610305565b8060020154620f4240146117af5760405162461bcd60e51b815260206004820152600760248201526631b0b730b93c9960c91b6044820152606401610305565b806003015462989680146117ef5760405162461bcd60e51b815260206004820152600760248201526663616e6172793360c81b6044820152606401610305565b42846001600160401b031611801561181b57506001600160401b038416611819426202a300613059565b115b61187b5760405162461bcd60e51b815260206004820152602b60248201527f5374616b696e674d616e616765723a20496e76616c696420726567697374726160448201526a74696f6e2065787069727960a81b6064820152608401610305565b856118c85760405162461bcd60e51b815260206004820152601f60248201527f5374616b696e674d616e616765723a20496e76616c6964206e6f6465204944006044820152606401610305565b5f868152600982016020526040902054156119345760405162461bcd60e51b815260206004820152602660248201527f5374616b696e674d616e616765723a204e6f646520494420616c72656164792060448201526561637469766560d01b6064820152608401610305565b82516040146119965760405162461bcd60e51b815260206004820152602860248201527f5374616b696e674d616e616765723a20496e76616c6964207369676e617475726044820152670ca40d8cadccee8d60c31b6064820152608401610305565b5f6119a0866121e2565b90505f6119ac82610393565b90508260020154816001600160401b0316101580156119d857508260030154816001600160401b031611155b611a305760405162461bcd60e51b8152602060048201526024808201527f5374616b696e674d616e616765723a20496e76616c6964207374616b6520616d6044820152631bdd5b9d60e21b6064820152608401610305565b5f80611a776040518060a00160405280876001015481526020018c8152602001856001600160401b031681526020018a6001600160401b0316815260200189815250612218565b5f82815260078801602052604090209193509150611a9582826131b3565b5060405163ee5b48eb60e01b81525f906005600160991b019063ee5b48eb90611ac2908590600401612c91565b6020604051808303815f875af1158015611ade573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611b029190612cc3565b6040805161012081019091529091508060018152602081018d90526001600160401b03861660408201525f606082018190526080820181905260a082015260c001336001600160a01b031681525f6020808301829052604092830182905286825260088a0190522081518154829060ff19166001836005811115611b8857611b88612c5b565b021790555060208281015160018301556040808401516002840180546060870151608088015160a08901516001600160401b03908116600160c01b026001600160c01b03928216600160801b02929092166001600160801b03938216600160401b026001600160801b03199095169682169690961793909317919091169390931792909217905560c08501516003909401805460e0870151610100909701518316600160a81b0267ffffffffffffffff60a81b19971515600160a01b026001600160a81b03199092166001600160a01b039097169690961717959095169390931790935582518783168152918c169082015282918d9186917f79b81620b81daf2c08cd5bb3dbb79e75d2d7a87f52171fde5aadc8c47823026e910160405180910390a45090945050505050610a6060017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b5f808251602714611cff5760405162461bcd60e51b8152600401610305906130e3565b5f805b6002811015611d4e57611d16816001613032565b611d21906008612d15565b61ffff16858281518110611d3757611d37613045565b016020015160f81c901b9190911790600101611d02565b5061ffff811615611dab5760405162461bcd60e51b815260206004820152602160248201527f5374616b696e674d657373616765733a20496e76616c696420636f64656320496044820152601160fa1b6064820152608401610305565b5f805b6004811015611e0657611dc2816003613032565b611dcd906008612d15565b63ffffffff1686611ddf836002613059565b81518110611def57611def613045565b016020015160f81c901b9190911790600101611dae565b5063ffffffff8116600214611e2d5760405162461bcd60e51b81526004016103059061312a565b5f805b6020811015611e8257611e4481601f613032565b611e4f906008612d15565b87611e5b836006613059565b81518110611e6b57611e6b613045565b016020015160f81c901b9190911790600101611e30565b505f86602681518110611e9757611e97613045565b016020015191976001600160f81b03199092161515965090945050505050565b5f805f8351603414611edb5760405162461bcd60e51b8152600401610305906130e3565b5f805b6004811015611f2c57611ef2816003613032565b611efd906008612d15565b63ffffffff16868281518110611f1557611f15613045565b016020015160f81c901b9190911790600101611ede565b5063ffffffff8116600114611f535760405162461bcd60e51b81526004016103059061312a565b5f805b6020811015611fa857611f6a81601f613032565b611f75906008612d15565b87611f81836004613059565b81518110611f9157611f91613045565b016020015160f81c901b9190911790600101611f56565b505f805b600881101561200757611fc0816007613032565b611fcb906008612d15565b6001600160401b031688611fe0836024613059565b81518110611ff057611ff0613045565b016020015160f81c901b9190911790600101611fac565b505f805b60088110156120665761201f816007613032565b61202a906008612d15565b6001600160401b03168961203f83602c613059565b8151811061204f5761204f613045565b016020015160f81c901b919091179060010161200b565b50919790965090945092505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff166120be57604051631afcd79f60e31b815260040160405180910390fd5b565b6120c8612075565b6120d061233e565b6120d861234e565b6120e181612356565b50565b6120ec612075565b7f8568826440873e37a96cb0aab773b28d8154d963d2f0e41bd9b5c15f63625f916001600160a01b0382166121785760405162461bcd60e51b815260206004820152602c60248201527f4552433230546f6b656e5374616b696e674d616e616765723a207a65726f207460448201526b6f6b656e206164647265737360a01b6064820152608401610305565b80546001600160a01b0319166001600160a01b0392909216919091179055565b7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f008054600119016121dc57604051633ee5aeb560e01b815260040160405180910390fd5b60029055565b5f6103a3827f8568826440873e37a96cb0aab773b28d8154d963d2f0e41bd9b5c15f63625f91546001600160a01b031690612486565b5f60605f80612226856125e8565b60408051609480825260c082019092529294509092505f91906020820181803683370190505090505f5b60048110156122a457612264816003613032565b61226f906008612d15565b5081515f9083908390811061228657612286613045565b60200101906001600160f81b03191690815f1a905350600101612250565b505f5b609081101561230b578281815181106122c2576122c2613045565b01602001516001600160f81b031916826122dd836004613059565b815181106122ed576122ed613045565b60200101906001600160f81b03191690815f1a9053506001016122a7565b5091959194509092505050565b60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b612346612075565b6120be6128ce565b6120be612075565b61235e612075565b80355f805160206132c983398151915290815560208201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6015560408201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6025560608201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab603556123f660a0830160808401612a6f565b60048201805467ffffffffffffffff19166001600160401b039290921691909117905561242960c0830160a08401613272565b60048201805460ff92909216600160e01b0260ff60e01b1990921691909117905561245a60e0830160c08401613292565b8160040160086101000a8154816001600160a01b0302191690836001600160a01b031602179055505050565b6040516370a0823160e01b81523060048201525f9081906001600160a01b038516906370a0823190602401602060405180830381865afa1580156124cc573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906124f09190612cc3565b90506125076001600160a01b0385163330866128d6565b6040516370a0823160e01b81523060048201525f906001600160a01b038616906370a0823190602401602060405180830381865afa15801561254b573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061256f9190612cc3565b90508181116125d55760405162461bcd60e51b815260206004820152602c60248201527f5361666545524332305472616e7366657246726f6d3a2062616c616e6365206e60448201526b1bdd081a5b98dc99585cd95960a21b6064820152608401610305565b6125df8282613032565b95945050505050565b5f60608260800151516040146126525760405162461bcd60e51b815260206004820152602960248201527f5374616b696e674d657373616765733a20496e76616c6964207369676e6174756044820152680e4ca40d8cadccee8d60bb1b6064820152608401610305565b60408051609080825260c082019092525f916020820181803683370190505090505f5b60208110156126c5578451816020811061269157612691613045565b1a60f81b8282815181106126a7576126a7613045565b60200101906001600160f81b03191690815f1a905350600101612675565b505f5b602081101561272557846020015181602081106126e7576126e7613045565b1a60f81b826126f7836020613059565b8151811061270757612707613045565b60200101906001600160f81b03191690815f1a9053506001016126c8565b505f5b60088110156127995761273c816007613032565b612747906008612d15565b60ff1685604001516001600160401b0316901c60f81b8282604061276b9190613059565b8151811061277b5761277b613045565b60200101906001600160f81b03191690815f1a905350600101612728565b505f5b600881101561280b576127b0816007613032565b6127bb906008612d15565b60608601516001600160401b0390811691161c60f81b826127dd836048613059565b815181106127ed576127ed613045565b60200101906001600160f81b03191690815f1a90535060010161279c565b505f5b6040811015612876578460800151818151811061282d5761282d613045565b01602001516001600160f81b03191682612848836050613059565b8151811061285857612858613045565b60200101906001600160f81b03191690815f1a90535060010161280e565b5060028160405161288791906132ad565b602060405180830381855afa1580156128a2573d5f803e3d5ffd5b5050506040513d601f19601f820116820180604052508101906128c59190612cc3565b94909350915050565b612318612075565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052612930908590612936565b50505050565b5f8060205f8451602086015f885af180612955576040513d5f823e3d81fd5b50505f513d9150811561296c578060011415612979565b6001600160a01b0384163b155b1561293057604051635274afe760e01b81526001600160a01b0385166004820152602401610305565b5080546129ae90612f2b565b5f825580601f106129bd575050565b601f0160209004905f5260205f20908101906120e191905b808211156129e8575f81556001016129d5565b5090565b5f602082840312156129fc575f80fd5b5035919050565b6001600160a01b03811681146120e1575f80fd5b5f80828403610100811215612a2a575f80fd5b60e0811215612a37575f80fd5b5082915060e0830135612a4981612a03565b809150509250929050565b80356001600160401b0381168114612a6a575f80fd5b919050565b5f60208284031215612a7f575f80fd5b612a8882612a54565b9392505050565b80151581146120e1575f80fd5b803563ffffffff81168114612a6a575f80fd5b5f805f60608486031215612ac1575f80fd5b833592506020840135612ad381612a8f565b9150612ae160408501612a9c565b90509250925092565b634e487b7160e01b5f52604160045260245ffd5b604051606081016001600160401b0381118282101715612b2057612b20612aea565b60405290565b604051601f8201601f191681016001600160401b0381118282101715612b4e57612b4e612aea565b604052919050565b5f6001600160401b03821115612b6e57612b6e612aea565b50601f01601f191660200190565b5f805f8060808587031215612b8f575f80fd5b8435935060208501359250612ba660408601612a54565b915060608501356001600160401b03811115612bc0575f80fd5b8501601f81018713612bd0575f80fd5b8035612be3612bde82612b56565b612b26565b818152886020838501011115612bf7575f80fd5b816020840160208301375f6020838301015280935050505092959194509250565b5f60208284031215612c28575f80fd5b612a8882612a9c565b5f8060408385031215612c42575f80fd5b612c4b83612a9c565b91506020830135612a4981612a8f565b634e487b7160e01b5f52602160045260245ffd5b5f5b83811015612c89578181015183820152602001612c71565b50505f910152565b602081525f8251806020840152612caf816040850160208701612c6f565b601f01601f19169190910160400192915050565b5f60208284031215612cd3575f80fd5b5051919050565b634e487b7160e01b5f52601260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b5f82612d1057612d10612cda565b500490565b80820281158282048414176103a3576103a3612cee565b6020808252602a908201527f5374616b696e674d616e616765723a2053656e646572206e6f742076616c696460408201526930ba37b91037bbb732b960b11b606082015260800190565b8051612a6a81612a8f565b5f8060408385031215612d92575f80fd5b82516001600160401b0380821115612da8575f80fd5b9084019060608287031215612dbb575f80fd5b612dc3612afe565b82518152602080840151612dd681612a03565b82820152604084015183811115612deb575f80fd5b80850194505087601f850112612dff575f80fd5b83519250612e0f612bde84612b56565b8381528882858701011115612e22575f80fd5b612e3184838301848801612c6f565b80604084015250819550612e46818801612d76565b9450505050509250929050565b60208082526024908201527f5374616b696e674d616e616765723a20496e76616c69642077617270206d65736040820152637361676560e01b606082015260800190565b60208082526027908201527f5374616b696e674d616e616765723a20496e76616c696420736f7572636520636040820152661a185a5b88125160ca1b606082015260800190565b6020808252602d908201527f5374616b696e674d616e616765723a20496e76616c6964206f726967696e207360408201526c656e646572206164647265737360981b606082015260800190565b600181811c90821680612f3f57607f821691505b602082108103612f5d57634e487b7160e01b5f52602260045260245ffd5b50919050565b60208082526025908201527f5374616b696e674d616e616765723a20496e76616c69642076616c69646174696040820152641bdb88125160da1b606082015260800190565b5f60208083525f8454612fba81612f2b565b806020870152604060018084165f8114612fdb5760018114612ff757613024565b60ff19851660408a0152604084151560051b8a01019550613024565b895f5260205f205f5b8581101561301b5781548b8201860152908301908801613000565b8a016040019650505b509398975050505050505050565b818103818111156103a3576103a3612cee565b634e487b7160e01b5f52603260045260245ffd5b808201808211156103a3576103a3612cee565b6001600160401b0381811683821601908082111561308c5761308c612cee565b5092915050565b6001600160401b038181168382160280821691908281146130b6576130b6612cee565b505092915050565b5f6001600160401b03808416806130d7576130d7612cda565b92169190910492915050565b60208082526027908201527f5374616b696e674d657373616765733a20496e76616c6964206d657373616765604082015266040d8cadccee8d60cb1b606082015260800190565b60208082526025908201527f5374616b696e674d657373616765733a20496e76616c6964206d657373616765604082015264207479706560d81b606082015260800190565b601f821115610e0457805f5260205f20601f840160051c810160208510156131945750805b601f840160051c820191505b8181101561038c575f81556001016131a0565b81516001600160401b038111156131cc576131cc612aea565b6131e0816131da8454612f2b565b8461316f565b602080601f831160018114613213575f84156131fc5750858301515b5f19600386901b1c1916600185901b17855561326a565b5f85815260208120601f198616915b8281101561324157888601518255948401946001909101908401613222565b508582101561325e57878501515f19600388901b60f8161c191681555b505060018460011b0185555b505050505050565b5f60208284031215613282575f80fd5b813560ff81168114612a88575f80fd5b5f602082840312156132a2575f80fd5b8135612a8881612a03565b5f82516132be818460208701612c6f565b919091019291505056feafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab600a164736f6c6343000819000a", + Bin: "0x608060405234801561000f575f80fd5b506040516134a03803806134a083398101604081905261002e91610107565b60018160018111156100425761004261012c565b0361004f5761004f610055565b50610140565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156100a55760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146101045780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b5f60208284031215610117575f80fd5b815160028110610125575f80fd5b9392505050565b634e487b7160e01b5f52602160045260245ffd5b6133538061014d5f395ff3fe608060405234801561000f575f80fd5b506004361061009b575f3560e01c8063872fda6411610063578063872fda641461012b578063a3a65e481461013e578063b771b3bc14610151578063bee0a03f14610177578063fdf94a1a1461018a575f80fd5b80630322ed981461009f5780632e2194d8146100b45780635d0d7466146100e457806362065856146100f757806376f7862114610118575b5f80fd5b6100b26100ad366004612a09565b61019d565b005b6100c76100c2366004612a09565b610393565b6040516001600160401b0390911681526020015b60405180910390f35b6100b26100f2366004612a34565b6103a9565b61010a610105366004612a8c565b6104b7565b6040519081526020016100db565b6100b2610126366004612acc565b6104d0565b61010a610139366004612b99565b610a50565b6100b261014c366004612c35565b610a68565b61015f6005600160991b0181565b6040516001600160a01b0390911681526020016100db565b6100b2610185366004612a09565b610cf5565b6100b2610198366004612c4e565b610e09565b5f8181527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab60860205260408082208151610120810190925280545f8051602061332783398151915293929190829060ff1660058111156101fe576101fe612c78565b600581111561020f5761020f612c78565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003928301546001600160a01b03811660c084015260ff600160a01b820416151560e0840152600160a81b90041661010090910152909150815160058111156102a6576102a6612c78565b1461030e5760405162461bcd60e51b815260206004820152602d60248201527f5374616b696e674d616e616765723a2056616c696461746f72206e6f7420706560448201526c1b991a5b99c81c995b5bdd985b609a1b60648201526084015b60405180910390fd5b5f61031f848361010001515f611230565b60405163ee5b48eb60e01b81529091506005600160991b019063ee5b48eb9061034c908490600401612cae565b6020604051808303815f875af1158015610368573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061038c9190612ce0565b5050505050565b5f6103a364e8d4a5100083612d1f565b92915050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff1615906001600160401b03165f811580156103ed5750825b90505f826001600160401b031660011480156104085750303b155b905081158015610416575080155b156104345760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561045e57845460ff60401b1916600160401b1785555b610468878761144d565b83156104ae57845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50505050505050565b5f6103a36001600160401b03831664e8d4a51000612d32565b5f8381527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab60860205260408082208151610120810190925280545f8051602061332783398151915293929190829060ff16600581111561053157610531612c78565b600581111561054257610542612c78565b8152600182015460208201526002808301546001600160401b038082166040850152600160401b820481166060850152600160801b820481166080850152600160c01b909104811660a08401526003909301546001600160a01b03811660c084015260ff600160a01b820416151560e0840152600160a81b900490921661010090910152909150815160058111156105dc576105dc612c78565b146106355760405162461bcd60e51b8152602060048201526024808201527f5374616b696e674d616e616765723a2056616c696461746f72206e6f742061636044820152637469766560e01b6064820152608401610305565b60c08101516001600160a01b0316336001600160a01b03161461066a5760405162461bcd60e51b815260040161030590612d49565b610677816040015161146b565b60038152426001600160401b031660808201525f8415610850576040516306f8253560e41b815263ffffffff851660048201525f9081906005600160991b0190636f825350906024015f60405180830381865afa1580156106da573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f191682016040526107019190810190612d9e565b91509150806107225760405162461bcd60e51b815260040161030590612e70565b6005600160991b016001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa158015610765573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107899190612ce0565b8251146107a85760405162461bcd60e51b815260040161030590612eb4565b60208201516001600160a01b0316156107d35760405162461bcd60e51b815260040161030590612efb565b5f806107e28460400151611618565b91509150818a1461084a5760405162461bcd60e51b815260206004820152602c60248201527f5374616b696e674d616e616765723a20496e76616c696420757074696d65207660448201526b185b1a59185d1a5bdb88125160a21b6064820152608401610305565b93505050505b6001600160401b03811660a08301525f86815260088401602052604090208251815484929190829060ff1916600183600581111561089057610890612c78565b02179055506020820151600182015560408201516002820180546060850151608086015160a08701516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c08301516003909201805460e0850151610100958601516001600160a01b039095166001600160a81b031990921691909117600160a01b911515919091021767ffffffffffffffff60a81b1916600160a81b93909216929092021790558201515f9061098190889083611230565b60405163ee5b48eb60e01b81529091505f906005600160991b019063ee5b48eb906109b0908590600401612cae565b6020604051808303815f875af11580156109cc573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109f09190612ce0565b60408581015181516001600160401b03918216815242602082015290861681830152905191925082918a917f530b908725650fb1052974f9df59e834fefac78c9ec2f00c6d2464d60cc6add5919081900360600190a35050505050505050565b5f610a5d848685856117f0565b90505b949350505050565b5f5f805160206133278339815191526040516306f8253560e41b815263ffffffff841660048201529091505f9081906005600160991b0190636f825350906024015f60405180830381865afa158015610ac3573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052610aea9190810190612d9e565b9150915080610b0b5760405162461bcd60e51b815260040161030590612e70565b8254825114610b2c5760405162461bcd60e51b815260040161030590612eb4565b60208201516001600160a01b031615610b575760405162461bcd60e51b815260040161030590612efb565b5f80610b668460400151611cf7565b9150915080610bc65760405162461bcd60e51b815260206004820152602660248201527f5374616b696e674d616e616765723a20526567697374726174696f6e206e6f74604482015265081d985b1a5960d21b6064820152608401610305565b5f82815260078601602052604081208054610be090612f48565b9050118015610c12575060015f83815260088701602052604090205460ff166005811115610c1057610c10612c78565b145b610c2e5760405162461bcd60e51b815260040161030590612f80565b5f8281526007860160205260408120610c46916129bf565b5f8281526008860160208181526040808420805460ff191660029081178255810180546001600160401b0342818116600160401b026fffffffffffffffff000000000000000019909316929092178355600190930154875260098c0185528387208990559588905293835292548151931683529082019290925283917ff8fd1c90fb9cfa2ca2358fdf5806b086ad43315d92b221c929efc7f105ce7568910160405180910390a2505050505050565b5f8181527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6076020526040812080545f80516020613327833981519152929190610d3d90612f48565b9050118015610d6f575060015f83815260088301602052604090205460ff166005811115610d6d57610d6d612c78565b145b610d8b5760405162461bcd60e51b815260040161030590612f80565b5f82815260078201602052604090819020905163ee5b48eb60e01b81526005600160991b019163ee5b48eb91610dc49190600401612fc5565b6020604051808303815f875af1158015610de0573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e049190612ce0565b505050565b5f5f805160206133278339815191526040516306f8253560e41b815263ffffffff851660048201529091505f9081906005600160991b0190636f825350906024015f60405180830381865afa158015610e64573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052610e8b9190810190612d9e565b9150915080610eac5760405162461bcd60e51b815260040161030590612e70565b5f8415610f25575f610ec18460400151611e98565b919350909150506001600160401b03811615610f1f5760405162461bcd60e51b815260206004820181905260248201527f5374616b696e674d616e616765723a20576569676874206d75737420626520306044820152606401610305565b50610f99565b5f610f338460400151611cf7565b90925090508015610f975760405162461bcd60e51b815260206004820152602860248201527f5374616b696e674d616e616765723a20526567697374726174696f6e207374696044820152671b1b081d985b1a5960c21b6064820152608401610305565b505b5f818152600885016020526040808220815161012081019092528054829060ff166005811115610fcb57610fcb612c78565b6005811115610fdc57610fdc612c78565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003909201546001600160a01b0380821660c080850191909152600160a01b830460ff16151560e0850152600160a81b9092049093166101009092019190915282015191925016331461108d5760405162461bcd60e51b815260040161030590612d49565b5f6003825160058111156110a3576110a3612c78565b14806110c157506002825160058111156110bf576110bf612c78565b145b156110e457506020808201515f90815260098701909152604081205560046110e8565b5060055b5f83815260088701602052604090208251815484929190829060ff1916600183600581111561111957611119612c78565b0217905550602082015160018201556040808301516002830180546060860151608087015160a08801516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c08401516003909301805460e0860151610100909601516001600160a01b039095166001600160a81b031990911617600160a01b951515959095029490941767ffffffffffffffff60a81b1916600160a81b9390911692909202919091179091555183907f3532ad18e70a039beb4663d48c15acbef558c96ec9b8fd0cc3c0304f774740b8905f90a25050505050505050565b60408051603680825260608281019093525f91906020820181803683370190505090505f5b60028110156112a95761126981600161304f565b611274906008612d32565b5081515f9083908390811061128b5761128b613062565b60200101906001600160f81b03191690815f1a905350600101611255565b505f5b600481101561130c576112c081600361304f565b6112cb906008612d32565b6001901c60f81b826112de836002613076565b815181106112ee576112ee613062565b60200101906001600160f81b03191690815f1a9053506001016112ac565b505f5b602081101561136e5761132381601f61304f565b61132e906008612d32565b86901c60f81b82611340836006613076565b8151811061135057611350613062565b60200101906001600160f81b03191690815f1a90535060010161130f565b505f5b60088110156113d95761138581600761304f565b611390906008612d32565b6001600160401b038616901c60f81b826113ab836026613076565b815181106113bb576113bb613062565b60200101906001600160f81b03191690815f1a905350600101611371565b505f5b6008811015611444576113f081600761304f565b6113fb906008612d32565b6001600160401b038516901c60f81b8261141683602e613076565b8151811061142657611426613062565b60200101906001600160f81b03191690815f1a9053506001016113dc565b50949350505050565b6114556120d3565b61145e8261211e565b61146781612142565b5050565b7fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab604545f8051602061332783398151915290600160e01b900460ff165f036114b0575050565b60408051606081018252600583015480825260068401546001600160401b038082166020850152600160401b9091041692820192909252904290610e10906114f8908361304f565b10611514576001600160401b0384166040830152808252611533565b83826040018181516115269190613089565b6001600160401b03169052505b5f82602001518360400151606461154a91906130b0565b61155491906130db565b600485015490915060ff600160e01b909104811690821611156115d45760405162461bcd60e51b815260206004820152603260248201527f5374616b696e674d616e616765723a204d6178696d756d20686f75726c7920636044820152711a1d5c9b881c985d1948195e18d95959195960721b6064820152608401610305565b5050805160058301556020810151600690920180546040909201516001600160401b03908116600160401b026001600160801b031990931693169290921717905550565b5f808251602e1461163b5760405162461bcd60e51b815260040161030590613100565b5f805b600281101561168a5761165281600161304f565b61165d906008612d32565b61ffff1685828151811061167357611673613062565b016020015160f81c901b919091179060010161163e565b5061ffff8116156116ad5760405162461bcd60e51b815260040161030590613147565b5f805b6004811015611708576116c481600361304f565b6116cf906008612d32565b63ffffffff16866116e1836002613076565b815181106116f1576116f1613062565b016020015160f81c901b91909117906001016116b0565b5063ffffffff811660041461172f5760405162461bcd60e51b815260040161030590613188565b5f805b60208110156117845761174681601f61304f565b611751906008612d32565b8761175d836006613076565b8151811061176d5761176d613062565b016020015160f81c901b9190911790600101611732565b505f805b60088110156117e35761179c81600761304f565b6117a7906008612d32565b6001600160401b0316886117bc836026613076565b815181106117cc576117cc613062565b016020015160f81c901b9190911790600101611788565b5090969095509350505050565b5f6117f96121f6565b5f80516020613327833981519152426001600160401b03851611801561183357506001600160401b038416611831426202a300613076565b115b6118935760405162461bcd60e51b815260206004820152602b60248201527f5374616b696e674d616e616765723a20496e76616c696420726567697374726160448201526a74696f6e2065787069727960a81b6064820152608401610305565b856118e05760405162461bcd60e51b815260206004820152601f60248201527f5374616b696e674d616e616765723a20496e76616c6964206e6f6465204944006044820152606401610305565b5f8681526009820160205260409020541561194c5760405162461bcd60e51b815260206004820152602660248201527f5374616b696e674d616e616765723a204e6f646520494420616c72656164792060448201526561637469766560d01b6064820152608401610305565b82516030146119b15760405162461bcd60e51b815260206004820152602b60248201527f5374616b696e674d616e616765723a20496e76616c696420626c735075626c6960448201526a0c696caf240d8cadccee8d60ab1b6064820152608401610305565b5f6119bb86612240565b90505f6119c782610393565b90508260020154816001600160401b0316101580156119f357508260030154816001600160401b031611155b611a4b5760405162461bcd60e51b8152602060048201526024808201527f5374616b696e674d616e616765723a20496e76616c6964207374616b6520616d6044820152631bdd5b9d60e21b6064820152608401610305565b5f80611a926040518060a00160405280876001015481526020018c8152602001856001600160401b031681526020018a6001600160401b0316815260200189815250612276565b5f82815260078801602052604090209193509150611ab08282613211565b5060405163ee5b48eb60e01b81525f906005600160991b019063ee5b48eb90611add908590600401612cae565b6020604051808303815f875af1158015611af9573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611b1d9190612ce0565b6040805161012081019091529091508060018152602081018d90526001600160401b03861660408201525f606082018190526080820181905260a082015260c001336001600160a01b031681525f6020808301829052604092830182905286825260088a0190522081518154829060ff19166001836005811115611ba357611ba3612c78565b021790555060208281015160018301556040808401516002840180546060870151608088015160a08901516001600160401b03908116600160c01b026001600160c01b03928216600160801b02929092166001600160801b03938216600160401b026001600160801b03199095169682169690961793909317919091169390931792909217905560c08501516003909401805460e0870151610100909701518316600160a81b0267ffffffffffffffff60a81b19971515600160a01b026001600160a81b03199092166001600160a01b039097169690961717959095169390931790935582518783168152918c169082015282918d9186917f79b81620b81daf2c08cd5bb3dbb79e75d2d7a87f52171fde5aadc8c47823026e910160405180910390a45090945050505050610a6060017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b5f808251602714611d1a5760405162461bcd60e51b815260040161030590613100565b5f805b6002811015611d6957611d3181600161304f565b611d3c906008612d32565b61ffff16858281518110611d5257611d52613062565b016020015160f81c901b9190911790600101611d1d565b5061ffff811615611d8c5760405162461bcd60e51b815260040161030590613147565b5f805b6004811015611de757611da381600361304f565b611dae906008612d32565b63ffffffff1686611dc0836002613076565b81518110611dd057611dd0613062565b016020015160f81c901b9190911790600101611d8f565b5063ffffffff8116600214611e0e5760405162461bcd60e51b815260040161030590613188565b5f805b6020811015611e6357611e2581601f61304f565b611e30906008612d32565b87611e3c836006613076565b81518110611e4c57611e4c613062565b016020015160f81c901b9190911790600101611e11565b505f86602681518110611e7857611e78613062565b016020015191976001600160f81b03199092161515965090945050505050565b5f805f8351603614611ebc5760405162461bcd60e51b815260040161030590613100565b5f805b6002811015611f0b57611ed381600161304f565b611ede906008612d32565b61ffff16868281518110611ef457611ef4613062565b016020015160f81c901b9190911790600101611ebf565b5061ffff811615611f2e5760405162461bcd60e51b815260040161030590613147565b5f805b6004811015611f8957611f4581600361304f565b611f50906008612d32565b63ffffffff1687611f62836002613076565b81518110611f7257611f72613062565b016020015160f81c901b9190911790600101611f31565b5063ffffffff8116600114611fb05760405162461bcd60e51b815260040161030590613188565b5f805b602081101561200557611fc781601f61304f565b611fd2906008612d32565b88611fde836006613076565b81518110611fee57611fee613062565b016020015160f81c901b9190911790600101611fb3565b505f805b60088110156120645761201d81600761304f565b612028906008612d32565b6001600160401b03168961203d836026613076565b8151811061204d5761204d613062565b016020015160f81c901b9190911790600101612009565b505f805b60088110156120c35761207c81600761304f565b612087906008612d32565b6001600160401b03168a61209c83602e613076565b815181106120ac576120ac613062565b016020015160f81c901b9190911790600101612068565b5091989097509095509350505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff1661211c57604051631afcd79f60e31b815260040160405180910390fd5b565b6121266120d3565b61212e612641565b612136612651565b61213f81612659565b50565b61214a6120d3565b7f8568826440873e37a96cb0aab773b28d8154d963d2f0e41bd9b5c15f63625f916001600160a01b0382166121d65760405162461bcd60e51b815260206004820152602c60248201527f4552433230546f6b656e5374616b696e674d616e616765723a207a65726f207460448201526b6f6b656e206164647265737360a01b6064820152608401610305565b80546001600160a01b0319166001600160a01b0392909216919091179055565b7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0080546001190161223a57604051633ee5aeb560e01b815260040160405180910390fd5b60029055565b5f6103a3827f8568826440873e37a96cb0aab773b28d8154d963d2f0e41bd9b5c15f63625f91546001600160a01b031690612789565b5f60608260800151516030146122e05760405162461bcd60e51b815260206004820152602960248201527f5374616b696e674d657373616765733a20496e76616c6964207369676e6174756044820152680e4ca40d8cadccee8d60bb1b6064820152608401610305565b60408051608680825260c082019092525f916020820181803683370190505090505f5b60028110156123575761231781600161304f565b612322906008612d32565b5081515f9083908390811061233957612339613062565b60200101906001600160f81b03191690815f1a905350600101612303565b505f5b60048110156123b55761236e81600361304f565b612379906008612d32565b505f82612387836002613076565b8151811061239757612397613062565b60200101906001600160f81b03191690815f1a90535060010161235a565b505f5b602081101561241257845181602081106123d4576123d4613062565b1a60f81b826123e4836006613076565b815181106123f4576123f4613062565b60200101906001600160f81b03191690815f1a9053506001016123b8565b505f5b6020811015612472578460200151816020811061243457612434613062565b1a60f81b82612444836026613076565b8151811061245457612454613062565b60200101906001600160f81b03191690815f1a905350600101612415565b505f5b60088110156124e65761248981600761304f565b612494906008612d32565b60ff1685604001516001600160401b0316901c60f81b828260466124b89190613076565b815181106124c8576124c8613062565b60200101906001600160f81b03191690815f1a905350600101612475565b505f5b6030811015612551578460800151818151811061250857612508613062565b01602001516001600160f81b0319168261252383604e613076565b8151811061253357612533613062565b60200101906001600160f81b03191690815f1a9053506001016124e9565b505f5b60088110156125c35761256881600761304f565b612573906008612d32565b60608601516001600160401b0390811691161c60f81b8261259583607e613076565b815181106125a5576125a5613062565b60200101906001600160f81b03191690815f1a905350600101612554565b506002816040516125d491906132d0565b602060405180830381855afa1580156125ef573d5f803e3d5ffd5b5050506040513d601f19601f820116820180604052508101906126129190612ce0565b94909350915050565b60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b6126496120d3565b61211c6128eb565b61211c6120d3565b6126616120d3565b80355f8051602061332783398151915290815560208201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6015560408201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6025560608201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab603556126f960a0830160808401612a8c565b60048201805467ffffffffffffffff19166001600160401b039290921691909117905561272c60c0830160a084016132eb565b60048201805460ff92909216600160e01b0260ff60e01b1990921691909117905561275d60e0830160c0840161330b565b8160040160086101000a8154816001600160a01b0302191690836001600160a01b031602179055505050565b6040516370a0823160e01b81523060048201525f9081906001600160a01b038516906370a0823190602401602060405180830381865afa1580156127cf573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906127f39190612ce0565b905061280a6001600160a01b0385163330866128f3565b6040516370a0823160e01b81523060048201525f906001600160a01b038616906370a0823190602401602060405180830381865afa15801561284e573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906128729190612ce0565b90508181116128d85760405162461bcd60e51b815260206004820152602c60248201527f5361666545524332305472616e7366657246726f6d3a2062616c616e6365206e60448201526b1bdd081a5b98dc99585cd95960a21b6064820152608401610305565b6128e2828261304f565b95945050505050565b61261b6120d3565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b17905261294d908590612953565b50505050565b5f8060205f8451602086015f885af180612972576040513d5f823e3d81fd5b50505f513d91508115612989578060011415612996565b6001600160a01b0384163b155b1561294d57604051635274afe760e01b81526001600160a01b0385166004820152602401610305565b5080546129cb90612f48565b5f825580601f106129da575050565b601f0160209004905f5260205f209081019061213f91905b80821115612a05575f81556001016129f2565b5090565b5f60208284031215612a19575f80fd5b5035919050565b6001600160a01b038116811461213f575f80fd5b5f80828403610100811215612a47575f80fd5b60e0811215612a54575f80fd5b5082915060e0830135612a6681612a20565b809150509250929050565b80356001600160401b0381168114612a87575f80fd5b919050565b5f60208284031215612a9c575f80fd5b612aa582612a71565b9392505050565b801515811461213f575f80fd5b803563ffffffff81168114612a87575f80fd5b5f805f60608486031215612ade575f80fd5b833592506020840135612af081612aac565b9150612afe60408501612ab9565b90509250925092565b634e487b7160e01b5f52604160045260245ffd5b604051606081016001600160401b0381118282101715612b3d57612b3d612b07565b60405290565b604051601f8201601f191681016001600160401b0381118282101715612b6b57612b6b612b07565b604052919050565b5f6001600160401b03821115612b8b57612b8b612b07565b50601f01601f191660200190565b5f805f8060808587031215612bac575f80fd5b8435935060208501359250612bc360408601612a71565b915060608501356001600160401b03811115612bdd575f80fd5b8501601f81018713612bed575f80fd5b8035612c00612bfb82612b73565b612b43565b818152886020838501011115612c14575f80fd5b816020840160208301375f6020838301015280935050505092959194509250565b5f60208284031215612c45575f80fd5b612aa582612ab9565b5f8060408385031215612c5f575f80fd5b612c6883612ab9565b91506020830135612a6681612aac565b634e487b7160e01b5f52602160045260245ffd5b5f5b83811015612ca6578181015183820152602001612c8e565b50505f910152565b602081525f8251806020840152612ccc816040850160208701612c8c565b601f01601f19169190910160400192915050565b5f60208284031215612cf0575f80fd5b5051919050565b634e487b7160e01b5f52601260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b5f82612d2d57612d2d612cf7565b500490565b80820281158282048414176103a3576103a3612d0b565b6020808252602a908201527f5374616b696e674d616e616765723a2053656e646572206e6f742076616c696460408201526930ba37b91037bbb732b960b11b606082015260800190565b8051612a8781612aac565b5f8060408385031215612daf575f80fd5b82516001600160401b0380821115612dc5575f80fd5b9084019060608287031215612dd8575f80fd5b612de0612b1b565b82518152602080840151612df381612a20565b82820152604084015183811115612e08575f80fd5b80850194505087601f850112612e1c575f80fd5b83519250612e2c612bfb84612b73565b8381528882858701011115612e3f575f80fd5b612e4e84838301848801612c8c565b80604084015250819550612e63818801612d93565b9450505050509250929050565b60208082526024908201527f5374616b696e674d616e616765723a20496e76616c69642077617270206d65736040820152637361676560e01b606082015260800190565b60208082526027908201527f5374616b696e674d616e616765723a20496e76616c696420736f7572636520636040820152661a185a5b88125160ca1b606082015260800190565b6020808252602d908201527f5374616b696e674d616e616765723a20496e76616c6964206f726967696e207360408201526c656e646572206164647265737360981b606082015260800190565b600181811c90821680612f5c57607f821691505b602082108103612f7a57634e487b7160e01b5f52602260045260245ffd5b50919050565b60208082526025908201527f5374616b696e674d616e616765723a20496e76616c69642076616c69646174696040820152641bdb88125160da1b606082015260800190565b5f60208083525f8454612fd781612f48565b806020870152604060018084165f8114612ff8576001811461301457613041565b60ff19851660408a0152604084151560051b8a01019550613041565b895f5260205f205f5b858110156130385781548b820186015290830190880161301d565b8a016040019650505b509398975050505050505050565b818103818111156103a3576103a3612d0b565b634e487b7160e01b5f52603260045260245ffd5b808201808211156103a3576103a3612d0b565b6001600160401b038181168382160190808211156130a9576130a9612d0b565b5092915050565b6001600160401b038181168382160280821691908281146130d3576130d3612d0b565b505092915050565b5f6001600160401b03808416806130f4576130f4612cf7565b92169190910492915050565b60208082526027908201527f5374616b696e674d657373616765733a20496e76616c6964206d657373616765604082015266040d8cadccee8d60cb1b606082015260800190565b60208082526021908201527f5374616b696e674d657373616765733a20496e76616c696420636f64656320496040820152601160fa1b606082015260800190565b60208082526025908201527f5374616b696e674d657373616765733a20496e76616c6964206d657373616765604082015264207479706560d81b606082015260800190565b601f821115610e0457805f5260205f20601f840160051c810160208510156131f25750805b601f840160051c820191505b8181101561038c575f81556001016131fe565b81516001600160401b0381111561322a5761322a612b07565b61323e816132388454612f48565b846131cd565b602080601f831160018114613271575f841561325a5750858301515b5f19600386901b1c1916600185901b1785556132c8565b5f85815260208120601f198616915b8281101561329f57888601518255948401946001909101908401613280565b50858210156132bc57878501515f19600388901b60f8161c191681555b505060018460011b0185555b505050505050565b5f82516132e1818460208701612c8c565b9190910192915050565b5f602082840312156132fb575f80fd5b813560ff81168114612aa5575f80fd5b5f6020828403121561331b575f80fd5b8135612aa581612a2056feafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab600a164736f6c6343000819000a", } // ERC20TokenStakingManagerABI is the input ABI used to generate the binding from. diff --git a/abi-bindings/go/staking/NativeTokenStakingManager/NativeTokenStakingManager.go b/abi-bindings/go/staking/NativeTokenStakingManager/NativeTokenStakingManager.go index 07a0c3cb5..ebb39787d 100644 --- a/abi-bindings/go/staking/NativeTokenStakingManager/NativeTokenStakingManager.go +++ b/abi-bindings/go/staking/NativeTokenStakingManager/NativeTokenStakingManager.go @@ -43,7 +43,7 @@ type StakingManagerSettings struct { // NativeTokenStakingManagerMetaData contains all meta data concerning the NativeTokenStakingManager contract. var NativeTokenStakingManagerMetaData = &bind.MetaData{ ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"init\",\"type\":\"uint8\",\"internalType\":\"enumICMInitializable\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"WARP_MESSENGER\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIWarpMessenger\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"completeEndValidation\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"setWeightMessageType\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"completeValidatorRegistration\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"settings\",\"type\":\"tuple\",\"internalType\":\"structStakingManagerSettings\",\"components\":[{\"name\":\"pChainBlockchainID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"subnetID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"minimumStakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"maximumStakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"minimumStakeDuration\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"maximumHourlyChurn\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"rewardCalculator\",\"type\":\"address\",\"internalType\":\"contractIRewardCalculator\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeEndValidation\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"includeUptimeProof\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeValidatorRegistration\",\"inputs\":[{\"name\":\"nodeID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"resendEndValidatorMessage\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"resendRegisterValidatorMessage\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"valueToWeight\",\"inputs\":[{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"weightToValue\",\"inputs\":[{\"name\":\"weight\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"pure\"},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodCreated\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"nodeID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"registerValidationMessageID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"weight\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodEnded\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodRegistered\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"stakeAmount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"timestamp\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidatorRemovalInitialized\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"setWeightMessageID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"stakeAmount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"endTime\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"uptime\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ReentrancyGuardReentrantCall\",\"inputs\":[]}]", - Bin: "0x608060405234801561000f575f80fd5b5060405161313d38038061313d83398101604081905261002e91610107565b60018160018111156100425761004261012c565b0361004f5761004f610055565b50610140565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156100a55760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146101045780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b5f60208284031215610117575f80fd5b815160028110610125575f80fd5b9392505050565b634e487b7160e01b5f52602160045260245ffd5b612ff08061014d5f395ff3fe60806040526004361061008f575f3560e01c8063a3a65e4811610057578063a3a65e481461015b578063b771b3bc1461017a578063bee0a03f146101ac578063f40797d7146101cb578063fdf94a1a146101de575f80fd5b80630322ed98146100935780632e2194d8146100b457806362065856146100f057806376f786211461011d57806379f54eb11461013c575b5f80fd5b34801561009e575f80fd5b506100b26100ad366004612717565b6101fd565b005b3480156100bf575f80fd5b506100d36100ce366004612717565b6103f3565b6040516001600160401b0390911681526020015b60405180910390f35b3480156100fb575f80fd5b5061010f61010a366004612749565b610409565b6040519081526020016100e7565b348015610128575f80fd5b506100b2610137366004612789565b610422565b348015610147575f80fd5b506100b26101563660046127c4565b6109a2565b348015610166575f80fd5b506100b26101753660046127da565b610aae565b348015610185575f80fd5b506101946005600160991b0181565b6040516001600160a01b0390911681526020016100e7565b3480156101b7575f80fd5b506100b26101c6366004612717565b610d3b565b61010f6101d9366004612885565b610e4f565b3480156101e9575f80fd5b506100b26101f8366004612917565b610e64565b5f8181527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab60860205260408082208151610120810190925280545f80516020612fc483398151915293929190829060ff16600581111561025e5761025e61294c565b600581111561026f5761026f61294c565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003928301546001600160a01b03811660c084015260ff600160a01b820416151560e0840152600160a81b90041661010090910152909150815160058111156103065761030661294c565b1461036e5760405162461bcd60e51b815260206004820152602d60248201527f5374616b696e674d616e616765723a2056616c696461746f72206e6f7420706560448201526c1b991a5b99c81c995b5bdd985b609a1b60648201526084015b60405180910390fd5b5f61037f848361010001515f61128b565b60405163ee5b48eb60e01b81529091506005600160991b019063ee5b48eb906103ac908490600401612982565b6020604051808303815f875af11580156103c8573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103ec91906129b4565b5050505050565b5f61040364e8d4a51000836129f3565b92915050565b5f6104036001600160401b03831664e8d4a51000612a06565b5f8381527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab60860205260408082208151610120810190925280545f80516020612fc483398151915293929190829060ff1660058111156104835761048361294c565b60058111156104945761049461294c565b8152600182015460208201526002808301546001600160401b038082166040850152600160401b820481166060850152600160801b820481166080850152600160c01b909104811660a08401526003909301546001600160a01b03811660c084015260ff600160a01b820416151560e0840152600160a81b9004909216610100909101529091508151600581111561052e5761052e61294c565b146105875760405162461bcd60e51b8152602060048201526024808201527f5374616b696e674d616e616765723a2056616c696461746f72206e6f742061636044820152637469766560e01b6064820152608401610365565b60c08101516001600160a01b0316336001600160a01b0316146105bc5760405162461bcd60e51b815260040161036590612a1d565b6105c9816040015161144d565b60038152426001600160401b031660808201525f84156107a2576040516306f8253560e41b815263ffffffff851660048201525f9081906005600160991b0190636f825350906024015f60405180830381865afa15801561062c573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f191682016040526106539190810190612a86565b91509150806106745760405162461bcd60e51b815260040161036590612b58565b6005600160991b016001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106b7573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106db91906129b4565b8251146106fa5760405162461bcd60e51b815260040161036590612b9c565b60208201516001600160a01b0316156107255760405162461bcd60e51b815260040161036590612be3565b5f8061073484604001516115fa565b91509150818a1461079c5760405162461bcd60e51b815260206004820152602c60248201527f5374616b696e674d616e616765723a20496e76616c696420757074696d65207660448201526b185b1a59185d1a5bdb88125160a21b6064820152608401610365565b93505050505b6001600160401b03811660a08301525f86815260088401602052604090208251815484929190829060ff191660018360058111156107e2576107e261294c565b02179055506020820151600182015560408201516002820180546060850151608086015160a08701516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c08301516003909201805460e0850151610100958601516001600160a01b039095166001600160a81b031990921691909117600160a01b911515919091021767ffffffffffffffff60a81b1916600160a81b93909216929092021790558201515f906108d39088908361128b565b60405163ee5b48eb60e01b81529091505f906005600160991b019063ee5b48eb90610902908590600401612982565b6020604051808303815f875af115801561091e573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061094291906129b4565b60408581015181516001600160401b03918216815242602082015290861681830152905191925082918a917f530b908725650fb1052974f9df59e834fefac78c9ec2f00c6d2464d60cc6add5919081900360600190a35050505050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff1615906001600160401b03165f811580156109e65750825b90505f826001600160401b03166001148015610a015750303b155b905081158015610a0f575080155b15610a2d5760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff191660011785558315610a5757845460ff60401b1916600160401b1785555b610a6086611755565b8315610aa657845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050565b5f5f80516020612fc48339815191526040516306f8253560e41b815263ffffffff841660048201529091505f9081906005600160991b0190636f825350906024015f60405180830381865afa158015610b09573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052610b309190810190612a86565b9150915080610b515760405162461bcd60e51b815260040161036590612b58565b8254825114610b725760405162461bcd60e51b815260040161036590612b9c565b60208201516001600160a01b031615610b9d5760405162461bcd60e51b815260040161036590612be3565b5f80610bac8460400151611769565b9150915080610c0c5760405162461bcd60e51b815260206004820152602660248201527f5374616b696e674d616e616765723a20526567697374726174696f6e206e6f74604482015265081d985b1a5960d21b6064820152608401610365565b5f82815260078601602052604081208054610c2690612c30565b9050118015610c58575060015f83815260088701602052604090205460ff166005811115610c5657610c5661294c565b145b610c745760405162461bcd60e51b815260040161036590612c62565b5f8281526007860160205260408120610c8c916126cd565b5f8281526008860160208181526040808420805460ff191660029081178255810180546001600160401b0342818116600160401b026fffffffffffffffff000000000000000019909316929092178355600190930154875260098c0185528387208990559588905293835292548151931683529082019290925283917ff8fd1c90fb9cfa2ca2358fdf5806b086ad43315d92b221c929efc7f105ce7568910160405180910390a2505050505050565b5f8181527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6076020526040812080545f80516020612fc4833981519152929190610d8390612c30565b9050118015610db5575060015f83815260088301602052604090205460ff166005811115610db357610db361294c565b145b610dd15760405162461bcd60e51b815260040161036590612c62565b5f82815260078201602052604090819020905163ee5b48eb60e01b81526005600160991b019163ee5b48eb91610e0a9190600401612ca7565b6020604051808303815f875af1158015610e26573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e4a91906129b4565b505050565b5f610e5c84348585611944565b949350505050565b5f5f80516020612fc48339815191526040516306f8253560e41b815263ffffffff851660048201529091505f9081906005600160991b0190636f825350906024015f60405180830381865afa158015610ebf573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052610ee69190810190612a86565b9150915080610f075760405162461bcd60e51b815260040161036590612b58565b5f8415610f80575f610f1c8460400151611efd565b919350909150506001600160401b03811615610f7a5760405162461bcd60e51b815260206004820181905260248201527f5374616b696e674d616e616765723a20576569676874206d75737420626520306044820152606401610365565b50610ff4565b5f610f8e8460400151611769565b90925090508015610ff25760405162461bcd60e51b815260206004820152602860248201527f5374616b696e674d616e616765723a20526567697374726174696f6e207374696044820152671b1b081d985b1a5960c21b6064820152608401610365565b505b5f818152600885016020526040808220815161012081019092528054829060ff1660058111156110265761102661294c565b60058111156110375761103761294c565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003909201546001600160a01b0380821660c080850191909152600160a01b830460ff16151560e0850152600160a81b909204909316610100909201919091528201519192501633146110e85760405162461bcd60e51b815260040161036590612a1d565b5f6003825160058111156110fe576110fe61294c565b148061111c575060028251600581111561111a5761111a61294c565b145b1561113f57506020808201515f9081526009870190915260408120556004611143565b5060055b5f83815260088701602052604090208251815484929190829060ff191660018360058111156111745761117461294c565b0217905550602082015160018201556040808301516002830180546060860151608087015160a08801516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c08401516003909301805460e0860151610100909601516001600160a01b039095166001600160a81b031990911617600160a01b951515959095029490941767ffffffffffffffff60a81b1916600160a81b9390911692909202919091179091555183907f3532ad18e70a039beb4663d48c15acbef558c96ec9b8fd0cc3c0304f774740b8905f90a25050505050505050565b60408051603480825260608281019093525f91906020820181803683370190505090505f5b600481101561130c576112c4816003612d31565b6112cf906008612a06565b600163ffffffff16901c60f81b8282815181106112ee576112ee612d44565b60200101906001600160f81b03191690815f1a9053506001016112b0565b505f5b602081101561136e5761132381601f612d31565b61132e906008612a06565b86901c60f81b82611340836004612d58565b8151811061135057611350612d44565b60200101906001600160f81b03191690815f1a90535060010161130f565b505f5b60088110156113d957611385816007612d31565b611390906008612a06565b6001600160401b038616901c60f81b826113ab836024612d58565b815181106113bb576113bb612d44565b60200101906001600160f81b03191690815f1a905350600101611371565b505f5b6008811015611444576113f0816007612d31565b6113fb906008612a06565b6001600160401b038516901c60f81b8261141683602c612d58565b8151811061142657611426612d44565b60200101906001600160f81b03191690815f1a9053506001016113dc565b50949350505050565b7fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab604545f80516020612fc483398151915290600160e01b900460ff165f03611492575050565b60408051606081018252600583015480825260068401546001600160401b038082166020850152600160401b9091041692820192909252904290610e10906114da9083612d31565b106114f6576001600160401b0384166040830152808252611515565b83826040018181516115089190612d6b565b6001600160401b03169052505b5f82602001518360400151606461152c9190612d92565b6115369190612dbd565b600485015490915060ff600160e01b909104811690821611156115b65760405162461bcd60e51b815260206004820152603260248201527f5374616b696e674d616e616765723a204d6178696d756d20686f75726c7920636044820152711a1d5c9b881c985d1948195e18d95959195960721b6064820152608401610365565b5050805160058301556020810151600690920180546040909201516001600160401b03908116600160401b026001600160801b031990931693169290921717905550565b5f808251602c1461161d5760405162461bcd60e51b815260040161036590612de2565b5f805b600481101561166e57611634816003612d31565b61163f906008612a06565b63ffffffff1685828151811061165757611657612d44565b016020015160f81c901b9190911790600101611620565b5063ffffffff81166004146116955760405162461bcd60e51b815260040161036590612e29565b5f805b60208110156116ea576116ac81601f612d31565b6116b7906008612a06565b866116c3836004612d58565b815181106116d3576116d3612d44565b016020015160f81c901b9190911790600101611698565b505f805b600881101561174957611702816007612d31565b61170d906008612a06565b6001600160401b031687611722836024612d58565b8151811061173257611732612d44565b016020015160f81c901b91909117906001016116ee565b50909590945092505050565b61175d6120bb565b61176681612106565b50565b5f80825160271461178c5760405162461bcd60e51b815260040161036590612de2565b5f805b60028110156117db576117a3816001612d31565b6117ae906008612a06565b61ffff168582815181106117c4576117c4612d44565b016020015160f81c901b919091179060010161178f565b5061ffff8116156118385760405162461bcd60e51b815260206004820152602160248201527f5374616b696e674d657373616765733a20496e76616c696420636f64656320496044820152601160fa1b6064820152608401610365565b5f805b60048110156118935761184f816003612d31565b61185a906008612a06565b63ffffffff168661186c836002612d58565b8151811061187c5761187c612d44565b016020015160f81c901b919091179060010161183b565b5063ffffffff81166002146118ba5760405162461bcd60e51b815260040161036590612e29565b5f805b602081101561190f576118d181601f612d31565b6118dc906008612a06565b876118e8836006612d58565b815181106118f8576118f8612d44565b016020015160f81c901b91909117906001016118bd565b505f8660268151811061192457611924612d44565b016020015191976001600160f81b03199092161515965090945050505050565b5f61194d612127565b5f80516020612fc4833981519152670de0b6b3a7640000851461199b5760405162461bcd60e51b815260206004820152600660248201526563616e61727960d01b6044820152606401610365565b8060020154620f4240146119db5760405162461bcd60e51b815260206004820152600760248201526631b0b730b93c9960c91b6044820152606401610365565b80600301546298968014611a1b5760405162461bcd60e51b815260206004820152600760248201526663616e6172793360c81b6044820152606401610365565b42846001600160401b0316118015611a4757506001600160401b038416611a45426202a300612d58565b115b611aa75760405162461bcd60e51b815260206004820152602b60248201527f5374616b696e674d616e616765723a20496e76616c696420726567697374726160448201526a74696f6e2065787069727960a81b6064820152608401610365565b85611af45760405162461bcd60e51b815260206004820152601f60248201527f5374616b696e674d616e616765723a20496e76616c6964206e6f6465204944006044820152606401610365565b5f86815260098201602052604090205415611b605760405162461bcd60e51b815260206004820152602660248201527f5374616b696e674d616e616765723a204e6f646520494420616c72656164792060448201526561637469766560d01b6064820152608401610365565b8251604014611bc25760405162461bcd60e51b815260206004820152602860248201527f5374616b696e674d616e616765723a20496e76616c6964207369676e617475726044820152670ca40d8cadccee8d60c31b6064820152608401610365565b845f611bcd826103f3565b90508260020154816001600160401b031610158015611bf957508260030154816001600160401b031611155b611c515760405162461bcd60e51b8152602060048201526024808201527f5374616b696e674d616e616765723a20496e76616c6964207374616b6520616d6044820152631bdd5b9d60e21b6064820152608401610365565b5f80611c986040518060a00160405280876001015481526020018c8152602001856001600160401b031681526020018a6001600160401b0316815260200189815250612171565b5f82815260078801602052604090209193509150611cb68282612eb2565b5060405163ee5b48eb60e01b81525f906005600160991b019063ee5b48eb90611ce3908590600401612982565b6020604051808303815f875af1158015611cff573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611d2391906129b4565b6040805161012081019091529091508060018152602081018d90526001600160401b03861660408201525f606082018190526080820181905260a082015260c001336001600160a01b031681525f6020808301829052604092830182905286825260088a0190522081518154829060ff19166001836005811115611da957611da961294c565b021790555060208281015160018301556040808401516002840180546060870151608088015160a08901516001600160401b03908116600160c01b026001600160c01b03928216600160801b02929092166001600160801b03938216600160401b026001600160801b03199095169682169690961793909317919091169390931792909217905560c08501516003909401805460e0870151610100909701518316600160a81b0267ffffffffffffffff60a81b19971515600160a01b026001600160a81b03199092166001600160a01b039097169690961717959095169390931790935582518783168152918c169082015282918d9186917f79b81620b81daf2c08cd5bb3dbb79e75d2d7a87f52171fde5aadc8c47823026e910160405180910390a45090945050505050610e5c60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b5f805f8351603414611f215760405162461bcd60e51b815260040161036590612de2565b5f805b6004811015611f7257611f38816003612d31565b611f43906008612a06565b63ffffffff16868281518110611f5b57611f5b612d44565b016020015160f81c901b9190911790600101611f24565b5063ffffffff8116600114611f995760405162461bcd60e51b815260040161036590612e29565b5f805b6020811015611fee57611fb081601f612d31565b611fbb906008612a06565b87611fc7836004612d58565b81518110611fd757611fd7612d44565b016020015160f81c901b9190911790600101611f9c565b505f805b600881101561204d57612006816007612d31565b612011906008612a06565b6001600160401b031688612026836024612d58565b8151811061203657612036612d44565b016020015160f81c901b9190911790600101611ff2565b505f805b60088110156120ac57612065816007612d31565b612070906008612a06565b6001600160401b03168961208583602c612d58565b8151811061209557612095612d44565b016020015160f81c901b9190911790600101612051565b50919790965090945092505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff1661210457604051631afcd79f60e31b815260040160405180910390fd5b565b61210e6120bb565b612116612297565b61211e6122a7565b611766816122af565b7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0080546001190161216b57604051633ee5aeb560e01b815260040160405180910390fd5b60029055565b5f60605f8061217f856123df565b60408051609480825260c082019092529294509092505f91906020820181803683370190505090505f5b60048110156121fd576121bd816003612d31565b6121c8906008612a06565b5081515f908390839081106121df576121df612d44565b60200101906001600160f81b03191690815f1a9053506001016121a9565b505f5b60908110156122645782818151811061221b5761221b612d44565b01602001516001600160f81b03191682612236836004612d58565b8151811061224657612246612d44565b60200101906001600160f81b03191690815f1a905350600101612200565b5091959194509092505050565b60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b61229f6120bb565b6121046126c5565b6121046120bb565b6122b76120bb565b80355f80516020612fc483398151915290815560208201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6015560408201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6025560608201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6035561234f60a0830160808401612749565b60048201805467ffffffffffffffff19166001600160401b039290921691909117905561238260c0830160a08401612f6d565b60048201805460ff92909216600160e01b0260ff60e01b199092169190911790556123b360e0830160c08401612f8d565b8160040160086101000a8154816001600160a01b0302191690836001600160a01b031602179055505050565b5f60608260800151516040146124495760405162461bcd60e51b815260206004820152602960248201527f5374616b696e674d657373616765733a20496e76616c6964207369676e6174756044820152680e4ca40d8cadccee8d60bb1b6064820152608401610365565b60408051609080825260c082019092525f916020820181803683370190505090505f5b60208110156124bc578451816020811061248857612488612d44565b1a60f81b82828151811061249e5761249e612d44565b60200101906001600160f81b03191690815f1a90535060010161246c565b505f5b602081101561251c57846020015181602081106124de576124de612d44565b1a60f81b826124ee836020612d58565b815181106124fe576124fe612d44565b60200101906001600160f81b03191690815f1a9053506001016124bf565b505f5b600881101561259057612533816007612d31565b61253e906008612a06565b60ff1685604001516001600160401b0316901c60f81b828260406125629190612d58565b8151811061257257612572612d44565b60200101906001600160f81b03191690815f1a90535060010161251f565b505f5b6008811015612602576125a7816007612d31565b6125b2906008612a06565b60608601516001600160401b0390811691161c60f81b826125d4836048612d58565b815181106125e4576125e4612d44565b60200101906001600160f81b03191690815f1a905350600101612593565b505f5b604081101561266d578460800151818151811061262457612624612d44565b01602001516001600160f81b0319168261263f836050612d58565b8151811061264f5761264f612d44565b60200101906001600160f81b03191690815f1a905350600101612605565b5060028160405161267e9190612fa8565b602060405180830381855afa158015612699573d5f803e3d5ffd5b5050506040513d601f19601f820116820180604052508101906126bc91906129b4565b94909350915050565b6122716120bb565b5080546126d990612c30565b5f825580601f106126e8575050565b601f0160209004905f5260205f209081019061176691905b80821115612713575f8155600101612700565b5090565b5f60208284031215612727575f80fd5b5035919050565b80356001600160401b0381168114612744575f80fd5b919050565b5f60208284031215612759575f80fd5b6127628261272e565b9392505050565b8015158114611766575f80fd5b803563ffffffff81168114612744575f80fd5b5f805f6060848603121561279b575f80fd5b8335925060208401356127ad81612769565b91506127bb60408501612776565b90509250925092565b5f60e082840312156127d4575f80fd5b50919050565b5f602082840312156127ea575f80fd5b61276282612776565b634e487b7160e01b5f52604160045260245ffd5b604051606081016001600160401b0381118282101715612829576128296127f3565b60405290565b604051601f8201601f191681016001600160401b0381118282101715612857576128576127f3565b604052919050565b5f6001600160401b03821115612877576128776127f3565b50601f01601f191660200190565b5f805f60608486031215612897575f80fd5b833592506128a76020850161272e565b915060408401356001600160401b038111156128c1575f80fd5b8401601f810186136128d1575f80fd5b80356128e46128df8261285f565b61282f565b8181528760208385010111156128f8575f80fd5b816020840160208301375f602083830101528093505050509250925092565b5f8060408385031215612928575f80fd5b61293183612776565b9150602083013561294181612769565b809150509250929050565b634e487b7160e01b5f52602160045260245ffd5b5f5b8381101561297a578181015183820152602001612962565b50505f910152565b602081525f82518060208401526129a0816040850160208701612960565b601f01601f19169190910160400192915050565b5f602082840312156129c4575f80fd5b5051919050565b634e487b7160e01b5f52601260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b5f82612a0157612a016129cb565b500490565b8082028115828204841417610403576104036129df565b6020808252602a908201527f5374616b696e674d616e616765723a2053656e646572206e6f742076616c696460408201526930ba37b91037bbb732b960b11b606082015260800190565b6001600160a01b0381168114611766575f80fd5b805161274481612769565b5f8060408385031215612a97575f80fd5b82516001600160401b0380821115612aad575f80fd5b9084019060608287031215612ac0575f80fd5b612ac8612807565b82518152602080840151612adb81612a67565b82820152604084015183811115612af0575f80fd5b80850194505087601f850112612b04575f80fd5b83519250612b146128df8461285f565b8381528882858701011115612b27575f80fd5b612b3684838301848801612960565b80604084015250819550612b4b818801612a7b565b9450505050509250929050565b60208082526024908201527f5374616b696e674d616e616765723a20496e76616c69642077617270206d65736040820152637361676560e01b606082015260800190565b60208082526027908201527f5374616b696e674d616e616765723a20496e76616c696420736f7572636520636040820152661a185a5b88125160ca1b606082015260800190565b6020808252602d908201527f5374616b696e674d616e616765723a20496e76616c6964206f726967696e207360408201526c656e646572206164647265737360981b606082015260800190565b600181811c90821680612c4457607f821691505b6020821081036127d457634e487b7160e01b5f52602260045260245ffd5b60208082526025908201527f5374616b696e674d616e616765723a20496e76616c69642076616c69646174696040820152641bdb88125160da1b606082015260800190565b5f60208083525f8454612cb981612c30565b806020870152604060018084165f8114612cda5760018114612cf657612d23565b60ff19851660408a0152604084151560051b8a01019550612d23565b895f5260205f205f5b85811015612d1a5781548b8201860152908301908801612cff565b8a016040019650505b509398975050505050505050565b81810381811115610403576104036129df565b634e487b7160e01b5f52603260045260245ffd5b80820180821115610403576104036129df565b6001600160401b03818116838216019080821115612d8b57612d8b6129df565b5092915050565b6001600160401b03818116838216028082169190828114612db557612db56129df565b505092915050565b5f6001600160401b0380841680612dd657612dd66129cb565b92169190910492915050565b60208082526027908201527f5374616b696e674d657373616765733a20496e76616c6964206d657373616765604082015266040d8cadccee8d60cb1b606082015260800190565b60208082526025908201527f5374616b696e674d657373616765733a20496e76616c6964206d657373616765604082015264207479706560d81b606082015260800190565b601f821115610e4a57805f5260205f20601f840160051c81016020851015612e935750805b601f840160051c820191505b818110156103ec575f8155600101612e9f565b81516001600160401b03811115612ecb57612ecb6127f3565b612edf81612ed98454612c30565b84612e6e565b602080601f831160018114612f12575f8415612efb5750858301515b5f19600386901b1c1916600185901b178555610aa6565b5f85815260208120601f198616915b82811015612f4057888601518255948401946001909101908401612f21565b5085821015612f5d57878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b5f60208284031215612f7d575f80fd5b813560ff81168114612762575f80fd5b5f60208284031215612f9d575f80fd5b813561276281612a67565b5f8251612fb9818460208701612960565b919091019291505056feafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab600a164736f6c6343000819000a", + Bin: "0x608060405234801561000f575f80fd5b5060405161319b38038061319b83398101604081905261002e91610107565b60018160018111156100425761004261012c565b0361004f5761004f610055565b50610140565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156100a55760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146101045780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b5f60208284031215610117575f80fd5b815160028110610125575f80fd5b9392505050565b634e487b7160e01b5f52602160045260245ffd5b61304e8061014d5f395ff3fe60806040526004361061008f575f3560e01c8063a3a65e4811610057578063a3a65e481461015b578063b771b3bc1461017a578063bee0a03f146101ac578063f40797d7146101cb578063fdf94a1a146101de575f80fd5b80630322ed98146100935780632e2194d8146100b457806362065856146100f057806376f786211461011d57806379f54eb11461013c575b5f80fd5b34801561009e575f80fd5b506100b26100ad366004612734565b6101fd565b005b3480156100bf575f80fd5b506100d36100ce366004612734565b6103f3565b6040516001600160401b0390911681526020015b60405180910390f35b3480156100fb575f80fd5b5061010f61010a366004612766565b610409565b6040519081526020016100e7565b348015610128575f80fd5b506100b26101373660046127a6565b610422565b348015610147575f80fd5b506100b26101563660046127e1565b6109a2565b348015610166575f80fd5b506100b26101753660046127f7565b610aae565b348015610185575f80fd5b506101946005600160991b0181565b6040516001600160a01b0390911681526020016100e7565b3480156101b7575f80fd5b506100b26101c6366004612734565b610d3b565b61010f6101d93660046128a2565b610e4f565b3480156101e9575f80fd5b506100b26101f8366004612934565b610e64565b5f8181527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab60860205260408082208151610120810190925280545f8051602061302283398151915293929190829060ff16600581111561025e5761025e612969565b600581111561026f5761026f612969565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003928301546001600160a01b03811660c084015260ff600160a01b820416151560e0840152600160a81b900416610100909101529091508151600581111561030657610306612969565b1461036e5760405162461bcd60e51b815260206004820152602d60248201527f5374616b696e674d616e616765723a2056616c696461746f72206e6f7420706560448201526c1b991a5b99c81c995b5bdd985b609a1b60648201526084015b60405180910390fd5b5f61037f848361010001515f61128b565b60405163ee5b48eb60e01b81529091506005600160991b019063ee5b48eb906103ac90849060040161299f565b6020604051808303815f875af11580156103c8573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103ec91906129d1565b5050505050565b5f61040364e8d4a5100083612a10565b92915050565b5f6104036001600160401b03831664e8d4a51000612a23565b5f8381527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab60860205260408082208151610120810190925280545f8051602061302283398151915293929190829060ff16600581111561048357610483612969565b600581111561049457610494612969565b8152600182015460208201526002808301546001600160401b038082166040850152600160401b820481166060850152600160801b820481166080850152600160c01b909104811660a08401526003909301546001600160a01b03811660c084015260ff600160a01b820416151560e0840152600160a81b9004909216610100909101529091508151600581111561052e5761052e612969565b146105875760405162461bcd60e51b8152602060048201526024808201527f5374616b696e674d616e616765723a2056616c696461746f72206e6f742061636044820152637469766560e01b6064820152608401610365565b60c08101516001600160a01b0316336001600160a01b0316146105bc5760405162461bcd60e51b815260040161036590612a3a565b6105c981604001516114a8565b60038152426001600160401b031660808201525f84156107a2576040516306f8253560e41b815263ffffffff851660048201525f9081906005600160991b0190636f825350906024015f60405180830381865afa15801561062c573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f191682016040526106539190810190612aa3565b91509150806106745760405162461bcd60e51b815260040161036590612b75565b6005600160991b016001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106b7573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106db91906129d1565b8251146106fa5760405162461bcd60e51b815260040161036590612bb9565b60208201516001600160a01b0316156107255760405162461bcd60e51b815260040161036590612c00565b5f806107348460400151611655565b91509150818a1461079c5760405162461bcd60e51b815260206004820152602c60248201527f5374616b696e674d616e616765723a20496e76616c696420757074696d65207660448201526b185b1a59185d1a5bdb88125160a21b6064820152608401610365565b93505050505b6001600160401b03811660a08301525f86815260088401602052604090208251815484929190829060ff191660018360058111156107e2576107e2612969565b02179055506020820151600182015560408201516002820180546060850151608086015160a08701516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c08301516003909201805460e0850151610100958601516001600160a01b039095166001600160a81b031990921691909117600160a01b911515919091021767ffffffffffffffff60a81b1916600160a81b93909216929092021790558201515f906108d39088908361128b565b60405163ee5b48eb60e01b81529091505f906005600160991b019063ee5b48eb9061090290859060040161299f565b6020604051808303815f875af115801561091e573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061094291906129d1565b60408581015181516001600160401b03918216815242602082015290861681830152905191925082918a917f530b908725650fb1052974f9df59e834fefac78c9ec2f00c6d2464d60cc6add5919081900360600190a35050505050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff1615906001600160401b03165f811580156109e65750825b90505f826001600160401b03166001148015610a015750303b155b905081158015610a0f575080155b15610a2d5760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff191660011785558315610a5757845460ff60401b1916600160401b1785555b610a608661182d565b8315610aa657845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050565b5f5f805160206130228339815191526040516306f8253560e41b815263ffffffff841660048201529091505f9081906005600160991b0190636f825350906024015f60405180830381865afa158015610b09573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052610b309190810190612aa3565b9150915080610b515760405162461bcd60e51b815260040161036590612b75565b8254825114610b725760405162461bcd60e51b815260040161036590612bb9565b60208201516001600160a01b031615610b9d5760405162461bcd60e51b815260040161036590612c00565b5f80610bac8460400151611841565b9150915080610c0c5760405162461bcd60e51b815260206004820152602660248201527f5374616b696e674d616e616765723a20526567697374726174696f6e206e6f74604482015265081d985b1a5960d21b6064820152608401610365565b5f82815260078601602052604081208054610c2690612c4d565b9050118015610c58575060015f83815260088701602052604090205460ff166005811115610c5657610c56612969565b145b610c745760405162461bcd60e51b815260040161036590612c7f565b5f8281526007860160205260408120610c8c916126ea565b5f8281526008860160208181526040808420805460ff191660029081178255810180546001600160401b0342818116600160401b026fffffffffffffffff000000000000000019909316929092178355600190930154875260098c0185528387208990559588905293835292548151931683529082019290925283917ff8fd1c90fb9cfa2ca2358fdf5806b086ad43315d92b221c929efc7f105ce7568910160405180910390a2505050505050565b5f8181527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6076020526040812080545f80516020613022833981519152929190610d8390612c4d565b9050118015610db5575060015f83815260088301602052604090205460ff166005811115610db357610db3612969565b145b610dd15760405162461bcd60e51b815260040161036590612c7f565b5f82815260078201602052604090819020905163ee5b48eb60e01b81526005600160991b019163ee5b48eb91610e0a9190600401612cc4565b6020604051808303815f875af1158015610e26573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e4a91906129d1565b505050565b5f610e5c843485856119e2565b949350505050565b5f5f805160206130228339815191526040516306f8253560e41b815263ffffffff851660048201529091505f9081906005600160991b0190636f825350906024015f60405180830381865afa158015610ebf573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052610ee69190810190612aa3565b9150915080610f075760405162461bcd60e51b815260040161036590612b75565b5f8415610f80575f610f1c8460400151611ede565b919350909150506001600160401b03811615610f7a5760405162461bcd60e51b815260206004820181905260248201527f5374616b696e674d616e616765723a20576569676874206d75737420626520306044820152606401610365565b50610ff4565b5f610f8e8460400151611841565b90925090508015610ff25760405162461bcd60e51b815260206004820152602860248201527f5374616b696e674d616e616765723a20526567697374726174696f6e207374696044820152671b1b081d985b1a5960c21b6064820152608401610365565b505b5f818152600885016020526040808220815161012081019092528054829060ff16600581111561102657611026612969565b600581111561103757611037612969565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003909201546001600160a01b0380821660c080850191909152600160a01b830460ff16151560e0850152600160a81b909204909316610100909201919091528201519192501633146110e85760405162461bcd60e51b815260040161036590612a3a565b5f6003825160058111156110fe576110fe612969565b148061111c575060028251600581111561111a5761111a612969565b145b1561113f57506020808201515f9081526009870190915260408120556004611143565b5060055b5f83815260088701602052604090208251815484929190829060ff1916600183600581111561117457611174612969565b0217905550602082015160018201556040808301516002830180546060860151608087015160a08801516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c08401516003909301805460e0860151610100909601516001600160a01b039095166001600160a81b031990911617600160a01b951515959095029490941767ffffffffffffffff60a81b1916600160a81b9390911692909202919091179091555183907f3532ad18e70a039beb4663d48c15acbef558c96ec9b8fd0cc3c0304f774740b8905f90a25050505050505050565b60408051603680825260608281019093525f91906020820181803683370190505090505f5b6002811015611304576112c4816001612d4e565b6112cf906008612a23565b5081515f908390839081106112e6576112e6612d61565b60200101906001600160f81b03191690815f1a9053506001016112b0565b505f5b60048110156113675761131b816003612d4e565b611326906008612a23565b6001901c60f81b82611339836002612d75565b8151811061134957611349612d61565b60200101906001600160f81b03191690815f1a905350600101611307565b505f5b60208110156113c95761137e81601f612d4e565b611389906008612a23565b86901c60f81b8261139b836006612d75565b815181106113ab576113ab612d61565b60200101906001600160f81b03191690815f1a90535060010161136a565b505f5b6008811015611434576113e0816007612d4e565b6113eb906008612a23565b6001600160401b038616901c60f81b82611406836026612d75565b8151811061141657611416612d61565b60200101906001600160f81b03191690815f1a9053506001016113cc565b505f5b600881101561149f5761144b816007612d4e565b611456906008612a23565b6001600160401b038516901c60f81b8261147183602e612d75565b8151811061148157611481612d61565b60200101906001600160f81b03191690815f1a905350600101611437565b50949350505050565b7fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab604545f8051602061302283398151915290600160e01b900460ff165f036114ed575050565b60408051606081018252600583015480825260068401546001600160401b038082166020850152600160401b9091041692820192909252904290610e10906115359083612d4e565b10611551576001600160401b0384166040830152808252611570565b83826040018181516115639190612d88565b6001600160401b03169052505b5f8260200151836040015160646115879190612daf565b6115919190612dda565b600485015490915060ff600160e01b909104811690821611156116115760405162461bcd60e51b815260206004820152603260248201527f5374616b696e674d616e616765723a204d6178696d756d20686f75726c7920636044820152711a1d5c9b881c985d1948195e18d95959195960721b6064820152608401610365565b5050805160058301556020810151600690920180546040909201516001600160401b03908116600160401b026001600160801b031990931693169290921717905550565b5f808251602e146116785760405162461bcd60e51b815260040161036590612dff565b5f805b60028110156116c75761168f816001612d4e565b61169a906008612a23565b61ffff168582815181106116b0576116b0612d61565b016020015160f81c901b919091179060010161167b565b5061ffff8116156116ea5760405162461bcd60e51b815260040161036590612e46565b5f805b600481101561174557611701816003612d4e565b61170c906008612a23565b63ffffffff168661171e836002612d75565b8151811061172e5761172e612d61565b016020015160f81c901b91909117906001016116ed565b5063ffffffff811660041461176c5760405162461bcd60e51b815260040161036590612e87565b5f805b60208110156117c15761178381601f612d4e565b61178e906008612a23565b8761179a836006612d75565b815181106117aa576117aa612d61565b016020015160f81c901b919091179060010161176f565b505f805b6008811015611820576117d9816007612d4e565b6117e4906008612a23565b6001600160401b0316886117f9836026612d75565b8151811061180957611809612d61565b016020015160f81c901b91909117906001016117c5565b5090969095509350505050565b611835612119565b61183e81612164565b50565b5f8082516027146118645760405162461bcd60e51b815260040161036590612dff565b5f805b60028110156118b35761187b816001612d4e565b611886906008612a23565b61ffff1685828151811061189c5761189c612d61565b016020015160f81c901b9190911790600101611867565b5061ffff8116156118d65760405162461bcd60e51b815260040161036590612e46565b5f805b6004811015611931576118ed816003612d4e565b6118f8906008612a23565b63ffffffff168661190a836002612d75565b8151811061191a5761191a612d61565b016020015160f81c901b91909117906001016118d9565b5063ffffffff81166002146119585760405162461bcd60e51b815260040161036590612e87565b5f805b60208110156119ad5761196f81601f612d4e565b61197a906008612a23565b87611986836006612d75565b8151811061199657611996612d61565b016020015160f81c901b919091179060010161195b565b505f866026815181106119c2576119c2612d61565b016020015191976001600160f81b03199092161515965090945050505050565b5f6119eb612185565b5f80516020613022833981519152426001600160401b038516118015611a2557506001600160401b038416611a23426202a300612d75565b115b611a855760405162461bcd60e51b815260206004820152602b60248201527f5374616b696e674d616e616765723a20496e76616c696420726567697374726160448201526a74696f6e2065787069727960a81b6064820152608401610365565b85611ad25760405162461bcd60e51b815260206004820152601f60248201527f5374616b696e674d616e616765723a20496e76616c6964206e6f6465204944006044820152606401610365565b5f86815260098201602052604090205415611b3e5760405162461bcd60e51b815260206004820152602660248201527f5374616b696e674d616e616765723a204e6f646520494420616c72656164792060448201526561637469766560d01b6064820152608401610365565b8251603014611ba35760405162461bcd60e51b815260206004820152602b60248201527f5374616b696e674d616e616765723a20496e76616c696420626c735075626c6960448201526a0c696caf240d8cadccee8d60ab1b6064820152608401610365565b845f611bae826103f3565b90508260020154816001600160401b031610158015611bda57508260030154816001600160401b031611155b611c325760405162461bcd60e51b8152602060048201526024808201527f5374616b696e674d616e616765723a20496e76616c6964207374616b6520616d6044820152631bdd5b9d60e21b6064820152608401610365565b5f80611c796040518060a00160405280876001015481526020018c8152602001856001600160401b031681526020018a6001600160401b03168152602001898152506121cf565b5f82815260078801602052604090209193509150611c978282612f10565b5060405163ee5b48eb60e01b81525f906005600160991b019063ee5b48eb90611cc490859060040161299f565b6020604051808303815f875af1158015611ce0573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611d0491906129d1565b6040805161012081019091529091508060018152602081018d90526001600160401b03861660408201525f606082018190526080820181905260a082015260c001336001600160a01b031681525f6020808301829052604092830182905286825260088a0190522081518154829060ff19166001836005811115611d8a57611d8a612969565b021790555060208281015160018301556040808401516002840180546060870151608088015160a08901516001600160401b03908116600160c01b026001600160c01b03928216600160801b02929092166001600160801b03938216600160401b026001600160801b03199095169682169690961793909317919091169390931792909217905560c08501516003909401805460e0870151610100909701518316600160a81b0267ffffffffffffffff60a81b19971515600160a01b026001600160a81b03199092166001600160a01b039097169690961717959095169390931790935582518783168152918c169082015282918d9186917f79b81620b81daf2c08cd5bb3dbb79e75d2d7a87f52171fde5aadc8c47823026e910160405180910390a45090945050505050610e5c60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b5f805f8351603614611f025760405162461bcd60e51b815260040161036590612dff565b5f805b6002811015611f5157611f19816001612d4e565b611f24906008612a23565b61ffff16868281518110611f3a57611f3a612d61565b016020015160f81c901b9190911790600101611f05565b5061ffff811615611f745760405162461bcd60e51b815260040161036590612e46565b5f805b6004811015611fcf57611f8b816003612d4e565b611f96906008612a23565b63ffffffff1687611fa8836002612d75565b81518110611fb857611fb8612d61565b016020015160f81c901b9190911790600101611f77565b5063ffffffff8116600114611ff65760405162461bcd60e51b815260040161036590612e87565b5f805b602081101561204b5761200d81601f612d4e565b612018906008612a23565b88612024836006612d75565b8151811061203457612034612d61565b016020015160f81c901b9190911790600101611ff9565b505f805b60088110156120aa57612063816007612d4e565b61206e906008612a23565b6001600160401b031689612083836026612d75565b8151811061209357612093612d61565b016020015160f81c901b919091179060010161204f565b505f805b6008811015612109576120c2816007612d4e565b6120cd906008612a23565b6001600160401b03168a6120e283602e612d75565b815181106120f2576120f2612d61565b016020015160f81c901b91909117906001016120ae565b5091989097509095509350505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff1661216257604051631afcd79f60e31b815260040160405180910390fd5b565b61216c612119565b61217461259a565b61217c6125aa565b61183e816125b2565b7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f008054600119016121c957604051633ee5aeb560e01b815260040160405180910390fd5b60029055565b5f60608260800151516030146122395760405162461bcd60e51b815260206004820152602960248201527f5374616b696e674d657373616765733a20496e76616c6964207369676e6174756044820152680e4ca40d8cadccee8d60bb1b6064820152608401610365565b60408051608680825260c082019092525f916020820181803683370190505090505f5b60028110156122b057612270816001612d4e565b61227b906008612a23565b5081515f9083908390811061229257612292612d61565b60200101906001600160f81b03191690815f1a90535060010161225c565b505f5b600481101561230e576122c7816003612d4e565b6122d2906008612a23565b505f826122e0836002612d75565b815181106122f0576122f0612d61565b60200101906001600160f81b03191690815f1a9053506001016122b3565b505f5b602081101561236b578451816020811061232d5761232d612d61565b1a60f81b8261233d836006612d75565b8151811061234d5761234d612d61565b60200101906001600160f81b03191690815f1a905350600101612311565b505f5b60208110156123cb578460200151816020811061238d5761238d612d61565b1a60f81b8261239d836026612d75565b815181106123ad576123ad612d61565b60200101906001600160f81b03191690815f1a90535060010161236e565b505f5b600881101561243f576123e2816007612d4e565b6123ed906008612a23565b60ff1685604001516001600160401b0316901c60f81b828260466124119190612d75565b8151811061242157612421612d61565b60200101906001600160f81b03191690815f1a9053506001016123ce565b505f5b60308110156124aa578460800151818151811061246157612461612d61565b01602001516001600160f81b0319168261247c83604e612d75565b8151811061248c5761248c612d61565b60200101906001600160f81b03191690815f1a905350600101612442565b505f5b600881101561251c576124c1816007612d4e565b6124cc906008612a23565b60608601516001600160401b0390811691161c60f81b826124ee83607e612d75565b815181106124fe576124fe612d61565b60200101906001600160f81b03191690815f1a9053506001016124ad565b5060028160405161252d9190612fcb565b602060405180830381855afa158015612548573d5f803e3d5ffd5b5050506040513d601f19601f8201168201806040525081019061256b91906129d1565b94909350915050565b60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b6125a2612119565b6121626126e2565b612162612119565b6125ba612119565b80355f8051602061302283398151915290815560208201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6015560408201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6025560608201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6035561265260a0830160808401612766565b60048201805467ffffffffffffffff19166001600160401b039290921691909117905561268560c0830160a08401612fe6565b60048201805460ff92909216600160e01b0260ff60e01b199092169190911790556126b660e0830160c08401613006565b8160040160086101000a8154816001600160a01b0302191690836001600160a01b031602179055505050565b612574612119565b5080546126f690612c4d565b5f825580601f10612705575050565b601f0160209004905f5260205f209081019061183e91905b80821115612730575f815560010161271d565b5090565b5f60208284031215612744575f80fd5b5035919050565b80356001600160401b0381168114612761575f80fd5b919050565b5f60208284031215612776575f80fd5b61277f8261274b565b9392505050565b801515811461183e575f80fd5b803563ffffffff81168114612761575f80fd5b5f805f606084860312156127b8575f80fd5b8335925060208401356127ca81612786565b91506127d860408501612793565b90509250925092565b5f60e082840312156127f1575f80fd5b50919050565b5f60208284031215612807575f80fd5b61277f82612793565b634e487b7160e01b5f52604160045260245ffd5b604051606081016001600160401b038111828210171561284657612846612810565b60405290565b604051601f8201601f191681016001600160401b038111828210171561287457612874612810565b604052919050565b5f6001600160401b0382111561289457612894612810565b50601f01601f191660200190565b5f805f606084860312156128b4575f80fd5b833592506128c46020850161274b565b915060408401356001600160401b038111156128de575f80fd5b8401601f810186136128ee575f80fd5b80356129016128fc8261287c565b61284c565b818152876020838501011115612915575f80fd5b816020840160208301375f602083830101528093505050509250925092565b5f8060408385031215612945575f80fd5b61294e83612793565b9150602083013561295e81612786565b809150509250929050565b634e487b7160e01b5f52602160045260245ffd5b5f5b8381101561299757818101518382015260200161297f565b50505f910152565b602081525f82518060208401526129bd81604085016020870161297d565b601f01601f19169190910160400192915050565b5f602082840312156129e1575f80fd5b5051919050565b634e487b7160e01b5f52601260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b5f82612a1e57612a1e6129e8565b500490565b8082028115828204841417610403576104036129fc565b6020808252602a908201527f5374616b696e674d616e616765723a2053656e646572206e6f742076616c696460408201526930ba37b91037bbb732b960b11b606082015260800190565b6001600160a01b038116811461183e575f80fd5b805161276181612786565b5f8060408385031215612ab4575f80fd5b82516001600160401b0380821115612aca575f80fd5b9084019060608287031215612add575f80fd5b612ae5612824565b82518152602080840151612af881612a84565b82820152604084015183811115612b0d575f80fd5b80850194505087601f850112612b21575f80fd5b83519250612b316128fc8461287c565b8381528882858701011115612b44575f80fd5b612b538483830184880161297d565b80604084015250819550612b68818801612a98565b9450505050509250929050565b60208082526024908201527f5374616b696e674d616e616765723a20496e76616c69642077617270206d65736040820152637361676560e01b606082015260800190565b60208082526027908201527f5374616b696e674d616e616765723a20496e76616c696420736f7572636520636040820152661a185a5b88125160ca1b606082015260800190565b6020808252602d908201527f5374616b696e674d616e616765723a20496e76616c6964206f726967696e207360408201526c656e646572206164647265737360981b606082015260800190565b600181811c90821680612c6157607f821691505b6020821081036127f157634e487b7160e01b5f52602260045260245ffd5b60208082526025908201527f5374616b696e674d616e616765723a20496e76616c69642076616c69646174696040820152641bdb88125160da1b606082015260800190565b5f60208083525f8454612cd681612c4d565b806020870152604060018084165f8114612cf75760018114612d1357612d40565b60ff19851660408a0152604084151560051b8a01019550612d40565b895f5260205f205f5b85811015612d375781548b8201860152908301908801612d1c565b8a016040019650505b509398975050505050505050565b81810381811115610403576104036129fc565b634e487b7160e01b5f52603260045260245ffd5b80820180821115610403576104036129fc565b6001600160401b03818116838216019080821115612da857612da86129fc565b5092915050565b6001600160401b03818116838216028082169190828114612dd257612dd26129fc565b505092915050565b5f6001600160401b0380841680612df357612df36129e8565b92169190910492915050565b60208082526027908201527f5374616b696e674d657373616765733a20496e76616c6964206d657373616765604082015266040d8cadccee8d60cb1b606082015260800190565b60208082526021908201527f5374616b696e674d657373616765733a20496e76616c696420636f64656320496040820152601160fa1b606082015260800190565b60208082526025908201527f5374616b696e674d657373616765733a20496e76616c6964206d657373616765604082015264207479706560d81b606082015260800190565b601f821115610e4a57805f5260205f20601f840160051c81016020851015612ef15750805b601f840160051c820191505b818110156103ec575f8155600101612efd565b81516001600160401b03811115612f2957612f29612810565b612f3d81612f378454612c4d565b84612ecc565b602080601f831160018114612f70575f8415612f595750858301515b5f19600386901b1c1916600185901b178555610aa6565b5f85815260208120601f198616915b82811015612f9e57888601518255948401946001909101908401612f7f565b5085821015612fbb57878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b5f8251612fdc81846020870161297d565b9190910192915050565b5f60208284031215612ff6575f80fd5b813560ff8116811461277f575f80fd5b5f60208284031215613016575f80fd5b813561277f81612a8456feafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab600a164736f6c6343000819000a", } // NativeTokenStakingManagerABI is the input ABI used to generate the binding from. diff --git a/contracts/staking/StakingManager.sol b/contracts/staking/StakingManager.sol index f3e7b6c9d..75482afff 100644 --- a/contracts/staking/StakingManager.sol +++ b/contracts/staking/StakingManager.sol @@ -120,18 +120,13 @@ abstract contract StakingManager is * @notice Begins the validator registration process. Locks the provided native asset in the contract as the stake. * @param nodeID The node ID of the validator being registered. * @param registrationExpiry The time at which the reigistration is no longer valid on the P-Chain. - * @param signature The raw bytes of the Ed25519 signature over the concatenated bytes of - * [subnetID]+[nodeID]+[blsPublicKey]+[weight]+[balance]+[expiry]. This signature must correspond to the Ed25519 - * public key that is used for the nodeID. This approach prevents NodeIDs from being unwillingly added to Subnets. - * balance is the minimum initial $nAVAX balance that must be attached to the validator serialized as a uint64. - * The signature field will be validated by the P-Chain. Implementations may choose to validate that the signature - * field is well-formed but it is not required. + * @param blsPublicKey The BLS public key of the validator. */ function _initializeValidatorRegistration( bytes32 nodeID, uint256 value, uint64 registrationExpiry, - bytes memory signature + bytes memory blsPublicKey ) internal nonReentrant returns (bytes32) { StakingManagerStorage storage $ = _getStakingManagerStorage(); @@ -144,12 +139,7 @@ abstract contract StakingManager is // Ensure the nodeID is not the zero address, and is not already an active validator. require(nodeID != bytes32(0), "StakingManager: Invalid node ID"); require($._activeValidators[nodeID] == bytes32(0), "StakingManager: Node ID already active"); - - // Ensure the signature is the proper length. The EVM does not provide an Ed25519 precompile to - // validate the signature, but the P-Chain will validate the signature. If the signature is invalid, - // the P-Chain will reject the registration, and the stake can be returned to the staker after the registration - // expiry has passed. - require(signature.length == 64, "StakingManager: Invalid signature length"); + require(blsPublicKey.length == 48, "StakingManager: Invalid blsPublicKey length"); // Lock the stake in the contract. uint256 lockedValue = _lock(value); @@ -170,8 +160,8 @@ abstract contract StakingManager is subnetID: $._subnetID, nodeID: nodeID, weight: weight, - registrationExpiry: registrationExpiry, - signature: signature + blsPublicKey: blsPublicKey, + registrationExpiry: registrationExpiry }) ); $._pendingRegisterValidationMessages[validationID] = registerSubnetValidatorMessage; diff --git a/contracts/staking/StakingMessages.sol b/contracts/staking/StakingMessages.sol index 20ac4deb4..8658af30a 100644 --- a/contracts/staking/StakingMessages.sol +++ b/contracts/staking/StakingMessages.sol @@ -7,13 +7,13 @@ pragma solidity 0.8.25; library StakingMessages { // The information that uniquely identifies a subnet validation period. // The validationID is the SHA-256 hash of the concatenation of the CODEC_ID, - // SUBNET_VALIDATOR_REGISTRATION_MESSAGE_TYPE_ID, and the concatenated ValidationInfo fields. + // REGISTER_SUBNET_VALIDATOR_MESSAGE_TYPE_ID, and the concatenated ValidationInfo fields. struct ValidationInfo { bytes32 subnetID; bytes32 nodeID; uint64 weight; uint64 registrationExpiry; - bytes signature; + bytes blsPublicKey; } // The P-Chain uses a hardcoded codecID of 0 for all messages. @@ -44,23 +44,23 @@ library StakingMessages { /** * @notice Packs a RegisterSubnetValidatorMessage message into a byte array. * The message format specification is: - * +-----------+----------+-----------+ - * | codecID : uint16 | 2 bytes | - * +-----------+----------+-----------+ - * | typeID : uint32 | 4 bytes | - * +-----------+----------+-----------+ - * | subnetID : [32]byte | 32 bytes | - * +-----------+----------+-----------+ - * | nodeID : [32]byte | 32 bytes | - * +-----------+----------+-----------+ - * | weight : uint64 | 8 bytes | - * +-----------+----------+-----------+ - * | expiry : uint64 | 8 bytes | - * +-----------+----------+-----------+ - * | signature : [64]byte | 64 bytes | - * +-----------+----------+-----------+ - * | 150 bytes | - * +-----------+ + * +--------------+----------+-----------+ + * | codecID : uint16 | 2 bytes | + * +--------------+----------+-----------+ + * | typeID : uint32 | 4 bytes | + * +--------------+----------+-----------+ + * | subnetID : [32]byte | 32 bytes | + * +--------------+----------+-----------+ + * | nodeID : [32]byte | 32 bytes | + * +--------------+----------+-----------+ + * | weight : uint64 | 8 bytes | + * +--------------+----------+-----------+ + * | blsPublicKey : [48]byte | 48 bytes | + * +--------------+----------+-----------+ + * | expiry : uint64 | 8 bytes | + * +--------------+----------+-----------+ + * | 134 bytes | + * +-----------+ * * @param validationInfo The information to pack into the message. * @return The validationID and the packed message. @@ -70,8 +70,8 @@ library StakingMessages { pure returns (bytes32, bytes memory) { - require(validationInfo.signature.length == 64, "StakingMessages: Invalid signature length"); - bytes memory res = new bytes(150); + require(validationInfo.blsPublicKey.length == 48, "StakingMessages: Invalid signature length"); + bytes memory res = new bytes(134); // Pack the codec ID for (uint256 i; i < 2; ++i) { res[i] = bytes1(uint8(CODEC_ID >> uint8((8 * (1 - i))))); @@ -79,7 +79,7 @@ library StakingMessages { // Pack the type ID for (uint256 i; i < 4; ++i) { res[i + 2] = - bytes1(uint8(SUBNET_VALIDATOR_REGISTRATION_MESSAGE_TYPE_ID >> uint8((8 * (3 - i))))); + bytes1(uint8(REGISTER_SUBNET_VALIDATOR_MESSAGE_TYPE_ID >> uint8((8 * (3 - i))))); } // Pack the subnetID @@ -94,13 +94,13 @@ library StakingMessages { for (uint256 i; i < 8; ++i) { res[i + 70] = bytes1(uint8(validationInfo.weight >> uint8((8 * (7 - i))))); } + // Pack the blsPublicKey + for (uint256 i; i < 48; ++i) { + res[i + 78] = validationInfo.blsPublicKey[i]; + } // Pack the registration expiry for (uint256 i; i < 8; ++i) { - res[i + 78] = bytes1(uint8(validationInfo.registrationExpiry >> uint64((8 * (7 - i))))); - } - // Pack the signature - for (uint256 i; i < 64; ++i) { - res[i + 86] = validationInfo.signature[i]; + res[i + 126] = bytes1(uint8(validationInfo.registrationExpiry >> uint64((8 * (7 - i))))); } return (sha256(res), res); } @@ -117,7 +117,7 @@ library StakingMessages { pure returns (ValidationInfo memory) { - require(input.length == 150, "StakingMessages: Invalid message length"); + require(input.length == 134, "StakingMessages: Invalid message length"); // Unpack the codec ID uint16 codecID; @@ -154,24 +154,25 @@ library StakingMessages { weight |= uint64(uint8(input[i + 70])) << uint64((8 * (7 - i))); } + // Unpack the blsPublicKey + bytes memory blsPublicKey = new bytes(48); + for (uint256 i; i < 48; ++i) { + blsPublicKey[i] = input[i + 78]; + } + // Unpack the registration expiry uint64 expiry; for (uint256 i; i < 8; ++i) { - expiry |= uint64(uint8(input[i + 78])) << uint64((8 * (7 - i))); + expiry |= uint64(uint8(input[i + 126])) << uint64((8 * (7 - i))); } - // Unpack the signature - bytes memory signature = new bytes(64); - for (uint256 i; i < 64; ++i) { - signature[i] = input[i + 86]; - } return ValidationInfo({ subnetID: subnetID, nodeID: nodeID, weight: weight, registrationExpiry: expiry, - signature: signature + blsPublicKey: blsPublicKey }); } diff --git a/contracts/staking/tests/StakingManagerTests.t.sol b/contracts/staking/tests/StakingManagerTests.t.sol index 171fad73a..148ebd254 100644 --- a/contracts/staking/tests/StakingManagerTests.t.sol +++ b/contracts/staking/tests/StakingManagerTests.t.sol @@ -19,8 +19,8 @@ abstract contract StakingManagerTest is Test { bytes32(hex"1234567812345678123456781234567812345678123456781234567812345678"); bytes32 public constant DEFAULT_NODE_ID = bytes32(hex"1234567812345678123456781234567812345678123456781234567812345678"); - bytes public constant DEFAULT_ED25519_SIGNATURE = bytes( - hex"12345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678" + bytes public constant DEFAULT_BLS_PUBLIC_KEY = bytes( + hex"123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678" ); address public constant WARP_PRECOMPILE_ADDRESS = 0x0200000000000000000000000000000000000005; @@ -63,7 +63,7 @@ abstract contract StakingManagerTest is Test { DEFAULT_SUBNET_ID, DEFAULT_WEIGHT, DEFAULT_EXPIRY, - DEFAULT_ED25519_SIGNATURE + DEFAULT_BLS_PUBLIC_KEY ); } @@ -92,7 +92,7 @@ abstract contract StakingManagerTest is Test { DEFAULT_SUBNET_ID, DEFAULT_WEIGHT, DEFAULT_EXPIRY, - DEFAULT_ED25519_SIGNATURE + DEFAULT_BLS_PUBLIC_KEY ); (, bytes memory registerSubnetValidatorMessage) = StakingMessages .packRegisterSubnetValidatorMessage( @@ -101,7 +101,7 @@ abstract contract StakingManagerTest is Test { nodeID: DEFAULT_NODE_ID, weight: DEFAULT_WEIGHT, registrationExpiry: DEFAULT_EXPIRY, - signature: DEFAULT_ED25519_SIGNATURE + blsPublicKey: DEFAULT_BLS_PUBLIC_KEY }) ); _mockSendWarpMessage(registerSubnetValidatorMessage, bytes32(0)); @@ -114,7 +114,7 @@ abstract contract StakingManagerTest is Test { subnetID: DEFAULT_SUBNET_ID, weight: DEFAULT_WEIGHT, registrationExpiry: DEFAULT_EXPIRY, - signature: DEFAULT_ED25519_SIGNATURE, + blsPublicKey: DEFAULT_BLS_PUBLIC_KEY, registrationTimestamp: DEFAULT_REGISTRATION_TIMESTAMP }); } @@ -125,7 +125,7 @@ abstract contract StakingManagerTest is Test { subnetID: DEFAULT_SUBNET_ID, weight: DEFAULT_WEIGHT, registrationExpiry: DEFAULT_EXPIRY, - signature: DEFAULT_ED25519_SIGNATURE, + blsPublicKey: DEFAULT_BLS_PUBLIC_KEY, registrationTimestamp: DEFAULT_REGISTRATION_TIMESTAMP, completionTimestamp: DEFAULT_COMPLETION_TIMESTAMP }); @@ -145,7 +145,7 @@ abstract contract StakingManagerTest is Test { subnetID: DEFAULT_SUBNET_ID, weight: DEFAULT_WEIGHT, registrationExpiry: DEFAULT_EXPIRY, - signature: DEFAULT_ED25519_SIGNATURE, + blsPublicKey: DEFAULT_BLS_PUBLIC_KEY, registrationTimestamp: DEFAULT_REGISTRATION_TIMESTAMP, completionTimestamp: DEFAULT_COMPLETION_TIMESTAMP }); @@ -161,7 +161,7 @@ abstract contract StakingManagerTest is Test { subnetID: DEFAULT_SUBNET_ID, weight: DEFAULT_WEIGHT, registrationExpiry: DEFAULT_EXPIRY, - signature: DEFAULT_ED25519_SIGNATURE, + blsPublicKey: DEFAULT_BLS_PUBLIC_KEY, registrationTimestamp: DEFAULT_REGISTRATION_TIMESTAMP, completionTimestamp: DEFAULT_COMPLETION_TIMESTAMP }); @@ -183,7 +183,7 @@ abstract contract StakingManagerTest is Test { subnetID: DEFAULT_SUBNET_ID, weight: DEFAULT_WEIGHT, registrationExpiry: DEFAULT_EXPIRY, - signature: DEFAULT_ED25519_SIGNATURE, + blsPublicKey: DEFAULT_BLS_PUBLIC_KEY, registrationTimestamp: DEFAULT_REGISTRATION_TIMESTAMP, completionTimestamp: DEFAULT_COMPLETION_TIMESTAMP }); @@ -224,15 +224,15 @@ abstract contract StakingManagerTest is Test { bytes32 subnetID, uint64 weight, uint64 registrationExpiry, - bytes memory signature + bytes memory blsPublicKey ) internal returns (bytes32 validationID) { - (validationID,) = StakingMessages.packValidationInfo( + (validationID,) = StakingMessages.packRegisterSubnetValidatorMessage( StakingMessages.ValidationInfo({ nodeID: nodeID, subnetID: subnetID, weight: weight, registrationExpiry: registrationExpiry, - signature: signature + blsPublicKey: blsPublicKey }) ); (, bytes memory registerSubnetValidatorMessage) = StakingMessages @@ -242,7 +242,7 @@ abstract contract StakingManagerTest is Test { nodeID: nodeID, weight: weight, registrationExpiry: registrationExpiry, - signature: signature + blsPublicKey: blsPublicKey }) ); vm.warp(DEFAULT_EXPIRY - 1); @@ -255,7 +255,7 @@ abstract contract StakingManagerTest is Test { ); _initializeValidatorRegistration( - nodeID, registrationExpiry, signature, stakingManager.weightToValue(weight) + nodeID, registrationExpiry, blsPublicKey, stakingManager.weightToValue(weight) ); } @@ -264,11 +264,11 @@ abstract contract StakingManagerTest is Test { bytes32 subnetID, uint64 weight, uint64 registrationExpiry, - bytes memory signature, + bytes memory blsPublicKey, uint64 registrationTimestamp ) internal returns (bytes32 validationID) { validationID = _setUpInitializeValidatorRegistration( - nodeID, subnetID, weight, registrationExpiry, signature + nodeID, subnetID, weight, registrationExpiry, blsPublicKey ); bytes memory subnetValidatorRegistrationMessage = StakingMessages.packSubnetValidatorRegistrationMessage(validationID, true); @@ -287,7 +287,7 @@ abstract contract StakingManagerTest is Test { bytes32 subnetID, uint64 weight, uint64 registrationExpiry, - bytes memory signature, + bytes memory blsPublicKey, uint64 registrationTimestamp, uint64 completionTimestamp ) internal returns (bytes32 validationID) { @@ -296,7 +296,7 @@ abstract contract StakingManagerTest is Test { subnetID: subnetID, weight: weight, registrationExpiry: registrationExpiry, - signature: signature, + blsPublicKey: blsPublicKey, registrationTimestamp: registrationTimestamp }); @@ -342,7 +342,7 @@ abstract contract StakingManagerTest is Test { function _initializeValidatorRegistration( bytes32 nodeID, uint64 registrationExpiry, - bytes memory signature, + bytes memory blsPublicKey, uint256 stakeAmount ) internal virtual returns (bytes32); diff --git a/contracts/staking/tests/StakingMessagesTests.t.sol b/contracts/staking/tests/StakingMessagesTests.t.sol index 0367f5acf..5f730f64b 100644 --- a/contracts/staking/tests/StakingMessagesTests.t.sol +++ b/contracts/staking/tests/StakingMessagesTests.t.sol @@ -13,8 +13,8 @@ contract StakingMessagesTest is Test { bytes32(hex"1234567812345678123456781234567812345678123456781234567812345678"); bytes32 public constant DEFAULT_NODE_ID = bytes32(hex"1234567812345678123456781234567812345678123456781234567812345678"); - bytes public constant DEFAULT_ED25519_SIGNATURE = bytes( - hex"12345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678" + bytes public constant DEFAULT_BLS_PUBLIC_KEY = bytes( + hex"123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678" ); bytes32 public constant DEFAULT_VALIDATION_ID = bytes32(hex"1234567812345678123456781234567812345678123456781234567812345678"); @@ -29,7 +29,7 @@ contract StakingMessagesTest is Test { nodeID: DEFAULT_NODE_ID, weight: DEFAULT_WEIGHT, registrationExpiry: DEFAULT_EXPIRY, - signature: DEFAULT_ED25519_SIGNATURE + blsPublicKey: DEFAULT_BLS_PUBLIC_KEY }) ); @@ -39,7 +39,7 @@ contract StakingMessagesTest is Test { assertEq(info.nodeID, DEFAULT_NODE_ID); assertEq(info.weight, DEFAULT_WEIGHT); assertEq(info.registrationExpiry, DEFAULT_EXPIRY); - assertEq(info.signature, DEFAULT_ED25519_SIGNATURE); + assertEq(info.blsPublicKey, DEFAULT_BLS_PUBLIC_KEY); (bytes32 recoveredID,) = StakingMessages.packRegisterSubnetValidatorMessage(info); assertEq(recoveredID, validationID); diff --git a/tests/flows/native_token_staking.go b/tests/flows/native_token_staking.go index ff71bee4d..789872b78 100644 --- a/tests/flows/native_token_staking.go +++ b/tests/flows/native_token_staking.go @@ -114,12 +114,12 @@ func NativeTokenStakingManager(network interfaces.LocalNetwork) { opts.Value = big.NewInt(0).SetUint64(1e18) nodeID := ids.GenerateTestID() - signature := [64]byte{} + blsPublicKey := [48]byte{} tx, err = stakingManager.InitializeValidatorRegistration( opts, nodeID, uint64(time.Now().Add(24*time.Hour).Unix()), - signature[:], + blsPublicKey[:], ) Expect(err).Should(BeNil()) receipt := utils.WaitForTransactionSuccess(context.Background(), subnetAInfo, tx.Hash()) @@ -136,16 +136,20 @@ func NativeTokenStakingManager(network interfaces.LocalNetwork) { Expect(err).Should(BeNil()) log.Info("Constructed signed RegisterSubnetValidator message", "message", signedWarpMessage) // Validate the Warp message, (this will be done on the P-Chain in the future) - // msg, err := warpPayload.ParseAddressedCall(signedWarpMessage.UnsignedMessage.Payload) - // Expect(err).Should(BeNil()) - // // Check that the addressed call payload is a registered Warp message type - // var registerValidatorPayload warpMessages.RegisterSubnetValidator - // ver, err := warpMessages.Codec.Unmarshal(msg.Payload, ®isterValidatorPayload) - // Expect(err).Should(BeNil()) - // Expect(ver).Should(Equal(uint16(warpMessages.CodecVersion))) - // Expect(registerValidatorPayload.NodeID).Should(Equal(nodeID)) - // Expect(registerValidatorPayload.Weight).Should(Equal(1e18)) - // Expect(registerValidatorPayload.SubnetID).Should(Equal(subnetAInfo.SubnetID)) + msg, err := warpPayload.ParseAddressedCall(signedWarpMessage.UnsignedMessage.Payload) + Expect(err).Should(BeNil()) + // Check that the addressed call payload is a registered Warp message type + var payloadInterface warpMessages.Payload + ver, err := warpMessages.Codec.Unmarshal(msg.Payload, &payloadInterface) + Expect(err).Should(BeNil()) + registerValidatorPayload, ok := payloadInterface.(*warpMessages.RegisterSubnetValidator) + Expect(ok).Should(BeTrue()) + + Expect(ver).Should(Equal(uint16(warpMessages.CodecVersion))) + Expect(registerValidatorPayload.NodeID).Should(Equal(nodeID)) + Expect(registerValidatorPayload.Weight).Should(Equal(uint64(1e6))) + Expect(registerValidatorPayload.SubnetID).Should(Equal(subnetAInfo.SubnetID)) + Expect(registerValidatorPayload.BlsPubKey[:]).Should(Equal(blsPublicKey[:])) // Construct a SubnetValidatorRegistrationMessage Warp message from the P-Chain // Query P-Chain validators for the Warp message From 79104a6422d2e5e78bcd3a98755e693228fb5a59 Mon Sep 17 00:00:00 2001 From: cam-schultz Date: Thu, 15 Aug 2024 11:52:26 -0400 Subject: [PATCH 11/27] delist validator working --- .../ERC20TokenStakingManager.go | 2 +- .../NativeTokenStakingManager.go | 2 +- contracts/staking/StakingManager.sol | 4 +- tests/flows/native_token_staking.go | 92 +++++++++++++++++++ 4 files changed, 97 insertions(+), 3 deletions(-) diff --git a/abi-bindings/go/staking/ERC20TokenStakingManager/ERC20TokenStakingManager.go b/abi-bindings/go/staking/ERC20TokenStakingManager/ERC20TokenStakingManager.go index cc95f36e9..3d8f473e9 100644 --- a/abi-bindings/go/staking/ERC20TokenStakingManager/ERC20TokenStakingManager.go +++ b/abi-bindings/go/staking/ERC20TokenStakingManager/ERC20TokenStakingManager.go @@ -43,7 +43,7 @@ type StakingManagerSettings struct { // ERC20TokenStakingManagerMetaData contains all meta data concerning the ERC20TokenStakingManager contract. var ERC20TokenStakingManagerMetaData = &bind.MetaData{ ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"init\",\"type\":\"uint8\",\"internalType\":\"enumICMInitializable\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"WARP_MESSENGER\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIWarpMessenger\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"completeEndValidation\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"setWeightMessageType\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"completeValidatorRegistration\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"settings\",\"type\":\"tuple\",\"internalType\":\"structStakingManagerSettings\",\"components\":[{\"name\":\"pChainBlockchainID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"subnetID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"minimumStakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"maximumStakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"minimumStakeDuration\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"maximumHourlyChurn\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"rewardCalculator\",\"type\":\"address\",\"internalType\":\"contractIRewardCalculator\"}]},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeEndValidation\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"includeUptimeProof\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeValidatorRegistration\",\"inputs\":[{\"name\":\"stakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"nodeID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"resendEndValidatorMessage\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"resendRegisterValidatorMessage\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"valueToWeight\",\"inputs\":[{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"weightToValue\",\"inputs\":[{\"name\":\"weight\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"pure\"},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodCreated\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"nodeID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"registerValidationMessageID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"weight\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodEnded\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodRegistered\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"stakeAmount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"timestamp\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidatorRemovalInitialized\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"setWeightMessageID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"stakeAmount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"endTime\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"uptime\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ReentrancyGuardReentrantCall\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"SafeERC20FailedOperation\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}]}]", - Bin: "0x608060405234801561000f575f80fd5b506040516134a03803806134a083398101604081905261002e91610107565b60018160018111156100425761004261012c565b0361004f5761004f610055565b50610140565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156100a55760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146101045780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b5f60208284031215610117575f80fd5b815160028110610125575f80fd5b9392505050565b634e487b7160e01b5f52602160045260245ffd5b6133538061014d5f395ff3fe608060405234801561000f575f80fd5b506004361061009b575f3560e01c8063872fda6411610063578063872fda641461012b578063a3a65e481461013e578063b771b3bc14610151578063bee0a03f14610177578063fdf94a1a1461018a575f80fd5b80630322ed981461009f5780632e2194d8146100b45780635d0d7466146100e457806362065856146100f757806376f7862114610118575b5f80fd5b6100b26100ad366004612a09565b61019d565b005b6100c76100c2366004612a09565b610393565b6040516001600160401b0390911681526020015b60405180910390f35b6100b26100f2366004612a34565b6103a9565b61010a610105366004612a8c565b6104b7565b6040519081526020016100db565b6100b2610126366004612acc565b6104d0565b61010a610139366004612b99565b610a50565b6100b261014c366004612c35565b610a68565b61015f6005600160991b0181565b6040516001600160a01b0390911681526020016100db565b6100b2610185366004612a09565b610cf5565b6100b2610198366004612c4e565b610e09565b5f8181527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab60860205260408082208151610120810190925280545f8051602061332783398151915293929190829060ff1660058111156101fe576101fe612c78565b600581111561020f5761020f612c78565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003928301546001600160a01b03811660c084015260ff600160a01b820416151560e0840152600160a81b90041661010090910152909150815160058111156102a6576102a6612c78565b1461030e5760405162461bcd60e51b815260206004820152602d60248201527f5374616b696e674d616e616765723a2056616c696461746f72206e6f7420706560448201526c1b991a5b99c81c995b5bdd985b609a1b60648201526084015b60405180910390fd5b5f61031f848361010001515f611230565b60405163ee5b48eb60e01b81529091506005600160991b019063ee5b48eb9061034c908490600401612cae565b6020604051808303815f875af1158015610368573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061038c9190612ce0565b5050505050565b5f6103a364e8d4a5100083612d1f565b92915050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff1615906001600160401b03165f811580156103ed5750825b90505f826001600160401b031660011480156104085750303b155b905081158015610416575080155b156104345760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561045e57845460ff60401b1916600160401b1785555b610468878761144d565b83156104ae57845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50505050505050565b5f6103a36001600160401b03831664e8d4a51000612d32565b5f8381527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab60860205260408082208151610120810190925280545f8051602061332783398151915293929190829060ff16600581111561053157610531612c78565b600581111561054257610542612c78565b8152600182015460208201526002808301546001600160401b038082166040850152600160401b820481166060850152600160801b820481166080850152600160c01b909104811660a08401526003909301546001600160a01b03811660c084015260ff600160a01b820416151560e0840152600160a81b900490921661010090910152909150815160058111156105dc576105dc612c78565b146106355760405162461bcd60e51b8152602060048201526024808201527f5374616b696e674d616e616765723a2056616c696461746f72206e6f742061636044820152637469766560e01b6064820152608401610305565b60c08101516001600160a01b0316336001600160a01b03161461066a5760405162461bcd60e51b815260040161030590612d49565b610677816040015161146b565b60038152426001600160401b031660808201525f8415610850576040516306f8253560e41b815263ffffffff851660048201525f9081906005600160991b0190636f825350906024015f60405180830381865afa1580156106da573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f191682016040526107019190810190612d9e565b91509150806107225760405162461bcd60e51b815260040161030590612e70565b6005600160991b016001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa158015610765573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107899190612ce0565b8251146107a85760405162461bcd60e51b815260040161030590612eb4565b60208201516001600160a01b0316156107d35760405162461bcd60e51b815260040161030590612efb565b5f806107e28460400151611618565b91509150818a1461084a5760405162461bcd60e51b815260206004820152602c60248201527f5374616b696e674d616e616765723a20496e76616c696420757074696d65207660448201526b185b1a59185d1a5bdb88125160a21b6064820152608401610305565b93505050505b6001600160401b03811660a08301525f86815260088401602052604090208251815484929190829060ff1916600183600581111561089057610890612c78565b02179055506020820151600182015560408201516002820180546060850151608086015160a08701516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c08301516003909201805460e0850151610100958601516001600160a01b039095166001600160a81b031990921691909117600160a01b911515919091021767ffffffffffffffff60a81b1916600160a81b93909216929092021790558201515f9061098190889083611230565b60405163ee5b48eb60e01b81529091505f906005600160991b019063ee5b48eb906109b0908590600401612cae565b6020604051808303815f875af11580156109cc573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109f09190612ce0565b60408581015181516001600160401b03918216815242602082015290861681830152905191925082918a917f530b908725650fb1052974f9df59e834fefac78c9ec2f00c6d2464d60cc6add5919081900360600190a35050505050505050565b5f610a5d848685856117f0565b90505b949350505050565b5f5f805160206133278339815191526040516306f8253560e41b815263ffffffff841660048201529091505f9081906005600160991b0190636f825350906024015f60405180830381865afa158015610ac3573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052610aea9190810190612d9e565b9150915080610b0b5760405162461bcd60e51b815260040161030590612e70565b8254825114610b2c5760405162461bcd60e51b815260040161030590612eb4565b60208201516001600160a01b031615610b575760405162461bcd60e51b815260040161030590612efb565b5f80610b668460400151611cf7565b9150915080610bc65760405162461bcd60e51b815260206004820152602660248201527f5374616b696e674d616e616765723a20526567697374726174696f6e206e6f74604482015265081d985b1a5960d21b6064820152608401610305565b5f82815260078601602052604081208054610be090612f48565b9050118015610c12575060015f83815260088701602052604090205460ff166005811115610c1057610c10612c78565b145b610c2e5760405162461bcd60e51b815260040161030590612f80565b5f8281526007860160205260408120610c46916129bf565b5f8281526008860160208181526040808420805460ff191660029081178255810180546001600160401b0342818116600160401b026fffffffffffffffff000000000000000019909316929092178355600190930154875260098c0185528387208990559588905293835292548151931683529082019290925283917ff8fd1c90fb9cfa2ca2358fdf5806b086ad43315d92b221c929efc7f105ce7568910160405180910390a2505050505050565b5f8181527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6076020526040812080545f80516020613327833981519152929190610d3d90612f48565b9050118015610d6f575060015f83815260088301602052604090205460ff166005811115610d6d57610d6d612c78565b145b610d8b5760405162461bcd60e51b815260040161030590612f80565b5f82815260078201602052604090819020905163ee5b48eb60e01b81526005600160991b019163ee5b48eb91610dc49190600401612fc5565b6020604051808303815f875af1158015610de0573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e049190612ce0565b505050565b5f5f805160206133278339815191526040516306f8253560e41b815263ffffffff851660048201529091505f9081906005600160991b0190636f825350906024015f60405180830381865afa158015610e64573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052610e8b9190810190612d9e565b9150915080610eac5760405162461bcd60e51b815260040161030590612e70565b5f8415610f25575f610ec18460400151611e98565b919350909150506001600160401b03811615610f1f5760405162461bcd60e51b815260206004820181905260248201527f5374616b696e674d616e616765723a20576569676874206d75737420626520306044820152606401610305565b50610f99565b5f610f338460400151611cf7565b90925090508015610f975760405162461bcd60e51b815260206004820152602860248201527f5374616b696e674d616e616765723a20526567697374726174696f6e207374696044820152671b1b081d985b1a5960c21b6064820152608401610305565b505b5f818152600885016020526040808220815161012081019092528054829060ff166005811115610fcb57610fcb612c78565b6005811115610fdc57610fdc612c78565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003909201546001600160a01b0380821660c080850191909152600160a01b830460ff16151560e0850152600160a81b9092049093166101009092019190915282015191925016331461108d5760405162461bcd60e51b815260040161030590612d49565b5f6003825160058111156110a3576110a3612c78565b14806110c157506002825160058111156110bf576110bf612c78565b145b156110e457506020808201515f90815260098701909152604081205560046110e8565b5060055b5f83815260088701602052604090208251815484929190829060ff1916600183600581111561111957611119612c78565b0217905550602082015160018201556040808301516002830180546060860151608087015160a08801516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c08401516003909301805460e0860151610100909601516001600160a01b039095166001600160a81b031990911617600160a01b951515959095029490941767ffffffffffffffff60a81b1916600160a81b9390911692909202919091179091555183907f3532ad18e70a039beb4663d48c15acbef558c96ec9b8fd0cc3c0304f774740b8905f90a25050505050505050565b60408051603680825260608281019093525f91906020820181803683370190505090505f5b60028110156112a95761126981600161304f565b611274906008612d32565b5081515f9083908390811061128b5761128b613062565b60200101906001600160f81b03191690815f1a905350600101611255565b505f5b600481101561130c576112c081600361304f565b6112cb906008612d32565b6001901c60f81b826112de836002613076565b815181106112ee576112ee613062565b60200101906001600160f81b03191690815f1a9053506001016112ac565b505f5b602081101561136e5761132381601f61304f565b61132e906008612d32565b86901c60f81b82611340836006613076565b8151811061135057611350613062565b60200101906001600160f81b03191690815f1a90535060010161130f565b505f5b60088110156113d95761138581600761304f565b611390906008612d32565b6001600160401b038616901c60f81b826113ab836026613076565b815181106113bb576113bb613062565b60200101906001600160f81b03191690815f1a905350600101611371565b505f5b6008811015611444576113f081600761304f565b6113fb906008612d32565b6001600160401b038516901c60f81b8261141683602e613076565b8151811061142657611426613062565b60200101906001600160f81b03191690815f1a9053506001016113dc565b50949350505050565b6114556120d3565b61145e8261211e565b61146781612142565b5050565b7fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab604545f8051602061332783398151915290600160e01b900460ff165f036114b0575050565b60408051606081018252600583015480825260068401546001600160401b038082166020850152600160401b9091041692820192909252904290610e10906114f8908361304f565b10611514576001600160401b0384166040830152808252611533565b83826040018181516115269190613089565b6001600160401b03169052505b5f82602001518360400151606461154a91906130b0565b61155491906130db565b600485015490915060ff600160e01b909104811690821611156115d45760405162461bcd60e51b815260206004820152603260248201527f5374616b696e674d616e616765723a204d6178696d756d20686f75726c7920636044820152711a1d5c9b881c985d1948195e18d95959195960721b6064820152608401610305565b5050805160058301556020810151600690920180546040909201516001600160401b03908116600160401b026001600160801b031990931693169290921717905550565b5f808251602e1461163b5760405162461bcd60e51b815260040161030590613100565b5f805b600281101561168a5761165281600161304f565b61165d906008612d32565b61ffff1685828151811061167357611673613062565b016020015160f81c901b919091179060010161163e565b5061ffff8116156116ad5760405162461bcd60e51b815260040161030590613147565b5f805b6004811015611708576116c481600361304f565b6116cf906008612d32565b63ffffffff16866116e1836002613076565b815181106116f1576116f1613062565b016020015160f81c901b91909117906001016116b0565b5063ffffffff811660041461172f5760405162461bcd60e51b815260040161030590613188565b5f805b60208110156117845761174681601f61304f565b611751906008612d32565b8761175d836006613076565b8151811061176d5761176d613062565b016020015160f81c901b9190911790600101611732565b505f805b60088110156117e35761179c81600761304f565b6117a7906008612d32565b6001600160401b0316886117bc836026613076565b815181106117cc576117cc613062565b016020015160f81c901b9190911790600101611788565b5090969095509350505050565b5f6117f96121f6565b5f80516020613327833981519152426001600160401b03851611801561183357506001600160401b038416611831426202a300613076565b115b6118935760405162461bcd60e51b815260206004820152602b60248201527f5374616b696e674d616e616765723a20496e76616c696420726567697374726160448201526a74696f6e2065787069727960a81b6064820152608401610305565b856118e05760405162461bcd60e51b815260206004820152601f60248201527f5374616b696e674d616e616765723a20496e76616c6964206e6f6465204944006044820152606401610305565b5f8681526009820160205260409020541561194c5760405162461bcd60e51b815260206004820152602660248201527f5374616b696e674d616e616765723a204e6f646520494420616c72656164792060448201526561637469766560d01b6064820152608401610305565b82516030146119b15760405162461bcd60e51b815260206004820152602b60248201527f5374616b696e674d616e616765723a20496e76616c696420626c735075626c6960448201526a0c696caf240d8cadccee8d60ab1b6064820152608401610305565b5f6119bb86612240565b90505f6119c782610393565b90508260020154816001600160401b0316101580156119f357508260030154816001600160401b031611155b611a4b5760405162461bcd60e51b8152602060048201526024808201527f5374616b696e674d616e616765723a20496e76616c6964207374616b6520616d6044820152631bdd5b9d60e21b6064820152608401610305565b5f80611a926040518060a00160405280876001015481526020018c8152602001856001600160401b031681526020018a6001600160401b0316815260200189815250612276565b5f82815260078801602052604090209193509150611ab08282613211565b5060405163ee5b48eb60e01b81525f906005600160991b019063ee5b48eb90611add908590600401612cae565b6020604051808303815f875af1158015611af9573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611b1d9190612ce0565b6040805161012081019091529091508060018152602081018d90526001600160401b03861660408201525f606082018190526080820181905260a082015260c001336001600160a01b031681525f6020808301829052604092830182905286825260088a0190522081518154829060ff19166001836005811115611ba357611ba3612c78565b021790555060208281015160018301556040808401516002840180546060870151608088015160a08901516001600160401b03908116600160c01b026001600160c01b03928216600160801b02929092166001600160801b03938216600160401b026001600160801b03199095169682169690961793909317919091169390931792909217905560c08501516003909401805460e0870151610100909701518316600160a81b0267ffffffffffffffff60a81b19971515600160a01b026001600160a81b03199092166001600160a01b039097169690961717959095169390931790935582518783168152918c169082015282918d9186917f79b81620b81daf2c08cd5bb3dbb79e75d2d7a87f52171fde5aadc8c47823026e910160405180910390a45090945050505050610a6060017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b5f808251602714611d1a5760405162461bcd60e51b815260040161030590613100565b5f805b6002811015611d6957611d3181600161304f565b611d3c906008612d32565b61ffff16858281518110611d5257611d52613062565b016020015160f81c901b9190911790600101611d1d565b5061ffff811615611d8c5760405162461bcd60e51b815260040161030590613147565b5f805b6004811015611de757611da381600361304f565b611dae906008612d32565b63ffffffff1686611dc0836002613076565b81518110611dd057611dd0613062565b016020015160f81c901b9190911790600101611d8f565b5063ffffffff8116600214611e0e5760405162461bcd60e51b815260040161030590613188565b5f805b6020811015611e6357611e2581601f61304f565b611e30906008612d32565b87611e3c836006613076565b81518110611e4c57611e4c613062565b016020015160f81c901b9190911790600101611e11565b505f86602681518110611e7857611e78613062565b016020015191976001600160f81b03199092161515965090945050505050565b5f805f8351603614611ebc5760405162461bcd60e51b815260040161030590613100565b5f805b6002811015611f0b57611ed381600161304f565b611ede906008612d32565b61ffff16868281518110611ef457611ef4613062565b016020015160f81c901b9190911790600101611ebf565b5061ffff811615611f2e5760405162461bcd60e51b815260040161030590613147565b5f805b6004811015611f8957611f4581600361304f565b611f50906008612d32565b63ffffffff1687611f62836002613076565b81518110611f7257611f72613062565b016020015160f81c901b9190911790600101611f31565b5063ffffffff8116600114611fb05760405162461bcd60e51b815260040161030590613188565b5f805b602081101561200557611fc781601f61304f565b611fd2906008612d32565b88611fde836006613076565b81518110611fee57611fee613062565b016020015160f81c901b9190911790600101611fb3565b505f805b60088110156120645761201d81600761304f565b612028906008612d32565b6001600160401b03168961203d836026613076565b8151811061204d5761204d613062565b016020015160f81c901b9190911790600101612009565b505f805b60088110156120c35761207c81600761304f565b612087906008612d32565b6001600160401b03168a61209c83602e613076565b815181106120ac576120ac613062565b016020015160f81c901b9190911790600101612068565b5091989097509095509350505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff1661211c57604051631afcd79f60e31b815260040160405180910390fd5b565b6121266120d3565b61212e612641565b612136612651565b61213f81612659565b50565b61214a6120d3565b7f8568826440873e37a96cb0aab773b28d8154d963d2f0e41bd9b5c15f63625f916001600160a01b0382166121d65760405162461bcd60e51b815260206004820152602c60248201527f4552433230546f6b656e5374616b696e674d616e616765723a207a65726f207460448201526b6f6b656e206164647265737360a01b6064820152608401610305565b80546001600160a01b0319166001600160a01b0392909216919091179055565b7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0080546001190161223a57604051633ee5aeb560e01b815260040160405180910390fd5b60029055565b5f6103a3827f8568826440873e37a96cb0aab773b28d8154d963d2f0e41bd9b5c15f63625f91546001600160a01b031690612789565b5f60608260800151516030146122e05760405162461bcd60e51b815260206004820152602960248201527f5374616b696e674d657373616765733a20496e76616c6964207369676e6174756044820152680e4ca40d8cadccee8d60bb1b6064820152608401610305565b60408051608680825260c082019092525f916020820181803683370190505090505f5b60028110156123575761231781600161304f565b612322906008612d32565b5081515f9083908390811061233957612339613062565b60200101906001600160f81b03191690815f1a905350600101612303565b505f5b60048110156123b55761236e81600361304f565b612379906008612d32565b505f82612387836002613076565b8151811061239757612397613062565b60200101906001600160f81b03191690815f1a90535060010161235a565b505f5b602081101561241257845181602081106123d4576123d4613062565b1a60f81b826123e4836006613076565b815181106123f4576123f4613062565b60200101906001600160f81b03191690815f1a9053506001016123b8565b505f5b6020811015612472578460200151816020811061243457612434613062565b1a60f81b82612444836026613076565b8151811061245457612454613062565b60200101906001600160f81b03191690815f1a905350600101612415565b505f5b60088110156124e65761248981600761304f565b612494906008612d32565b60ff1685604001516001600160401b0316901c60f81b828260466124b89190613076565b815181106124c8576124c8613062565b60200101906001600160f81b03191690815f1a905350600101612475565b505f5b6030811015612551578460800151818151811061250857612508613062565b01602001516001600160f81b0319168261252383604e613076565b8151811061253357612533613062565b60200101906001600160f81b03191690815f1a9053506001016124e9565b505f5b60088110156125c35761256881600761304f565b612573906008612d32565b60608601516001600160401b0390811691161c60f81b8261259583607e613076565b815181106125a5576125a5613062565b60200101906001600160f81b03191690815f1a905350600101612554565b506002816040516125d491906132d0565b602060405180830381855afa1580156125ef573d5f803e3d5ffd5b5050506040513d601f19601f820116820180604052508101906126129190612ce0565b94909350915050565b60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b6126496120d3565b61211c6128eb565b61211c6120d3565b6126616120d3565b80355f8051602061332783398151915290815560208201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6015560408201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6025560608201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab603556126f960a0830160808401612a8c565b60048201805467ffffffffffffffff19166001600160401b039290921691909117905561272c60c0830160a084016132eb565b60048201805460ff92909216600160e01b0260ff60e01b1990921691909117905561275d60e0830160c0840161330b565b8160040160086101000a8154816001600160a01b0302191690836001600160a01b031602179055505050565b6040516370a0823160e01b81523060048201525f9081906001600160a01b038516906370a0823190602401602060405180830381865afa1580156127cf573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906127f39190612ce0565b905061280a6001600160a01b0385163330866128f3565b6040516370a0823160e01b81523060048201525f906001600160a01b038616906370a0823190602401602060405180830381865afa15801561284e573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906128729190612ce0565b90508181116128d85760405162461bcd60e51b815260206004820152602c60248201527f5361666545524332305472616e7366657246726f6d3a2062616c616e6365206e60448201526b1bdd081a5b98dc99585cd95960a21b6064820152608401610305565b6128e2828261304f565b95945050505050565b61261b6120d3565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b17905261294d908590612953565b50505050565b5f8060205f8451602086015f885af180612972576040513d5f823e3d81fd5b50505f513d91508115612989578060011415612996565b6001600160a01b0384163b155b1561294d57604051635274afe760e01b81526001600160a01b0385166004820152602401610305565b5080546129cb90612f48565b5f825580601f106129da575050565b601f0160209004905f5260205f209081019061213f91905b80821115612a05575f81556001016129f2565b5090565b5f60208284031215612a19575f80fd5b5035919050565b6001600160a01b038116811461213f575f80fd5b5f80828403610100811215612a47575f80fd5b60e0811215612a54575f80fd5b5082915060e0830135612a6681612a20565b809150509250929050565b80356001600160401b0381168114612a87575f80fd5b919050565b5f60208284031215612a9c575f80fd5b612aa582612a71565b9392505050565b801515811461213f575f80fd5b803563ffffffff81168114612a87575f80fd5b5f805f60608486031215612ade575f80fd5b833592506020840135612af081612aac565b9150612afe60408501612ab9565b90509250925092565b634e487b7160e01b5f52604160045260245ffd5b604051606081016001600160401b0381118282101715612b3d57612b3d612b07565b60405290565b604051601f8201601f191681016001600160401b0381118282101715612b6b57612b6b612b07565b604052919050565b5f6001600160401b03821115612b8b57612b8b612b07565b50601f01601f191660200190565b5f805f8060808587031215612bac575f80fd5b8435935060208501359250612bc360408601612a71565b915060608501356001600160401b03811115612bdd575f80fd5b8501601f81018713612bed575f80fd5b8035612c00612bfb82612b73565b612b43565b818152886020838501011115612c14575f80fd5b816020840160208301375f6020838301015280935050505092959194509250565b5f60208284031215612c45575f80fd5b612aa582612ab9565b5f8060408385031215612c5f575f80fd5b612c6883612ab9565b91506020830135612a6681612aac565b634e487b7160e01b5f52602160045260245ffd5b5f5b83811015612ca6578181015183820152602001612c8e565b50505f910152565b602081525f8251806020840152612ccc816040850160208701612c8c565b601f01601f19169190910160400192915050565b5f60208284031215612cf0575f80fd5b5051919050565b634e487b7160e01b5f52601260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b5f82612d2d57612d2d612cf7565b500490565b80820281158282048414176103a3576103a3612d0b565b6020808252602a908201527f5374616b696e674d616e616765723a2053656e646572206e6f742076616c696460408201526930ba37b91037bbb732b960b11b606082015260800190565b8051612a8781612aac565b5f8060408385031215612daf575f80fd5b82516001600160401b0380821115612dc5575f80fd5b9084019060608287031215612dd8575f80fd5b612de0612b1b565b82518152602080840151612df381612a20565b82820152604084015183811115612e08575f80fd5b80850194505087601f850112612e1c575f80fd5b83519250612e2c612bfb84612b73565b8381528882858701011115612e3f575f80fd5b612e4e84838301848801612c8c565b80604084015250819550612e63818801612d93565b9450505050509250929050565b60208082526024908201527f5374616b696e674d616e616765723a20496e76616c69642077617270206d65736040820152637361676560e01b606082015260800190565b60208082526027908201527f5374616b696e674d616e616765723a20496e76616c696420736f7572636520636040820152661a185a5b88125160ca1b606082015260800190565b6020808252602d908201527f5374616b696e674d616e616765723a20496e76616c6964206f726967696e207360408201526c656e646572206164647265737360981b606082015260800190565b600181811c90821680612f5c57607f821691505b602082108103612f7a57634e487b7160e01b5f52602260045260245ffd5b50919050565b60208082526025908201527f5374616b696e674d616e616765723a20496e76616c69642076616c69646174696040820152641bdb88125160da1b606082015260800190565b5f60208083525f8454612fd781612f48565b806020870152604060018084165f8114612ff8576001811461301457613041565b60ff19851660408a0152604084151560051b8a01019550613041565b895f5260205f205f5b858110156130385781548b820186015290830190880161301d565b8a016040019650505b509398975050505050505050565b818103818111156103a3576103a3612d0b565b634e487b7160e01b5f52603260045260245ffd5b808201808211156103a3576103a3612d0b565b6001600160401b038181168382160190808211156130a9576130a9612d0b565b5092915050565b6001600160401b038181168382160280821691908281146130d3576130d3612d0b565b505092915050565b5f6001600160401b03808416806130f4576130f4612cf7565b92169190910492915050565b60208082526027908201527f5374616b696e674d657373616765733a20496e76616c6964206d657373616765604082015266040d8cadccee8d60cb1b606082015260800190565b60208082526021908201527f5374616b696e674d657373616765733a20496e76616c696420636f64656320496040820152601160fa1b606082015260800190565b60208082526025908201527f5374616b696e674d657373616765733a20496e76616c6964206d657373616765604082015264207479706560d81b606082015260800190565b601f821115610e0457805f5260205f20601f840160051c810160208510156131f25750805b601f840160051c820191505b8181101561038c575f81556001016131fe565b81516001600160401b0381111561322a5761322a612b07565b61323e816132388454612f48565b846131cd565b602080601f831160018114613271575f841561325a5750858301515b5f19600386901b1c1916600185901b1785556132c8565b5f85815260208120601f198616915b8281101561329f57888601518255948401946001909101908401613280565b50858210156132bc57878501515f19600388901b60f8161c191681555b505060018460011b0185555b505050505050565b5f82516132e1818460208701612c8c565b9190910192915050565b5f602082840312156132fb575f80fd5b813560ff81168114612aa5575f80fd5b5f6020828403121561331b575f80fd5b8135612aa581612a2056feafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab600a164736f6c6343000819000a", + Bin: "0x608060405234801561000f575f80fd5b5060405161326738038061326783398101604081905261002e91610107565b60018160018111156100425761004261012c565b0361004f5761004f610055565b50610140565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156100a55760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146101045780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b5f60208284031215610117575f80fd5b815160028110610125575f80fd5b9392505050565b634e487b7160e01b5f52602160045260245ffd5b61311a8061014d5f395ff3fe608060405234801561000f575f80fd5b506004361061009b575f3560e01c8063872fda6411610063578063872fda641461012b578063a3a65e481461013e578063b771b3bc14610151578063bee0a03f14610177578063fdf94a1a1461018a575f80fd5b80630322ed981461009f5780632e2194d8146100b45780635d0d7466146100e457806362065856146100f757806376f7862114610118575b5f80fd5b6100b26100ad36600461284f565b61019d565b005b6100c76100c236600461284f565b610393565b6040516001600160401b0390911681526020015b60405180910390f35b6100b26100f236600461287a565b6103a9565b61010a6101053660046128d2565b6104b7565b6040519081526020016100db565b6100b2610126366004612912565b6104d0565b61010a6101393660046129df565b610a43565b6100b261014c366004612a7b565b610a5b565b61015f6005600160991b0181565b6040516001600160a01b0390911681526020016100db565b6100b261018536600461284f565b610ce8565b6100b2610198366004612a94565b610dfc565b5f8181527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab60860205260408082208151610120810190925280545f805160206130ee83398151915293929190829060ff1660058111156101fe576101fe612abe565b600581111561020f5761020f612abe565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003928301546001600160a01b03811660c084015260ff600160a01b820416151560e0840152600160a81b90041661010090910152909150815160058111156102a6576102a6612abe565b1461030e5760405162461bcd60e51b815260206004820152602d60248201527f5374616b696e674d616e616765723a2056616c696461746f72206e6f7420706560448201526c1b991a5b99c81c995b5bdd985b609a1b60648201526084015b60405180910390fd5b5f61031f848361010001515f611223565b60405163ee5b48eb60e01b81529091506005600160991b019063ee5b48eb9061034c908490600401612af4565b6020604051808303815f875af1158015610368573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061038c9190612b26565b5050505050565b5f6103a364e8d4a5100083612b51565b92915050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff1615906001600160401b03165f811580156103ed5750825b90505f826001600160401b031660011480156104085750303b155b905081158015610416575080155b156104345760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561045e57845460ff60401b1916600160401b1785555b6104688787611440565b83156104ae57845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50505050505050565b5f6103a36001600160401b03831664e8d4a51000612b70565b5f8381527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab60860205260408082208151610120810190925280545f805160206130ee83398151915293929190829060ff16600581111561053157610531612abe565b600581111561054257610542612abe565b8152600182015460208201526002808301546001600160401b038082166040850152600160401b820481166060850152600160801b820481166080850152600160c01b909104811660a08401526003909301546001600160a01b03811660c084015260ff600160a01b820416151560e0840152600160a81b900490921661010090910152909150815160058111156105dc576105dc612abe565b146106355760405162461bcd60e51b8152602060048201526024808201527f5374616b696e674d616e616765723a2056616c696461746f72206e6f742061636044820152637469766560e01b6064820152608401610305565b60c08101516001600160a01b0316336001600160a01b03161461066a5760405162461bcd60e51b815260040161030590612b87565b60038152426001600160401b031660808201525f8415610843576040516306f8253560e41b815263ffffffff851660048201525f9081906005600160991b0190636f825350906024015f60405180830381865afa1580156106cd573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f191682016040526106f49190810190612bdc565b91509150806107155760405162461bcd60e51b815260040161030590612cae565b6005600160991b016001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa158015610758573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061077c9190612b26565b82511461079b5760405162461bcd60e51b815260040161030590612cf2565b60208201516001600160a01b0316156107c65760405162461bcd60e51b815260040161030590612d39565b5f806107d5846040015161145e565b91509150818a1461083d5760405162461bcd60e51b815260206004820152602c60248201527f5374616b696e674d616e616765723a20496e76616c696420757074696d65207660448201526b185b1a59185d1a5bdb88125160a21b6064820152608401610305565b93505050505b6001600160401b03811660a08301525f86815260088401602052604090208251815484929190829060ff1916600183600581111561088357610883612abe565b02179055506020820151600182015560408201516002820180546060850151608086015160a08701516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c08301516003909201805460e0850151610100958601516001600160a01b039095166001600160a81b031990921691909117600160a01b911515919091021767ffffffffffffffff60a81b1916600160a81b93909216929092021790558201515f9061097490889083611223565b60405163ee5b48eb60e01b81529091505f906005600160991b019063ee5b48eb906109a3908590600401612af4565b6020604051808303815f875af11580156109bf573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109e39190612b26565b60408581015181516001600160401b03918216815242602082015290861681830152905191925082918a917f530b908725650fb1052974f9df59e834fefac78c9ec2f00c6d2464d60cc6add5919081900360600190a35050505050505050565b5f610a5084868585611636565b90505b949350505050565b5f5f805160206130ee8339815191526040516306f8253560e41b815263ffffffff841660048201529091505f9081906005600160991b0190636f825350906024015f60405180830381865afa158015610ab6573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052610add9190810190612bdc565b9150915080610afe5760405162461bcd60e51b815260040161030590612cae565b8254825114610b1f5760405162461bcd60e51b815260040161030590612cf2565b60208201516001600160a01b031615610b4a5760405162461bcd60e51b815260040161030590612d39565b5f80610b598460400151611b3d565b9150915080610bb95760405162461bcd60e51b815260206004820152602660248201527f5374616b696e674d616e616765723a20526567697374726174696f6e206e6f74604482015265081d985b1a5960d21b6064820152608401610305565b5f82815260078601602052604081208054610bd390612d86565b9050118015610c05575060015f83815260088701602052604090205460ff166005811115610c0357610c03612abe565b145b610c215760405162461bcd60e51b815260040161030590612dbe565b5f8281526007860160205260408120610c3991612805565b5f8281526008860160208181526040808420805460ff191660029081178255810180546001600160401b0342818116600160401b026fffffffffffffffff000000000000000019909316929092178355600190930154875260098c0185528387208990559588905293835292548151931683529082019290925283917ff8fd1c90fb9cfa2ca2358fdf5806b086ad43315d92b221c929efc7f105ce7568910160405180910390a2505050505050565b5f8181527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6076020526040812080545f805160206130ee833981519152929190610d3090612d86565b9050118015610d62575060015f83815260088301602052604090205460ff166005811115610d6057610d60612abe565b145b610d7e5760405162461bcd60e51b815260040161030590612dbe565b5f82815260078201602052604090819020905163ee5b48eb60e01b81526005600160991b019163ee5b48eb91610db79190600401612e03565b6020604051808303815f875af1158015610dd3573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610df79190612b26565b505050565b5f5f805160206130ee8339815191526040516306f8253560e41b815263ffffffff851660048201529091505f9081906005600160991b0190636f825350906024015f60405180830381865afa158015610e57573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052610e7e9190810190612bdc565b9150915080610e9f5760405162461bcd60e51b815260040161030590612cae565b5f8415610f18575f610eb48460400151611cde565b919350909150506001600160401b03811615610f125760405162461bcd60e51b815260206004820181905260248201527f5374616b696e674d616e616765723a20576569676874206d75737420626520306044820152606401610305565b50610f8c565b5f610f268460400151611b3d565b90925090508015610f8a5760405162461bcd60e51b815260206004820152602860248201527f5374616b696e674d616e616765723a20526567697374726174696f6e207374696044820152671b1b081d985b1a5960c21b6064820152608401610305565b505b5f818152600885016020526040808220815161012081019092528054829060ff166005811115610fbe57610fbe612abe565b6005811115610fcf57610fcf612abe565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003909201546001600160a01b0380821660c080850191909152600160a01b830460ff16151560e0850152600160a81b909204909316610100909201919091528201519192501633146110805760405162461bcd60e51b815260040161030590612b87565b5f60038251600581111561109657611096612abe565b14806110b457506002825160058111156110b2576110b2612abe565b145b156110d757506020808201515f90815260098701909152604081205560046110db565b5060055b5f83815260088701602052604090208251815484929190829060ff1916600183600581111561110c5761110c612abe565b0217905550602082015160018201556040808301516002830180546060860151608087015160a08801516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c08401516003909301805460e0860151610100909601516001600160a01b039095166001600160a81b031990911617600160a01b951515959095029490941767ffffffffffffffff60a81b1916600160a81b9390911692909202919091179091555183907f3532ad18e70a039beb4663d48c15acbef558c96ec9b8fd0cc3c0304f774740b8905f90a25050505050505050565b60408051603680825260608281019093525f91906020820181803683370190505090505f5b600281101561129c5761125c816001612e8d565b611267906008612b70565b5081515f9083908390811061127e5761127e612ea0565b60200101906001600160f81b03191690815f1a905350600101611248565b505f5b60048110156112ff576112b3816003612e8d565b6112be906008612b70565b6001901c60f81b826112d1836002612eb4565b815181106112e1576112e1612ea0565b60200101906001600160f81b03191690815f1a90535060010161129f565b505f5b60208110156113615761131681601f612e8d565b611321906008612b70565b86901c60f81b82611333836006612eb4565b8151811061134357611343612ea0565b60200101906001600160f81b03191690815f1a905350600101611302565b505f5b60088110156113cc57611378816007612e8d565b611383906008612b70565b6001600160401b038616901c60f81b8261139e836026612eb4565b815181106113ae576113ae612ea0565b60200101906001600160f81b03191690815f1a905350600101611364565b505f5b6008811015611437576113e3816007612e8d565b6113ee906008612b70565b6001600160401b038516901c60f81b8261140983602e612eb4565b8151811061141957611419612ea0565b60200101906001600160f81b03191690815f1a9053506001016113cf565b50949350505050565b611448611f19565b61145182611f64565b61145a81611f88565b5050565b5f808251602e146114815760405162461bcd60e51b815260040161030590612ec7565b5f805b60028110156114d057611498816001612e8d565b6114a3906008612b70565b61ffff168582815181106114b9576114b9612ea0565b016020015160f81c901b9190911790600101611484565b5061ffff8116156114f35760405162461bcd60e51b815260040161030590612f0e565b5f805b600481101561154e5761150a816003612e8d565b611515906008612b70565b63ffffffff1686611527836002612eb4565b8151811061153757611537612ea0565b016020015160f81c901b91909117906001016114f6565b5063ffffffff81166004146115755760405162461bcd60e51b815260040161030590612f4f565b5f805b60208110156115ca5761158c81601f612e8d565b611597906008612b70565b876115a3836006612eb4565b815181106115b3576115b3612ea0565b016020015160f81c901b9190911790600101611578565b505f805b6008811015611629576115e2816007612e8d565b6115ed906008612b70565b6001600160401b031688611602836026612eb4565b8151811061161257611612612ea0565b016020015160f81c901b91909117906001016115ce565b5090969095509350505050565b5f61163f61203c565b5f805160206130ee833981519152426001600160401b03851611801561167957506001600160401b038416611677426202a300612eb4565b115b6116d95760405162461bcd60e51b815260206004820152602b60248201527f5374616b696e674d616e616765723a20496e76616c696420726567697374726160448201526a74696f6e2065787069727960a81b6064820152608401610305565b856117265760405162461bcd60e51b815260206004820152601f60248201527f5374616b696e674d616e616765723a20496e76616c6964206e6f6465204944006044820152606401610305565b5f868152600982016020526040902054156117925760405162461bcd60e51b815260206004820152602660248201527f5374616b696e674d616e616765723a204e6f646520494420616c72656164792060448201526561637469766560d01b6064820152608401610305565b82516030146117f75760405162461bcd60e51b815260206004820152602b60248201527f5374616b696e674d616e616765723a20496e76616c696420626c735075626c6960448201526a0c696caf240d8cadccee8d60ab1b6064820152608401610305565b5f61180186612086565b90505f61180d82610393565b90508260020154816001600160401b03161015801561183957508260030154816001600160401b031611155b6118915760405162461bcd60e51b8152602060048201526024808201527f5374616b696e674d616e616765723a20496e76616c6964207374616b6520616d6044820152631bdd5b9d60e21b6064820152608401610305565b5f806118d86040518060a00160405280876001015481526020018c8152602001856001600160401b031681526020018a6001600160401b03168152602001898152506120bc565b5f828152600788016020526040902091935091506118f68282612fd8565b5060405163ee5b48eb60e01b81525f906005600160991b019063ee5b48eb90611923908590600401612af4565b6020604051808303815f875af115801561193f573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906119639190612b26565b6040805161012081019091529091508060018152602081018d90526001600160401b03861660408201525f606082018190526080820181905260a082015260c001336001600160a01b031681525f6020808301829052604092830182905286825260088a0190522081518154829060ff191660018360058111156119e9576119e9612abe565b021790555060208281015160018301556040808401516002840180546060870151608088015160a08901516001600160401b03908116600160c01b026001600160c01b03928216600160801b02929092166001600160801b03938216600160401b026001600160801b03199095169682169690961793909317919091169390931792909217905560c08501516003909401805460e0870151610100909701518316600160a81b0267ffffffffffffffff60a81b19971515600160a01b026001600160a81b03199092166001600160a01b039097169690961717959095169390931790935582518783168152918c169082015282918d9186917f79b81620b81daf2c08cd5bb3dbb79e75d2d7a87f52171fde5aadc8c47823026e910160405180910390a45090945050505050610a5360017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b5f808251602714611b605760405162461bcd60e51b815260040161030590612ec7565b5f805b6002811015611baf57611b77816001612e8d565b611b82906008612b70565b61ffff16858281518110611b9857611b98612ea0565b016020015160f81c901b9190911790600101611b63565b5061ffff811615611bd25760405162461bcd60e51b815260040161030590612f0e565b5f805b6004811015611c2d57611be9816003612e8d565b611bf4906008612b70565b63ffffffff1686611c06836002612eb4565b81518110611c1657611c16612ea0565b016020015160f81c901b9190911790600101611bd5565b5063ffffffff8116600214611c545760405162461bcd60e51b815260040161030590612f4f565b5f805b6020811015611ca957611c6b81601f612e8d565b611c76906008612b70565b87611c82836006612eb4565b81518110611c9257611c92612ea0565b016020015160f81c901b9190911790600101611c57565b505f86602681518110611cbe57611cbe612ea0565b016020015191976001600160f81b03199092161515965090945050505050565b5f805f8351603614611d025760405162461bcd60e51b815260040161030590612ec7565b5f805b6002811015611d5157611d19816001612e8d565b611d24906008612b70565b61ffff16868281518110611d3a57611d3a612ea0565b016020015160f81c901b9190911790600101611d05565b5061ffff811615611d745760405162461bcd60e51b815260040161030590612f0e565b5f805b6004811015611dcf57611d8b816003612e8d565b611d96906008612b70565b63ffffffff1687611da8836002612eb4565b81518110611db857611db8612ea0565b016020015160f81c901b9190911790600101611d77565b5063ffffffff8116600114611df65760405162461bcd60e51b815260040161030590612f4f565b5f805b6020811015611e4b57611e0d81601f612e8d565b611e18906008612b70565b88611e24836006612eb4565b81518110611e3457611e34612ea0565b016020015160f81c901b9190911790600101611df9565b505f805b6008811015611eaa57611e63816007612e8d565b611e6e906008612b70565b6001600160401b031689611e83836026612eb4565b81518110611e9357611e93612ea0565b016020015160f81c901b9190911790600101611e4f565b505f805b6008811015611f0957611ec2816007612e8d565b611ecd906008612b70565b6001600160401b03168a611ee283602e612eb4565b81518110611ef257611ef2612ea0565b016020015160f81c901b9190911790600101611eae565b5091989097509095509350505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff16611f6257604051631afcd79f60e31b815260040160405180910390fd5b565b611f6c611f19565b611f74612487565b611f7c612497565b611f858161249f565b50565b611f90611f19565b7f8568826440873e37a96cb0aab773b28d8154d963d2f0e41bd9b5c15f63625f916001600160a01b03821661201c5760405162461bcd60e51b815260206004820152602c60248201527f4552433230546f6b656e5374616b696e674d616e616765723a207a65726f207460448201526b6f6b656e206164647265737360a01b6064820152608401610305565b80546001600160a01b0319166001600160a01b0392909216919091179055565b7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0080546001190161208057604051633ee5aeb560e01b815260040160405180910390fd5b60029055565b5f6103a3827f8568826440873e37a96cb0aab773b28d8154d963d2f0e41bd9b5c15f63625f91546001600160a01b0316906125cf565b5f60608260800151516030146121265760405162461bcd60e51b815260206004820152602960248201527f5374616b696e674d657373616765733a20496e76616c6964207369676e6174756044820152680e4ca40d8cadccee8d60bb1b6064820152608401610305565b60408051608680825260c082019092525f916020820181803683370190505090505f5b600281101561219d5761215d816001612e8d565b612168906008612b70565b5081515f9083908390811061217f5761217f612ea0565b60200101906001600160f81b03191690815f1a905350600101612149565b505f5b60048110156121fb576121b4816003612e8d565b6121bf906008612b70565b505f826121cd836002612eb4565b815181106121dd576121dd612ea0565b60200101906001600160f81b03191690815f1a9053506001016121a0565b505f5b6020811015612258578451816020811061221a5761221a612ea0565b1a60f81b8261222a836006612eb4565b8151811061223a5761223a612ea0565b60200101906001600160f81b03191690815f1a9053506001016121fe565b505f5b60208110156122b8578460200151816020811061227a5761227a612ea0565b1a60f81b8261228a836026612eb4565b8151811061229a5761229a612ea0565b60200101906001600160f81b03191690815f1a90535060010161225b565b505f5b600881101561232c576122cf816007612e8d565b6122da906008612b70565b60ff1685604001516001600160401b0316901c60f81b828260466122fe9190612eb4565b8151811061230e5761230e612ea0565b60200101906001600160f81b03191690815f1a9053506001016122bb565b505f5b6030811015612397578460800151818151811061234e5761234e612ea0565b01602001516001600160f81b0319168261236983604e612eb4565b8151811061237957612379612ea0565b60200101906001600160f81b03191690815f1a90535060010161232f565b505f5b6008811015612409576123ae816007612e8d565b6123b9906008612b70565b60608601516001600160401b0390811691161c60f81b826123db83607e612eb4565b815181106123eb576123eb612ea0565b60200101906001600160f81b03191690815f1a90535060010161239a565b5060028160405161241a9190613097565b602060405180830381855afa158015612435573d5f803e3d5ffd5b5050506040513d601f19601f820116820180604052508101906124589190612b26565b94909350915050565b60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b61248f611f19565b611f62612731565b611f62611f19565b6124a7611f19565b80355f805160206130ee83398151915290815560208201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6015560408201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6025560608201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6035561253f60a08301608084016128d2565b60048201805467ffffffffffffffff19166001600160401b039290921691909117905561257260c0830160a084016130b2565b60048201805460ff92909216600160e01b0260ff60e01b199092169190911790556125a360e0830160c084016130d2565b8160040160086101000a8154816001600160a01b0302191690836001600160a01b031602179055505050565b6040516370a0823160e01b81523060048201525f9081906001600160a01b038516906370a0823190602401602060405180830381865afa158015612615573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906126399190612b26565b90506126506001600160a01b038516333086612739565b6040516370a0823160e01b81523060048201525f906001600160a01b038616906370a0823190602401602060405180830381865afa158015612694573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906126b89190612b26565b905081811161271e5760405162461bcd60e51b815260206004820152602c60248201527f5361666545524332305472616e7366657246726f6d3a2062616c616e6365206e60448201526b1bdd081a5b98dc99585cd95960a21b6064820152608401610305565b6127288282612e8d565b95945050505050565b612461611f19565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052612793908590612799565b50505050565b5f8060205f8451602086015f885af1806127b8576040513d5f823e3d81fd5b50505f513d915081156127cf5780600114156127dc565b6001600160a01b0384163b155b1561279357604051635274afe760e01b81526001600160a01b0385166004820152602401610305565b50805461281190612d86565b5f825580601f10612820575050565b601f0160209004905f5260205f2090810190611f8591905b8082111561284b575f8155600101612838565b5090565b5f6020828403121561285f575f80fd5b5035919050565b6001600160a01b0381168114611f85575f80fd5b5f8082840361010081121561288d575f80fd5b60e081121561289a575f80fd5b5082915060e08301356128ac81612866565b809150509250929050565b80356001600160401b03811681146128cd575f80fd5b919050565b5f602082840312156128e2575f80fd5b6128eb826128b7565b9392505050565b8015158114611f85575f80fd5b803563ffffffff811681146128cd575f80fd5b5f805f60608486031215612924575f80fd5b833592506020840135612936816128f2565b9150612944604085016128ff565b90509250925092565b634e487b7160e01b5f52604160045260245ffd5b604051606081016001600160401b03811182821017156129835761298361294d565b60405290565b604051601f8201601f191681016001600160401b03811182821017156129b1576129b161294d565b604052919050565b5f6001600160401b038211156129d1576129d161294d565b50601f01601f191660200190565b5f805f80608085870312156129f2575f80fd5b8435935060208501359250612a09604086016128b7565b915060608501356001600160401b03811115612a23575f80fd5b8501601f81018713612a33575f80fd5b8035612a46612a41826129b9565b612989565b818152886020838501011115612a5a575f80fd5b816020840160208301375f6020838301015280935050505092959194509250565b5f60208284031215612a8b575f80fd5b6128eb826128ff565b5f8060408385031215612aa5575f80fd5b612aae836128ff565b915060208301356128ac816128f2565b634e487b7160e01b5f52602160045260245ffd5b5f5b83811015612aec578181015183820152602001612ad4565b50505f910152565b602081525f8251806020840152612b12816040850160208701612ad2565b601f01601f19169190910160400192915050565b5f60208284031215612b36575f80fd5b5051919050565b634e487b7160e01b5f52601160045260245ffd5b5f82612b6b57634e487b7160e01b5f52601260045260245ffd5b500490565b80820281158282048414176103a3576103a3612b3d565b6020808252602a908201527f5374616b696e674d616e616765723a2053656e646572206e6f742076616c696460408201526930ba37b91037bbb732b960b11b606082015260800190565b80516128cd816128f2565b5f8060408385031215612bed575f80fd5b82516001600160401b0380821115612c03575f80fd5b9084019060608287031215612c16575f80fd5b612c1e612961565b82518152602080840151612c3181612866565b82820152604084015183811115612c46575f80fd5b80850194505087601f850112612c5a575f80fd5b83519250612c6a612a41846129b9565b8381528882858701011115612c7d575f80fd5b612c8c84838301848801612ad2565b80604084015250819550612ca1818801612bd1565b9450505050509250929050565b60208082526024908201527f5374616b696e674d616e616765723a20496e76616c69642077617270206d65736040820152637361676560e01b606082015260800190565b60208082526027908201527f5374616b696e674d616e616765723a20496e76616c696420736f7572636520636040820152661a185a5b88125160ca1b606082015260800190565b6020808252602d908201527f5374616b696e674d616e616765723a20496e76616c6964206f726967696e207360408201526c656e646572206164647265737360981b606082015260800190565b600181811c90821680612d9a57607f821691505b602082108103612db857634e487b7160e01b5f52602260045260245ffd5b50919050565b60208082526025908201527f5374616b696e674d616e616765723a20496e76616c69642076616c69646174696040820152641bdb88125160da1b606082015260800190565b5f60208083525f8454612e1581612d86565b806020870152604060018084165f8114612e365760018114612e5257612e7f565b60ff19851660408a0152604084151560051b8a01019550612e7f565b895f5260205f205f5b85811015612e765781548b8201860152908301908801612e5b565b8a016040019650505b509398975050505050505050565b818103818111156103a3576103a3612b3d565b634e487b7160e01b5f52603260045260245ffd5b808201808211156103a3576103a3612b3d565b60208082526027908201527f5374616b696e674d657373616765733a20496e76616c6964206d657373616765604082015266040d8cadccee8d60cb1b606082015260800190565b60208082526021908201527f5374616b696e674d657373616765733a20496e76616c696420636f64656320496040820152601160fa1b606082015260800190565b60208082526025908201527f5374616b696e674d657373616765733a20496e76616c6964206d657373616765604082015264207479706560d81b606082015260800190565b601f821115610df757805f5260205f20601f840160051c81016020851015612fb95750805b601f840160051c820191505b8181101561038c575f8155600101612fc5565b81516001600160401b03811115612ff157612ff161294d565b61300581612fff8454612d86565b84612f94565b602080601f831160018114613038575f84156130215750858301515b5f19600386901b1c1916600185901b17855561308f565b5f85815260208120601f198616915b8281101561306657888601518255948401946001909101908401613047565b508582101561308357878501515f19600388901b60f8161c191681555b505060018460011b0185555b505050505050565b5f82516130a8818460208701612ad2565b9190910192915050565b5f602082840312156130c2575f80fd5b813560ff811681146128eb575f80fd5b5f602082840312156130e2575f80fd5b81356128eb8161286656feafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab600a164736f6c6343000819000a", } // ERC20TokenStakingManagerABI is the input ABI used to generate the binding from. diff --git a/abi-bindings/go/staking/NativeTokenStakingManager/NativeTokenStakingManager.go b/abi-bindings/go/staking/NativeTokenStakingManager/NativeTokenStakingManager.go index ebb39787d..4b36d3bd2 100644 --- a/abi-bindings/go/staking/NativeTokenStakingManager/NativeTokenStakingManager.go +++ b/abi-bindings/go/staking/NativeTokenStakingManager/NativeTokenStakingManager.go @@ -43,7 +43,7 @@ type StakingManagerSettings struct { // NativeTokenStakingManagerMetaData contains all meta data concerning the NativeTokenStakingManager contract. var NativeTokenStakingManagerMetaData = &bind.MetaData{ ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"init\",\"type\":\"uint8\",\"internalType\":\"enumICMInitializable\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"WARP_MESSENGER\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIWarpMessenger\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"completeEndValidation\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"setWeightMessageType\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"completeValidatorRegistration\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"settings\",\"type\":\"tuple\",\"internalType\":\"structStakingManagerSettings\",\"components\":[{\"name\":\"pChainBlockchainID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"subnetID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"minimumStakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"maximumStakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"minimumStakeDuration\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"maximumHourlyChurn\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"rewardCalculator\",\"type\":\"address\",\"internalType\":\"contractIRewardCalculator\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeEndValidation\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"includeUptimeProof\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeValidatorRegistration\",\"inputs\":[{\"name\":\"nodeID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"resendEndValidatorMessage\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"resendRegisterValidatorMessage\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"valueToWeight\",\"inputs\":[{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"weightToValue\",\"inputs\":[{\"name\":\"weight\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"pure\"},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodCreated\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"nodeID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"registerValidationMessageID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"weight\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodEnded\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodRegistered\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"stakeAmount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"timestamp\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidatorRemovalInitialized\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"setWeightMessageID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"stakeAmount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"endTime\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"uptime\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ReentrancyGuardReentrantCall\",\"inputs\":[]}]", - Bin: "0x608060405234801561000f575f80fd5b5060405161319b38038061319b83398101604081905261002e91610107565b60018160018111156100425761004261012c565b0361004f5761004f610055565b50610140565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156100a55760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146101045780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b5f60208284031215610117575f80fd5b815160028110610125575f80fd5b9392505050565b634e487b7160e01b5f52602160045260245ffd5b61304e8061014d5f395ff3fe60806040526004361061008f575f3560e01c8063a3a65e4811610057578063a3a65e481461015b578063b771b3bc1461017a578063bee0a03f146101ac578063f40797d7146101cb578063fdf94a1a146101de575f80fd5b80630322ed98146100935780632e2194d8146100b457806362065856146100f057806376f786211461011d57806379f54eb11461013c575b5f80fd5b34801561009e575f80fd5b506100b26100ad366004612734565b6101fd565b005b3480156100bf575f80fd5b506100d36100ce366004612734565b6103f3565b6040516001600160401b0390911681526020015b60405180910390f35b3480156100fb575f80fd5b5061010f61010a366004612766565b610409565b6040519081526020016100e7565b348015610128575f80fd5b506100b26101373660046127a6565b610422565b348015610147575f80fd5b506100b26101563660046127e1565b6109a2565b348015610166575f80fd5b506100b26101753660046127f7565b610aae565b348015610185575f80fd5b506101946005600160991b0181565b6040516001600160a01b0390911681526020016100e7565b3480156101b7575f80fd5b506100b26101c6366004612734565b610d3b565b61010f6101d93660046128a2565b610e4f565b3480156101e9575f80fd5b506100b26101f8366004612934565b610e64565b5f8181527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab60860205260408082208151610120810190925280545f8051602061302283398151915293929190829060ff16600581111561025e5761025e612969565b600581111561026f5761026f612969565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003928301546001600160a01b03811660c084015260ff600160a01b820416151560e0840152600160a81b900416610100909101529091508151600581111561030657610306612969565b1461036e5760405162461bcd60e51b815260206004820152602d60248201527f5374616b696e674d616e616765723a2056616c696461746f72206e6f7420706560448201526c1b991a5b99c81c995b5bdd985b609a1b60648201526084015b60405180910390fd5b5f61037f848361010001515f61128b565b60405163ee5b48eb60e01b81529091506005600160991b019063ee5b48eb906103ac90849060040161299f565b6020604051808303815f875af11580156103c8573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103ec91906129d1565b5050505050565b5f61040364e8d4a5100083612a10565b92915050565b5f6104036001600160401b03831664e8d4a51000612a23565b5f8381527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab60860205260408082208151610120810190925280545f8051602061302283398151915293929190829060ff16600581111561048357610483612969565b600581111561049457610494612969565b8152600182015460208201526002808301546001600160401b038082166040850152600160401b820481166060850152600160801b820481166080850152600160c01b909104811660a08401526003909301546001600160a01b03811660c084015260ff600160a01b820416151560e0840152600160a81b9004909216610100909101529091508151600581111561052e5761052e612969565b146105875760405162461bcd60e51b8152602060048201526024808201527f5374616b696e674d616e616765723a2056616c696461746f72206e6f742061636044820152637469766560e01b6064820152608401610365565b60c08101516001600160a01b0316336001600160a01b0316146105bc5760405162461bcd60e51b815260040161036590612a3a565b6105c981604001516114a8565b60038152426001600160401b031660808201525f84156107a2576040516306f8253560e41b815263ffffffff851660048201525f9081906005600160991b0190636f825350906024015f60405180830381865afa15801561062c573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f191682016040526106539190810190612aa3565b91509150806106745760405162461bcd60e51b815260040161036590612b75565b6005600160991b016001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106b7573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106db91906129d1565b8251146106fa5760405162461bcd60e51b815260040161036590612bb9565b60208201516001600160a01b0316156107255760405162461bcd60e51b815260040161036590612c00565b5f806107348460400151611655565b91509150818a1461079c5760405162461bcd60e51b815260206004820152602c60248201527f5374616b696e674d616e616765723a20496e76616c696420757074696d65207660448201526b185b1a59185d1a5bdb88125160a21b6064820152608401610365565b93505050505b6001600160401b03811660a08301525f86815260088401602052604090208251815484929190829060ff191660018360058111156107e2576107e2612969565b02179055506020820151600182015560408201516002820180546060850151608086015160a08701516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c08301516003909201805460e0850151610100958601516001600160a01b039095166001600160a81b031990921691909117600160a01b911515919091021767ffffffffffffffff60a81b1916600160a81b93909216929092021790558201515f906108d39088908361128b565b60405163ee5b48eb60e01b81529091505f906005600160991b019063ee5b48eb9061090290859060040161299f565b6020604051808303815f875af115801561091e573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061094291906129d1565b60408581015181516001600160401b03918216815242602082015290861681830152905191925082918a917f530b908725650fb1052974f9df59e834fefac78c9ec2f00c6d2464d60cc6add5919081900360600190a35050505050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff1615906001600160401b03165f811580156109e65750825b90505f826001600160401b03166001148015610a015750303b155b905081158015610a0f575080155b15610a2d5760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff191660011785558315610a5757845460ff60401b1916600160401b1785555b610a608661182d565b8315610aa657845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050565b5f5f805160206130228339815191526040516306f8253560e41b815263ffffffff841660048201529091505f9081906005600160991b0190636f825350906024015f60405180830381865afa158015610b09573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052610b309190810190612aa3565b9150915080610b515760405162461bcd60e51b815260040161036590612b75565b8254825114610b725760405162461bcd60e51b815260040161036590612bb9565b60208201516001600160a01b031615610b9d5760405162461bcd60e51b815260040161036590612c00565b5f80610bac8460400151611841565b9150915080610c0c5760405162461bcd60e51b815260206004820152602660248201527f5374616b696e674d616e616765723a20526567697374726174696f6e206e6f74604482015265081d985b1a5960d21b6064820152608401610365565b5f82815260078601602052604081208054610c2690612c4d565b9050118015610c58575060015f83815260088701602052604090205460ff166005811115610c5657610c56612969565b145b610c745760405162461bcd60e51b815260040161036590612c7f565b5f8281526007860160205260408120610c8c916126ea565b5f8281526008860160208181526040808420805460ff191660029081178255810180546001600160401b0342818116600160401b026fffffffffffffffff000000000000000019909316929092178355600190930154875260098c0185528387208990559588905293835292548151931683529082019290925283917ff8fd1c90fb9cfa2ca2358fdf5806b086ad43315d92b221c929efc7f105ce7568910160405180910390a2505050505050565b5f8181527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6076020526040812080545f80516020613022833981519152929190610d8390612c4d565b9050118015610db5575060015f83815260088301602052604090205460ff166005811115610db357610db3612969565b145b610dd15760405162461bcd60e51b815260040161036590612c7f565b5f82815260078201602052604090819020905163ee5b48eb60e01b81526005600160991b019163ee5b48eb91610e0a9190600401612cc4565b6020604051808303815f875af1158015610e26573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e4a91906129d1565b505050565b5f610e5c843485856119e2565b949350505050565b5f5f805160206130228339815191526040516306f8253560e41b815263ffffffff851660048201529091505f9081906005600160991b0190636f825350906024015f60405180830381865afa158015610ebf573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052610ee69190810190612aa3565b9150915080610f075760405162461bcd60e51b815260040161036590612b75565b5f8415610f80575f610f1c8460400151611ede565b919350909150506001600160401b03811615610f7a5760405162461bcd60e51b815260206004820181905260248201527f5374616b696e674d616e616765723a20576569676874206d75737420626520306044820152606401610365565b50610ff4565b5f610f8e8460400151611841565b90925090508015610ff25760405162461bcd60e51b815260206004820152602860248201527f5374616b696e674d616e616765723a20526567697374726174696f6e207374696044820152671b1b081d985b1a5960c21b6064820152608401610365565b505b5f818152600885016020526040808220815161012081019092528054829060ff16600581111561102657611026612969565b600581111561103757611037612969565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003909201546001600160a01b0380821660c080850191909152600160a01b830460ff16151560e0850152600160a81b909204909316610100909201919091528201519192501633146110e85760405162461bcd60e51b815260040161036590612a3a565b5f6003825160058111156110fe576110fe612969565b148061111c575060028251600581111561111a5761111a612969565b145b1561113f57506020808201515f9081526009870190915260408120556004611143565b5060055b5f83815260088701602052604090208251815484929190829060ff1916600183600581111561117457611174612969565b0217905550602082015160018201556040808301516002830180546060860151608087015160a08801516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c08401516003909301805460e0860151610100909601516001600160a01b039095166001600160a81b031990911617600160a01b951515959095029490941767ffffffffffffffff60a81b1916600160a81b9390911692909202919091179091555183907f3532ad18e70a039beb4663d48c15acbef558c96ec9b8fd0cc3c0304f774740b8905f90a25050505050505050565b60408051603680825260608281019093525f91906020820181803683370190505090505f5b6002811015611304576112c4816001612d4e565b6112cf906008612a23565b5081515f908390839081106112e6576112e6612d61565b60200101906001600160f81b03191690815f1a9053506001016112b0565b505f5b60048110156113675761131b816003612d4e565b611326906008612a23565b6001901c60f81b82611339836002612d75565b8151811061134957611349612d61565b60200101906001600160f81b03191690815f1a905350600101611307565b505f5b60208110156113c95761137e81601f612d4e565b611389906008612a23565b86901c60f81b8261139b836006612d75565b815181106113ab576113ab612d61565b60200101906001600160f81b03191690815f1a90535060010161136a565b505f5b6008811015611434576113e0816007612d4e565b6113eb906008612a23565b6001600160401b038616901c60f81b82611406836026612d75565b8151811061141657611416612d61565b60200101906001600160f81b03191690815f1a9053506001016113cc565b505f5b600881101561149f5761144b816007612d4e565b611456906008612a23565b6001600160401b038516901c60f81b8261147183602e612d75565b8151811061148157611481612d61565b60200101906001600160f81b03191690815f1a905350600101611437565b50949350505050565b7fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab604545f8051602061302283398151915290600160e01b900460ff165f036114ed575050565b60408051606081018252600583015480825260068401546001600160401b038082166020850152600160401b9091041692820192909252904290610e10906115359083612d4e565b10611551576001600160401b0384166040830152808252611570565b83826040018181516115639190612d88565b6001600160401b03169052505b5f8260200151836040015160646115879190612daf565b6115919190612dda565b600485015490915060ff600160e01b909104811690821611156116115760405162461bcd60e51b815260206004820152603260248201527f5374616b696e674d616e616765723a204d6178696d756d20686f75726c7920636044820152711a1d5c9b881c985d1948195e18d95959195960721b6064820152608401610365565b5050805160058301556020810151600690920180546040909201516001600160401b03908116600160401b026001600160801b031990931693169290921717905550565b5f808251602e146116785760405162461bcd60e51b815260040161036590612dff565b5f805b60028110156116c75761168f816001612d4e565b61169a906008612a23565b61ffff168582815181106116b0576116b0612d61565b016020015160f81c901b919091179060010161167b565b5061ffff8116156116ea5760405162461bcd60e51b815260040161036590612e46565b5f805b600481101561174557611701816003612d4e565b61170c906008612a23565b63ffffffff168661171e836002612d75565b8151811061172e5761172e612d61565b016020015160f81c901b91909117906001016116ed565b5063ffffffff811660041461176c5760405162461bcd60e51b815260040161036590612e87565b5f805b60208110156117c15761178381601f612d4e565b61178e906008612a23565b8761179a836006612d75565b815181106117aa576117aa612d61565b016020015160f81c901b919091179060010161176f565b505f805b6008811015611820576117d9816007612d4e565b6117e4906008612a23565b6001600160401b0316886117f9836026612d75565b8151811061180957611809612d61565b016020015160f81c901b91909117906001016117c5565b5090969095509350505050565b611835612119565b61183e81612164565b50565b5f8082516027146118645760405162461bcd60e51b815260040161036590612dff565b5f805b60028110156118b35761187b816001612d4e565b611886906008612a23565b61ffff1685828151811061189c5761189c612d61565b016020015160f81c901b9190911790600101611867565b5061ffff8116156118d65760405162461bcd60e51b815260040161036590612e46565b5f805b6004811015611931576118ed816003612d4e565b6118f8906008612a23565b63ffffffff168661190a836002612d75565b8151811061191a5761191a612d61565b016020015160f81c901b91909117906001016118d9565b5063ffffffff81166002146119585760405162461bcd60e51b815260040161036590612e87565b5f805b60208110156119ad5761196f81601f612d4e565b61197a906008612a23565b87611986836006612d75565b8151811061199657611996612d61565b016020015160f81c901b919091179060010161195b565b505f866026815181106119c2576119c2612d61565b016020015191976001600160f81b03199092161515965090945050505050565b5f6119eb612185565b5f80516020613022833981519152426001600160401b038516118015611a2557506001600160401b038416611a23426202a300612d75565b115b611a855760405162461bcd60e51b815260206004820152602b60248201527f5374616b696e674d616e616765723a20496e76616c696420726567697374726160448201526a74696f6e2065787069727960a81b6064820152608401610365565b85611ad25760405162461bcd60e51b815260206004820152601f60248201527f5374616b696e674d616e616765723a20496e76616c6964206e6f6465204944006044820152606401610365565b5f86815260098201602052604090205415611b3e5760405162461bcd60e51b815260206004820152602660248201527f5374616b696e674d616e616765723a204e6f646520494420616c72656164792060448201526561637469766560d01b6064820152608401610365565b8251603014611ba35760405162461bcd60e51b815260206004820152602b60248201527f5374616b696e674d616e616765723a20496e76616c696420626c735075626c6960448201526a0c696caf240d8cadccee8d60ab1b6064820152608401610365565b845f611bae826103f3565b90508260020154816001600160401b031610158015611bda57508260030154816001600160401b031611155b611c325760405162461bcd60e51b8152602060048201526024808201527f5374616b696e674d616e616765723a20496e76616c6964207374616b6520616d6044820152631bdd5b9d60e21b6064820152608401610365565b5f80611c796040518060a00160405280876001015481526020018c8152602001856001600160401b031681526020018a6001600160401b03168152602001898152506121cf565b5f82815260078801602052604090209193509150611c978282612f10565b5060405163ee5b48eb60e01b81525f906005600160991b019063ee5b48eb90611cc490859060040161299f565b6020604051808303815f875af1158015611ce0573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611d0491906129d1565b6040805161012081019091529091508060018152602081018d90526001600160401b03861660408201525f606082018190526080820181905260a082015260c001336001600160a01b031681525f6020808301829052604092830182905286825260088a0190522081518154829060ff19166001836005811115611d8a57611d8a612969565b021790555060208281015160018301556040808401516002840180546060870151608088015160a08901516001600160401b03908116600160c01b026001600160c01b03928216600160801b02929092166001600160801b03938216600160401b026001600160801b03199095169682169690961793909317919091169390931792909217905560c08501516003909401805460e0870151610100909701518316600160a81b0267ffffffffffffffff60a81b19971515600160a01b026001600160a81b03199092166001600160a01b039097169690961717959095169390931790935582518783168152918c169082015282918d9186917f79b81620b81daf2c08cd5bb3dbb79e75d2d7a87f52171fde5aadc8c47823026e910160405180910390a45090945050505050610e5c60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b5f805f8351603614611f025760405162461bcd60e51b815260040161036590612dff565b5f805b6002811015611f5157611f19816001612d4e565b611f24906008612a23565b61ffff16868281518110611f3a57611f3a612d61565b016020015160f81c901b9190911790600101611f05565b5061ffff811615611f745760405162461bcd60e51b815260040161036590612e46565b5f805b6004811015611fcf57611f8b816003612d4e565b611f96906008612a23565b63ffffffff1687611fa8836002612d75565b81518110611fb857611fb8612d61565b016020015160f81c901b9190911790600101611f77565b5063ffffffff8116600114611ff65760405162461bcd60e51b815260040161036590612e87565b5f805b602081101561204b5761200d81601f612d4e565b612018906008612a23565b88612024836006612d75565b8151811061203457612034612d61565b016020015160f81c901b9190911790600101611ff9565b505f805b60088110156120aa57612063816007612d4e565b61206e906008612a23565b6001600160401b031689612083836026612d75565b8151811061209357612093612d61565b016020015160f81c901b919091179060010161204f565b505f805b6008811015612109576120c2816007612d4e565b6120cd906008612a23565b6001600160401b03168a6120e283602e612d75565b815181106120f2576120f2612d61565b016020015160f81c901b91909117906001016120ae565b5091989097509095509350505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff1661216257604051631afcd79f60e31b815260040160405180910390fd5b565b61216c612119565b61217461259a565b61217c6125aa565b61183e816125b2565b7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f008054600119016121c957604051633ee5aeb560e01b815260040160405180910390fd5b60029055565b5f60608260800151516030146122395760405162461bcd60e51b815260206004820152602960248201527f5374616b696e674d657373616765733a20496e76616c6964207369676e6174756044820152680e4ca40d8cadccee8d60bb1b6064820152608401610365565b60408051608680825260c082019092525f916020820181803683370190505090505f5b60028110156122b057612270816001612d4e565b61227b906008612a23565b5081515f9083908390811061229257612292612d61565b60200101906001600160f81b03191690815f1a90535060010161225c565b505f5b600481101561230e576122c7816003612d4e565b6122d2906008612a23565b505f826122e0836002612d75565b815181106122f0576122f0612d61565b60200101906001600160f81b03191690815f1a9053506001016122b3565b505f5b602081101561236b578451816020811061232d5761232d612d61565b1a60f81b8261233d836006612d75565b8151811061234d5761234d612d61565b60200101906001600160f81b03191690815f1a905350600101612311565b505f5b60208110156123cb578460200151816020811061238d5761238d612d61565b1a60f81b8261239d836026612d75565b815181106123ad576123ad612d61565b60200101906001600160f81b03191690815f1a90535060010161236e565b505f5b600881101561243f576123e2816007612d4e565b6123ed906008612a23565b60ff1685604001516001600160401b0316901c60f81b828260466124119190612d75565b8151811061242157612421612d61565b60200101906001600160f81b03191690815f1a9053506001016123ce565b505f5b60308110156124aa578460800151818151811061246157612461612d61565b01602001516001600160f81b0319168261247c83604e612d75565b8151811061248c5761248c612d61565b60200101906001600160f81b03191690815f1a905350600101612442565b505f5b600881101561251c576124c1816007612d4e565b6124cc906008612a23565b60608601516001600160401b0390811691161c60f81b826124ee83607e612d75565b815181106124fe576124fe612d61565b60200101906001600160f81b03191690815f1a9053506001016124ad565b5060028160405161252d9190612fcb565b602060405180830381855afa158015612548573d5f803e3d5ffd5b5050506040513d601f19601f8201168201806040525081019061256b91906129d1565b94909350915050565b60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b6125a2612119565b6121626126e2565b612162612119565b6125ba612119565b80355f8051602061302283398151915290815560208201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6015560408201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6025560608201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6035561265260a0830160808401612766565b60048201805467ffffffffffffffff19166001600160401b039290921691909117905561268560c0830160a08401612fe6565b60048201805460ff92909216600160e01b0260ff60e01b199092169190911790556126b660e0830160c08401613006565b8160040160086101000a8154816001600160a01b0302191690836001600160a01b031602179055505050565b612574612119565b5080546126f690612c4d565b5f825580601f10612705575050565b601f0160209004905f5260205f209081019061183e91905b80821115612730575f815560010161271d565b5090565b5f60208284031215612744575f80fd5b5035919050565b80356001600160401b0381168114612761575f80fd5b919050565b5f60208284031215612776575f80fd5b61277f8261274b565b9392505050565b801515811461183e575f80fd5b803563ffffffff81168114612761575f80fd5b5f805f606084860312156127b8575f80fd5b8335925060208401356127ca81612786565b91506127d860408501612793565b90509250925092565b5f60e082840312156127f1575f80fd5b50919050565b5f60208284031215612807575f80fd5b61277f82612793565b634e487b7160e01b5f52604160045260245ffd5b604051606081016001600160401b038111828210171561284657612846612810565b60405290565b604051601f8201601f191681016001600160401b038111828210171561287457612874612810565b604052919050565b5f6001600160401b0382111561289457612894612810565b50601f01601f191660200190565b5f805f606084860312156128b4575f80fd5b833592506128c46020850161274b565b915060408401356001600160401b038111156128de575f80fd5b8401601f810186136128ee575f80fd5b80356129016128fc8261287c565b61284c565b818152876020838501011115612915575f80fd5b816020840160208301375f602083830101528093505050509250925092565b5f8060408385031215612945575f80fd5b61294e83612793565b9150602083013561295e81612786565b809150509250929050565b634e487b7160e01b5f52602160045260245ffd5b5f5b8381101561299757818101518382015260200161297f565b50505f910152565b602081525f82518060208401526129bd81604085016020870161297d565b601f01601f19169190910160400192915050565b5f602082840312156129e1575f80fd5b5051919050565b634e487b7160e01b5f52601260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b5f82612a1e57612a1e6129e8565b500490565b8082028115828204841417610403576104036129fc565b6020808252602a908201527f5374616b696e674d616e616765723a2053656e646572206e6f742076616c696460408201526930ba37b91037bbb732b960b11b606082015260800190565b6001600160a01b038116811461183e575f80fd5b805161276181612786565b5f8060408385031215612ab4575f80fd5b82516001600160401b0380821115612aca575f80fd5b9084019060608287031215612add575f80fd5b612ae5612824565b82518152602080840151612af881612a84565b82820152604084015183811115612b0d575f80fd5b80850194505087601f850112612b21575f80fd5b83519250612b316128fc8461287c565b8381528882858701011115612b44575f80fd5b612b538483830184880161297d565b80604084015250819550612b68818801612a98565b9450505050509250929050565b60208082526024908201527f5374616b696e674d616e616765723a20496e76616c69642077617270206d65736040820152637361676560e01b606082015260800190565b60208082526027908201527f5374616b696e674d616e616765723a20496e76616c696420736f7572636520636040820152661a185a5b88125160ca1b606082015260800190565b6020808252602d908201527f5374616b696e674d616e616765723a20496e76616c6964206f726967696e207360408201526c656e646572206164647265737360981b606082015260800190565b600181811c90821680612c6157607f821691505b6020821081036127f157634e487b7160e01b5f52602260045260245ffd5b60208082526025908201527f5374616b696e674d616e616765723a20496e76616c69642076616c69646174696040820152641bdb88125160da1b606082015260800190565b5f60208083525f8454612cd681612c4d565b806020870152604060018084165f8114612cf75760018114612d1357612d40565b60ff19851660408a0152604084151560051b8a01019550612d40565b895f5260205f205f5b85811015612d375781548b8201860152908301908801612d1c565b8a016040019650505b509398975050505050505050565b81810381811115610403576104036129fc565b634e487b7160e01b5f52603260045260245ffd5b80820180821115610403576104036129fc565b6001600160401b03818116838216019080821115612da857612da86129fc565b5092915050565b6001600160401b03818116838216028082169190828114612dd257612dd26129fc565b505092915050565b5f6001600160401b0380841680612df357612df36129e8565b92169190910492915050565b60208082526027908201527f5374616b696e674d657373616765733a20496e76616c6964206d657373616765604082015266040d8cadccee8d60cb1b606082015260800190565b60208082526021908201527f5374616b696e674d657373616765733a20496e76616c696420636f64656320496040820152601160fa1b606082015260800190565b60208082526025908201527f5374616b696e674d657373616765733a20496e76616c6964206d657373616765604082015264207479706560d81b606082015260800190565b601f821115610e4a57805f5260205f20601f840160051c81016020851015612ef15750805b601f840160051c820191505b818110156103ec575f8155600101612efd565b81516001600160401b03811115612f2957612f29612810565b612f3d81612f378454612c4d565b84612ecc565b602080601f831160018114612f70575f8415612f595750858301515b5f19600386901b1c1916600185901b178555610aa6565b5f85815260208120601f198616915b82811015612f9e57888601518255948401946001909101908401612f7f565b5085821015612fbb57878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b5f8251612fdc81846020870161297d565b9190910192915050565b5f60208284031215612ff6575f80fd5b813560ff8116811461277f575f80fd5b5f60208284031215613016575f80fd5b813561277f81612a8456feafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab600a164736f6c6343000819000a", + Bin: "0x608060405234801561000f575f80fd5b50604051612f62380380612f6283398101604081905261002e91610107565b60018160018111156100425761004261012c565b0361004f5761004f610055565b50610140565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156100a55760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146101045780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b5f60208284031215610117575f80fd5b815160028110610125575f80fd5b9392505050565b634e487b7160e01b5f52602160045260245ffd5b612e158061014d5f395ff3fe60806040526004361061008f575f3560e01c8063a3a65e4811610057578063a3a65e481461015b578063b771b3bc1461017a578063bee0a03f146101ac578063f40797d7146101cb578063fdf94a1a146101de575f80fd5b80630322ed98146100935780632e2194d8146100b457806362065856146100f057806376f786211461011d57806379f54eb11461013c575b5f80fd5b34801561009e575f80fd5b506100b26100ad36600461257a565b6101fd565b005b3480156100bf575f80fd5b506100d36100ce36600461257a565b6103f3565b6040516001600160401b0390911681526020015b60405180910390f35b3480156100fb575f80fd5b5061010f61010a3660046125ac565b610409565b6040519081526020016100e7565b348015610128575f80fd5b506100b26101373660046125ec565b610422565b348015610147575f80fd5b506100b2610156366004612627565b610995565b348015610166575f80fd5b506100b261017536600461263d565b610aa1565b348015610185575f80fd5b506101946005600160991b0181565b6040516001600160a01b0390911681526020016100e7565b3480156101b7575f80fd5b506100b26101c636600461257a565b610d2e565b61010f6101d93660046126e8565b610e42565b3480156101e9575f80fd5b506100b26101f836600461277a565b610e57565b5f8181527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab60860205260408082208151610120810190925280545f80516020612de983398151915293929190829060ff16600581111561025e5761025e6127af565b600581111561026f5761026f6127af565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003928301546001600160a01b03811660c084015260ff600160a01b820416151560e0840152600160a81b9004166101009091015290915081516005811115610306576103066127af565b1461036e5760405162461bcd60e51b815260206004820152602d60248201527f5374616b696e674d616e616765723a2056616c696461746f72206e6f7420706560448201526c1b991a5b99c81c995b5bdd985b609a1b60648201526084015b60405180910390fd5b5f61037f848361010001515f61127e565b60405163ee5b48eb60e01b81529091506005600160991b019063ee5b48eb906103ac9084906004016127e5565b6020604051808303815f875af11580156103c8573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103ec9190612817565b5050505050565b5f61040364e8d4a5100083612842565b92915050565b5f6104036001600160401b03831664e8d4a51000612861565b5f8381527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab60860205260408082208151610120810190925280545f80516020612de983398151915293929190829060ff166005811115610483576104836127af565b6005811115610494576104946127af565b8152600182015460208201526002808301546001600160401b038082166040850152600160401b820481166060850152600160801b820481166080850152600160c01b909104811660a08401526003909301546001600160a01b03811660c084015260ff600160a01b820416151560e0840152600160a81b9004909216610100909101529091508151600581111561052e5761052e6127af565b146105875760405162461bcd60e51b8152602060048201526024808201527f5374616b696e674d616e616765723a2056616c696461746f72206e6f742061636044820152637469766560e01b6064820152608401610365565b60c08101516001600160a01b0316336001600160a01b0316146105bc5760405162461bcd60e51b815260040161036590612878565b60038152426001600160401b031660808201525f8415610795576040516306f8253560e41b815263ffffffff851660048201525f9081906005600160991b0190636f825350906024015f60405180830381865afa15801561061f573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f1916820160405261064691908101906128e1565b91509150806106675760405162461bcd60e51b8152600401610365906129b3565b6005600160991b016001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106aa573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106ce9190612817565b8251146106ed5760405162461bcd60e51b8152600401610365906129f7565b60208201516001600160a01b0316156107185760405162461bcd60e51b815260040161036590612a3e565b5f80610727846040015161149b565b91509150818a1461078f5760405162461bcd60e51b815260206004820152602c60248201527f5374616b696e674d616e616765723a20496e76616c696420757074696d65207660448201526b185b1a59185d1a5bdb88125160a21b6064820152608401610365565b93505050505b6001600160401b03811660a08301525f86815260088401602052604090208251815484929190829060ff191660018360058111156107d5576107d56127af565b02179055506020820151600182015560408201516002820180546060850151608086015160a08701516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c08301516003909201805460e0850151610100958601516001600160a01b039095166001600160a81b031990921691909117600160a01b911515919091021767ffffffffffffffff60a81b1916600160a81b93909216929092021790558201515f906108c69088908361127e565b60405163ee5b48eb60e01b81529091505f906005600160991b019063ee5b48eb906108f59085906004016127e5565b6020604051808303815f875af1158015610911573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109359190612817565b60408581015181516001600160401b03918216815242602082015290861681830152905191925082918a917f530b908725650fb1052974f9df59e834fefac78c9ec2f00c6d2464d60cc6add5919081900360600190a35050505050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff1615906001600160401b03165f811580156109d95750825b90505f826001600160401b031660011480156109f45750303b155b905081158015610a02575080155b15610a205760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff191660011785558315610a4a57845460ff60401b1916600160401b1785555b610a5386611673565b8315610a9957845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050565b5f5f80516020612de98339815191526040516306f8253560e41b815263ffffffff841660048201529091505f9081906005600160991b0190636f825350906024015f60405180830381865afa158015610afc573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052610b2391908101906128e1565b9150915080610b445760405162461bcd60e51b8152600401610365906129b3565b8254825114610b655760405162461bcd60e51b8152600401610365906129f7565b60208201516001600160a01b031615610b905760405162461bcd60e51b815260040161036590612a3e565b5f80610b9f8460400151611687565b9150915080610bff5760405162461bcd60e51b815260206004820152602660248201527f5374616b696e674d616e616765723a20526567697374726174696f6e206e6f74604482015265081d985b1a5960d21b6064820152608401610365565b5f82815260078601602052604081208054610c1990612a8b565b9050118015610c4b575060015f83815260088701602052604090205460ff166005811115610c4957610c496127af565b145b610c675760405162461bcd60e51b815260040161036590612abd565b5f8281526007860160205260408120610c7f91612530565b5f8281526008860160208181526040808420805460ff191660029081178255810180546001600160401b0342818116600160401b026fffffffffffffffff000000000000000019909316929092178355600190930154875260098c0185528387208990559588905293835292548151931683529082019290925283917ff8fd1c90fb9cfa2ca2358fdf5806b086ad43315d92b221c929efc7f105ce7568910160405180910390a2505050505050565b5f8181527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6076020526040812080545f80516020612de9833981519152929190610d7690612a8b565b9050118015610da8575060015f83815260088301602052604090205460ff166005811115610da657610da66127af565b145b610dc45760405162461bcd60e51b815260040161036590612abd565b5f82815260078201602052604090819020905163ee5b48eb60e01b81526005600160991b019163ee5b48eb91610dfd9190600401612b02565b6020604051808303815f875af1158015610e19573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e3d9190612817565b505050565b5f610e4f84348585611828565b949350505050565b5f5f80516020612de98339815191526040516306f8253560e41b815263ffffffff851660048201529091505f9081906005600160991b0190636f825350906024015f60405180830381865afa158015610eb2573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052610ed991908101906128e1565b9150915080610efa5760405162461bcd60e51b8152600401610365906129b3565b5f8415610f73575f610f0f8460400151611d24565b919350909150506001600160401b03811615610f6d5760405162461bcd60e51b815260206004820181905260248201527f5374616b696e674d616e616765723a20576569676874206d75737420626520306044820152606401610365565b50610fe7565b5f610f818460400151611687565b90925090508015610fe55760405162461bcd60e51b815260206004820152602860248201527f5374616b696e674d616e616765723a20526567697374726174696f6e207374696044820152671b1b081d985b1a5960c21b6064820152608401610365565b505b5f818152600885016020526040808220815161012081019092528054829060ff166005811115611019576110196127af565b600581111561102a5761102a6127af565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003909201546001600160a01b0380821660c080850191909152600160a01b830460ff16151560e0850152600160a81b909204909316610100909201919091528201519192501633146110db5760405162461bcd60e51b815260040161036590612878565b5f6003825160058111156110f1576110f16127af565b148061110f575060028251600581111561110d5761110d6127af565b145b1561113257506020808201515f9081526009870190915260408120556004611136565b5060055b5f83815260088701602052604090208251815484929190829060ff19166001836005811115611167576111676127af565b0217905550602082015160018201556040808301516002830180546060860151608087015160a08801516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c08401516003909301805460e0860151610100909601516001600160a01b039095166001600160a81b031990911617600160a01b951515959095029490941767ffffffffffffffff60a81b1916600160a81b9390911692909202919091179091555183907f3532ad18e70a039beb4663d48c15acbef558c96ec9b8fd0cc3c0304f774740b8905f90a25050505050505050565b60408051603680825260608281019093525f91906020820181803683370190505090505f5b60028110156112f7576112b7816001612b8c565b6112c2906008612861565b5081515f908390839081106112d9576112d9612b9f565b60200101906001600160f81b03191690815f1a9053506001016112a3565b505f5b600481101561135a5761130e816003612b8c565b611319906008612861565b6001901c60f81b8261132c836002612bb3565b8151811061133c5761133c612b9f565b60200101906001600160f81b03191690815f1a9053506001016112fa565b505f5b60208110156113bc5761137181601f612b8c565b61137c906008612861565b86901c60f81b8261138e836006612bb3565b8151811061139e5761139e612b9f565b60200101906001600160f81b03191690815f1a90535060010161135d565b505f5b6008811015611427576113d3816007612b8c565b6113de906008612861565b6001600160401b038616901c60f81b826113f9836026612bb3565b8151811061140957611409612b9f565b60200101906001600160f81b03191690815f1a9053506001016113bf565b505f5b60088110156114925761143e816007612b8c565b611449906008612861565b6001600160401b038516901c60f81b8261146483602e612bb3565b8151811061147457611474612b9f565b60200101906001600160f81b03191690815f1a90535060010161142a565b50949350505050565b5f808251602e146114be5760405162461bcd60e51b815260040161036590612bc6565b5f805b600281101561150d576114d5816001612b8c565b6114e0906008612861565b61ffff168582815181106114f6576114f6612b9f565b016020015160f81c901b91909117906001016114c1565b5061ffff8116156115305760405162461bcd60e51b815260040161036590612c0d565b5f805b600481101561158b57611547816003612b8c565b611552906008612861565b63ffffffff1686611564836002612bb3565b8151811061157457611574612b9f565b016020015160f81c901b9190911790600101611533565b5063ffffffff81166004146115b25760405162461bcd60e51b815260040161036590612c4e565b5f805b6020811015611607576115c981601f612b8c565b6115d4906008612861565b876115e0836006612bb3565b815181106115f0576115f0612b9f565b016020015160f81c901b91909117906001016115b5565b505f805b60088110156116665761161f816007612b8c565b61162a906008612861565b6001600160401b03168861163f836026612bb3565b8151811061164f5761164f612b9f565b016020015160f81c901b919091179060010161160b565b5090969095509350505050565b61167b611f5f565b61168481611faa565b50565b5f8082516027146116aa5760405162461bcd60e51b815260040161036590612bc6565b5f805b60028110156116f9576116c1816001612b8c565b6116cc906008612861565b61ffff168582815181106116e2576116e2612b9f565b016020015160f81c901b91909117906001016116ad565b5061ffff81161561171c5760405162461bcd60e51b815260040161036590612c0d565b5f805b600481101561177757611733816003612b8c565b61173e906008612861565b63ffffffff1686611750836002612bb3565b8151811061176057611760612b9f565b016020015160f81c901b919091179060010161171f565b5063ffffffff811660021461179e5760405162461bcd60e51b815260040161036590612c4e565b5f805b60208110156117f3576117b581601f612b8c565b6117c0906008612861565b876117cc836006612bb3565b815181106117dc576117dc612b9f565b016020015160f81c901b91909117906001016117a1565b505f8660268151811061180857611808612b9f565b016020015191976001600160f81b03199092161515965090945050505050565b5f611831611fcb565b5f80516020612de9833981519152426001600160401b03851611801561186b57506001600160401b038416611869426202a300612bb3565b115b6118cb5760405162461bcd60e51b815260206004820152602b60248201527f5374616b696e674d616e616765723a20496e76616c696420726567697374726160448201526a74696f6e2065787069727960a81b6064820152608401610365565b856119185760405162461bcd60e51b815260206004820152601f60248201527f5374616b696e674d616e616765723a20496e76616c6964206e6f6465204944006044820152606401610365565b5f868152600982016020526040902054156119845760405162461bcd60e51b815260206004820152602660248201527f5374616b696e674d616e616765723a204e6f646520494420616c72656164792060448201526561637469766560d01b6064820152608401610365565b82516030146119e95760405162461bcd60e51b815260206004820152602b60248201527f5374616b696e674d616e616765723a20496e76616c696420626c735075626c6960448201526a0c696caf240d8cadccee8d60ab1b6064820152608401610365565b845f6119f4826103f3565b90508260020154816001600160401b031610158015611a2057508260030154816001600160401b031611155b611a785760405162461bcd60e51b8152602060048201526024808201527f5374616b696e674d616e616765723a20496e76616c6964207374616b6520616d6044820152631bdd5b9d60e21b6064820152608401610365565b5f80611abf6040518060a00160405280876001015481526020018c8152602001856001600160401b031681526020018a6001600160401b0316815260200189815250612015565b5f82815260078801602052604090209193509150611add8282612cd7565b5060405163ee5b48eb60e01b81525f906005600160991b019063ee5b48eb90611b0a9085906004016127e5565b6020604051808303815f875af1158015611b26573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611b4a9190612817565b6040805161012081019091529091508060018152602081018d90526001600160401b03861660408201525f606082018190526080820181905260a082015260c001336001600160a01b031681525f6020808301829052604092830182905286825260088a0190522081518154829060ff19166001836005811115611bd057611bd06127af565b021790555060208281015160018301556040808401516002840180546060870151608088015160a08901516001600160401b03908116600160c01b026001600160c01b03928216600160801b02929092166001600160801b03938216600160401b026001600160801b03199095169682169690961793909317919091169390931792909217905560c08501516003909401805460e0870151610100909701518316600160a81b0267ffffffffffffffff60a81b19971515600160a01b026001600160a81b03199092166001600160a01b039097169690961717959095169390931790935582518783168152918c169082015282918d9186917f79b81620b81daf2c08cd5bb3dbb79e75d2d7a87f52171fde5aadc8c47823026e910160405180910390a45090945050505050610e4f60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b5f805f8351603614611d485760405162461bcd60e51b815260040161036590612bc6565b5f805b6002811015611d9757611d5f816001612b8c565b611d6a906008612861565b61ffff16868281518110611d8057611d80612b9f565b016020015160f81c901b9190911790600101611d4b565b5061ffff811615611dba5760405162461bcd60e51b815260040161036590612c0d565b5f805b6004811015611e1557611dd1816003612b8c565b611ddc906008612861565b63ffffffff1687611dee836002612bb3565b81518110611dfe57611dfe612b9f565b016020015160f81c901b9190911790600101611dbd565b5063ffffffff8116600114611e3c5760405162461bcd60e51b815260040161036590612c4e565b5f805b6020811015611e9157611e5381601f612b8c565b611e5e906008612861565b88611e6a836006612bb3565b81518110611e7a57611e7a612b9f565b016020015160f81c901b9190911790600101611e3f565b505f805b6008811015611ef057611ea9816007612b8c565b611eb4906008612861565b6001600160401b031689611ec9836026612bb3565b81518110611ed957611ed9612b9f565b016020015160f81c901b9190911790600101611e95565b505f805b6008811015611f4f57611f08816007612b8c565b611f13906008612861565b6001600160401b03168a611f2883602e612bb3565b81518110611f3857611f38612b9f565b016020015160f81c901b9190911790600101611ef4565b5091989097509095509350505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff16611fa857604051631afcd79f60e31b815260040160405180910390fd5b565b611fb2611f5f565b611fba6123e0565b611fc26123f0565b611684816123f8565b7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0080546001190161200f57604051633ee5aeb560e01b815260040160405180910390fd5b60029055565b5f606082608001515160301461207f5760405162461bcd60e51b815260206004820152602960248201527f5374616b696e674d657373616765733a20496e76616c6964207369676e6174756044820152680e4ca40d8cadccee8d60bb1b6064820152608401610365565b60408051608680825260c082019092525f916020820181803683370190505090505f5b60028110156120f6576120b6816001612b8c565b6120c1906008612861565b5081515f908390839081106120d8576120d8612b9f565b60200101906001600160f81b03191690815f1a9053506001016120a2565b505f5b60048110156121545761210d816003612b8c565b612118906008612861565b505f82612126836002612bb3565b8151811061213657612136612b9f565b60200101906001600160f81b03191690815f1a9053506001016120f9565b505f5b60208110156121b1578451816020811061217357612173612b9f565b1a60f81b82612183836006612bb3565b8151811061219357612193612b9f565b60200101906001600160f81b03191690815f1a905350600101612157565b505f5b602081101561221157846020015181602081106121d3576121d3612b9f565b1a60f81b826121e3836026612bb3565b815181106121f3576121f3612b9f565b60200101906001600160f81b03191690815f1a9053506001016121b4565b505f5b600881101561228557612228816007612b8c565b612233906008612861565b60ff1685604001516001600160401b0316901c60f81b828260466122579190612bb3565b8151811061226757612267612b9f565b60200101906001600160f81b03191690815f1a905350600101612214565b505f5b60308110156122f057846080015181815181106122a7576122a7612b9f565b01602001516001600160f81b031916826122c283604e612bb3565b815181106122d2576122d2612b9f565b60200101906001600160f81b03191690815f1a905350600101612288565b505f5b600881101561236257612307816007612b8c565b612312906008612861565b60608601516001600160401b0390811691161c60f81b8261233483607e612bb3565b8151811061234457612344612b9f565b60200101906001600160f81b03191690815f1a9053506001016122f3565b506002816040516123739190612d92565b602060405180830381855afa15801561238e573d5f803e3d5ffd5b5050506040513d601f19601f820116820180604052508101906123b19190612817565b94909350915050565b60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b6123e8611f5f565b611fa8612528565b611fa8611f5f565b612400611f5f565b80355f80516020612de983398151915290815560208201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6015560408201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6025560608201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6035561249860a08301608084016125ac565b60048201805467ffffffffffffffff19166001600160401b03929092169190911790556124cb60c0830160a08401612dad565b60048201805460ff92909216600160e01b0260ff60e01b199092169190911790556124fc60e0830160c08401612dcd565b8160040160086101000a8154816001600160a01b0302191690836001600160a01b031602179055505050565b6123ba611f5f565b50805461253c90612a8b565b5f825580601f1061254b575050565b601f0160209004905f5260205f209081019061168491905b80821115612576575f8155600101612563565b5090565b5f6020828403121561258a575f80fd5b5035919050565b80356001600160401b03811681146125a7575f80fd5b919050565b5f602082840312156125bc575f80fd5b6125c582612591565b9392505050565b8015158114611684575f80fd5b803563ffffffff811681146125a7575f80fd5b5f805f606084860312156125fe575f80fd5b833592506020840135612610816125cc565b915061261e604085016125d9565b90509250925092565b5f60e08284031215612637575f80fd5b50919050565b5f6020828403121561264d575f80fd5b6125c5826125d9565b634e487b7160e01b5f52604160045260245ffd5b604051606081016001600160401b038111828210171561268c5761268c612656565b60405290565b604051601f8201601f191681016001600160401b03811182821017156126ba576126ba612656565b604052919050565b5f6001600160401b038211156126da576126da612656565b50601f01601f191660200190565b5f805f606084860312156126fa575f80fd5b8335925061270a60208501612591565b915060408401356001600160401b03811115612724575f80fd5b8401601f81018613612734575f80fd5b8035612747612742826126c2565b612692565b81815287602083850101111561275b575f80fd5b816020840160208301375f602083830101528093505050509250925092565b5f806040838503121561278b575f80fd5b612794836125d9565b915060208301356127a4816125cc565b809150509250929050565b634e487b7160e01b5f52602160045260245ffd5b5f5b838110156127dd5781810151838201526020016127c5565b50505f910152565b602081525f82518060208401526128038160408501602087016127c3565b601f01601f19169190910160400192915050565b5f60208284031215612827575f80fd5b5051919050565b634e487b7160e01b5f52601160045260245ffd5b5f8261285c57634e487b7160e01b5f52601260045260245ffd5b500490565b80820281158282048414176104035761040361282e565b6020808252602a908201527f5374616b696e674d616e616765723a2053656e646572206e6f742076616c696460408201526930ba37b91037bbb732b960b11b606082015260800190565b6001600160a01b0381168114611684575f80fd5b80516125a7816125cc565b5f80604083850312156128f2575f80fd5b82516001600160401b0380821115612908575f80fd5b908401906060828703121561291b575f80fd5b61292361266a565b82518152602080840151612936816128c2565b8282015260408401518381111561294b575f80fd5b80850194505087601f85011261295f575f80fd5b8351925061296f612742846126c2565b8381528882858701011115612982575f80fd5b612991848383018488016127c3565b806040840152508195506129a68188016128d6565b9450505050509250929050565b60208082526024908201527f5374616b696e674d616e616765723a20496e76616c69642077617270206d65736040820152637361676560e01b606082015260800190565b60208082526027908201527f5374616b696e674d616e616765723a20496e76616c696420736f7572636520636040820152661a185a5b88125160ca1b606082015260800190565b6020808252602d908201527f5374616b696e674d616e616765723a20496e76616c6964206f726967696e207360408201526c656e646572206164647265737360981b606082015260800190565b600181811c90821680612a9f57607f821691505b60208210810361263757634e487b7160e01b5f52602260045260245ffd5b60208082526025908201527f5374616b696e674d616e616765723a20496e76616c69642076616c69646174696040820152641bdb88125160da1b606082015260800190565b5f60208083525f8454612b1481612a8b565b806020870152604060018084165f8114612b355760018114612b5157612b7e565b60ff19851660408a0152604084151560051b8a01019550612b7e565b895f5260205f205f5b85811015612b755781548b8201860152908301908801612b5a565b8a016040019650505b509398975050505050505050565b818103818111156104035761040361282e565b634e487b7160e01b5f52603260045260245ffd5b808201808211156104035761040361282e565b60208082526027908201527f5374616b696e674d657373616765733a20496e76616c6964206d657373616765604082015266040d8cadccee8d60cb1b606082015260800190565b60208082526021908201527f5374616b696e674d657373616765733a20496e76616c696420636f64656320496040820152601160fa1b606082015260800190565b60208082526025908201527f5374616b696e674d657373616765733a20496e76616c6964206d657373616765604082015264207479706560d81b606082015260800190565b601f821115610e3d57805f5260205f20601f840160051c81016020851015612cb85750805b601f840160051c820191505b818110156103ec575f8155600101612cc4565b81516001600160401b03811115612cf057612cf0612656565b612d0481612cfe8454612a8b565b84612c93565b602080601f831160018114612d37575f8415612d205750858301515b5f19600386901b1c1916600185901b178555610a99565b5f85815260208120601f198616915b82811015612d6557888601518255948401946001909101908401612d46565b5085821015612d8257878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b5f8251612da38184602087016127c3565b9190910192915050565b5f60208284031215612dbd575f80fd5b813560ff811681146125c5575f80fd5b5f60208284031215612ddd575f80fd5b81356125c5816128c256feafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab600a164736f6c6343000819000a", } // NativeTokenStakingManagerABI is the input ABI used to generate the binding from. diff --git a/contracts/staking/StakingManager.sol b/contracts/staking/StakingManager.sol index 75482afff..619e784f2 100644 --- a/contracts/staking/StakingManager.sol +++ b/contracts/staking/StakingManager.sol @@ -146,6 +146,7 @@ abstract contract StakingManager is // Ensure the stake churn doesn't exceed the maximum churn rate. uint64 weight = valueToWeight(lockedValue); + // TODO: Support this in the e2e test // _checkAndUpdateChurnTracker(weight); // Ensure the weight is within the valid range. @@ -258,7 +259,8 @@ abstract contract StakingManager is require(_msgSender() == validator.owner, "StakingManager: Sender not validator owner"); // Check that removing this validator would not exceed the maximum churn rate. - _checkAndUpdateChurnTracker(validator.weight); + // TODO: Support this in the e2e test + // _checkAndUpdateChurnTracker(validator.weight); // Update the validator status to pending removal. // They are not removed from the active validators mapping until the P-Chain acknowledges the removal. diff --git a/tests/flows/native_token_staking.go b/tests/flows/native_token_staking.go index 789872b78..de21a4f8b 100644 --- a/tests/flows/native_token_staking.go +++ b/tests/flows/native_token_staking.go @@ -199,4 +199,96 @@ func NativeTokenStakingManager(network interfaces.LocalNetwork) { ) Expect(err).Should(BeNil()) Expect(registrationEvent.ValidationID[:]).Should(Equal(validationID[:])) + + // + // Delist the validator + // + { + opts, err = bind.NewKeyedTransactorWithChainID(fundedKey, subnetAInfo.EVMChainID) + Expect(err).Should(BeNil()) + tx, err = stakingManager.InitializeEndValidation( + opts, + validationID, + false, + 0, + ) + Expect(err).Should(BeNil()) + receipt = utils.WaitForTransactionSuccess(context.Background(), subnetAInfo, tx.Hash()) + validatorRemovalEvent, err := utils.GetEventFromLogs( + receipt.Logs, + stakingManager.ParseValidatorRemovalInitialized, + ) + Expect(err).Should(BeNil()) + Expect(validatorRemovalEvent.ValidationID[:]).Should(Equal(validationID[:])) + Expect(validatorRemovalEvent.StakeAmount.Uint64()).Should(Equal(uint64(1e6))) + + // Gather subnet-evm Warp signatures for the SetSubnetValidatorWeightMessage & relay to the P-Chain + // (Sending to the P-Chain will be skipped for now) + signedWarpMessage = network.ConstructSignedWarpMessage(context.Background(), receipt, subnetAInfo, pChainInfo) + Expect(err).Should(BeNil()) + log.Info("Constructed signed SetSubnetValidatorWeightMessage message", "message", signedWarpMessage) + // Validate the Warp message, (this will be done on the P-Chain in the future) + msg, err = warpPayload.ParseAddressedCall(signedWarpMessage.UnsignedMessage.Payload) + Expect(err).Should(BeNil()) + // Check that the addressed call payload is a registered Warp message type + var payloadInterface warpMessages.Payload + ver, err := warpMessages.Codec.Unmarshal(msg.Payload, &payloadInterface) + Expect(err).Should(BeNil()) + registerValidatorPayload, ok := payloadInterface.(*warpMessages.SetSubnetValidatorWeight) + Expect(ok).Should(BeTrue()) + + Expect(ver).Should(Equal(uint16(warpMessages.CodecVersion))) + Expect(registerValidatorPayload.ValidationID).Should(Equal(validationID)) + Expect(registerValidatorPayload.Weight).Should(Equal(uint64(0))) + Expect(registerValidatorPayload.Nonce).Should(Equal(uint64(0))) + + // Construct a SubnetValidatorRegistrationMessage Warp message from the P-Chain + // Query P-Chain validators for the Warp message + registrationPayload, err := warpMessages.NewSubnetValidatorRegistration(validationID, false) + Expect(err).Should(BeNil()) + registrationAddressedCall, err := warpPayload.NewAddressedCall(common.Address{}.Bytes(), registrationPayload.Bytes()) + Expect(err).Should(BeNil()) + registrationUnsignedMessage, err := avalancheWarp.NewUnsignedMessage(network.GetNetworkID(), pChainInfo.BlockchainID, registrationAddressedCall.Bytes()) + Expect(err).Should(BeNil()) + log.Info("Constructed unsigned SubnetValidatorRegistration message", "message", hex.EncodeToString(registrationUnsignedMessage.Bytes())) + + registrationSignedMessage, err := signatureAggregator.CreateSignedMessage( + registrationUnsignedMessage, + nil, + subnetAInfo.SubnetID, + 67, + ) + Expect(err).Should(BeNil()) + log.Info("Constructed signed SubnetValidatorRegistration message", "message", registrationSignedMessage) + + // Deliver the Warp message to the subnet + abi, err := nativetokenstakingmanager.NativeTokenStakingManagerMetaData.GetAbi() + Expect(err).Should(BeNil()) + callData, err := abi.Pack("completeEndValidation", uint32(0), false) + Expect(err).Should(BeNil()) + gasFeeCap, gasTipCap, nonce := utils.CalculateTxParams(context.Background(), subnetAInfo, utils.PrivateKeyToAddress(fundedKey)) + registrationTx := predicateutils.NewPredicateTx( + subnetAInfo.EVMChainID, + nonce, + &stakingManagerContractAddress, + 2_000_000, + gasFeeCap, + gasTipCap, + big.NewInt(0), + callData, + types.AccessList{}, + warp.ContractAddress, + registrationSignedMessage.Bytes(), + ) + signedRegistrationTx := utils.SignTransaction(registrationTx, fundedKey, subnetAInfo.EVMChainID) + receipt = utils.SendTransactionAndWaitForSuccess(context.Background(), subnetAInfo, signedRegistrationTx) + + // Check that the validator is registered in the staking contract + registrationEvent, err := utils.GetEventFromLogs( + receipt.Logs, + stakingManager.ParseValidationPeriodEnded, + ) + Expect(err).Should(BeNil()) + Expect(registrationEvent.ValidationID[:]).Should(Equal(validationID[:])) + } } From 935cd864e298a6b7528bec9d21b741f9d0413692 Mon Sep 17 00:00:00 2001 From: cam-schultz Date: Thu, 15 Aug 2024 12:04:04 -0400 Subject: [PATCH 12/27] scope listing and delisting steps --- tests/flows/native_token_staking.go | 182 +++++++++++++++------------- 1 file changed, 97 insertions(+), 85 deletions(-) diff --git a/tests/flows/native_token_staking.go b/tests/flows/native_token_staking.go index de21a4f8b..b30f9bec5 100644 --- a/tests/flows/native_token_staking.go +++ b/tests/flows/native_token_staking.go @@ -39,6 +39,12 @@ import ( // - Aggregate P-Chain signatures on the response Warp message // - Deliver the Warp message to the subnet // - Verify that the validator is registered in the staking contract +// Delists the validator from the subnet. The steps are as follows: +// - Initiate validator delisting +// - Deliver the Warp message to the P-Chain (not implemented) +// - Aggregate P-Chain signatures on the response Warp message +// - Deliver the Warp message to the subnet +// - Verify that the validator is delisted from the staking contract func NativeTokenStakingManager(network interfaces.LocalNetwork) { // Get the subnets info cChainInfo := network.GetPrimaryNetworkInfo() @@ -110,95 +116,101 @@ func NativeTokenStakingManager(network interfaces.LocalNetwork) { ) Expect(err).Should(BeNil()) utils.WaitForTransactionSuccess(context.Background(), subnetAInfo, tx.Hash()) - // Iniatiate validator registration - opts.Value = big.NewInt(0).SetUint64(1e18) - nodeID := ids.GenerateTestID() - blsPublicKey := [48]byte{} - tx, err = stakingManager.InitializeValidatorRegistration( - opts, - nodeID, - uint64(time.Now().Add(24*time.Hour).Unix()), - blsPublicKey[:], - ) - Expect(err).Should(BeNil()) - receipt := utils.WaitForTransactionSuccess(context.Background(), subnetAInfo, tx.Hash()) - registrationInitiatedEvent, err := utils.GetEventFromLogs( - receipt.Logs, - stakingManager.ParseValidationPeriodCreated, - ) - Expect(err).Should(BeNil()) - validationID := ids.ID(registrationInitiatedEvent.ValidationID) + // + // Register a validator + // + var validationID ids.ID // To be used in the delisting step + { + // Iniatiate validator registration + opts.Value = big.NewInt(0).SetUint64(1e18) + nodeID := ids.GenerateTestID() + blsPublicKey := [48]byte{} + tx, err = stakingManager.InitializeValidatorRegistration( + opts, + nodeID, + uint64(time.Now().Add(24*time.Hour).Unix()), + blsPublicKey[:], + ) + Expect(err).Should(BeNil()) + receipt := utils.WaitForTransactionSuccess(context.Background(), subnetAInfo, tx.Hash()) + registrationInitiatedEvent, err := utils.GetEventFromLogs( + receipt.Logs, + stakingManager.ParseValidationPeriodCreated, + ) + Expect(err).Should(BeNil()) + validationID = ids.ID(registrationInitiatedEvent.ValidationID) - // Gather subnet-evm Warp signatures for the RegisterSubnetValidatorMessage & relay to the P-Chain - // (Sending to the P-Chain will be skipped for now) - signedWarpMessage := network.ConstructSignedWarpMessage(context.Background(), receipt, subnetAInfo, pChainInfo) - Expect(err).Should(BeNil()) - log.Info("Constructed signed RegisterSubnetValidator message", "message", signedWarpMessage) - // Validate the Warp message, (this will be done on the P-Chain in the future) - msg, err := warpPayload.ParseAddressedCall(signedWarpMessage.UnsignedMessage.Payload) - Expect(err).Should(BeNil()) - // Check that the addressed call payload is a registered Warp message type - var payloadInterface warpMessages.Payload - ver, err := warpMessages.Codec.Unmarshal(msg.Payload, &payloadInterface) - Expect(err).Should(BeNil()) - registerValidatorPayload, ok := payloadInterface.(*warpMessages.RegisterSubnetValidator) - Expect(ok).Should(BeTrue()) + // Gather subnet-evm Warp signatures for the RegisterSubnetValidatorMessage & relay to the P-Chain + // (Sending to the P-Chain will be skipped for now) + signedWarpMessage := network.ConstructSignedWarpMessage(context.Background(), receipt, subnetAInfo, pChainInfo) + Expect(err).Should(BeNil()) + log.Info("Constructed signed RegisterSubnetValidator message", "message", signedWarpMessage) + // Validate the Warp message, (this will be done on the P-Chain in the future) + msg, err := warpPayload.ParseAddressedCall(signedWarpMessage.UnsignedMessage.Payload) + Expect(err).Should(BeNil()) + // Check that the addressed call payload is a registered Warp message type + var payloadInterface warpMessages.Payload + ver, err := warpMessages.Codec.Unmarshal(msg.Payload, &payloadInterface) + Expect(err).Should(BeNil()) + registerValidatorPayload, ok := payloadInterface.(*warpMessages.RegisterSubnetValidator) + Expect(ok).Should(BeTrue()) - Expect(ver).Should(Equal(uint16(warpMessages.CodecVersion))) - Expect(registerValidatorPayload.NodeID).Should(Equal(nodeID)) - Expect(registerValidatorPayload.Weight).Should(Equal(uint64(1e6))) - Expect(registerValidatorPayload.SubnetID).Should(Equal(subnetAInfo.SubnetID)) - Expect(registerValidatorPayload.BlsPubKey[:]).Should(Equal(blsPublicKey[:])) + Expect(ver).Should(Equal(uint16(warpMessages.CodecVersion))) + Expect(registerValidatorPayload.NodeID).Should(Equal(nodeID)) + Expect(registerValidatorPayload.Weight).Should(Equal(uint64(1e6))) + Expect(registerValidatorPayload.SubnetID).Should(Equal(subnetAInfo.SubnetID)) + Expect(registerValidatorPayload.BlsPubKey[:]).Should(Equal(blsPublicKey[:])) - // Construct a SubnetValidatorRegistrationMessage Warp message from the P-Chain - // Query P-Chain validators for the Warp message - registrationPayload, err := warpMessages.NewSubnetValidatorRegistration(validationID, true) - Expect(err).Should(BeNil()) - registrationAddressedCall, err := warpPayload.NewAddressedCall(common.Address{}.Bytes(), registrationPayload.Bytes()) - Expect(err).Should(BeNil()) - registrationUnsignedMessage, err := avalancheWarp.NewUnsignedMessage(network.GetNetworkID(), pChainInfo.BlockchainID, registrationAddressedCall.Bytes()) - Expect(err).Should(BeNil()) - log.Info("Constructed unsigned SubnetValidatorRegistration message", "message", hex.EncodeToString(registrationUnsignedMessage.Bytes())) + // Construct a SubnetValidatorRegistrationMessage Warp message from the P-Chain + // Query P-Chain validators for the Warp message + registrationPayload, err := warpMessages.NewSubnetValidatorRegistration(validationID, true) + Expect(err).Should(BeNil()) + registrationAddressedCall, err := warpPayload.NewAddressedCall(common.Address{}.Bytes(), registrationPayload.Bytes()) + Expect(err).Should(BeNil()) + registrationUnsignedMessage, err := avalancheWarp.NewUnsignedMessage(network.GetNetworkID(), pChainInfo.BlockchainID, registrationAddressedCall.Bytes()) + Expect(err).Should(BeNil()) + log.Info("Constructed unsigned SubnetValidatorRegistration message", "message", hex.EncodeToString(registrationUnsignedMessage.Bytes())) - registrationSignedMessage, err := signatureAggregator.CreateSignedMessage( - registrationUnsignedMessage, - nil, - subnetAInfo.SubnetID, - 67, - ) - Expect(err).Should(BeNil()) - log.Info("Constructed signed SubnetValidatorRegistration message", "message", registrationSignedMessage) + registrationSignedMessage, err := signatureAggregator.CreateSignedMessage( + registrationUnsignedMessage, + nil, + subnetAInfo.SubnetID, + 67, + ) + Expect(err).Should(BeNil()) + log.Info("Constructed signed SubnetValidatorRegistration message", "message", registrationSignedMessage) - // Deliver the Warp message to the subnet - abi, err := nativetokenstakingmanager.NativeTokenStakingManagerMetaData.GetAbi() - Expect(err).Should(BeNil()) - callData, err := abi.Pack("completeValidatorRegistration", uint32(0)) - Expect(err).Should(BeNil()) - gasFeeCap, gasTipCap, nonce := utils.CalculateTxParams(context.Background(), subnetAInfo, utils.PrivateKeyToAddress(fundedKey)) - registrationTx := predicateutils.NewPredicateTx( - subnetAInfo.EVMChainID, - nonce, - &stakingManagerContractAddress, - 2_000_000, - gasFeeCap, - gasTipCap, - big.NewInt(0), - callData, - types.AccessList{}, - warp.ContractAddress, - registrationSignedMessage.Bytes(), - ) - signedRegistrationTx := utils.SignTransaction(registrationTx, fundedKey, subnetAInfo.EVMChainID) - receipt = utils.SendTransactionAndWaitForSuccess(context.Background(), subnetAInfo, signedRegistrationTx) + // Deliver the Warp message to the subnet + abi, err := nativetokenstakingmanager.NativeTokenStakingManagerMetaData.GetAbi() + Expect(err).Should(BeNil()) + callData, err := abi.Pack("completeValidatorRegistration", uint32(0)) + Expect(err).Should(BeNil()) + gasFeeCap, gasTipCap, nonce := utils.CalculateTxParams(context.Background(), subnetAInfo, utils.PrivateKeyToAddress(fundedKey)) + registrationTx := predicateutils.NewPredicateTx( + subnetAInfo.EVMChainID, + nonce, + &stakingManagerContractAddress, + 2_000_000, + gasFeeCap, + gasTipCap, + big.NewInt(0), + callData, + types.AccessList{}, + warp.ContractAddress, + registrationSignedMessage.Bytes(), + ) + signedRegistrationTx := utils.SignTransaction(registrationTx, fundedKey, subnetAInfo.EVMChainID) + receipt = utils.SendTransactionAndWaitForSuccess(context.Background(), subnetAInfo, signedRegistrationTx) - // Check that the validator is registered in the staking contract - registrationEvent, err := utils.GetEventFromLogs( - receipt.Logs, - stakingManager.ParseValidationPeriodRegistered, - ) - Expect(err).Should(BeNil()) - Expect(registrationEvent.ValidationID[:]).Should(Equal(validationID[:])) + // Check that the validator is registered in the staking contract + registrationEvent, err := utils.GetEventFromLogs( + receipt.Logs, + stakingManager.ParseValidationPeriodRegistered, + ) + Expect(err).Should(BeNil()) + Expect(registrationEvent.ValidationID[:]).Should(Equal(validationID[:])) + } // // Delist the validator @@ -213,7 +225,7 @@ func NativeTokenStakingManager(network interfaces.LocalNetwork) { 0, ) Expect(err).Should(BeNil()) - receipt = utils.WaitForTransactionSuccess(context.Background(), subnetAInfo, tx.Hash()) + receipt := utils.WaitForTransactionSuccess(context.Background(), subnetAInfo, tx.Hash()) validatorRemovalEvent, err := utils.GetEventFromLogs( receipt.Logs, stakingManager.ParseValidatorRemovalInitialized, @@ -224,11 +236,11 @@ func NativeTokenStakingManager(network interfaces.LocalNetwork) { // Gather subnet-evm Warp signatures for the SetSubnetValidatorWeightMessage & relay to the P-Chain // (Sending to the P-Chain will be skipped for now) - signedWarpMessage = network.ConstructSignedWarpMessage(context.Background(), receipt, subnetAInfo, pChainInfo) + signedWarpMessage := network.ConstructSignedWarpMessage(context.Background(), receipt, subnetAInfo, pChainInfo) Expect(err).Should(BeNil()) log.Info("Constructed signed SetSubnetValidatorWeightMessage message", "message", signedWarpMessage) // Validate the Warp message, (this will be done on the P-Chain in the future) - msg, err = warpPayload.ParseAddressedCall(signedWarpMessage.UnsignedMessage.Payload) + msg, err := warpPayload.ParseAddressedCall(signedWarpMessage.UnsignedMessage.Payload) Expect(err).Should(BeNil()) // Check that the addressed call payload is a registered Warp message type var payloadInterface warpMessages.Payload From aa975ac18b058cbd7783831c17d90ab6904171a2 Mon Sep 17 00:00:00 2001 From: cam-schultz Date: Thu, 15 Aug 2024 12:20:16 -0400 Subject: [PATCH 13/27] add back in churn tracker --- .../ERC20TokenStakingManager/ERC20TokenStakingManager.go | 2 +- .../NativeTokenStakingManager/NativeTokenStakingManager.go | 2 +- contracts/staking/StakingManager.sol | 6 ++---- tests/flows/native_token_staking.go | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/abi-bindings/go/staking/ERC20TokenStakingManager/ERC20TokenStakingManager.go b/abi-bindings/go/staking/ERC20TokenStakingManager/ERC20TokenStakingManager.go index 3d8f473e9..5a1485209 100644 --- a/abi-bindings/go/staking/ERC20TokenStakingManager/ERC20TokenStakingManager.go +++ b/abi-bindings/go/staking/ERC20TokenStakingManager/ERC20TokenStakingManager.go @@ -43,7 +43,7 @@ type StakingManagerSettings struct { // ERC20TokenStakingManagerMetaData contains all meta data concerning the ERC20TokenStakingManager contract. var ERC20TokenStakingManagerMetaData = &bind.MetaData{ ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"init\",\"type\":\"uint8\",\"internalType\":\"enumICMInitializable\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"WARP_MESSENGER\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIWarpMessenger\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"completeEndValidation\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"setWeightMessageType\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"completeValidatorRegistration\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"settings\",\"type\":\"tuple\",\"internalType\":\"structStakingManagerSettings\",\"components\":[{\"name\":\"pChainBlockchainID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"subnetID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"minimumStakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"maximumStakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"minimumStakeDuration\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"maximumHourlyChurn\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"rewardCalculator\",\"type\":\"address\",\"internalType\":\"contractIRewardCalculator\"}]},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeEndValidation\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"includeUptimeProof\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeValidatorRegistration\",\"inputs\":[{\"name\":\"stakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"nodeID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"resendEndValidatorMessage\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"resendRegisterValidatorMessage\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"valueToWeight\",\"inputs\":[{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"weightToValue\",\"inputs\":[{\"name\":\"weight\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"pure\"},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodCreated\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"nodeID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"registerValidationMessageID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"weight\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodEnded\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodRegistered\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"stakeAmount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"timestamp\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidatorRemovalInitialized\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"setWeightMessageID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"stakeAmount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"endTime\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"uptime\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ReentrancyGuardReentrantCall\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"SafeERC20FailedOperation\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}]}]", - Bin: "0x608060405234801561000f575f80fd5b5060405161326738038061326783398101604081905261002e91610107565b60018160018111156100425761004261012c565b0361004f5761004f610055565b50610140565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156100a55760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146101045780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b5f60208284031215610117575f80fd5b815160028110610125575f80fd5b9392505050565b634e487b7160e01b5f52602160045260245ffd5b61311a8061014d5f395ff3fe608060405234801561000f575f80fd5b506004361061009b575f3560e01c8063872fda6411610063578063872fda641461012b578063a3a65e481461013e578063b771b3bc14610151578063bee0a03f14610177578063fdf94a1a1461018a575f80fd5b80630322ed981461009f5780632e2194d8146100b45780635d0d7466146100e457806362065856146100f757806376f7862114610118575b5f80fd5b6100b26100ad36600461284f565b61019d565b005b6100c76100c236600461284f565b610393565b6040516001600160401b0390911681526020015b60405180910390f35b6100b26100f236600461287a565b6103a9565b61010a6101053660046128d2565b6104b7565b6040519081526020016100db565b6100b2610126366004612912565b6104d0565b61010a6101393660046129df565b610a43565b6100b261014c366004612a7b565b610a5b565b61015f6005600160991b0181565b6040516001600160a01b0390911681526020016100db565b6100b261018536600461284f565b610ce8565b6100b2610198366004612a94565b610dfc565b5f8181527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab60860205260408082208151610120810190925280545f805160206130ee83398151915293929190829060ff1660058111156101fe576101fe612abe565b600581111561020f5761020f612abe565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003928301546001600160a01b03811660c084015260ff600160a01b820416151560e0840152600160a81b90041661010090910152909150815160058111156102a6576102a6612abe565b1461030e5760405162461bcd60e51b815260206004820152602d60248201527f5374616b696e674d616e616765723a2056616c696461746f72206e6f7420706560448201526c1b991a5b99c81c995b5bdd985b609a1b60648201526084015b60405180910390fd5b5f61031f848361010001515f611223565b60405163ee5b48eb60e01b81529091506005600160991b019063ee5b48eb9061034c908490600401612af4565b6020604051808303815f875af1158015610368573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061038c9190612b26565b5050505050565b5f6103a364e8d4a5100083612b51565b92915050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff1615906001600160401b03165f811580156103ed5750825b90505f826001600160401b031660011480156104085750303b155b905081158015610416575080155b156104345760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561045e57845460ff60401b1916600160401b1785555b6104688787611440565b83156104ae57845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50505050505050565b5f6103a36001600160401b03831664e8d4a51000612b70565b5f8381527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab60860205260408082208151610120810190925280545f805160206130ee83398151915293929190829060ff16600581111561053157610531612abe565b600581111561054257610542612abe565b8152600182015460208201526002808301546001600160401b038082166040850152600160401b820481166060850152600160801b820481166080850152600160c01b909104811660a08401526003909301546001600160a01b03811660c084015260ff600160a01b820416151560e0840152600160a81b900490921661010090910152909150815160058111156105dc576105dc612abe565b146106355760405162461bcd60e51b8152602060048201526024808201527f5374616b696e674d616e616765723a2056616c696461746f72206e6f742061636044820152637469766560e01b6064820152608401610305565b60c08101516001600160a01b0316336001600160a01b03161461066a5760405162461bcd60e51b815260040161030590612b87565b60038152426001600160401b031660808201525f8415610843576040516306f8253560e41b815263ffffffff851660048201525f9081906005600160991b0190636f825350906024015f60405180830381865afa1580156106cd573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f191682016040526106f49190810190612bdc565b91509150806107155760405162461bcd60e51b815260040161030590612cae565b6005600160991b016001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa158015610758573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061077c9190612b26565b82511461079b5760405162461bcd60e51b815260040161030590612cf2565b60208201516001600160a01b0316156107c65760405162461bcd60e51b815260040161030590612d39565b5f806107d5846040015161145e565b91509150818a1461083d5760405162461bcd60e51b815260206004820152602c60248201527f5374616b696e674d616e616765723a20496e76616c696420757074696d65207660448201526b185b1a59185d1a5bdb88125160a21b6064820152608401610305565b93505050505b6001600160401b03811660a08301525f86815260088401602052604090208251815484929190829060ff1916600183600581111561088357610883612abe565b02179055506020820151600182015560408201516002820180546060850151608086015160a08701516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c08301516003909201805460e0850151610100958601516001600160a01b039095166001600160a81b031990921691909117600160a01b911515919091021767ffffffffffffffff60a81b1916600160a81b93909216929092021790558201515f9061097490889083611223565b60405163ee5b48eb60e01b81529091505f906005600160991b019063ee5b48eb906109a3908590600401612af4565b6020604051808303815f875af11580156109bf573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109e39190612b26565b60408581015181516001600160401b03918216815242602082015290861681830152905191925082918a917f530b908725650fb1052974f9df59e834fefac78c9ec2f00c6d2464d60cc6add5919081900360600190a35050505050505050565b5f610a5084868585611636565b90505b949350505050565b5f5f805160206130ee8339815191526040516306f8253560e41b815263ffffffff841660048201529091505f9081906005600160991b0190636f825350906024015f60405180830381865afa158015610ab6573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052610add9190810190612bdc565b9150915080610afe5760405162461bcd60e51b815260040161030590612cae565b8254825114610b1f5760405162461bcd60e51b815260040161030590612cf2565b60208201516001600160a01b031615610b4a5760405162461bcd60e51b815260040161030590612d39565b5f80610b598460400151611b3d565b9150915080610bb95760405162461bcd60e51b815260206004820152602660248201527f5374616b696e674d616e616765723a20526567697374726174696f6e206e6f74604482015265081d985b1a5960d21b6064820152608401610305565b5f82815260078601602052604081208054610bd390612d86565b9050118015610c05575060015f83815260088701602052604090205460ff166005811115610c0357610c03612abe565b145b610c215760405162461bcd60e51b815260040161030590612dbe565b5f8281526007860160205260408120610c3991612805565b5f8281526008860160208181526040808420805460ff191660029081178255810180546001600160401b0342818116600160401b026fffffffffffffffff000000000000000019909316929092178355600190930154875260098c0185528387208990559588905293835292548151931683529082019290925283917ff8fd1c90fb9cfa2ca2358fdf5806b086ad43315d92b221c929efc7f105ce7568910160405180910390a2505050505050565b5f8181527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6076020526040812080545f805160206130ee833981519152929190610d3090612d86565b9050118015610d62575060015f83815260088301602052604090205460ff166005811115610d6057610d60612abe565b145b610d7e5760405162461bcd60e51b815260040161030590612dbe565b5f82815260078201602052604090819020905163ee5b48eb60e01b81526005600160991b019163ee5b48eb91610db79190600401612e03565b6020604051808303815f875af1158015610dd3573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610df79190612b26565b505050565b5f5f805160206130ee8339815191526040516306f8253560e41b815263ffffffff851660048201529091505f9081906005600160991b0190636f825350906024015f60405180830381865afa158015610e57573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052610e7e9190810190612bdc565b9150915080610e9f5760405162461bcd60e51b815260040161030590612cae565b5f8415610f18575f610eb48460400151611cde565b919350909150506001600160401b03811615610f125760405162461bcd60e51b815260206004820181905260248201527f5374616b696e674d616e616765723a20576569676874206d75737420626520306044820152606401610305565b50610f8c565b5f610f268460400151611b3d565b90925090508015610f8a5760405162461bcd60e51b815260206004820152602860248201527f5374616b696e674d616e616765723a20526567697374726174696f6e207374696044820152671b1b081d985b1a5960c21b6064820152608401610305565b505b5f818152600885016020526040808220815161012081019092528054829060ff166005811115610fbe57610fbe612abe565b6005811115610fcf57610fcf612abe565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003909201546001600160a01b0380821660c080850191909152600160a01b830460ff16151560e0850152600160a81b909204909316610100909201919091528201519192501633146110805760405162461bcd60e51b815260040161030590612b87565b5f60038251600581111561109657611096612abe565b14806110b457506002825160058111156110b2576110b2612abe565b145b156110d757506020808201515f90815260098701909152604081205560046110db565b5060055b5f83815260088701602052604090208251815484929190829060ff1916600183600581111561110c5761110c612abe565b0217905550602082015160018201556040808301516002830180546060860151608087015160a08801516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c08401516003909301805460e0860151610100909601516001600160a01b039095166001600160a81b031990911617600160a01b951515959095029490941767ffffffffffffffff60a81b1916600160a81b9390911692909202919091179091555183907f3532ad18e70a039beb4663d48c15acbef558c96ec9b8fd0cc3c0304f774740b8905f90a25050505050505050565b60408051603680825260608281019093525f91906020820181803683370190505090505f5b600281101561129c5761125c816001612e8d565b611267906008612b70565b5081515f9083908390811061127e5761127e612ea0565b60200101906001600160f81b03191690815f1a905350600101611248565b505f5b60048110156112ff576112b3816003612e8d565b6112be906008612b70565b6001901c60f81b826112d1836002612eb4565b815181106112e1576112e1612ea0565b60200101906001600160f81b03191690815f1a90535060010161129f565b505f5b60208110156113615761131681601f612e8d565b611321906008612b70565b86901c60f81b82611333836006612eb4565b8151811061134357611343612ea0565b60200101906001600160f81b03191690815f1a905350600101611302565b505f5b60088110156113cc57611378816007612e8d565b611383906008612b70565b6001600160401b038616901c60f81b8261139e836026612eb4565b815181106113ae576113ae612ea0565b60200101906001600160f81b03191690815f1a905350600101611364565b505f5b6008811015611437576113e3816007612e8d565b6113ee906008612b70565b6001600160401b038516901c60f81b8261140983602e612eb4565b8151811061141957611419612ea0565b60200101906001600160f81b03191690815f1a9053506001016113cf565b50949350505050565b611448611f19565b61145182611f64565b61145a81611f88565b5050565b5f808251602e146114815760405162461bcd60e51b815260040161030590612ec7565b5f805b60028110156114d057611498816001612e8d565b6114a3906008612b70565b61ffff168582815181106114b9576114b9612ea0565b016020015160f81c901b9190911790600101611484565b5061ffff8116156114f35760405162461bcd60e51b815260040161030590612f0e565b5f805b600481101561154e5761150a816003612e8d565b611515906008612b70565b63ffffffff1686611527836002612eb4565b8151811061153757611537612ea0565b016020015160f81c901b91909117906001016114f6565b5063ffffffff81166004146115755760405162461bcd60e51b815260040161030590612f4f565b5f805b60208110156115ca5761158c81601f612e8d565b611597906008612b70565b876115a3836006612eb4565b815181106115b3576115b3612ea0565b016020015160f81c901b9190911790600101611578565b505f805b6008811015611629576115e2816007612e8d565b6115ed906008612b70565b6001600160401b031688611602836026612eb4565b8151811061161257611612612ea0565b016020015160f81c901b91909117906001016115ce565b5090969095509350505050565b5f61163f61203c565b5f805160206130ee833981519152426001600160401b03851611801561167957506001600160401b038416611677426202a300612eb4565b115b6116d95760405162461bcd60e51b815260206004820152602b60248201527f5374616b696e674d616e616765723a20496e76616c696420726567697374726160448201526a74696f6e2065787069727960a81b6064820152608401610305565b856117265760405162461bcd60e51b815260206004820152601f60248201527f5374616b696e674d616e616765723a20496e76616c6964206e6f6465204944006044820152606401610305565b5f868152600982016020526040902054156117925760405162461bcd60e51b815260206004820152602660248201527f5374616b696e674d616e616765723a204e6f646520494420616c72656164792060448201526561637469766560d01b6064820152608401610305565b82516030146117f75760405162461bcd60e51b815260206004820152602b60248201527f5374616b696e674d616e616765723a20496e76616c696420626c735075626c6960448201526a0c696caf240d8cadccee8d60ab1b6064820152608401610305565b5f61180186612086565b90505f61180d82610393565b90508260020154816001600160401b03161015801561183957508260030154816001600160401b031611155b6118915760405162461bcd60e51b8152602060048201526024808201527f5374616b696e674d616e616765723a20496e76616c6964207374616b6520616d6044820152631bdd5b9d60e21b6064820152608401610305565b5f806118d86040518060a00160405280876001015481526020018c8152602001856001600160401b031681526020018a6001600160401b03168152602001898152506120bc565b5f828152600788016020526040902091935091506118f68282612fd8565b5060405163ee5b48eb60e01b81525f906005600160991b019063ee5b48eb90611923908590600401612af4565b6020604051808303815f875af115801561193f573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906119639190612b26565b6040805161012081019091529091508060018152602081018d90526001600160401b03861660408201525f606082018190526080820181905260a082015260c001336001600160a01b031681525f6020808301829052604092830182905286825260088a0190522081518154829060ff191660018360058111156119e9576119e9612abe565b021790555060208281015160018301556040808401516002840180546060870151608088015160a08901516001600160401b03908116600160c01b026001600160c01b03928216600160801b02929092166001600160801b03938216600160401b026001600160801b03199095169682169690961793909317919091169390931792909217905560c08501516003909401805460e0870151610100909701518316600160a81b0267ffffffffffffffff60a81b19971515600160a01b026001600160a81b03199092166001600160a01b039097169690961717959095169390931790935582518783168152918c169082015282918d9186917f79b81620b81daf2c08cd5bb3dbb79e75d2d7a87f52171fde5aadc8c47823026e910160405180910390a45090945050505050610a5360017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b5f808251602714611b605760405162461bcd60e51b815260040161030590612ec7565b5f805b6002811015611baf57611b77816001612e8d565b611b82906008612b70565b61ffff16858281518110611b9857611b98612ea0565b016020015160f81c901b9190911790600101611b63565b5061ffff811615611bd25760405162461bcd60e51b815260040161030590612f0e565b5f805b6004811015611c2d57611be9816003612e8d565b611bf4906008612b70565b63ffffffff1686611c06836002612eb4565b81518110611c1657611c16612ea0565b016020015160f81c901b9190911790600101611bd5565b5063ffffffff8116600214611c545760405162461bcd60e51b815260040161030590612f4f565b5f805b6020811015611ca957611c6b81601f612e8d565b611c76906008612b70565b87611c82836006612eb4565b81518110611c9257611c92612ea0565b016020015160f81c901b9190911790600101611c57565b505f86602681518110611cbe57611cbe612ea0565b016020015191976001600160f81b03199092161515965090945050505050565b5f805f8351603614611d025760405162461bcd60e51b815260040161030590612ec7565b5f805b6002811015611d5157611d19816001612e8d565b611d24906008612b70565b61ffff16868281518110611d3a57611d3a612ea0565b016020015160f81c901b9190911790600101611d05565b5061ffff811615611d745760405162461bcd60e51b815260040161030590612f0e565b5f805b6004811015611dcf57611d8b816003612e8d565b611d96906008612b70565b63ffffffff1687611da8836002612eb4565b81518110611db857611db8612ea0565b016020015160f81c901b9190911790600101611d77565b5063ffffffff8116600114611df65760405162461bcd60e51b815260040161030590612f4f565b5f805b6020811015611e4b57611e0d81601f612e8d565b611e18906008612b70565b88611e24836006612eb4565b81518110611e3457611e34612ea0565b016020015160f81c901b9190911790600101611df9565b505f805b6008811015611eaa57611e63816007612e8d565b611e6e906008612b70565b6001600160401b031689611e83836026612eb4565b81518110611e9357611e93612ea0565b016020015160f81c901b9190911790600101611e4f565b505f805b6008811015611f0957611ec2816007612e8d565b611ecd906008612b70565b6001600160401b03168a611ee283602e612eb4565b81518110611ef257611ef2612ea0565b016020015160f81c901b9190911790600101611eae565b5091989097509095509350505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff16611f6257604051631afcd79f60e31b815260040160405180910390fd5b565b611f6c611f19565b611f74612487565b611f7c612497565b611f858161249f565b50565b611f90611f19565b7f8568826440873e37a96cb0aab773b28d8154d963d2f0e41bd9b5c15f63625f916001600160a01b03821661201c5760405162461bcd60e51b815260206004820152602c60248201527f4552433230546f6b656e5374616b696e674d616e616765723a207a65726f207460448201526b6f6b656e206164647265737360a01b6064820152608401610305565b80546001600160a01b0319166001600160a01b0392909216919091179055565b7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0080546001190161208057604051633ee5aeb560e01b815260040160405180910390fd5b60029055565b5f6103a3827f8568826440873e37a96cb0aab773b28d8154d963d2f0e41bd9b5c15f63625f91546001600160a01b0316906125cf565b5f60608260800151516030146121265760405162461bcd60e51b815260206004820152602960248201527f5374616b696e674d657373616765733a20496e76616c6964207369676e6174756044820152680e4ca40d8cadccee8d60bb1b6064820152608401610305565b60408051608680825260c082019092525f916020820181803683370190505090505f5b600281101561219d5761215d816001612e8d565b612168906008612b70565b5081515f9083908390811061217f5761217f612ea0565b60200101906001600160f81b03191690815f1a905350600101612149565b505f5b60048110156121fb576121b4816003612e8d565b6121bf906008612b70565b505f826121cd836002612eb4565b815181106121dd576121dd612ea0565b60200101906001600160f81b03191690815f1a9053506001016121a0565b505f5b6020811015612258578451816020811061221a5761221a612ea0565b1a60f81b8261222a836006612eb4565b8151811061223a5761223a612ea0565b60200101906001600160f81b03191690815f1a9053506001016121fe565b505f5b60208110156122b8578460200151816020811061227a5761227a612ea0565b1a60f81b8261228a836026612eb4565b8151811061229a5761229a612ea0565b60200101906001600160f81b03191690815f1a90535060010161225b565b505f5b600881101561232c576122cf816007612e8d565b6122da906008612b70565b60ff1685604001516001600160401b0316901c60f81b828260466122fe9190612eb4565b8151811061230e5761230e612ea0565b60200101906001600160f81b03191690815f1a9053506001016122bb565b505f5b6030811015612397578460800151818151811061234e5761234e612ea0565b01602001516001600160f81b0319168261236983604e612eb4565b8151811061237957612379612ea0565b60200101906001600160f81b03191690815f1a90535060010161232f565b505f5b6008811015612409576123ae816007612e8d565b6123b9906008612b70565b60608601516001600160401b0390811691161c60f81b826123db83607e612eb4565b815181106123eb576123eb612ea0565b60200101906001600160f81b03191690815f1a90535060010161239a565b5060028160405161241a9190613097565b602060405180830381855afa158015612435573d5f803e3d5ffd5b5050506040513d601f19601f820116820180604052508101906124589190612b26565b94909350915050565b60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b61248f611f19565b611f62612731565b611f62611f19565b6124a7611f19565b80355f805160206130ee83398151915290815560208201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6015560408201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6025560608201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6035561253f60a08301608084016128d2565b60048201805467ffffffffffffffff19166001600160401b039290921691909117905561257260c0830160a084016130b2565b60048201805460ff92909216600160e01b0260ff60e01b199092169190911790556125a360e0830160c084016130d2565b8160040160086101000a8154816001600160a01b0302191690836001600160a01b031602179055505050565b6040516370a0823160e01b81523060048201525f9081906001600160a01b038516906370a0823190602401602060405180830381865afa158015612615573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906126399190612b26565b90506126506001600160a01b038516333086612739565b6040516370a0823160e01b81523060048201525f906001600160a01b038616906370a0823190602401602060405180830381865afa158015612694573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906126b89190612b26565b905081811161271e5760405162461bcd60e51b815260206004820152602c60248201527f5361666545524332305472616e7366657246726f6d3a2062616c616e6365206e60448201526b1bdd081a5b98dc99585cd95960a21b6064820152608401610305565b6127288282612e8d565b95945050505050565b612461611f19565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052612793908590612799565b50505050565b5f8060205f8451602086015f885af1806127b8576040513d5f823e3d81fd5b50505f513d915081156127cf5780600114156127dc565b6001600160a01b0384163b155b1561279357604051635274afe760e01b81526001600160a01b0385166004820152602401610305565b50805461281190612d86565b5f825580601f10612820575050565b601f0160209004905f5260205f2090810190611f8591905b8082111561284b575f8155600101612838565b5090565b5f6020828403121561285f575f80fd5b5035919050565b6001600160a01b0381168114611f85575f80fd5b5f8082840361010081121561288d575f80fd5b60e081121561289a575f80fd5b5082915060e08301356128ac81612866565b809150509250929050565b80356001600160401b03811681146128cd575f80fd5b919050565b5f602082840312156128e2575f80fd5b6128eb826128b7565b9392505050565b8015158114611f85575f80fd5b803563ffffffff811681146128cd575f80fd5b5f805f60608486031215612924575f80fd5b833592506020840135612936816128f2565b9150612944604085016128ff565b90509250925092565b634e487b7160e01b5f52604160045260245ffd5b604051606081016001600160401b03811182821017156129835761298361294d565b60405290565b604051601f8201601f191681016001600160401b03811182821017156129b1576129b161294d565b604052919050565b5f6001600160401b038211156129d1576129d161294d565b50601f01601f191660200190565b5f805f80608085870312156129f2575f80fd5b8435935060208501359250612a09604086016128b7565b915060608501356001600160401b03811115612a23575f80fd5b8501601f81018713612a33575f80fd5b8035612a46612a41826129b9565b612989565b818152886020838501011115612a5a575f80fd5b816020840160208301375f6020838301015280935050505092959194509250565b5f60208284031215612a8b575f80fd5b6128eb826128ff565b5f8060408385031215612aa5575f80fd5b612aae836128ff565b915060208301356128ac816128f2565b634e487b7160e01b5f52602160045260245ffd5b5f5b83811015612aec578181015183820152602001612ad4565b50505f910152565b602081525f8251806020840152612b12816040850160208701612ad2565b601f01601f19169190910160400192915050565b5f60208284031215612b36575f80fd5b5051919050565b634e487b7160e01b5f52601160045260245ffd5b5f82612b6b57634e487b7160e01b5f52601260045260245ffd5b500490565b80820281158282048414176103a3576103a3612b3d565b6020808252602a908201527f5374616b696e674d616e616765723a2053656e646572206e6f742076616c696460408201526930ba37b91037bbb732b960b11b606082015260800190565b80516128cd816128f2565b5f8060408385031215612bed575f80fd5b82516001600160401b0380821115612c03575f80fd5b9084019060608287031215612c16575f80fd5b612c1e612961565b82518152602080840151612c3181612866565b82820152604084015183811115612c46575f80fd5b80850194505087601f850112612c5a575f80fd5b83519250612c6a612a41846129b9565b8381528882858701011115612c7d575f80fd5b612c8c84838301848801612ad2565b80604084015250819550612ca1818801612bd1565b9450505050509250929050565b60208082526024908201527f5374616b696e674d616e616765723a20496e76616c69642077617270206d65736040820152637361676560e01b606082015260800190565b60208082526027908201527f5374616b696e674d616e616765723a20496e76616c696420736f7572636520636040820152661a185a5b88125160ca1b606082015260800190565b6020808252602d908201527f5374616b696e674d616e616765723a20496e76616c6964206f726967696e207360408201526c656e646572206164647265737360981b606082015260800190565b600181811c90821680612d9a57607f821691505b602082108103612db857634e487b7160e01b5f52602260045260245ffd5b50919050565b60208082526025908201527f5374616b696e674d616e616765723a20496e76616c69642076616c69646174696040820152641bdb88125160da1b606082015260800190565b5f60208083525f8454612e1581612d86565b806020870152604060018084165f8114612e365760018114612e5257612e7f565b60ff19851660408a0152604084151560051b8a01019550612e7f565b895f5260205f205f5b85811015612e765781548b8201860152908301908801612e5b565b8a016040019650505b509398975050505050505050565b818103818111156103a3576103a3612b3d565b634e487b7160e01b5f52603260045260245ffd5b808201808211156103a3576103a3612b3d565b60208082526027908201527f5374616b696e674d657373616765733a20496e76616c6964206d657373616765604082015266040d8cadccee8d60cb1b606082015260800190565b60208082526021908201527f5374616b696e674d657373616765733a20496e76616c696420636f64656320496040820152601160fa1b606082015260800190565b60208082526025908201527f5374616b696e674d657373616765733a20496e76616c6964206d657373616765604082015264207479706560d81b606082015260800190565b601f821115610df757805f5260205f20601f840160051c81016020851015612fb95750805b601f840160051c820191505b8181101561038c575f8155600101612fc5565b81516001600160401b03811115612ff157612ff161294d565b61300581612fff8454612d86565b84612f94565b602080601f831160018114613038575f84156130215750858301515b5f19600386901b1c1916600185901b17855561308f565b5f85815260208120601f198616915b8281101561306657888601518255948401946001909101908401613047565b508582101561308357878501515f19600388901b60f8161c191681555b505060018460011b0185555b505050505050565b5f82516130a8818460208701612ad2565b9190910192915050565b5f602082840312156130c2575f80fd5b813560ff811681146128eb575f80fd5b5f602082840312156130e2575f80fd5b81356128eb8161286656feafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab600a164736f6c6343000819000a", + Bin: "0x608060405234801561000f575f80fd5b506040516134a93803806134a983398101604081905261002e91610107565b60018160018111156100425761004261012c565b0361004f5761004f610055565b50610140565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156100a55760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146101045780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b5f60208284031215610117575f80fd5b815160028110610125575f80fd5b9392505050565b634e487b7160e01b5f52602160045260245ffd5b61335c8061014d5f395ff3fe608060405234801561000f575f80fd5b506004361061009b575f3560e01c8063872fda6411610063578063872fda641461012b578063a3a65e481461013e578063b771b3bc14610151578063bee0a03f14610177578063fdf94a1a1461018a575f80fd5b80630322ed981461009f5780632e2194d8146100b45780635d0d7466146100e457806362065856146100f757806376f7862114610118575b5f80fd5b6100b26100ad366004612a12565b61019d565b005b6100c76100c2366004612a12565b610393565b6040516001600160401b0390911681526020015b60405180910390f35b6100b26100f2366004612a3d565b6103a9565b61010a610105366004612a95565b6104b7565b6040519081526020016100db565b6100b2610126366004612ad5565b6104d0565b61010a610139366004612ba2565b610a50565b6100b261014c366004612c3e565b610a68565b61015f6005600160991b0181565b6040516001600160a01b0390911681526020016100db565b6100b2610185366004612a12565b610cf5565b6100b2610198366004612c57565b610e09565b5f8181527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab60860205260408082208151610120810190925280545f8051602061333083398151915293929190829060ff1660058111156101fe576101fe612c81565b600581111561020f5761020f612c81565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003928301546001600160a01b03811660c084015260ff600160a01b820416151560e0840152600160a81b90041661010090910152909150815160058111156102a6576102a6612c81565b1461030e5760405162461bcd60e51b815260206004820152602d60248201527f5374616b696e674d616e616765723a2056616c696461746f72206e6f7420706560448201526c1b991a5b99c81c995b5bdd985b609a1b60648201526084015b60405180910390fd5b5f61031f848361010001515f611230565b60405163ee5b48eb60e01b81529091506005600160991b019063ee5b48eb9061034c908490600401612cb7565b6020604051808303815f875af1158015610368573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061038c9190612ce9565b5050505050565b5f6103a364e8d4a5100083612d28565b92915050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff1615906001600160401b03165f811580156103ed5750825b90505f826001600160401b031660011480156104085750303b155b905081158015610416575080155b156104345760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561045e57845460ff60401b1916600160401b1785555b610468878761144d565b83156104ae57845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50505050505050565b5f6103a36001600160401b03831664e8d4a51000612d3b565b5f8381527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab60860205260408082208151610120810190925280545f8051602061333083398151915293929190829060ff16600581111561053157610531612c81565b600581111561054257610542612c81565b8152600182015460208201526002808301546001600160401b038082166040850152600160401b820481166060850152600160801b820481166080850152600160c01b909104811660a08401526003909301546001600160a01b03811660c084015260ff600160a01b820416151560e0840152600160a81b900490921661010090910152909150815160058111156105dc576105dc612c81565b146106355760405162461bcd60e51b8152602060048201526024808201527f5374616b696e674d616e616765723a2056616c696461746f72206e6f742061636044820152637469766560e01b6064820152608401610305565b60c08101516001600160a01b0316336001600160a01b03161461066a5760405162461bcd60e51b815260040161030590612d52565b610677816040015161146b565b60038152426001600160401b031660808201525f8415610850576040516306f8253560e41b815263ffffffff851660048201525f9081906005600160991b0190636f825350906024015f60405180830381865afa1580156106da573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f191682016040526107019190810190612da7565b91509150806107225760405162461bcd60e51b815260040161030590612e79565b6005600160991b016001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa158015610765573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107899190612ce9565b8251146107a85760405162461bcd60e51b815260040161030590612ebd565b60208201516001600160a01b0316156107d35760405162461bcd60e51b815260040161030590612f04565b5f806107e28460400151611618565b91509150818a1461084a5760405162461bcd60e51b815260206004820152602c60248201527f5374616b696e674d616e616765723a20496e76616c696420757074696d65207660448201526b185b1a59185d1a5bdb88125160a21b6064820152608401610305565b93505050505b6001600160401b03811660a08301525f86815260088401602052604090208251815484929190829060ff1916600183600581111561089057610890612c81565b02179055506020820151600182015560408201516002820180546060850151608086015160a08701516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c08301516003909201805460e0850151610100958601516001600160a01b039095166001600160a81b031990921691909117600160a01b911515919091021767ffffffffffffffff60a81b1916600160a81b93909216929092021790558201515f9061098190889083611230565b60405163ee5b48eb60e01b81529091505f906005600160991b019063ee5b48eb906109b0908590600401612cb7565b6020604051808303815f875af11580156109cc573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109f09190612ce9565b60408581015181516001600160401b03918216815242602082015290861681830152905191925082918a917f530b908725650fb1052974f9df59e834fefac78c9ec2f00c6d2464d60cc6add5919081900360600190a35050505050505050565b5f610a5d848685856117f0565b90505b949350505050565b5f5f805160206133308339815191526040516306f8253560e41b815263ffffffff841660048201529091505f9081906005600160991b0190636f825350906024015f60405180830381865afa158015610ac3573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052610aea9190810190612da7565b9150915080610b0b5760405162461bcd60e51b815260040161030590612e79565b8254825114610b2c5760405162461bcd60e51b815260040161030590612ebd565b60208201516001600160a01b031615610b575760405162461bcd60e51b815260040161030590612f04565b5f80610b668460400151611d00565b9150915080610bc65760405162461bcd60e51b815260206004820152602660248201527f5374616b696e674d616e616765723a20526567697374726174696f6e206e6f74604482015265081d985b1a5960d21b6064820152608401610305565b5f82815260078601602052604081208054610be090612f51565b9050118015610c12575060015f83815260088701602052604090205460ff166005811115610c1057610c10612c81565b145b610c2e5760405162461bcd60e51b815260040161030590612f89565b5f8281526007860160205260408120610c46916129c8565b5f8281526008860160208181526040808420805460ff191660029081178255810180546001600160401b0342818116600160401b026fffffffffffffffff000000000000000019909316929092178355600190930154875260098c0185528387208990559588905293835292548151931683529082019290925283917ff8fd1c90fb9cfa2ca2358fdf5806b086ad43315d92b221c929efc7f105ce7568910160405180910390a2505050505050565b5f8181527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6076020526040812080545f80516020613330833981519152929190610d3d90612f51565b9050118015610d6f575060015f83815260088301602052604090205460ff166005811115610d6d57610d6d612c81565b145b610d8b5760405162461bcd60e51b815260040161030590612f89565b5f82815260078201602052604090819020905163ee5b48eb60e01b81526005600160991b019163ee5b48eb91610dc49190600401612fce565b6020604051808303815f875af1158015610de0573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e049190612ce9565b505050565b5f5f805160206133308339815191526040516306f8253560e41b815263ffffffff851660048201529091505f9081906005600160991b0190636f825350906024015f60405180830381865afa158015610e64573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052610e8b9190810190612da7565b9150915080610eac5760405162461bcd60e51b815260040161030590612e79565b5f8415610f25575f610ec18460400151611ea1565b919350909150506001600160401b03811615610f1f5760405162461bcd60e51b815260206004820181905260248201527f5374616b696e674d616e616765723a20576569676874206d75737420626520306044820152606401610305565b50610f99565b5f610f338460400151611d00565b90925090508015610f975760405162461bcd60e51b815260206004820152602860248201527f5374616b696e674d616e616765723a20526567697374726174696f6e207374696044820152671b1b081d985b1a5960c21b6064820152608401610305565b505b5f818152600885016020526040808220815161012081019092528054829060ff166005811115610fcb57610fcb612c81565b6005811115610fdc57610fdc612c81565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003909201546001600160a01b0380821660c080850191909152600160a01b830460ff16151560e0850152600160a81b9092049093166101009092019190915282015191925016331461108d5760405162461bcd60e51b815260040161030590612d52565b5f6003825160058111156110a3576110a3612c81565b14806110c157506002825160058111156110bf576110bf612c81565b145b156110e457506020808201515f90815260098701909152604081205560046110e8565b5060055b5f83815260088701602052604090208251815484929190829060ff1916600183600581111561111957611119612c81565b0217905550602082015160018201556040808301516002830180546060860151608087015160a08801516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c08401516003909301805460e0860151610100909601516001600160a01b039095166001600160a81b031990911617600160a01b951515959095029490941767ffffffffffffffff60a81b1916600160a81b9390911692909202919091179091555183907f3532ad18e70a039beb4663d48c15acbef558c96ec9b8fd0cc3c0304f774740b8905f90a25050505050505050565b60408051603680825260608281019093525f91906020820181803683370190505090505f5b60028110156112a957611269816001613058565b611274906008612d3b565b5081515f9083908390811061128b5761128b61306b565b60200101906001600160f81b03191690815f1a905350600101611255565b505f5b600481101561130c576112c0816003613058565b6112cb906008612d3b565b6001901c60f81b826112de83600261307f565b815181106112ee576112ee61306b565b60200101906001600160f81b03191690815f1a9053506001016112ac565b505f5b602081101561136e5761132381601f613058565b61132e906008612d3b565b86901c60f81b8261134083600661307f565b815181106113505761135061306b565b60200101906001600160f81b03191690815f1a90535060010161130f565b505f5b60088110156113d957611385816007613058565b611390906008612d3b565b6001600160401b038616901c60f81b826113ab83602661307f565b815181106113bb576113bb61306b565b60200101906001600160f81b03191690815f1a905350600101611371565b505f5b6008811015611444576113f0816007613058565b6113fb906008612d3b565b6001600160401b038516901c60f81b8261141683602e61307f565b815181106114265761142661306b565b60200101906001600160f81b03191690815f1a9053506001016113dc565b50949350505050565b6114556120dc565b61145e82612127565b6114678161214b565b5050565b7fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab604545f8051602061333083398151915290600160e01b900460ff165f036114b0575050565b60408051606081018252600583015480825260068401546001600160401b038082166020850152600160401b9091041692820192909252904290610e10906114f89083613058565b10611514576001600160401b0384166040830152808252611533565b83826040018181516115269190613092565b6001600160401b03169052505b5f82602001518360400151606461154a91906130b9565b61155491906130e4565b600485015490915060ff600160e01b909104811690821611156115d45760405162461bcd60e51b815260206004820152603260248201527f5374616b696e674d616e616765723a204d6178696d756d20686f75726c7920636044820152711a1d5c9b881c985d1948195e18d95959195960721b6064820152608401610305565b5050805160058301556020810151600690920180546040909201516001600160401b03908116600160401b026001600160801b031990931693169290921717905550565b5f808251602e1461163b5760405162461bcd60e51b815260040161030590613109565b5f805b600281101561168a57611652816001613058565b61165d906008612d3b565b61ffff168582815181106116735761167361306b565b016020015160f81c901b919091179060010161163e565b5061ffff8116156116ad5760405162461bcd60e51b815260040161030590613150565b5f805b6004811015611708576116c4816003613058565b6116cf906008612d3b565b63ffffffff16866116e183600261307f565b815181106116f1576116f161306b565b016020015160f81c901b91909117906001016116b0565b5063ffffffff811660041461172f5760405162461bcd60e51b815260040161030590613191565b5f805b60208110156117845761174681601f613058565b611751906008612d3b565b8761175d83600661307f565b8151811061176d5761176d61306b565b016020015160f81c901b9190911790600101611732565b505f805b60088110156117e35761179c816007613058565b6117a7906008612d3b565b6001600160401b0316886117bc83602661307f565b815181106117cc576117cc61306b565b016020015160f81c901b9190911790600101611788565b5090969095509350505050565b5f6117f96121ff565b5f80516020613330833981519152426001600160401b03851611801561183357506001600160401b038416611831426202a30061307f565b115b6118935760405162461bcd60e51b815260206004820152602b60248201527f5374616b696e674d616e616765723a20496e76616c696420726567697374726160448201526a74696f6e2065787069727960a81b6064820152608401610305565b856118e05760405162461bcd60e51b815260206004820152601f60248201527f5374616b696e674d616e616765723a20496e76616c6964206e6f6465204944006044820152606401610305565b5f8681526009820160205260409020541561194c5760405162461bcd60e51b815260206004820152602660248201527f5374616b696e674d616e616765723a204e6f646520494420616c72656164792060448201526561637469766560d01b6064820152608401610305565b82516030146119b15760405162461bcd60e51b815260206004820152602b60248201527f5374616b696e674d616e616765723a20496e76616c696420626c735075626c6960448201526a0c696caf240d8cadccee8d60ab1b6064820152608401610305565b5f6119bb86612249565b90505f6119c782610393565b90506119d28161146b565b8260020154816001600160401b0316101580156119fc57508260030154816001600160401b031611155b611a545760405162461bcd60e51b8152602060048201526024808201527f5374616b696e674d616e616765723a20496e76616c6964207374616b6520616d6044820152631bdd5b9d60e21b6064820152608401610305565b5f80611a9b6040518060a00160405280876001015481526020018c8152602001856001600160401b031681526020018a6001600160401b031681526020018981525061227f565b5f82815260078801602052604090209193509150611ab9828261321a565b5060405163ee5b48eb60e01b81525f906005600160991b019063ee5b48eb90611ae6908590600401612cb7565b6020604051808303815f875af1158015611b02573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611b269190612ce9565b6040805161012081019091529091508060018152602081018d90526001600160401b03861660408201525f606082018190526080820181905260a082015260c001336001600160a01b031681525f6020808301829052604092830182905286825260088a0190522081518154829060ff19166001836005811115611bac57611bac612c81565b021790555060208281015160018301556040808401516002840180546060870151608088015160a08901516001600160401b03908116600160c01b026001600160c01b03928216600160801b02929092166001600160801b03938216600160401b026001600160801b03199095169682169690961793909317919091169390931792909217905560c08501516003909401805460e0870151610100909701518316600160a81b0267ffffffffffffffff60a81b19971515600160a01b026001600160a81b03199092166001600160a01b039097169690961717959095169390931790935582518783168152918c169082015282918d9186917f79b81620b81daf2c08cd5bb3dbb79e75d2d7a87f52171fde5aadc8c47823026e910160405180910390a45090945050505050610a6060017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b5f808251602714611d235760405162461bcd60e51b815260040161030590613109565b5f805b6002811015611d7257611d3a816001613058565b611d45906008612d3b565b61ffff16858281518110611d5b57611d5b61306b565b016020015160f81c901b9190911790600101611d26565b5061ffff811615611d955760405162461bcd60e51b815260040161030590613150565b5f805b6004811015611df057611dac816003613058565b611db7906008612d3b565b63ffffffff1686611dc983600261307f565b81518110611dd957611dd961306b565b016020015160f81c901b9190911790600101611d98565b5063ffffffff8116600214611e175760405162461bcd60e51b815260040161030590613191565b5f805b6020811015611e6c57611e2e81601f613058565b611e39906008612d3b565b87611e4583600661307f565b81518110611e5557611e5561306b565b016020015160f81c901b9190911790600101611e1a565b505f86602681518110611e8157611e8161306b565b016020015191976001600160f81b03199092161515965090945050505050565b5f805f8351603614611ec55760405162461bcd60e51b815260040161030590613109565b5f805b6002811015611f1457611edc816001613058565b611ee7906008612d3b565b61ffff16868281518110611efd57611efd61306b565b016020015160f81c901b9190911790600101611ec8565b5061ffff811615611f375760405162461bcd60e51b815260040161030590613150565b5f805b6004811015611f9257611f4e816003613058565b611f59906008612d3b565b63ffffffff1687611f6b83600261307f565b81518110611f7b57611f7b61306b565b016020015160f81c901b9190911790600101611f3a565b5063ffffffff8116600114611fb95760405162461bcd60e51b815260040161030590613191565b5f805b602081101561200e57611fd081601f613058565b611fdb906008612d3b565b88611fe783600661307f565b81518110611ff757611ff761306b565b016020015160f81c901b9190911790600101611fbc565b505f805b600881101561206d57612026816007613058565b612031906008612d3b565b6001600160401b03168961204683602661307f565b815181106120565761205661306b565b016020015160f81c901b9190911790600101612012565b505f805b60088110156120cc57612085816007613058565b612090906008612d3b565b6001600160401b03168a6120a583602e61307f565b815181106120b5576120b561306b565b016020015160f81c901b9190911790600101612071565b5091989097509095509350505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff1661212557604051631afcd79f60e31b815260040160405180910390fd5b565b61212f6120dc565b61213761264a565b61213f61265a565b61214881612662565b50565b6121536120dc565b7f8568826440873e37a96cb0aab773b28d8154d963d2f0e41bd9b5c15f63625f916001600160a01b0382166121df5760405162461bcd60e51b815260206004820152602c60248201527f4552433230546f6b656e5374616b696e674d616e616765723a207a65726f207460448201526b6f6b656e206164647265737360a01b6064820152608401610305565b80546001600160a01b0319166001600160a01b0392909216919091179055565b7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0080546001190161224357604051633ee5aeb560e01b815260040160405180910390fd5b60029055565b5f6103a3827f8568826440873e37a96cb0aab773b28d8154d963d2f0e41bd9b5c15f63625f91546001600160a01b031690612792565b5f60608260800151516030146122e95760405162461bcd60e51b815260206004820152602960248201527f5374616b696e674d657373616765733a20496e76616c6964207369676e6174756044820152680e4ca40d8cadccee8d60bb1b6064820152608401610305565b60408051608680825260c082019092525f916020820181803683370190505090505f5b600281101561236057612320816001613058565b61232b906008612d3b565b5081515f908390839081106123425761234261306b565b60200101906001600160f81b03191690815f1a90535060010161230c565b505f5b60048110156123be57612377816003613058565b612382906008612d3b565b505f8261239083600261307f565b815181106123a0576123a061306b565b60200101906001600160f81b03191690815f1a905350600101612363565b505f5b602081101561241b57845181602081106123dd576123dd61306b565b1a60f81b826123ed83600661307f565b815181106123fd576123fd61306b565b60200101906001600160f81b03191690815f1a9053506001016123c1565b505f5b602081101561247b578460200151816020811061243d5761243d61306b565b1a60f81b8261244d83602661307f565b8151811061245d5761245d61306b565b60200101906001600160f81b03191690815f1a90535060010161241e565b505f5b60088110156124ef57612492816007613058565b61249d906008612d3b565b60ff1685604001516001600160401b0316901c60f81b828260466124c1919061307f565b815181106124d1576124d161306b565b60200101906001600160f81b03191690815f1a90535060010161247e565b505f5b603081101561255a57846080015181815181106125115761251161306b565b01602001516001600160f81b0319168261252c83604e61307f565b8151811061253c5761253c61306b565b60200101906001600160f81b03191690815f1a9053506001016124f2565b505f5b60088110156125cc57612571816007613058565b61257c906008612d3b565b60608601516001600160401b0390811691161c60f81b8261259e83607e61307f565b815181106125ae576125ae61306b565b60200101906001600160f81b03191690815f1a90535060010161255d565b506002816040516125dd91906132d9565b602060405180830381855afa1580156125f8573d5f803e3d5ffd5b5050506040513d601f19601f8201168201806040525081019061261b9190612ce9565b94909350915050565b60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b6126526120dc565b6121256128f4565b6121256120dc565b61266a6120dc565b80355f8051602061333083398151915290815560208201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6015560408201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6025560608201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6035561270260a0830160808401612a95565b60048201805467ffffffffffffffff19166001600160401b039290921691909117905561273560c0830160a084016132f4565b60048201805460ff92909216600160e01b0260ff60e01b1990921691909117905561276660e0830160c08401613314565b8160040160086101000a8154816001600160a01b0302191690836001600160a01b031602179055505050565b6040516370a0823160e01b81523060048201525f9081906001600160a01b038516906370a0823190602401602060405180830381865afa1580156127d8573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906127fc9190612ce9565b90506128136001600160a01b0385163330866128fc565b6040516370a0823160e01b81523060048201525f906001600160a01b038616906370a0823190602401602060405180830381865afa158015612857573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061287b9190612ce9565b90508181116128e15760405162461bcd60e51b815260206004820152602c60248201527f5361666545524332305472616e7366657246726f6d3a2062616c616e6365206e60448201526b1bdd081a5b98dc99585cd95960a21b6064820152608401610305565b6128eb8282613058565b95945050505050565b6126246120dc565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b17905261295690859061295c565b50505050565b5f8060205f8451602086015f885af18061297b576040513d5f823e3d81fd5b50505f513d9150811561299257806001141561299f565b6001600160a01b0384163b155b1561295657604051635274afe760e01b81526001600160a01b0385166004820152602401610305565b5080546129d490612f51565b5f825580601f106129e3575050565b601f0160209004905f5260205f209081019061214891905b80821115612a0e575f81556001016129fb565b5090565b5f60208284031215612a22575f80fd5b5035919050565b6001600160a01b0381168114612148575f80fd5b5f80828403610100811215612a50575f80fd5b60e0811215612a5d575f80fd5b5082915060e0830135612a6f81612a29565b809150509250929050565b80356001600160401b0381168114612a90575f80fd5b919050565b5f60208284031215612aa5575f80fd5b612aae82612a7a565b9392505050565b8015158114612148575f80fd5b803563ffffffff81168114612a90575f80fd5b5f805f60608486031215612ae7575f80fd5b833592506020840135612af981612ab5565b9150612b0760408501612ac2565b90509250925092565b634e487b7160e01b5f52604160045260245ffd5b604051606081016001600160401b0381118282101715612b4657612b46612b10565b60405290565b604051601f8201601f191681016001600160401b0381118282101715612b7457612b74612b10565b604052919050565b5f6001600160401b03821115612b9457612b94612b10565b50601f01601f191660200190565b5f805f8060808587031215612bb5575f80fd5b8435935060208501359250612bcc60408601612a7a565b915060608501356001600160401b03811115612be6575f80fd5b8501601f81018713612bf6575f80fd5b8035612c09612c0482612b7c565b612b4c565b818152886020838501011115612c1d575f80fd5b816020840160208301375f6020838301015280935050505092959194509250565b5f60208284031215612c4e575f80fd5b612aae82612ac2565b5f8060408385031215612c68575f80fd5b612c7183612ac2565b91506020830135612a6f81612ab5565b634e487b7160e01b5f52602160045260245ffd5b5f5b83811015612caf578181015183820152602001612c97565b50505f910152565b602081525f8251806020840152612cd5816040850160208701612c95565b601f01601f19169190910160400192915050565b5f60208284031215612cf9575f80fd5b5051919050565b634e487b7160e01b5f52601260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b5f82612d3657612d36612d00565b500490565b80820281158282048414176103a3576103a3612d14565b6020808252602a908201527f5374616b696e674d616e616765723a2053656e646572206e6f742076616c696460408201526930ba37b91037bbb732b960b11b606082015260800190565b8051612a9081612ab5565b5f8060408385031215612db8575f80fd5b82516001600160401b0380821115612dce575f80fd5b9084019060608287031215612de1575f80fd5b612de9612b24565b82518152602080840151612dfc81612a29565b82820152604084015183811115612e11575f80fd5b80850194505087601f850112612e25575f80fd5b83519250612e35612c0484612b7c565b8381528882858701011115612e48575f80fd5b612e5784838301848801612c95565b80604084015250819550612e6c818801612d9c565b9450505050509250929050565b60208082526024908201527f5374616b696e674d616e616765723a20496e76616c69642077617270206d65736040820152637361676560e01b606082015260800190565b60208082526027908201527f5374616b696e674d616e616765723a20496e76616c696420736f7572636520636040820152661a185a5b88125160ca1b606082015260800190565b6020808252602d908201527f5374616b696e674d616e616765723a20496e76616c6964206f726967696e207360408201526c656e646572206164647265737360981b606082015260800190565b600181811c90821680612f6557607f821691505b602082108103612f8357634e487b7160e01b5f52602260045260245ffd5b50919050565b60208082526025908201527f5374616b696e674d616e616765723a20496e76616c69642076616c69646174696040820152641bdb88125160da1b606082015260800190565b5f60208083525f8454612fe081612f51565b806020870152604060018084165f8114613001576001811461301d5761304a565b60ff19851660408a0152604084151560051b8a0101955061304a565b895f5260205f205f5b858110156130415781548b8201860152908301908801613026565b8a016040019650505b509398975050505050505050565b818103818111156103a3576103a3612d14565b634e487b7160e01b5f52603260045260245ffd5b808201808211156103a3576103a3612d14565b6001600160401b038181168382160190808211156130b2576130b2612d14565b5092915050565b6001600160401b038181168382160280821691908281146130dc576130dc612d14565b505092915050565b5f6001600160401b03808416806130fd576130fd612d00565b92169190910492915050565b60208082526027908201527f5374616b696e674d657373616765733a20496e76616c6964206d657373616765604082015266040d8cadccee8d60cb1b606082015260800190565b60208082526021908201527f5374616b696e674d657373616765733a20496e76616c696420636f64656320496040820152601160fa1b606082015260800190565b60208082526025908201527f5374616b696e674d657373616765733a20496e76616c6964206d657373616765604082015264207479706560d81b606082015260800190565b601f821115610e0457805f5260205f20601f840160051c810160208510156131fb5750805b601f840160051c820191505b8181101561038c575f8155600101613207565b81516001600160401b0381111561323357613233612b10565b613247816132418454612f51565b846131d6565b602080601f83116001811461327a575f84156132635750858301515b5f19600386901b1c1916600185901b1785556132d1565b5f85815260208120601f198616915b828110156132a857888601518255948401946001909101908401613289565b50858210156132c557878501515f19600388901b60f8161c191681555b505060018460011b0185555b505050505050565b5f82516132ea818460208701612c95565b9190910192915050565b5f60208284031215613304575f80fd5b813560ff81168114612aae575f80fd5b5f60208284031215613324575f80fd5b8135612aae81612a2956feafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab600a164736f6c6343000819000a", } // ERC20TokenStakingManagerABI is the input ABI used to generate the binding from. diff --git a/abi-bindings/go/staking/NativeTokenStakingManager/NativeTokenStakingManager.go b/abi-bindings/go/staking/NativeTokenStakingManager/NativeTokenStakingManager.go index 4b36d3bd2..83b75bcc7 100644 --- a/abi-bindings/go/staking/NativeTokenStakingManager/NativeTokenStakingManager.go +++ b/abi-bindings/go/staking/NativeTokenStakingManager/NativeTokenStakingManager.go @@ -43,7 +43,7 @@ type StakingManagerSettings struct { // NativeTokenStakingManagerMetaData contains all meta data concerning the NativeTokenStakingManager contract. var NativeTokenStakingManagerMetaData = &bind.MetaData{ ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"init\",\"type\":\"uint8\",\"internalType\":\"enumICMInitializable\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"WARP_MESSENGER\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIWarpMessenger\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"completeEndValidation\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"setWeightMessageType\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"completeValidatorRegistration\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"settings\",\"type\":\"tuple\",\"internalType\":\"structStakingManagerSettings\",\"components\":[{\"name\":\"pChainBlockchainID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"subnetID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"minimumStakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"maximumStakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"minimumStakeDuration\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"maximumHourlyChurn\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"rewardCalculator\",\"type\":\"address\",\"internalType\":\"contractIRewardCalculator\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeEndValidation\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"includeUptimeProof\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeValidatorRegistration\",\"inputs\":[{\"name\":\"nodeID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"resendEndValidatorMessage\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"resendRegisterValidatorMessage\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"valueToWeight\",\"inputs\":[{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"weightToValue\",\"inputs\":[{\"name\":\"weight\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"pure\"},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodCreated\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"nodeID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"registerValidationMessageID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"weight\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodEnded\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodRegistered\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"stakeAmount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"timestamp\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidatorRemovalInitialized\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"setWeightMessageID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"stakeAmount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"endTime\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"uptime\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ReentrancyGuardReentrantCall\",\"inputs\":[]}]", - Bin: "0x608060405234801561000f575f80fd5b50604051612f62380380612f6283398101604081905261002e91610107565b60018160018111156100425761004261012c565b0361004f5761004f610055565b50610140565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156100a55760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146101045780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b5f60208284031215610117575f80fd5b815160028110610125575f80fd5b9392505050565b634e487b7160e01b5f52602160045260245ffd5b612e158061014d5f395ff3fe60806040526004361061008f575f3560e01c8063a3a65e4811610057578063a3a65e481461015b578063b771b3bc1461017a578063bee0a03f146101ac578063f40797d7146101cb578063fdf94a1a146101de575f80fd5b80630322ed98146100935780632e2194d8146100b457806362065856146100f057806376f786211461011d57806379f54eb11461013c575b5f80fd5b34801561009e575f80fd5b506100b26100ad36600461257a565b6101fd565b005b3480156100bf575f80fd5b506100d36100ce36600461257a565b6103f3565b6040516001600160401b0390911681526020015b60405180910390f35b3480156100fb575f80fd5b5061010f61010a3660046125ac565b610409565b6040519081526020016100e7565b348015610128575f80fd5b506100b26101373660046125ec565b610422565b348015610147575f80fd5b506100b2610156366004612627565b610995565b348015610166575f80fd5b506100b261017536600461263d565b610aa1565b348015610185575f80fd5b506101946005600160991b0181565b6040516001600160a01b0390911681526020016100e7565b3480156101b7575f80fd5b506100b26101c636600461257a565b610d2e565b61010f6101d93660046126e8565b610e42565b3480156101e9575f80fd5b506100b26101f836600461277a565b610e57565b5f8181527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab60860205260408082208151610120810190925280545f80516020612de983398151915293929190829060ff16600581111561025e5761025e6127af565b600581111561026f5761026f6127af565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003928301546001600160a01b03811660c084015260ff600160a01b820416151560e0840152600160a81b9004166101009091015290915081516005811115610306576103066127af565b1461036e5760405162461bcd60e51b815260206004820152602d60248201527f5374616b696e674d616e616765723a2056616c696461746f72206e6f7420706560448201526c1b991a5b99c81c995b5bdd985b609a1b60648201526084015b60405180910390fd5b5f61037f848361010001515f61127e565b60405163ee5b48eb60e01b81529091506005600160991b019063ee5b48eb906103ac9084906004016127e5565b6020604051808303815f875af11580156103c8573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103ec9190612817565b5050505050565b5f61040364e8d4a5100083612842565b92915050565b5f6104036001600160401b03831664e8d4a51000612861565b5f8381527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab60860205260408082208151610120810190925280545f80516020612de983398151915293929190829060ff166005811115610483576104836127af565b6005811115610494576104946127af565b8152600182015460208201526002808301546001600160401b038082166040850152600160401b820481166060850152600160801b820481166080850152600160c01b909104811660a08401526003909301546001600160a01b03811660c084015260ff600160a01b820416151560e0840152600160a81b9004909216610100909101529091508151600581111561052e5761052e6127af565b146105875760405162461bcd60e51b8152602060048201526024808201527f5374616b696e674d616e616765723a2056616c696461746f72206e6f742061636044820152637469766560e01b6064820152608401610365565b60c08101516001600160a01b0316336001600160a01b0316146105bc5760405162461bcd60e51b815260040161036590612878565b60038152426001600160401b031660808201525f8415610795576040516306f8253560e41b815263ffffffff851660048201525f9081906005600160991b0190636f825350906024015f60405180830381865afa15801561061f573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f1916820160405261064691908101906128e1565b91509150806106675760405162461bcd60e51b8152600401610365906129b3565b6005600160991b016001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106aa573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106ce9190612817565b8251146106ed5760405162461bcd60e51b8152600401610365906129f7565b60208201516001600160a01b0316156107185760405162461bcd60e51b815260040161036590612a3e565b5f80610727846040015161149b565b91509150818a1461078f5760405162461bcd60e51b815260206004820152602c60248201527f5374616b696e674d616e616765723a20496e76616c696420757074696d65207660448201526b185b1a59185d1a5bdb88125160a21b6064820152608401610365565b93505050505b6001600160401b03811660a08301525f86815260088401602052604090208251815484929190829060ff191660018360058111156107d5576107d56127af565b02179055506020820151600182015560408201516002820180546060850151608086015160a08701516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c08301516003909201805460e0850151610100958601516001600160a01b039095166001600160a81b031990921691909117600160a01b911515919091021767ffffffffffffffff60a81b1916600160a81b93909216929092021790558201515f906108c69088908361127e565b60405163ee5b48eb60e01b81529091505f906005600160991b019063ee5b48eb906108f59085906004016127e5565b6020604051808303815f875af1158015610911573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109359190612817565b60408581015181516001600160401b03918216815242602082015290861681830152905191925082918a917f530b908725650fb1052974f9df59e834fefac78c9ec2f00c6d2464d60cc6add5919081900360600190a35050505050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff1615906001600160401b03165f811580156109d95750825b90505f826001600160401b031660011480156109f45750303b155b905081158015610a02575080155b15610a205760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff191660011785558315610a4a57845460ff60401b1916600160401b1785555b610a5386611673565b8315610a9957845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050565b5f5f80516020612de98339815191526040516306f8253560e41b815263ffffffff841660048201529091505f9081906005600160991b0190636f825350906024015f60405180830381865afa158015610afc573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052610b2391908101906128e1565b9150915080610b445760405162461bcd60e51b8152600401610365906129b3565b8254825114610b655760405162461bcd60e51b8152600401610365906129f7565b60208201516001600160a01b031615610b905760405162461bcd60e51b815260040161036590612a3e565b5f80610b9f8460400151611687565b9150915080610bff5760405162461bcd60e51b815260206004820152602660248201527f5374616b696e674d616e616765723a20526567697374726174696f6e206e6f74604482015265081d985b1a5960d21b6064820152608401610365565b5f82815260078601602052604081208054610c1990612a8b565b9050118015610c4b575060015f83815260088701602052604090205460ff166005811115610c4957610c496127af565b145b610c675760405162461bcd60e51b815260040161036590612abd565b5f8281526007860160205260408120610c7f91612530565b5f8281526008860160208181526040808420805460ff191660029081178255810180546001600160401b0342818116600160401b026fffffffffffffffff000000000000000019909316929092178355600190930154875260098c0185528387208990559588905293835292548151931683529082019290925283917ff8fd1c90fb9cfa2ca2358fdf5806b086ad43315d92b221c929efc7f105ce7568910160405180910390a2505050505050565b5f8181527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6076020526040812080545f80516020612de9833981519152929190610d7690612a8b565b9050118015610da8575060015f83815260088301602052604090205460ff166005811115610da657610da66127af565b145b610dc45760405162461bcd60e51b815260040161036590612abd565b5f82815260078201602052604090819020905163ee5b48eb60e01b81526005600160991b019163ee5b48eb91610dfd9190600401612b02565b6020604051808303815f875af1158015610e19573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e3d9190612817565b505050565b5f610e4f84348585611828565b949350505050565b5f5f80516020612de98339815191526040516306f8253560e41b815263ffffffff851660048201529091505f9081906005600160991b0190636f825350906024015f60405180830381865afa158015610eb2573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052610ed991908101906128e1565b9150915080610efa5760405162461bcd60e51b8152600401610365906129b3565b5f8415610f73575f610f0f8460400151611d24565b919350909150506001600160401b03811615610f6d5760405162461bcd60e51b815260206004820181905260248201527f5374616b696e674d616e616765723a20576569676874206d75737420626520306044820152606401610365565b50610fe7565b5f610f818460400151611687565b90925090508015610fe55760405162461bcd60e51b815260206004820152602860248201527f5374616b696e674d616e616765723a20526567697374726174696f6e207374696044820152671b1b081d985b1a5960c21b6064820152608401610365565b505b5f818152600885016020526040808220815161012081019092528054829060ff166005811115611019576110196127af565b600581111561102a5761102a6127af565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003909201546001600160a01b0380821660c080850191909152600160a01b830460ff16151560e0850152600160a81b909204909316610100909201919091528201519192501633146110db5760405162461bcd60e51b815260040161036590612878565b5f6003825160058111156110f1576110f16127af565b148061110f575060028251600581111561110d5761110d6127af565b145b1561113257506020808201515f9081526009870190915260408120556004611136565b5060055b5f83815260088701602052604090208251815484929190829060ff19166001836005811115611167576111676127af565b0217905550602082015160018201556040808301516002830180546060860151608087015160a08801516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c08401516003909301805460e0860151610100909601516001600160a01b039095166001600160a81b031990911617600160a01b951515959095029490941767ffffffffffffffff60a81b1916600160a81b9390911692909202919091179091555183907f3532ad18e70a039beb4663d48c15acbef558c96ec9b8fd0cc3c0304f774740b8905f90a25050505050505050565b60408051603680825260608281019093525f91906020820181803683370190505090505f5b60028110156112f7576112b7816001612b8c565b6112c2906008612861565b5081515f908390839081106112d9576112d9612b9f565b60200101906001600160f81b03191690815f1a9053506001016112a3565b505f5b600481101561135a5761130e816003612b8c565b611319906008612861565b6001901c60f81b8261132c836002612bb3565b8151811061133c5761133c612b9f565b60200101906001600160f81b03191690815f1a9053506001016112fa565b505f5b60208110156113bc5761137181601f612b8c565b61137c906008612861565b86901c60f81b8261138e836006612bb3565b8151811061139e5761139e612b9f565b60200101906001600160f81b03191690815f1a90535060010161135d565b505f5b6008811015611427576113d3816007612b8c565b6113de906008612861565b6001600160401b038616901c60f81b826113f9836026612bb3565b8151811061140957611409612b9f565b60200101906001600160f81b03191690815f1a9053506001016113bf565b505f5b60088110156114925761143e816007612b8c565b611449906008612861565b6001600160401b038516901c60f81b8261146483602e612bb3565b8151811061147457611474612b9f565b60200101906001600160f81b03191690815f1a90535060010161142a565b50949350505050565b5f808251602e146114be5760405162461bcd60e51b815260040161036590612bc6565b5f805b600281101561150d576114d5816001612b8c565b6114e0906008612861565b61ffff168582815181106114f6576114f6612b9f565b016020015160f81c901b91909117906001016114c1565b5061ffff8116156115305760405162461bcd60e51b815260040161036590612c0d565b5f805b600481101561158b57611547816003612b8c565b611552906008612861565b63ffffffff1686611564836002612bb3565b8151811061157457611574612b9f565b016020015160f81c901b9190911790600101611533565b5063ffffffff81166004146115b25760405162461bcd60e51b815260040161036590612c4e565b5f805b6020811015611607576115c981601f612b8c565b6115d4906008612861565b876115e0836006612bb3565b815181106115f0576115f0612b9f565b016020015160f81c901b91909117906001016115b5565b505f805b60088110156116665761161f816007612b8c565b61162a906008612861565b6001600160401b03168861163f836026612bb3565b8151811061164f5761164f612b9f565b016020015160f81c901b919091179060010161160b565b5090969095509350505050565b61167b611f5f565b61168481611faa565b50565b5f8082516027146116aa5760405162461bcd60e51b815260040161036590612bc6565b5f805b60028110156116f9576116c1816001612b8c565b6116cc906008612861565b61ffff168582815181106116e2576116e2612b9f565b016020015160f81c901b91909117906001016116ad565b5061ffff81161561171c5760405162461bcd60e51b815260040161036590612c0d565b5f805b600481101561177757611733816003612b8c565b61173e906008612861565b63ffffffff1686611750836002612bb3565b8151811061176057611760612b9f565b016020015160f81c901b919091179060010161171f565b5063ffffffff811660021461179e5760405162461bcd60e51b815260040161036590612c4e565b5f805b60208110156117f3576117b581601f612b8c565b6117c0906008612861565b876117cc836006612bb3565b815181106117dc576117dc612b9f565b016020015160f81c901b91909117906001016117a1565b505f8660268151811061180857611808612b9f565b016020015191976001600160f81b03199092161515965090945050505050565b5f611831611fcb565b5f80516020612de9833981519152426001600160401b03851611801561186b57506001600160401b038416611869426202a300612bb3565b115b6118cb5760405162461bcd60e51b815260206004820152602b60248201527f5374616b696e674d616e616765723a20496e76616c696420726567697374726160448201526a74696f6e2065787069727960a81b6064820152608401610365565b856119185760405162461bcd60e51b815260206004820152601f60248201527f5374616b696e674d616e616765723a20496e76616c6964206e6f6465204944006044820152606401610365565b5f868152600982016020526040902054156119845760405162461bcd60e51b815260206004820152602660248201527f5374616b696e674d616e616765723a204e6f646520494420616c72656164792060448201526561637469766560d01b6064820152608401610365565b82516030146119e95760405162461bcd60e51b815260206004820152602b60248201527f5374616b696e674d616e616765723a20496e76616c696420626c735075626c6960448201526a0c696caf240d8cadccee8d60ab1b6064820152608401610365565b845f6119f4826103f3565b90508260020154816001600160401b031610158015611a2057508260030154816001600160401b031611155b611a785760405162461bcd60e51b8152602060048201526024808201527f5374616b696e674d616e616765723a20496e76616c6964207374616b6520616d6044820152631bdd5b9d60e21b6064820152608401610365565b5f80611abf6040518060a00160405280876001015481526020018c8152602001856001600160401b031681526020018a6001600160401b0316815260200189815250612015565b5f82815260078801602052604090209193509150611add8282612cd7565b5060405163ee5b48eb60e01b81525f906005600160991b019063ee5b48eb90611b0a9085906004016127e5565b6020604051808303815f875af1158015611b26573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611b4a9190612817565b6040805161012081019091529091508060018152602081018d90526001600160401b03861660408201525f606082018190526080820181905260a082015260c001336001600160a01b031681525f6020808301829052604092830182905286825260088a0190522081518154829060ff19166001836005811115611bd057611bd06127af565b021790555060208281015160018301556040808401516002840180546060870151608088015160a08901516001600160401b03908116600160c01b026001600160c01b03928216600160801b02929092166001600160801b03938216600160401b026001600160801b03199095169682169690961793909317919091169390931792909217905560c08501516003909401805460e0870151610100909701518316600160a81b0267ffffffffffffffff60a81b19971515600160a01b026001600160a81b03199092166001600160a01b039097169690961717959095169390931790935582518783168152918c169082015282918d9186917f79b81620b81daf2c08cd5bb3dbb79e75d2d7a87f52171fde5aadc8c47823026e910160405180910390a45090945050505050610e4f60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b5f805f8351603614611d485760405162461bcd60e51b815260040161036590612bc6565b5f805b6002811015611d9757611d5f816001612b8c565b611d6a906008612861565b61ffff16868281518110611d8057611d80612b9f565b016020015160f81c901b9190911790600101611d4b565b5061ffff811615611dba5760405162461bcd60e51b815260040161036590612c0d565b5f805b6004811015611e1557611dd1816003612b8c565b611ddc906008612861565b63ffffffff1687611dee836002612bb3565b81518110611dfe57611dfe612b9f565b016020015160f81c901b9190911790600101611dbd565b5063ffffffff8116600114611e3c5760405162461bcd60e51b815260040161036590612c4e565b5f805b6020811015611e9157611e5381601f612b8c565b611e5e906008612861565b88611e6a836006612bb3565b81518110611e7a57611e7a612b9f565b016020015160f81c901b9190911790600101611e3f565b505f805b6008811015611ef057611ea9816007612b8c565b611eb4906008612861565b6001600160401b031689611ec9836026612bb3565b81518110611ed957611ed9612b9f565b016020015160f81c901b9190911790600101611e95565b505f805b6008811015611f4f57611f08816007612b8c565b611f13906008612861565b6001600160401b03168a611f2883602e612bb3565b81518110611f3857611f38612b9f565b016020015160f81c901b9190911790600101611ef4565b5091989097509095509350505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff16611fa857604051631afcd79f60e31b815260040160405180910390fd5b565b611fb2611f5f565b611fba6123e0565b611fc26123f0565b611684816123f8565b7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0080546001190161200f57604051633ee5aeb560e01b815260040160405180910390fd5b60029055565b5f606082608001515160301461207f5760405162461bcd60e51b815260206004820152602960248201527f5374616b696e674d657373616765733a20496e76616c6964207369676e6174756044820152680e4ca40d8cadccee8d60bb1b6064820152608401610365565b60408051608680825260c082019092525f916020820181803683370190505090505f5b60028110156120f6576120b6816001612b8c565b6120c1906008612861565b5081515f908390839081106120d8576120d8612b9f565b60200101906001600160f81b03191690815f1a9053506001016120a2565b505f5b60048110156121545761210d816003612b8c565b612118906008612861565b505f82612126836002612bb3565b8151811061213657612136612b9f565b60200101906001600160f81b03191690815f1a9053506001016120f9565b505f5b60208110156121b1578451816020811061217357612173612b9f565b1a60f81b82612183836006612bb3565b8151811061219357612193612b9f565b60200101906001600160f81b03191690815f1a905350600101612157565b505f5b602081101561221157846020015181602081106121d3576121d3612b9f565b1a60f81b826121e3836026612bb3565b815181106121f3576121f3612b9f565b60200101906001600160f81b03191690815f1a9053506001016121b4565b505f5b600881101561228557612228816007612b8c565b612233906008612861565b60ff1685604001516001600160401b0316901c60f81b828260466122579190612bb3565b8151811061226757612267612b9f565b60200101906001600160f81b03191690815f1a905350600101612214565b505f5b60308110156122f057846080015181815181106122a7576122a7612b9f565b01602001516001600160f81b031916826122c283604e612bb3565b815181106122d2576122d2612b9f565b60200101906001600160f81b03191690815f1a905350600101612288565b505f5b600881101561236257612307816007612b8c565b612312906008612861565b60608601516001600160401b0390811691161c60f81b8261233483607e612bb3565b8151811061234457612344612b9f565b60200101906001600160f81b03191690815f1a9053506001016122f3565b506002816040516123739190612d92565b602060405180830381855afa15801561238e573d5f803e3d5ffd5b5050506040513d601f19601f820116820180604052508101906123b19190612817565b94909350915050565b60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b6123e8611f5f565b611fa8612528565b611fa8611f5f565b612400611f5f565b80355f80516020612de983398151915290815560208201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6015560408201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6025560608201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6035561249860a08301608084016125ac565b60048201805467ffffffffffffffff19166001600160401b03929092169190911790556124cb60c0830160a08401612dad565b60048201805460ff92909216600160e01b0260ff60e01b199092169190911790556124fc60e0830160c08401612dcd565b8160040160086101000a8154816001600160a01b0302191690836001600160a01b031602179055505050565b6123ba611f5f565b50805461253c90612a8b565b5f825580601f1061254b575050565b601f0160209004905f5260205f209081019061168491905b80821115612576575f8155600101612563565b5090565b5f6020828403121561258a575f80fd5b5035919050565b80356001600160401b03811681146125a7575f80fd5b919050565b5f602082840312156125bc575f80fd5b6125c582612591565b9392505050565b8015158114611684575f80fd5b803563ffffffff811681146125a7575f80fd5b5f805f606084860312156125fe575f80fd5b833592506020840135612610816125cc565b915061261e604085016125d9565b90509250925092565b5f60e08284031215612637575f80fd5b50919050565b5f6020828403121561264d575f80fd5b6125c5826125d9565b634e487b7160e01b5f52604160045260245ffd5b604051606081016001600160401b038111828210171561268c5761268c612656565b60405290565b604051601f8201601f191681016001600160401b03811182821017156126ba576126ba612656565b604052919050565b5f6001600160401b038211156126da576126da612656565b50601f01601f191660200190565b5f805f606084860312156126fa575f80fd5b8335925061270a60208501612591565b915060408401356001600160401b03811115612724575f80fd5b8401601f81018613612734575f80fd5b8035612747612742826126c2565b612692565b81815287602083850101111561275b575f80fd5b816020840160208301375f602083830101528093505050509250925092565b5f806040838503121561278b575f80fd5b612794836125d9565b915060208301356127a4816125cc565b809150509250929050565b634e487b7160e01b5f52602160045260245ffd5b5f5b838110156127dd5781810151838201526020016127c5565b50505f910152565b602081525f82518060208401526128038160408501602087016127c3565b601f01601f19169190910160400192915050565b5f60208284031215612827575f80fd5b5051919050565b634e487b7160e01b5f52601160045260245ffd5b5f8261285c57634e487b7160e01b5f52601260045260245ffd5b500490565b80820281158282048414176104035761040361282e565b6020808252602a908201527f5374616b696e674d616e616765723a2053656e646572206e6f742076616c696460408201526930ba37b91037bbb732b960b11b606082015260800190565b6001600160a01b0381168114611684575f80fd5b80516125a7816125cc565b5f80604083850312156128f2575f80fd5b82516001600160401b0380821115612908575f80fd5b908401906060828703121561291b575f80fd5b61292361266a565b82518152602080840151612936816128c2565b8282015260408401518381111561294b575f80fd5b80850194505087601f85011261295f575f80fd5b8351925061296f612742846126c2565b8381528882858701011115612982575f80fd5b612991848383018488016127c3565b806040840152508195506129a68188016128d6565b9450505050509250929050565b60208082526024908201527f5374616b696e674d616e616765723a20496e76616c69642077617270206d65736040820152637361676560e01b606082015260800190565b60208082526027908201527f5374616b696e674d616e616765723a20496e76616c696420736f7572636520636040820152661a185a5b88125160ca1b606082015260800190565b6020808252602d908201527f5374616b696e674d616e616765723a20496e76616c6964206f726967696e207360408201526c656e646572206164647265737360981b606082015260800190565b600181811c90821680612a9f57607f821691505b60208210810361263757634e487b7160e01b5f52602260045260245ffd5b60208082526025908201527f5374616b696e674d616e616765723a20496e76616c69642076616c69646174696040820152641bdb88125160da1b606082015260800190565b5f60208083525f8454612b1481612a8b565b806020870152604060018084165f8114612b355760018114612b5157612b7e565b60ff19851660408a0152604084151560051b8a01019550612b7e565b895f5260205f205f5b85811015612b755781548b8201860152908301908801612b5a565b8a016040019650505b509398975050505050505050565b818103818111156104035761040361282e565b634e487b7160e01b5f52603260045260245ffd5b808201808211156104035761040361282e565b60208082526027908201527f5374616b696e674d657373616765733a20496e76616c6964206d657373616765604082015266040d8cadccee8d60cb1b606082015260800190565b60208082526021908201527f5374616b696e674d657373616765733a20496e76616c696420636f64656320496040820152601160fa1b606082015260800190565b60208082526025908201527f5374616b696e674d657373616765733a20496e76616c6964206d657373616765604082015264207479706560d81b606082015260800190565b601f821115610e3d57805f5260205f20601f840160051c81016020851015612cb85750805b601f840160051c820191505b818110156103ec575f8155600101612cc4565b81516001600160401b03811115612cf057612cf0612656565b612d0481612cfe8454612a8b565b84612c93565b602080601f831160018114612d37575f8415612d205750858301515b5f19600386901b1c1916600185901b178555610a99565b5f85815260208120601f198616915b82811015612d6557888601518255948401946001909101908401612d46565b5085821015612d8257878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b5f8251612da38184602087016127c3565b9190910192915050565b5f60208284031215612dbd575f80fd5b813560ff811681146125c5575f80fd5b5f60208284031215612ddd575f80fd5b81356125c5816128c256feafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab600a164736f6c6343000819000a", + Bin: "0x608060405234801561000f575f80fd5b506040516131a43803806131a483398101604081905261002e91610107565b60018160018111156100425761004261012c565b0361004f5761004f610055565b50610140565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156100a55760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146101045780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b5f60208284031215610117575f80fd5b815160028110610125575f80fd5b9392505050565b634e487b7160e01b5f52602160045260245ffd5b6130578061014d5f395ff3fe60806040526004361061008f575f3560e01c8063a3a65e4811610057578063a3a65e481461015b578063b771b3bc1461017a578063bee0a03f146101ac578063f40797d7146101cb578063fdf94a1a146101de575f80fd5b80630322ed98146100935780632e2194d8146100b457806362065856146100f057806376f786211461011d57806379f54eb11461013c575b5f80fd5b34801561009e575f80fd5b506100b26100ad36600461273d565b6101fd565b005b3480156100bf575f80fd5b506100d36100ce36600461273d565b6103f3565b6040516001600160401b0390911681526020015b60405180910390f35b3480156100fb575f80fd5b5061010f61010a36600461276f565b610409565b6040519081526020016100e7565b348015610128575f80fd5b506100b26101373660046127af565b610422565b348015610147575f80fd5b506100b26101563660046127ea565b6109a2565b348015610166575f80fd5b506100b2610175366004612800565b610aae565b348015610185575f80fd5b506101946005600160991b0181565b6040516001600160a01b0390911681526020016100e7565b3480156101b7575f80fd5b506100b26101c636600461273d565b610d3b565b61010f6101d93660046128ab565b610e4f565b3480156101e9575f80fd5b506100b26101f836600461293d565b610e64565b5f8181527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab60860205260408082208151610120810190925280545f8051602061302b83398151915293929190829060ff16600581111561025e5761025e612972565b600581111561026f5761026f612972565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003928301546001600160a01b03811660c084015260ff600160a01b820416151560e0840152600160a81b900416610100909101529091508151600581111561030657610306612972565b1461036e5760405162461bcd60e51b815260206004820152602d60248201527f5374616b696e674d616e616765723a2056616c696461746f72206e6f7420706560448201526c1b991a5b99c81c995b5bdd985b609a1b60648201526084015b60405180910390fd5b5f61037f848361010001515f61128b565b60405163ee5b48eb60e01b81529091506005600160991b019063ee5b48eb906103ac9084906004016129a8565b6020604051808303815f875af11580156103c8573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103ec91906129da565b5050505050565b5f61040364e8d4a5100083612a19565b92915050565b5f6104036001600160401b03831664e8d4a51000612a2c565b5f8381527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab60860205260408082208151610120810190925280545f8051602061302b83398151915293929190829060ff16600581111561048357610483612972565b600581111561049457610494612972565b8152600182015460208201526002808301546001600160401b038082166040850152600160401b820481166060850152600160801b820481166080850152600160c01b909104811660a08401526003909301546001600160a01b03811660c084015260ff600160a01b820416151560e0840152600160a81b9004909216610100909101529091508151600581111561052e5761052e612972565b146105875760405162461bcd60e51b8152602060048201526024808201527f5374616b696e674d616e616765723a2056616c696461746f72206e6f742061636044820152637469766560e01b6064820152608401610365565b60c08101516001600160a01b0316336001600160a01b0316146105bc5760405162461bcd60e51b815260040161036590612a43565b6105c981604001516114a8565b60038152426001600160401b031660808201525f84156107a2576040516306f8253560e41b815263ffffffff851660048201525f9081906005600160991b0190636f825350906024015f60405180830381865afa15801561062c573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f191682016040526106539190810190612aac565b91509150806106745760405162461bcd60e51b815260040161036590612b7e565b6005600160991b016001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106b7573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106db91906129da565b8251146106fa5760405162461bcd60e51b815260040161036590612bc2565b60208201516001600160a01b0316156107255760405162461bcd60e51b815260040161036590612c09565b5f806107348460400151611655565b91509150818a1461079c5760405162461bcd60e51b815260206004820152602c60248201527f5374616b696e674d616e616765723a20496e76616c696420757074696d65207660448201526b185b1a59185d1a5bdb88125160a21b6064820152608401610365565b93505050505b6001600160401b03811660a08301525f86815260088401602052604090208251815484929190829060ff191660018360058111156107e2576107e2612972565b02179055506020820151600182015560408201516002820180546060850151608086015160a08701516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c08301516003909201805460e0850151610100958601516001600160a01b039095166001600160a81b031990921691909117600160a01b911515919091021767ffffffffffffffff60a81b1916600160a81b93909216929092021790558201515f906108d39088908361128b565b60405163ee5b48eb60e01b81529091505f906005600160991b019063ee5b48eb906109029085906004016129a8565b6020604051808303815f875af115801561091e573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061094291906129da565b60408581015181516001600160401b03918216815242602082015290861681830152905191925082918a917f530b908725650fb1052974f9df59e834fefac78c9ec2f00c6d2464d60cc6add5919081900360600190a35050505050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff1615906001600160401b03165f811580156109e65750825b90505f826001600160401b03166001148015610a015750303b155b905081158015610a0f575080155b15610a2d5760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff191660011785558315610a5757845460ff60401b1916600160401b1785555b610a608661182d565b8315610aa657845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050565b5f5f8051602061302b8339815191526040516306f8253560e41b815263ffffffff841660048201529091505f9081906005600160991b0190636f825350906024015f60405180830381865afa158015610b09573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052610b309190810190612aac565b9150915080610b515760405162461bcd60e51b815260040161036590612b7e565b8254825114610b725760405162461bcd60e51b815260040161036590612bc2565b60208201516001600160a01b031615610b9d5760405162461bcd60e51b815260040161036590612c09565b5f80610bac8460400151611841565b9150915080610c0c5760405162461bcd60e51b815260206004820152602660248201527f5374616b696e674d616e616765723a20526567697374726174696f6e206e6f74604482015265081d985b1a5960d21b6064820152608401610365565b5f82815260078601602052604081208054610c2690612c56565b9050118015610c58575060015f83815260088701602052604090205460ff166005811115610c5657610c56612972565b145b610c745760405162461bcd60e51b815260040161036590612c88565b5f8281526007860160205260408120610c8c916126f3565b5f8281526008860160208181526040808420805460ff191660029081178255810180546001600160401b0342818116600160401b026fffffffffffffffff000000000000000019909316929092178355600190930154875260098c0185528387208990559588905293835292548151931683529082019290925283917ff8fd1c90fb9cfa2ca2358fdf5806b086ad43315d92b221c929efc7f105ce7568910160405180910390a2505050505050565b5f8181527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6076020526040812080545f8051602061302b833981519152929190610d8390612c56565b9050118015610db5575060015f83815260088301602052604090205460ff166005811115610db357610db3612972565b145b610dd15760405162461bcd60e51b815260040161036590612c88565b5f82815260078201602052604090819020905163ee5b48eb60e01b81526005600160991b019163ee5b48eb91610e0a9190600401612ccd565b6020604051808303815f875af1158015610e26573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e4a91906129da565b505050565b5f610e5c843485856119e2565b949350505050565b5f5f8051602061302b8339815191526040516306f8253560e41b815263ffffffff851660048201529091505f9081906005600160991b0190636f825350906024015f60405180830381865afa158015610ebf573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052610ee69190810190612aac565b9150915080610f075760405162461bcd60e51b815260040161036590612b7e565b5f8415610f80575f610f1c8460400151611ee7565b919350909150506001600160401b03811615610f7a5760405162461bcd60e51b815260206004820181905260248201527f5374616b696e674d616e616765723a20576569676874206d75737420626520306044820152606401610365565b50610ff4565b5f610f8e8460400151611841565b90925090508015610ff25760405162461bcd60e51b815260206004820152602860248201527f5374616b696e674d616e616765723a20526567697374726174696f6e207374696044820152671b1b081d985b1a5960c21b6064820152608401610365565b505b5f818152600885016020526040808220815161012081019092528054829060ff16600581111561102657611026612972565b600581111561103757611037612972565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003909201546001600160a01b0380821660c080850191909152600160a01b830460ff16151560e0850152600160a81b909204909316610100909201919091528201519192501633146110e85760405162461bcd60e51b815260040161036590612a43565b5f6003825160058111156110fe576110fe612972565b148061111c575060028251600581111561111a5761111a612972565b145b1561113f57506020808201515f9081526009870190915260408120556004611143565b5060055b5f83815260088701602052604090208251815484929190829060ff1916600183600581111561117457611174612972565b0217905550602082015160018201556040808301516002830180546060860151608087015160a08801516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c08401516003909301805460e0860151610100909601516001600160a01b039095166001600160a81b031990911617600160a01b951515959095029490941767ffffffffffffffff60a81b1916600160a81b9390911692909202919091179091555183907f3532ad18e70a039beb4663d48c15acbef558c96ec9b8fd0cc3c0304f774740b8905f90a25050505050505050565b60408051603680825260608281019093525f91906020820181803683370190505090505f5b6002811015611304576112c4816001612d57565b6112cf906008612a2c565b5081515f908390839081106112e6576112e6612d6a565b60200101906001600160f81b03191690815f1a9053506001016112b0565b505f5b60048110156113675761131b816003612d57565b611326906008612a2c565b6001901c60f81b82611339836002612d7e565b8151811061134957611349612d6a565b60200101906001600160f81b03191690815f1a905350600101611307565b505f5b60208110156113c95761137e81601f612d57565b611389906008612a2c565b86901c60f81b8261139b836006612d7e565b815181106113ab576113ab612d6a565b60200101906001600160f81b03191690815f1a90535060010161136a565b505f5b6008811015611434576113e0816007612d57565b6113eb906008612a2c565b6001600160401b038616901c60f81b82611406836026612d7e565b8151811061141657611416612d6a565b60200101906001600160f81b03191690815f1a9053506001016113cc565b505f5b600881101561149f5761144b816007612d57565b611456906008612a2c565b6001600160401b038516901c60f81b8261147183602e612d7e565b8151811061148157611481612d6a565b60200101906001600160f81b03191690815f1a905350600101611437565b50949350505050565b7fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab604545f8051602061302b83398151915290600160e01b900460ff165f036114ed575050565b60408051606081018252600583015480825260068401546001600160401b038082166020850152600160401b9091041692820192909252904290610e10906115359083612d57565b10611551576001600160401b0384166040830152808252611570565b83826040018181516115639190612d91565b6001600160401b03169052505b5f8260200151836040015160646115879190612db8565b6115919190612de3565b600485015490915060ff600160e01b909104811690821611156116115760405162461bcd60e51b815260206004820152603260248201527f5374616b696e674d616e616765723a204d6178696d756d20686f75726c7920636044820152711a1d5c9b881c985d1948195e18d95959195960721b6064820152608401610365565b5050805160058301556020810151600690920180546040909201516001600160401b03908116600160401b026001600160801b031990931693169290921717905550565b5f808251602e146116785760405162461bcd60e51b815260040161036590612e08565b5f805b60028110156116c75761168f816001612d57565b61169a906008612a2c565b61ffff168582815181106116b0576116b0612d6a565b016020015160f81c901b919091179060010161167b565b5061ffff8116156116ea5760405162461bcd60e51b815260040161036590612e4f565b5f805b600481101561174557611701816003612d57565b61170c906008612a2c565b63ffffffff168661171e836002612d7e565b8151811061172e5761172e612d6a565b016020015160f81c901b91909117906001016116ed565b5063ffffffff811660041461176c5760405162461bcd60e51b815260040161036590612e90565b5f805b60208110156117c15761178381601f612d57565b61178e906008612a2c565b8761179a836006612d7e565b815181106117aa576117aa612d6a565b016020015160f81c901b919091179060010161176f565b505f805b6008811015611820576117d9816007612d57565b6117e4906008612a2c565b6001600160401b0316886117f9836026612d7e565b8151811061180957611809612d6a565b016020015160f81c901b91909117906001016117c5565b5090969095509350505050565b611835612122565b61183e8161216d565b50565b5f8082516027146118645760405162461bcd60e51b815260040161036590612e08565b5f805b60028110156118b35761187b816001612d57565b611886906008612a2c565b61ffff1685828151811061189c5761189c612d6a565b016020015160f81c901b9190911790600101611867565b5061ffff8116156118d65760405162461bcd60e51b815260040161036590612e4f565b5f805b6004811015611931576118ed816003612d57565b6118f8906008612a2c565b63ffffffff168661190a836002612d7e565b8151811061191a5761191a612d6a565b016020015160f81c901b91909117906001016118d9565b5063ffffffff81166002146119585760405162461bcd60e51b815260040161036590612e90565b5f805b60208110156119ad5761196f81601f612d57565b61197a906008612a2c565b87611986836006612d7e565b8151811061199657611996612d6a565b016020015160f81c901b919091179060010161195b565b505f866026815181106119c2576119c2612d6a565b016020015191976001600160f81b03199092161515965090945050505050565b5f6119eb61218e565b5f8051602061302b833981519152426001600160401b038516118015611a2557506001600160401b038416611a23426202a300612d7e565b115b611a855760405162461bcd60e51b815260206004820152602b60248201527f5374616b696e674d616e616765723a20496e76616c696420726567697374726160448201526a74696f6e2065787069727960a81b6064820152608401610365565b85611ad25760405162461bcd60e51b815260206004820152601f60248201527f5374616b696e674d616e616765723a20496e76616c6964206e6f6465204944006044820152606401610365565b5f86815260098201602052604090205415611b3e5760405162461bcd60e51b815260206004820152602660248201527f5374616b696e674d616e616765723a204e6f646520494420616c72656164792060448201526561637469766560d01b6064820152608401610365565b8251603014611ba35760405162461bcd60e51b815260206004820152602b60248201527f5374616b696e674d616e616765723a20496e76616c696420626c735075626c6960448201526a0c696caf240d8cadccee8d60ab1b6064820152608401610365565b845f611bae826103f3565b9050611bb9816114a8565b8260020154816001600160401b031610158015611be357508260030154816001600160401b031611155b611c3b5760405162461bcd60e51b8152602060048201526024808201527f5374616b696e674d616e616765723a20496e76616c6964207374616b6520616d6044820152631bdd5b9d60e21b6064820152608401610365565b5f80611c826040518060a00160405280876001015481526020018c8152602001856001600160401b031681526020018a6001600160401b03168152602001898152506121d8565b5f82815260078801602052604090209193509150611ca08282612f19565b5060405163ee5b48eb60e01b81525f906005600160991b019063ee5b48eb90611ccd9085906004016129a8565b6020604051808303815f875af1158015611ce9573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611d0d91906129da565b6040805161012081019091529091508060018152602081018d90526001600160401b03861660408201525f606082018190526080820181905260a082015260c001336001600160a01b031681525f6020808301829052604092830182905286825260088a0190522081518154829060ff19166001836005811115611d9357611d93612972565b021790555060208281015160018301556040808401516002840180546060870151608088015160a08901516001600160401b03908116600160c01b026001600160c01b03928216600160801b02929092166001600160801b03938216600160401b026001600160801b03199095169682169690961793909317919091169390931792909217905560c08501516003909401805460e0870151610100909701518316600160a81b0267ffffffffffffffff60a81b19971515600160a01b026001600160a81b03199092166001600160a01b039097169690961717959095169390931790935582518783168152918c169082015282918d9186917f79b81620b81daf2c08cd5bb3dbb79e75d2d7a87f52171fde5aadc8c47823026e910160405180910390a45090945050505050610e5c60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b5f805f8351603614611f0b5760405162461bcd60e51b815260040161036590612e08565b5f805b6002811015611f5a57611f22816001612d57565b611f2d906008612a2c565b61ffff16868281518110611f4357611f43612d6a565b016020015160f81c901b9190911790600101611f0e565b5061ffff811615611f7d5760405162461bcd60e51b815260040161036590612e4f565b5f805b6004811015611fd857611f94816003612d57565b611f9f906008612a2c565b63ffffffff1687611fb1836002612d7e565b81518110611fc157611fc1612d6a565b016020015160f81c901b9190911790600101611f80565b5063ffffffff8116600114611fff5760405162461bcd60e51b815260040161036590612e90565b5f805b60208110156120545761201681601f612d57565b612021906008612a2c565b8861202d836006612d7e565b8151811061203d5761203d612d6a565b016020015160f81c901b9190911790600101612002565b505f805b60088110156120b35761206c816007612d57565b612077906008612a2c565b6001600160401b03168961208c836026612d7e565b8151811061209c5761209c612d6a565b016020015160f81c901b9190911790600101612058565b505f805b6008811015612112576120cb816007612d57565b6120d6906008612a2c565b6001600160401b03168a6120eb83602e612d7e565b815181106120fb576120fb612d6a565b016020015160f81c901b91909117906001016120b7565b5091989097509095509350505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff1661216b57604051631afcd79f60e31b815260040160405180910390fd5b565b612175612122565b61217d6125a3565b6121856125b3565b61183e816125bb565b7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f008054600119016121d257604051633ee5aeb560e01b815260040160405180910390fd5b60029055565b5f60608260800151516030146122425760405162461bcd60e51b815260206004820152602960248201527f5374616b696e674d657373616765733a20496e76616c6964207369676e6174756044820152680e4ca40d8cadccee8d60bb1b6064820152608401610365565b60408051608680825260c082019092525f916020820181803683370190505090505f5b60028110156122b957612279816001612d57565b612284906008612a2c565b5081515f9083908390811061229b5761229b612d6a565b60200101906001600160f81b03191690815f1a905350600101612265565b505f5b6004811015612317576122d0816003612d57565b6122db906008612a2c565b505f826122e9836002612d7e565b815181106122f9576122f9612d6a565b60200101906001600160f81b03191690815f1a9053506001016122bc565b505f5b6020811015612374578451816020811061233657612336612d6a565b1a60f81b82612346836006612d7e565b8151811061235657612356612d6a565b60200101906001600160f81b03191690815f1a90535060010161231a565b505f5b60208110156123d4578460200151816020811061239657612396612d6a565b1a60f81b826123a6836026612d7e565b815181106123b6576123b6612d6a565b60200101906001600160f81b03191690815f1a905350600101612377565b505f5b6008811015612448576123eb816007612d57565b6123f6906008612a2c565b60ff1685604001516001600160401b0316901c60f81b8282604661241a9190612d7e565b8151811061242a5761242a612d6a565b60200101906001600160f81b03191690815f1a9053506001016123d7565b505f5b60308110156124b3578460800151818151811061246a5761246a612d6a565b01602001516001600160f81b0319168261248583604e612d7e565b8151811061249557612495612d6a565b60200101906001600160f81b03191690815f1a90535060010161244b565b505f5b6008811015612525576124ca816007612d57565b6124d5906008612a2c565b60608601516001600160401b0390811691161c60f81b826124f783607e612d7e565b8151811061250757612507612d6a565b60200101906001600160f81b03191690815f1a9053506001016124b6565b506002816040516125369190612fd4565b602060405180830381855afa158015612551573d5f803e3d5ffd5b5050506040513d601f19601f8201168201806040525081019061257491906129da565b94909350915050565b60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b6125ab612122565b61216b6126eb565b61216b612122565b6125c3612122565b80355f8051602061302b83398151915290815560208201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6015560408201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6025560608201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6035561265b60a083016080840161276f565b60048201805467ffffffffffffffff19166001600160401b039290921691909117905561268e60c0830160a08401612fef565b60048201805460ff92909216600160e01b0260ff60e01b199092169190911790556126bf60e0830160c0840161300f565b8160040160086101000a8154816001600160a01b0302191690836001600160a01b031602179055505050565b61257d612122565b5080546126ff90612c56565b5f825580601f1061270e575050565b601f0160209004905f5260205f209081019061183e91905b80821115612739575f8155600101612726565b5090565b5f6020828403121561274d575f80fd5b5035919050565b80356001600160401b038116811461276a575f80fd5b919050565b5f6020828403121561277f575f80fd5b61278882612754565b9392505050565b801515811461183e575f80fd5b803563ffffffff8116811461276a575f80fd5b5f805f606084860312156127c1575f80fd5b8335925060208401356127d38161278f565b91506127e16040850161279c565b90509250925092565b5f60e082840312156127fa575f80fd5b50919050565b5f60208284031215612810575f80fd5b6127888261279c565b634e487b7160e01b5f52604160045260245ffd5b604051606081016001600160401b038111828210171561284f5761284f612819565b60405290565b604051601f8201601f191681016001600160401b038111828210171561287d5761287d612819565b604052919050565b5f6001600160401b0382111561289d5761289d612819565b50601f01601f191660200190565b5f805f606084860312156128bd575f80fd5b833592506128cd60208501612754565b915060408401356001600160401b038111156128e7575f80fd5b8401601f810186136128f7575f80fd5b803561290a61290582612885565b612855565b81815287602083850101111561291e575f80fd5b816020840160208301375f602083830101528093505050509250925092565b5f806040838503121561294e575f80fd5b6129578361279c565b915060208301356129678161278f565b809150509250929050565b634e487b7160e01b5f52602160045260245ffd5b5f5b838110156129a0578181015183820152602001612988565b50505f910152565b602081525f82518060208401526129c6816040850160208701612986565b601f01601f19169190910160400192915050565b5f602082840312156129ea575f80fd5b5051919050565b634e487b7160e01b5f52601260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b5f82612a2757612a276129f1565b500490565b808202811582820484141761040357610403612a05565b6020808252602a908201527f5374616b696e674d616e616765723a2053656e646572206e6f742076616c696460408201526930ba37b91037bbb732b960b11b606082015260800190565b6001600160a01b038116811461183e575f80fd5b805161276a8161278f565b5f8060408385031215612abd575f80fd5b82516001600160401b0380821115612ad3575f80fd5b9084019060608287031215612ae6575f80fd5b612aee61282d565b82518152602080840151612b0181612a8d565b82820152604084015183811115612b16575f80fd5b80850194505087601f850112612b2a575f80fd5b83519250612b3a61290584612885565b8381528882858701011115612b4d575f80fd5b612b5c84838301848801612986565b80604084015250819550612b71818801612aa1565b9450505050509250929050565b60208082526024908201527f5374616b696e674d616e616765723a20496e76616c69642077617270206d65736040820152637361676560e01b606082015260800190565b60208082526027908201527f5374616b696e674d616e616765723a20496e76616c696420736f7572636520636040820152661a185a5b88125160ca1b606082015260800190565b6020808252602d908201527f5374616b696e674d616e616765723a20496e76616c6964206f726967696e207360408201526c656e646572206164647265737360981b606082015260800190565b600181811c90821680612c6a57607f821691505b6020821081036127fa57634e487b7160e01b5f52602260045260245ffd5b60208082526025908201527f5374616b696e674d616e616765723a20496e76616c69642076616c69646174696040820152641bdb88125160da1b606082015260800190565b5f60208083525f8454612cdf81612c56565b806020870152604060018084165f8114612d005760018114612d1c57612d49565b60ff19851660408a0152604084151560051b8a01019550612d49565b895f5260205f205f5b85811015612d405781548b8201860152908301908801612d25565b8a016040019650505b509398975050505050505050565b8181038181111561040357610403612a05565b634e487b7160e01b5f52603260045260245ffd5b8082018082111561040357610403612a05565b6001600160401b03818116838216019080821115612db157612db1612a05565b5092915050565b6001600160401b03818116838216028082169190828114612ddb57612ddb612a05565b505092915050565b5f6001600160401b0380841680612dfc57612dfc6129f1565b92169190910492915050565b60208082526027908201527f5374616b696e674d657373616765733a20496e76616c6964206d657373616765604082015266040d8cadccee8d60cb1b606082015260800190565b60208082526021908201527f5374616b696e674d657373616765733a20496e76616c696420636f64656320496040820152601160fa1b606082015260800190565b60208082526025908201527f5374616b696e674d657373616765733a20496e76616c6964206d657373616765604082015264207479706560d81b606082015260800190565b601f821115610e4a57805f5260205f20601f840160051c81016020851015612efa5750805b601f840160051c820191505b818110156103ec575f8155600101612f06565b81516001600160401b03811115612f3257612f32612819565b612f4681612f408454612c56565b84612ed5565b602080601f831160018114612f79575f8415612f625750858301515b5f19600386901b1c1916600185901b178555610aa6565b5f85815260208120601f198616915b82811015612fa757888601518255948401946001909101908401612f88565b5085821015612fc457878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b5f8251612fe5818460208701612986565b9190910192915050565b5f60208284031215612fff575f80fd5b813560ff81168114612788575f80fd5b5f6020828403121561301f575f80fd5b813561278881612a8d56feafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab600a164736f6c6343000819000a", } // NativeTokenStakingManagerABI is the input ABI used to generate the binding from. diff --git a/contracts/staking/StakingManager.sol b/contracts/staking/StakingManager.sol index 619e784f2..e22e66d20 100644 --- a/contracts/staking/StakingManager.sol +++ b/contracts/staking/StakingManager.sol @@ -146,8 +146,7 @@ abstract contract StakingManager is // Ensure the stake churn doesn't exceed the maximum churn rate. uint64 weight = valueToWeight(lockedValue); - // TODO: Support this in the e2e test - // _checkAndUpdateChurnTracker(weight); + _checkAndUpdateChurnTracker(weight); // Ensure the weight is within the valid range. require( @@ -259,8 +258,7 @@ abstract contract StakingManager is require(_msgSender() == validator.owner, "StakingManager: Sender not validator owner"); // Check that removing this validator would not exceed the maximum churn rate. - // TODO: Support this in the e2e test - // _checkAndUpdateChurnTracker(validator.weight); + _checkAndUpdateChurnTracker(validator.weight); // Update the validator status to pending removal. // They are not removed from the active validators mapping until the P-Chain acknowledges the removal. diff --git a/tests/flows/native_token_staking.go b/tests/flows/native_token_staking.go index b30f9bec5..15ba7756f 100644 --- a/tests/flows/native_token_staking.go +++ b/tests/flows/native_token_staking.go @@ -110,7 +110,7 @@ func NativeTokenStakingManager(network interfaces.LocalNetwork) { MinimumStakeAmount: big.NewInt(0).SetUint64(1e6), MaximumStakeAmount: big.NewInt(0).SetUint64(10e6), MinimumStakeDuration: uint64(24 * time.Hour), - MaximumHourlyChurn: 1, + MaximumHourlyChurn: 0, RewardCalculator: common.Address{}, }, ) From 4c331399824e24e20128e5140f8dc6be9f6fb3c3 Mon Sep 17 00:00:00 2001 From: cam-schultz Date: Thu, 15 Aug 2024 16:00:06 -0400 Subject: [PATCH 14/27] refactor utils --- tests/flows/native_token_staking.go | 83 +- tests/local/network.go | 44 +- tests/utils/chain_utils.go | 563 +++++++++ tests/utils/erc20_utils.go | 61 + tests/utils/governance_utils.go | 108 ++ tests/utils/staking_utils.go | 65 + tests/utils/{utils.go => teleporter_utils.go} | 1065 ++++------------- 7 files changed, 1047 insertions(+), 942 deletions(-) create mode 100644 tests/utils/chain_utils.go create mode 100644 tests/utils/erc20_utils.go create mode 100644 tests/utils/governance_utils.go create mode 100644 tests/utils/staking_utils.go rename tests/utils/{utils.go => teleporter_utils.go} (51%) diff --git a/tests/flows/native_token_staking.go b/tests/flows/native_token_staking.go index 15ba7756f..fc525f404 100644 --- a/tests/flows/native_token_staking.go +++ b/tests/flows/native_token_staking.go @@ -6,19 +6,10 @@ import ( "math/big" "time" - "github.com/ava-labs/avalanchego/api/info" "github.com/ava-labs/avalanchego/ids" - "github.com/ava-labs/avalanchego/message" - "github.com/ava-labs/avalanchego/utils/constants" - "github.com/ava-labs/avalanchego/utils/logging" - "github.com/ava-labs/avalanchego/utils/set" avalancheWarp "github.com/ava-labs/avalanchego/vms/platformvm/warp" warpMessages "github.com/ava-labs/avalanchego/vms/platformvm/warp/messages" warpPayload "github.com/ava-labs/avalanchego/vms/platformvm/warp/payload" - relayerConfig "github.com/ava-labs/awm-relayer/config" - "github.com/ava-labs/awm-relayer/peers" - "github.com/ava-labs/awm-relayer/signature-aggregator/aggregator" - sigAggConfig "github.com/ava-labs/awm-relayer/signature-aggregator/config" "github.com/ava-labs/subnet-evm/accounts/abi/bind" "github.com/ava-labs/subnet-evm/core/types" "github.com/ava-labs/subnet-evm/precompile/contracts/warp" @@ -29,7 +20,6 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/log" . "github.com/onsi/gomega" - "github.com/prometheus/client_golang/prometheus" ) // Registers a native token staking validator on a subnet. The steps are as follows: @@ -50,72 +40,23 @@ func NativeTokenStakingManager(network interfaces.LocalNetwork) { cChainInfo := network.GetPrimaryNetworkInfo() subnetAInfo, _ := utils.GetTwoSubnets(network) _, fundedKey := network.GetFundedAccountInfo() + pChainInfo := utils.GetPChainInfo(cChainInfo) - // Construct the P-Chain info - pChainBlockchainID, err := info.NewClient(cChainInfo.NodeURIs[0]).GetBlockchainID(context.Background(), "P") - Expect(err).Should(BeNil()) - pChainInfo := interfaces.SubnetTestInfo{ - BlockchainID: pChainBlockchainID, - SubnetID: ids.Empty, - } - - // Create the signature aggregator - logger := logging.NoLog{} - cfg := sigAggConfig.Config{ - PChainAPI: &relayerConfig.APIConfig{ - BaseURL: cChainInfo.NodeURIs[0], - }, - InfoAPI: &relayerConfig.APIConfig{ - BaseURL: cChainInfo.NodeURIs[0], + signatureAggregator := utils.NewSignatureAggregator( + cChainInfo.NodeURIs[0], + []ids.ID{ + subnetAInfo.SubnetID, + ids.Empty, // Primary network subnet ID }, - } - trackedSubnets := set.NewSet[ids.ID](2) - trackedSubnets.Add(subnetAInfo.BlockchainID) - trackedSubnets.Add(ids.Empty) // Primary network subnet ID - appRequestNetwork, err := peers.NewNetwork( - logging.Debug, - prometheus.DefaultRegisterer, - trackedSubnets, - &cfg, ) - Expect(err).Should(BeNil()) - - messageCreator, err := message.NewCreator( - logger, - prometheus.DefaultRegisterer, - constants.DefaultNetworkCompressionType, - constants.DefaultNetworkMaximumInboundTimeout, - ) - Expect(err).Should(BeNil()) - signatureAggregator := aggregator.NewSignatureAggregator( - appRequestNetwork, - logger, - messageCreator, - ) - signatureAggregator.GetSubnetID(subnetAInfo.BlockchainID) // Deploy the staking manager contract - stakingManagerContractAddress, stakingManager := utils.DeployNativeTokenStakingManager( + stakingManagerContractAddress, stakingManager := utils.DeployAndInitializeNativeTokenStakingManager( context.Background(), fundedKey, subnetAInfo, + pChainInfo, ) - opts, err := bind.NewKeyedTransactorWithChainID(fundedKey, subnetAInfo.EVMChainID) - Expect(err).Should(BeNil()) - tx, err := stakingManager.Initialize( - opts, - nativetokenstakingmanager.StakingManagerSettings{ - PChainBlockchainID: pChainInfo.BlockchainID, - SubnetID: subnetAInfo.SubnetID, - MinimumStakeAmount: big.NewInt(0).SetUint64(1e6), - MaximumStakeAmount: big.NewInt(0).SetUint64(10e6), - MinimumStakeDuration: uint64(24 * time.Hour), - MaximumHourlyChurn: 0, - RewardCalculator: common.Address{}, - }, - ) - Expect(err).Should(BeNil()) - utils.WaitForTransactionSuccess(context.Background(), subnetAInfo, tx.Hash()) // // Register a validator @@ -123,10 +64,12 @@ func NativeTokenStakingManager(network interfaces.LocalNetwork) { var validationID ids.ID // To be used in the delisting step { // Iniatiate validator registration + opts, err := bind.NewKeyedTransactorWithChainID(fundedKey, subnetAInfo.EVMChainID) + Expect(err).Should(BeNil()) opts.Value = big.NewInt(0).SetUint64(1e18) nodeID := ids.GenerateTestID() blsPublicKey := [48]byte{} - tx, err = stakingManager.InitializeValidatorRegistration( + tx, err := stakingManager.InitializeValidatorRegistration( opts, nodeID, uint64(time.Now().Add(24*time.Hour).Unix()), @@ -216,9 +159,9 @@ func NativeTokenStakingManager(network interfaces.LocalNetwork) { // Delist the validator // { - opts, err = bind.NewKeyedTransactorWithChainID(fundedKey, subnetAInfo.EVMChainID) + opts, err := bind.NewKeyedTransactorWithChainID(fundedKey, subnetAInfo.EVMChainID) Expect(err).Should(BeNil()) - tx, err = stakingManager.InitializeEndValidation( + tx, err := stakingManager.InitializeEndValidation( opts, validationID, false, diff --git a/tests/local/network.go b/tests/local/network.go index 7f6e7fb0f..d2d4ce28b 100644 --- a/tests/local/network.go +++ b/tests/local/network.go @@ -51,45 +51,13 @@ type LocalNetwork struct { // Internal vars only used to set up the local network tmpnet *tmpnet.Network - // warpChainConfigPath string } const ( fundedKeyStr = "56289e99c94b6912bfc12adc093c9b51124f0dc54ac7a766b2bc5ccf558d8027" - // warpEnabledChainConfig = `{ - // "warp-api-enabled": true, - // "eth-apis":["eth","eth-filter","net","admin","web3", - // "internal-eth","internal-blockchain","internal-transaction", - // "internal-debug","internal-account","internal-personal", - // "debug","debug-tracer","debug-file-tracer","debug-handler"] - // }` - - timeout = 60 * time.Second + timeout = 60 * time.Second ) -var warpEnabledChainConfig = tmpnet.FlagsMap{ - "log-level": "debug", - "warp-api-enabled": true, - "local-txs-enabled": true, - "eth-apis": []string{ - "eth", - "eth-filter", - "net", - "admin", - "web3", - "internal-eth", - "internal-blockchain", - "internal-transaction", - "internal-debug", - "internal-account", - "internal-personal", - "debug", - "debug-tracer", - "debug-file-tracer", - "debug-handler", - }, -} - type SubnetSpec struct { Name string EVMChainID uint64 @@ -111,12 +79,6 @@ func NewLocalNetwork( // Create extra nodes to be used to add more validators later extraNodes := subnetEvmTestUtils.NewTmpnetNodes(extraNodeCount) - // f, err := os.CreateTemp(os.TempDir(), "config.json") - // Expect(err).Should(BeNil()) - // _, err = f.Write([]byte(warpEnabledChainConfig)) - // Expect(err).Should(BeNil()) - // warpChainConfigPath := f.Name() - var allNodes []*tmpnet.Node allNodes = append(allNodes, extraNodes...) // to be appended w/ subnet validators @@ -134,7 +96,7 @@ func NewLocalNetwork( subnetSpec.TeleporterDeployedBytecode, subnetSpec.TeleporterDeployerAddress, ), - warpEnabledChainConfig, + utils.WarpEnabledChainConfig, nodes..., ) subnets = append(subnets, subnet) @@ -177,7 +139,6 @@ func NewLocalNetwork( extraNodes: extraNodes, globalFundedKey: globalFundedKey, tmpnet: network, - // warpChainConfigPath: warpChainConfigPath, } for _, subnet := range network.Subnets { localNetwork.setSubnetValues(subnet) @@ -509,7 +470,6 @@ func (n *LocalNetwork) TearDownNetwork() { Expect(n).ShouldNot(BeNil()) Expect(n.tmpnet).ShouldNot(BeNil()) Expect(n.tmpnet.Stop(context.Background())).Should(BeNil()) - // Expect(os.Remove(n.warpChainConfigPath)).Should(BeNil()) } func (n *LocalNetwork) AddSubnetValidators(ctx context.Context, subnetID ids.ID, count uint) { diff --git a/tests/utils/chain_utils.go b/tests/utils/chain_utils.go new file mode 100644 index 000000000..36244b4f9 --- /dev/null +++ b/tests/utils/chain_utils.go @@ -0,0 +1,563 @@ +package utils + +import ( + "context" + "crypto/ecdsa" + "encoding/json" + "errors" + "fmt" + "math/big" + "os" + "strconv" + "strings" + "time" + + "github.com/ava-labs/avalanchego/api/info" + "github.com/ava-labs/avalanchego/ids" + "github.com/ava-labs/avalanchego/message" + "github.com/ava-labs/avalanchego/tests/fixture/tmpnet" + "github.com/ava-labs/avalanchego/utils/constants" + "github.com/ava-labs/avalanchego/utils/logging" + "github.com/ava-labs/avalanchego/utils/set" + avalancheWarp "github.com/ava-labs/avalanchego/vms/platformvm/warp" + relayerConfig "github.com/ava-labs/awm-relayer/config" + "github.com/ava-labs/awm-relayer/peers" + "github.com/ava-labs/awm-relayer/signature-aggregator/aggregator" + sigAggConfig "github.com/ava-labs/awm-relayer/signature-aggregator/config" + "github.com/ava-labs/subnet-evm/core/types" + "github.com/ava-labs/subnet-evm/eth/tracers" + "github.com/ava-labs/subnet-evm/ethclient" + subnetEvmInterfaces "github.com/ava-labs/subnet-evm/interfaces" + "github.com/ava-labs/teleporter/tests/interfaces" + gasUtils "github.com/ava-labs/teleporter/utils/gas-utils" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" + . "github.com/onsi/gomega" + "github.com/prometheus/client_golang/prometheus" +) + +const ( + CChainPathSpecifier = "C" +) + +var NativeTransferGas uint64 = 21_000 + +var WarpEnabledChainConfig = tmpnet.FlagsMap{ + "log-level": "debug", + "warp-api-enabled": true, + "local-txs-enabled": true, + "eth-apis": []string{ + "eth", + "eth-filter", + "net", + "admin", + "web3", + "internal-eth", + "internal-blockchain", + "internal-transaction", + "internal-debug", + "internal-account", + "internal-personal", + "debug", + "debug-tracer", + "debug-file-tracer", + "debug-handler", + }, +} + +// +// URL utils +// + +func HttpToWebsocketURI(uri string, blockchainID string) string { + return fmt.Sprintf("ws://%s/ext/bc/%s/ws", strings.TrimPrefix(uri, "http://"), blockchainID) +} + +func HttpToRPCURI(uri string, blockchainID string) string { + return fmt.Sprintf("http://%s/ext/bc/%s/rpc", strings.TrimPrefix(uri, "http://"), blockchainID) +} + +// Get the host and port from a URI. The URI should be in the format http://host:port or https://host:port +func GetURIHostAndPort(uri string) (string, uint32, error) { + // At a minimum uri should have http:// of 7 characters + Expect(len(uri)).Should(BeNumerically(">", 7)) + if uri[:7] == "http://" { + uri = uri[7:] + } else if uri[:8] == "https://" { + uri = uri[8:] + } else { + return "", 0, fmt.Errorf("invalid uri: %s", uri) + } + + // Split the uri into host and port + hostAndPort := strings.Split(uri, ":") + Expect(len(hostAndPort)).Should(Equal(2)) + + // Parse the port + port, err := strconv.ParseUint(hostAndPort[1], 10, 32) + if err != nil { + return "", 0, fmt.Errorf("failed to parse port: %w", err) + } + + return hostAndPort[0], uint32(port), nil +} + +// +// Transaction utils +// + +func CreateNativeTransferTransaction( + ctx context.Context, + subnetInfo interfaces.SubnetTestInfo, + fromKey *ecdsa.PrivateKey, + recipient common.Address, + amount *big.Int, +) *types.Transaction { + fromAddress := crypto.PubkeyToAddress(fromKey.PublicKey) + gasFeeCap, gasTipCap, nonce := CalculateTxParams(ctx, subnetInfo, fromAddress) + + tx := types.NewTx(&types.DynamicFeeTx{ + ChainID: subnetInfo.EVMChainID, + Nonce: nonce, + To: &recipient, + Gas: NativeTransferGas, + GasFeeCap: gasFeeCap, + GasTipCap: gasTipCap, + Value: amount, + }) + + return SignTransaction(tx, fromKey, subnetInfo.EVMChainID) +} + +func SendNativeTransfer( + ctx context.Context, + subnetInfo interfaces.SubnetTestInfo, + fromKey *ecdsa.PrivateKey, + recipient common.Address, + amount *big.Int, +) *types.Receipt { + tx := CreateNativeTransferTransaction(ctx, subnetInfo, fromKey, recipient, amount) + return SendTransactionAndWaitForSuccess(ctx, subnetInfo, tx) +} + +// Sends a tx, and waits for it to be mined. +// Asserts Receipt.status equals success. +func sendAndWaitForTransaction( + ctx context.Context, + subnetInfo interfaces.SubnetTestInfo, + tx *types.Transaction, + success bool, +) *types.Receipt { + err := subnetInfo.RPCClient.SendTransaction(ctx, tx) + Expect(err).Should(BeNil()) + + return waitForTransaction(ctx, subnetInfo, tx.Hash(), success) +} + +// Sends a tx, and waits for it to be mined. +// Asserts Receipt.status equals false. +func SendTransactionAndWaitForFailure( + ctx context.Context, + subnetInfo interfaces.SubnetTestInfo, + tx *types.Transaction, +) *types.Receipt { + return sendAndWaitForTransaction(ctx, subnetInfo, tx, false) +} + +// Sends a tx, and waits for it to be mined. +// Asserts Receipt.status equals true. +func SendTransactionAndWaitForSuccess( + ctx context.Context, + subnetInfo interfaces.SubnetTestInfo, + tx *types.Transaction, +) *types.Receipt { + return sendAndWaitForTransaction(ctx, subnetInfo, tx, true) +} + +// Waits for a transaction to be mined. +// Asserts Receipt.status equals true. +func WaitForTransactionSuccess( + ctx context.Context, + subnetInfo interfaces.SubnetTestInfo, + txHash common.Hash, +) *types.Receipt { + return waitForTransaction(ctx, subnetInfo, txHash, true) +} + +// Waits for a transaction to be mined. +// Asserts Receipt.status equals false. +func WaitForTransactionFailure( + ctx context.Context, + subnetInfo interfaces.SubnetTestInfo, + txHash common.Hash, +) *types.Receipt { + return waitForTransaction(ctx, subnetInfo, txHash, false) +} + +// Waits for a transaction to be mined. +// Asserts Receipt.status equals success. +func waitForTransaction( + ctx context.Context, + subnetInfo interfaces.SubnetTestInfo, + txHash common.Hash, + success bool, +) *types.Receipt { + cctx, cancel := context.WithTimeout(ctx, 10*time.Second) + defer cancel() + + receipt, err := WaitMined(cctx, subnetInfo.RPCClient, txHash) + Expect(err).Should(BeNil()) + + if success { + if receipt.Status == types.ReceiptStatusFailed { + TraceTransactionAndExit(ctx, subnetInfo.RPCClient, receipt.TxHash) + } + } else { + Expect(receipt.Status).Should(Equal(types.ReceiptStatusFailed)) + } + return receipt +} + +// Polls for a transaction receipt of the given txHash on each queryTicker tick until +// either a transaction receipt returned, or the context is cancelled or expired. +func waitForTransactionReceipt( + cctx context.Context, + rpcClient ethclient.Client, + txHash common.Hash, +) (*types.Receipt, error) { + queryTicker := time.NewTicker(200 * time.Millisecond) + defer queryTicker.Stop() + for { + receipt, err := rpcClient.TransactionReceipt(cctx, txHash) + if err == nil { + return receipt, nil + } + + if errors.Is(err, subnetEvmInterfaces.NotFound) { + log.Debug("Transaction not yet mined") + } else { + log.Error("Receipt retrieval failed", "err", err) + return nil, err + } + + // Wait for the next round. + select { + case <-cctx.Done(): + return nil, cctx.Err() + case <-queryTicker.C: + } + } +} + +// Signs a transaction using the provided key for the specified chainID +func SignTransaction(tx *types.Transaction, key *ecdsa.PrivateKey, chainID *big.Int) *types.Transaction { + txSigner := types.LatestSignerForChainID(chainID) + signedTx, err := types.SignTx(tx, txSigner, key) + Expect(err).Should(BeNil()) + + return signedTx +} + +// Returns the gasFeeCap, gasTipCap, and nonce the be used when constructing a transaction from fundedAddress +func CalculateTxParams( + ctx context.Context, + subnetInfo interfaces.SubnetTestInfo, + fundedAddress common.Address, +) (*big.Int, *big.Int, uint64) { + baseFee, err := subnetInfo.RPCClient.EstimateBaseFee(ctx) + Expect(err).Should(BeNil()) + + gasTipCap, err := subnetInfo.RPCClient.SuggestGasTipCap(ctx) + Expect(err).Should(BeNil()) + + nonce, err := subnetInfo.RPCClient.NonceAt(ctx, fundedAddress, nil) + Expect(err).Should(BeNil()) + + gasFeeCap := baseFee.Mul(baseFee, big.NewInt(gasUtils.BaseFeeFactor)) + gasFeeCap.Add(gasFeeCap, big.NewInt(gasUtils.MaxPriorityFeePerGas)) + + return gasFeeCap, gasTipCap, nonce +} + +// Gomega will print the transaction trace and exit +func TraceTransactionAndExit(ctx context.Context, rpcClient ethclient.Client, txHash common.Hash) { + Expect(TraceTransaction(ctx, rpcClient, txHash)).Should(Equal("")) +} + +func TraceTransaction(ctx context.Context, rpcClient ethclient.Client, txHash common.Hash) string { + var result interface{} + ct := "callTracer" + err := rpcClient.Client().Call(&result, "debug_traceTransaction", txHash.String(), tracers.TraceConfig{Tracer: &ct}) + Expect(err).Should(BeNil()) + + jsonStr, err := json.Marshal(result) + Expect(err).Should(BeNil()) + + return string(jsonStr) +} + +// +// Block utils +// + +// WaitMined waits for tx to be mined on the blockchain. +// It stops waiting when the context is canceled. +// Takes a tx hash instead of the full tx in the subnet-evm version of this function. +// Copied and modified from https://github.com/ava-labs/subnet-evm/blob/v0.6.0-fuji/accounts/abi/bind/util.go#L42 +func WaitMined(ctx context.Context, rpcClient ethclient.Client, txHash common.Hash) (*types.Receipt, error) { + cctx, cancel := context.WithTimeout(ctx, 20*time.Second) + defer cancel() + + receipt, err := waitForTransactionReceipt(cctx, rpcClient, txHash) + if err != nil { + return nil, err + } + + // Check that the block height endpoint returns a block height as high as the block number that the transaction was + // included in. This is to workaround the issue where multiple nodes behind a public RPC endpoint see + // transactions/blocks at different points in time. Ideally, all nodes in the network should have seen this block + // and transaction before returning from WaitMined. The block height endpoint of public RPC endpoints is + // configured to return the lowest value currently returned by any node behind the load balancer, so waiting for + // it to be at least as high as the block height specified in the receipt should provide a relatively strong + // indication that the transaction has been seen widely throughout the network. + err = waitForBlockHeight(cctx, rpcClient, receipt.BlockNumber.Uint64()) + if err != nil { + return nil, err + } + + return receipt, nil +} + +// Polls for the eth_blockNumber endpoint for the latest blockheight on each queryTicker tick until +// either the returned height is greater than or equal to the expectedBlockNumber, or the context +// is cancelled or expired. +func waitForBlockHeight( + cctx context.Context, + rpcClient ethclient.Client, + expectedBlockNumber uint64, +) error { + queryTicker := time.NewTicker(2 * time.Second) + defer queryTicker.Stop() + for { + currentBlockNumber, err := rpcClient.BlockNumber(cctx) + if err != nil { + return err + } + + if currentBlockNumber >= expectedBlockNumber { + return nil + } else { + log.Info("Waiting for block height where transaction was included", + "blockNumber", expectedBlockNumber) + } + + // Wait for the next round. + select { + case <-cctx.Done(): + return cctx.Err() + case <-queryTicker.C: + } + } +} + +// +// Log utils +// + +// Returns the first log in 'logs' that is successfully parsed by 'parser' +// Errors and prints a trace of the transaction if no log is found. +func GetEventFromLogsOrTrace[T any]( + ctx context.Context, + receipt *types.Receipt, + subnetInfo interfaces.SubnetTestInfo, + parser func(log types.Log) (T, error), +) T { + log, err := GetEventFromLogs(receipt.Logs, parser) + if err != nil { + TraceTransactionAndExit(ctx, subnetInfo.RPCClient, receipt.TxHash) + } + return log +} + +// Returns the first log in 'logs' that is successfully parsed by 'parser' +func GetEventFromLogs[T any](logs []*types.Log, parser func(log types.Log) (T, error)) (T, error) { + for _, log := range logs { + event, err := parser(*log) + if err == nil { + return event, nil + } + } + return *new(T), fmt.Errorf("failed to find %T event in receipt logs", *new(T)) +} + +// +// Account utils +// + +func PrivateKeyToAddress(k *ecdsa.PrivateKey) common.Address { + return crypto.PubkeyToAddress(k.PublicKey) +} + +// Throws a Gomega error if there is a mismatch +func CheckBalance(ctx context.Context, addr common.Address, expectedBalance *big.Int, rpcClient ethclient.Client) { + bal, err := rpcClient.BalanceAt(ctx, addr, nil) + Expect(err).Should(BeNil()) + ExpectBigEqual(bal, expectedBalance) +} + +// +// Big int utils +// + +func ExpectBigEqual(v1 *big.Int, v2 *big.Int) { + // Compare strings, so gomega will print the numbers if they differ + Expect(v1.String()).Should(Equal(v2.String())) +} + +func BigIntSub(v1 *big.Int, v2 *big.Int) *big.Int { + return big.NewInt(0).Sub(v1, v2) +} + +func BigIntMul(v1 *big.Int, v2 *big.Int) *big.Int { + return big.NewInt(0).Mul(v1, v2) +} + +// +// Network utils +// + +func GetPChainInfo(cChainInfo interfaces.SubnetTestInfo) interfaces.SubnetTestInfo { + pChainBlockchainID, err := info.NewClient(cChainInfo.NodeURIs[0]).GetBlockchainID(context.Background(), "P") + Expect(err).Should(BeNil()) + return interfaces.SubnetTestInfo{ + BlockchainID: pChainBlockchainID, + SubnetID: ids.Empty, + } +} + +func GetTwoSubnets(network interfaces.Network) ( + interfaces.SubnetTestInfo, + interfaces.SubnetTestInfo, +) { + subnets := network.GetSubnetsInfo() + Expect(len(subnets)).Should(BeNumerically(">=", 2)) + return subnets[0], subnets[1] +} + +type ChainConfigMap map[string]string + +// Sets the chain config in customChainConfigs for the specified subnet +func (m ChainConfigMap) Add(subnet interfaces.SubnetTestInfo, chainConfig string) { + if subnet.SubnetID == constants.PrimaryNetworkID { + m[CChainPathSpecifier] = chainConfig + } else { + m[subnet.BlockchainID.String()] = chainConfig + } +} + +func GetChainConfigWithOffChainMessages(offChainMessages []avalancheWarp.UnsignedMessage) string { + // Convert messages to hex + hexOffChainMessages := []string{} + for _, message := range offChainMessages { + hexOffChainMessages = append(hexOffChainMessages, hexutil.Encode(message.Bytes())) + } + + chainConfig := WarpEnabledChainConfig + chainConfig["warp-off-chain-messages"] = hexOffChainMessages + + // Marshal the map to JSON + offChainMessageJson, err := tmpnet.DefaultJSONMarshal(chainConfig) + Expect(err).Should(BeNil()) + + return string(offChainMessageJson) +} + +// read in the template file, make the substitutions declared at the beginning +// of the function, write out the instantiation to a temp file, and then return +// the path to that temp file. +func InstantiateGenesisTemplate( + templateFileName string, + chainID uint64, + teleporterContractAddress common.Address, + teleporterDeployedBytecode string, + teleporterDeployerAddress common.Address, +) string { + substitutions := []struct { + Target string + Value string + }{ + { + "", + strconv.FormatUint(chainID, 10), + }, + { + "", + teleporterContractAddress.Hex(), + }, + { + "", + teleporterDeployedBytecode, + }, + { + "", + teleporterDeployerAddress.Hex(), + }, + } + + templateFileBytes, err := os.ReadFile(templateFileName) + Expect(err).Should(BeNil()) + + subnetGenesisFile, err := os.CreateTemp(os.TempDir(), "") + Expect(err).Should(BeNil()) + + defer subnetGenesisFile.Close() + + var replaced string = string(templateFileBytes[:]) + for _, s := range substitutions { + replaced = strings.ReplaceAll(replaced, s.Target, s.Value) + } + + subnetGenesisFile.WriteString(replaced) + + return subnetGenesisFile.Name() +} + +// +// Aggregator utils +// + +func NewSignatureAggregator(apiUri string, subnets []ids.ID) *aggregator.SignatureAggregator { + logger := logging.NoLog{} + cfg := sigAggConfig.Config{ + PChainAPI: &relayerConfig.APIConfig{ + BaseURL: apiUri, + }, + InfoAPI: &relayerConfig.APIConfig{ + BaseURL: apiUri, + }, + } + trackedSubnets := set.NewSet[ids.ID](len(subnets)) + trackedSubnets.Add(subnets...) + appRequestNetwork, err := peers.NewNetwork( + logging.Debug, + prometheus.DefaultRegisterer, + trackedSubnets, + &cfg, + ) + Expect(err).Should(BeNil()) + + messageCreator, err := message.NewCreator( + logger, + prometheus.DefaultRegisterer, + constants.DefaultNetworkCompressionType, + constants.DefaultNetworkMaximumInboundTimeout, + ) + Expect(err).Should(BeNil()) + return aggregator.NewSignatureAggregator( + appRequestNetwork, + logger, + messageCreator, + ) +} diff --git a/tests/utils/erc20_utils.go b/tests/utils/erc20_utils.go new file mode 100644 index 000000000..b235dbf6d --- /dev/null +++ b/tests/utils/erc20_utils.go @@ -0,0 +1,61 @@ +package utils + +import ( + "context" + "crypto/ecdsa" + "math/big" + + "github.com/ava-labs/subnet-evm/accounts/abi/bind" + exampleerc20 "github.com/ava-labs/teleporter/abi-bindings/go/mocks/ExampleERC20" + "github.com/ava-labs/teleporter/tests/interfaces" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" + . "github.com/onsi/gomega" +) + +var ( + ExpectedExampleERC20DeployerBalance = new(big.Int).Mul(big.NewInt(1e18), big.NewInt(1e10)) +) + +func DeployExampleERC20( + ctx context.Context, + senderKey *ecdsa.PrivateKey, + source interfaces.SubnetTestInfo, +) (common.Address, *exampleerc20.ExampleERC20) { + opts, err := bind.NewKeyedTransactorWithChainID(senderKey, source.EVMChainID) + Expect(err).Should(BeNil()) + + // Deploy Mock ERC20 contract + address, tx, token, err := exampleerc20.DeployExampleERC20(opts, source.RPCClient) + Expect(err).Should(BeNil()) + log.Info("Deployed Mock ERC20 contract", "address", address.Hex(), "txHash", tx.Hash().Hex()) + + // Wait for the transaction to be mined + WaitForTransactionSuccess(ctx, source, tx.Hash()) + + // Check that the deployer has the expected initial balance + senderAddress := crypto.PubkeyToAddress(senderKey.PublicKey) + balance, err := token.BalanceOf(&bind.CallOpts{}, senderAddress) + Expect(err).Should(BeNil()) + Expect(balance).Should(Equal(ExpectedExampleERC20DeployerBalance)) + + return address, token +} + +func ERC20Approve( + ctx context.Context, + token *exampleerc20.ExampleERC20, + spender common.Address, + amount *big.Int, + source interfaces.SubnetTestInfo, + senderKey *ecdsa.PrivateKey, +) { + opts, err := bind.NewKeyedTransactorWithChainID(senderKey, source.EVMChainID) + Expect(err).Should(BeNil()) + tx, err := token.Approve(opts, spender, amount) + Expect(err).Should(BeNil()) + log.Info("Approved ERC20", "spender", spender.Hex(), "txHash", tx.Hash().Hex()) + + WaitForTransactionSuccess(ctx, source, tx.Hash()) +} diff --git a/tests/utils/governance_utils.go b/tests/utils/governance_utils.go new file mode 100644 index 000000000..177d3f017 --- /dev/null +++ b/tests/utils/governance_utils.go @@ -0,0 +1,108 @@ +package utils + +import ( + "context" + "crypto/ecdsa" + + avalancheWarp "github.com/ava-labs/avalanchego/vms/platformvm/warp" + "github.com/ava-labs/avalanchego/vms/platformvm/warp/payload" + "github.com/ava-labs/subnet-evm/accounts/abi/bind" + "github.com/ava-labs/subnet-evm/core/types" + validatorsetsig "github.com/ava-labs/teleporter/abi-bindings/go/governance/ValidatorSetSig" + "github.com/ava-labs/teleporter/tests/interfaces" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/log" + . "github.com/onsi/gomega" +) + +func DeployValidatorSetSig( + ctx context.Context, + senderKey *ecdsa.PrivateKey, + contractSubnet interfaces.SubnetTestInfo, + validatorSubnet interfaces.SubnetTestInfo, +) (common.Address, *validatorsetsig.ValidatorSetSig) { + opts, err := bind.NewKeyedTransactorWithChainID(senderKey, contractSubnet.EVMChainID) + Expect(err).Should(BeNil()) + address, tx, validatorSetSig, err := validatorsetsig.DeployValidatorSetSig( + opts, + contractSubnet.RPCClient, + validatorSubnet.BlockchainID, + ) + Expect(err).Should(BeNil()) + + // Wait for the transaction to be mined + WaitForTransactionSuccess(ctx, contractSubnet, tx.Hash()) + + return address, validatorSetSig +} + +// Returns Receipt for the transaction unlike TeleporterRegistry version since this is a non-teleporter case +// and we don't want to add the ValidatorSetSig ABI to the subnetInfo +func ExecuteValidatorSetSigCallAndVerify( + ctx context.Context, + network interfaces.Network, + source interfaces.SubnetTestInfo, + destination interfaces.SubnetTestInfo, + validatorSetSigAddress common.Address, + senderKey *ecdsa.PrivateKey, + unsignedMessage *avalancheWarp.UnsignedMessage, + expectSuccess bool, +) *types.Receipt { + signedWarpMsg := network.GetSignedMessage(ctx, source, destination, unsignedMessage.ID()) + log.Info("Got signed warp message", "messageID", signedWarpMsg.ID()) + + signedPredicateTx := CreateExecuteCallPredicateTransaction( + ctx, + signedWarpMsg, + validatorSetSigAddress, + senderKey, + destination, + ) + + // Wait for tx to be accepted and verify events emitted + if expectSuccess { + return SendTransactionAndWaitForSuccess(ctx, destination, signedPredicateTx) + } + return SendTransactionAndWaitForFailure(ctx, destination, signedPredicateTx) +} + +func InitOffChainMessageChainConfigValidatorSetSig( + networkID uint32, + subnet interfaces.SubnetTestInfo, + validatorSetSigAddress common.Address, + validatorSetSigMessages []validatorsetsig.ValidatorSetSigMessage, +) ([]avalancheWarp.UnsignedMessage, string) { + unsignedMessages := []avalancheWarp.UnsignedMessage{} + for _, message := range validatorSetSigMessages { + unsignedMessage := CreateOffChainValidatorSetSigMessage(networkID, subnet, message) + unsignedMessages = append(unsignedMessages, *unsignedMessage) + log.Info("Adding validatorSetSig off-chain message to Warp chain config", + "messageID", unsignedMessage.ID(), + "blockchainID", subnet.BlockchainID.String()) + } + return unsignedMessages, GetChainConfigWithOffChainMessages(unsignedMessages) +} + +// Creates an off-chain Warp message pointing to a function, contract and payload to be executed +// if the validator set signs this message +func CreateOffChainValidatorSetSigMessage( + networkID uint32, + subnet interfaces.SubnetTestInfo, + message validatorsetsig.ValidatorSetSigMessage, +) *avalancheWarp.UnsignedMessage { + sourceAddress := []byte{} + payloadBytes, err := message.Pack() + Expect(err).Should(BeNil()) + + addressedPayload, err := payload.NewAddressedCall(sourceAddress, payloadBytes) + Expect(err).Should(BeNil()) + + unsignedMessage, err := avalancheWarp.NewUnsignedMessage( + networkID, + subnet.BlockchainID, + addressedPayload.Bytes(), + ) + Expect(err).Should(BeNil()) + + return unsignedMessage +} diff --git a/tests/utils/staking_utils.go b/tests/utils/staking_utils.go new file mode 100644 index 000000000..443952210 --- /dev/null +++ b/tests/utils/staking_utils.go @@ -0,0 +1,65 @@ +package utils + +import ( + "context" + "crypto/ecdsa" + "math/big" + "time" + + "github.com/ava-labs/subnet-evm/accounts/abi/bind" + nativetokenstakingmanager "github.com/ava-labs/teleporter/abi-bindings/go/staking/NativeTokenStakingManager" + "github.com/ava-labs/teleporter/tests/interfaces" + "github.com/ethereum/go-ethereum/common" + . "github.com/onsi/gomega" +) + +func DeployNativeTokenStakingManager( + ctx context.Context, + senderKey *ecdsa.PrivateKey, + subnet interfaces.SubnetTestInfo, +) (common.Address, *nativetokenstakingmanager.NativeTokenStakingManager) { + opts, err := bind.NewKeyedTransactorWithChainID(senderKey, subnet.EVMChainID) + Expect(err).Should(BeNil()) + address, tx, stakingManager, err := nativetokenstakingmanager.DeployNativeTokenStakingManager( + opts, + subnet.RPCClient, + 0, // ICMInitializable.Allowed + ) + Expect(err).Should(BeNil()) + + // Wait for the transaction to be mined + WaitForTransactionSuccess(ctx, subnet, tx.Hash()) + + return address, stakingManager +} + +func DeployAndInitializeNativeTokenStakingManager( + ctx context.Context, + senderKey *ecdsa.PrivateKey, + subnet interfaces.SubnetTestInfo, + pChainInfo interfaces.SubnetTestInfo, +) (common.Address, *nativetokenstakingmanager.NativeTokenStakingManager) { + stakingManagerContractAddress, stakingManager := DeployNativeTokenStakingManager( + ctx, + senderKey, + subnet, + ) + opts, err := bind.NewKeyedTransactorWithChainID(senderKey, subnet.EVMChainID) + Expect(err).Should(BeNil()) + tx, err := stakingManager.Initialize( + opts, + nativetokenstakingmanager.StakingManagerSettings{ + PChainBlockchainID: pChainInfo.BlockchainID, + SubnetID: subnet.SubnetID, + MinimumStakeAmount: big.NewInt(0).SetUint64(1e6), + MaximumStakeAmount: big.NewInt(0).SetUint64(10e6), + MinimumStakeDuration: uint64(24 * time.Hour), + MaximumHourlyChurn: 0, + RewardCalculator: common.Address{}, + }, + ) + Expect(err).Should(BeNil()) + WaitForTransactionSuccess(context.Background(), subnet, tx.Hash()) + + return stakingManagerContractAddress, stakingManager +} diff --git a/tests/utils/utils.go b/tests/utils/teleporter_utils.go similarity index 51% rename from tests/utils/utils.go rename to tests/utils/teleporter_utils.go index 73948666f..e8d9e9161 100644 --- a/tests/utils/utils.go +++ b/tests/utils/teleporter_utils.go @@ -1,62 +1,112 @@ -// Copyright (C) 2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - package utils import ( "bytes" "context" "crypto/ecdsa" - "encoding/json" - "errors" - "fmt" "math/big" - "os" - "strconv" - "strings" - "time" - - validatorsetsig "github.com/ava-labs/teleporter/abi-bindings/go/governance/ValidatorSetSig" - exampleerc20 "github.com/ava-labs/teleporter/abi-bindings/go/mocks/ExampleERC20" - nativetokenstakingmanager "github.com/ava-labs/teleporter/abi-bindings/go/staking/NativeTokenStakingManager" - teleportermessenger "github.com/ava-labs/teleporter/abi-bindings/go/teleporter/TeleporterMessenger" - teleporterregistry "github.com/ava-labs/teleporter/abi-bindings/go/teleporter/registry/TeleporterRegistry" - testmessenger "github.com/ava-labs/teleporter/abi-bindings/go/teleporter/tests/TestMessenger" - deploymentUtils "github.com/ava-labs/teleporter/utils/deployment-utils" - gasUtils "github.com/ava-labs/teleporter/utils/gas-utils" "github.com/ava-labs/avalanchego/ids" - "github.com/ava-labs/avalanchego/utils/constants" avalancheWarp "github.com/ava-labs/avalanchego/vms/platformvm/warp" "github.com/ava-labs/avalanchego/vms/platformvm/warp/payload" "github.com/ava-labs/subnet-evm/accounts/abi/bind" "github.com/ava-labs/subnet-evm/core/types" - "github.com/ava-labs/subnet-evm/eth/tracers" - "github.com/ava-labs/subnet-evm/ethclient" - subnetEvmInterfaces "github.com/ava-labs/subnet-evm/interfaces" "github.com/ava-labs/subnet-evm/precompile/contracts/warp" predicateutils "github.com/ava-labs/subnet-evm/predicate" + validatorsetsig "github.com/ava-labs/teleporter/abi-bindings/go/governance/ValidatorSetSig" + exampleerc20 "github.com/ava-labs/teleporter/abi-bindings/go/mocks/ExampleERC20" + teleportermessenger "github.com/ava-labs/teleporter/abi-bindings/go/teleporter/TeleporterMessenger" + teleporterregistry "github.com/ava-labs/teleporter/abi-bindings/go/teleporter/registry/TeleporterRegistry" + testmessenger "github.com/ava-labs/teleporter/abi-bindings/go/teleporter/tests/TestMessenger" "github.com/ava-labs/teleporter/tests/interfaces" + deploymentUtils "github.com/ava-labs/teleporter/utils/deployment-utils" + gasUtils "github.com/ava-labs/teleporter/utils/gas-utils" "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/log" . "github.com/onsi/gomega" ) var ( - NativeTransferGas uint64 = 21_000 - DefaultTeleporterTransactionGas uint64 = 300_000 - DefaultTeleporterTransactionValue = common.Big0 - ExpectedExampleERC20DeployerBalance = new(big.Int).Mul(big.NewInt(1e18), big.NewInt(1e10)) + DefaultTeleporterTransactionGas uint64 = 300_000 + DefaultTeleporterTransactionValue = common.Big0 ) -const ( - CChainPathSpecifier = "C" -) +// +// Deployment utils +// + +// Deploys a new version of Teleporter and returns its address +// Does NOT modify the global Teleporter contract address to provide greater testing flexibility. +func DeployNewTeleporterVersion( + ctx context.Context, + network interfaces.LocalNetwork, + fundedKey *ecdsa.PrivateKey, + teleporterByteCodeFile string, +) common.Address { + contractCreationGasPrice := (&big.Int{}).Add(deploymentUtils.GetDefaultContractCreationGasPrice(), big.NewInt(1)) + teleporterDeployerTransaction, + _, + teleporterDeployerAddress, + teleporterContractAddress, + err := deploymentUtils.ConstructKeylessTransaction( + teleporterByteCodeFile, + false, + contractCreationGasPrice, + ) + Expect(err).Should(BeNil()) + + network.DeployTeleporterContractToAllChains( + teleporterDeployerTransaction, + teleporterDeployerAddress, + teleporterContractAddress, + fundedKey, + ) + return teleporterContractAddress +} + +func DeployTestMessenger( + ctx context.Context, + senderKey *ecdsa.PrivateKey, + teleporterManager common.Address, + subnet interfaces.SubnetTestInfo, +) (common.Address, *testmessenger.TestMessenger) { + opts, err := bind.NewKeyedTransactorWithChainID( + senderKey, + subnet.EVMChainID, + ) + Expect(err).Should(BeNil()) + address, tx, exampleMessenger, err := testmessenger.DeployTestMessenger( + opts, + subnet.RPCClient, + subnet.TeleporterRegistryAddress, + teleporterManager, + ) + Expect(err).Should(BeNil()) + + // Wait for the transaction to be mined + WaitForTransactionSuccess(ctx, subnet, tx.Hash()) + + return address, exampleMessenger +} + +// +// Parsing utils +// + +func ParseTeleporterMessage(unsignedMessage avalancheWarp.UnsignedMessage) *teleportermessenger.TeleporterMessage { + addressedPayload, err := payload.ParseAddressedCall(unsignedMessage.Payload) + Expect(err).Should(BeNil()) + + teleporterMessage := teleportermessenger.TeleporterMessage{} + err = teleporterMessage.Unpack(addressedPayload.Payload) + Expect(err).Should(BeNil()) + + return &teleporterMessage +} // -// Test utility functions +// Function call utils // func SendAddFeeAmountAndWaitForAcceptance( @@ -191,183 +241,6 @@ func SendSpecifiedReceiptsAndWaitForAcceptance( return receipt, event.MessageID } -func HttpToWebsocketURI(uri string, blockchainID string) string { - return fmt.Sprintf("ws://%s/ext/bc/%s/ws", strings.TrimPrefix(uri, "http://"), blockchainID) -} - -func HttpToRPCURI(uri string, blockchainID string) string { - return fmt.Sprintf("http://%s/ext/bc/%s/rpc", strings.TrimPrefix(uri, "http://"), blockchainID) -} - -// Get the host and port from a URI. The URI should be in the format http://host:port or https://host:port -func GetURIHostAndPort(uri string) (string, uint32, error) { - // At a minimum uri should have http:// of 7 characters - Expect(len(uri)).Should(BeNumerically(">", 7)) - if uri[:7] == "http://" { - uri = uri[7:] - } else if uri[:8] == "https://" { - uri = uri[8:] - } else { - return "", 0, fmt.Errorf("invalid uri: %s", uri) - } - - // Split the uri into host and port - hostAndPort := strings.Split(uri, ":") - Expect(len(hostAndPort)).Should(Equal(2)) - - // Parse the port - port, err := strconv.ParseUint(hostAndPort[1], 10, 32) - if err != nil { - return "", 0, fmt.Errorf("failed to parse port: %w", err) - } - - return hostAndPort[0], uint32(port), nil -} - -// -// Transaction creation functions -// - -// Constructs a transaction to call sendCrossChainMessage -// Returns the signed transaction. -func CreateSendCrossChainMessageTransaction( - ctx context.Context, - source interfaces.SubnetTestInfo, - input teleportermessenger.TeleporterMessageInput, - senderKey *ecdsa.PrivateKey, - teleporterContractAddress common.Address, -) *types.Transaction { - data, err := teleportermessenger.PackSendCrossChainMessage(input) - Expect(err).Should(BeNil()) - - gasFeeCap, gasTipCap, nonce := CalculateTxParams(ctx, source, PrivateKeyToAddress(senderKey)) - - // Send a transaction to the Teleporter contract - tx := types.NewTx(&types.DynamicFeeTx{ - ChainID: source.EVMChainID, - Nonce: nonce, - To: &teleporterContractAddress, - Gas: DefaultTeleporterTransactionGas, - GasFeeCap: gasFeeCap, - GasTipCap: gasTipCap, - Value: DefaultTeleporterTransactionValue, - Data: data, - }) - - return SignTransaction(tx, senderKey, source.EVMChainID) -} - -// Constructs a transaction to call receiveCrossChainMessage -// Returns the signed transaction. -func CreateReceiveCrossChainMessageTransaction( - ctx context.Context, - signedMessage *avalancheWarp.Message, - requiredGasLimit *big.Int, - teleporterContractAddress common.Address, - senderKey *ecdsa.PrivateKey, - subnetInfo interfaces.SubnetTestInfo, -) *types.Transaction { - // Construct the transaction to send the Warp message to the destination chain - log.Info("Constructing receiveCrossChainMessage transaction for the destination chain") - numSigners, err := signedMessage.Signature.NumSigners() - Expect(err).Should(BeNil()) - - teleporterMessage := ParseTeleporterMessage(signedMessage.UnsignedMessage) - gasLimit, err := gasUtils.CalculateReceiveMessageGasLimit( - numSigners, - requiredGasLimit, - len(signedMessage.Bytes()), - len(signedMessage.Payload), - len(teleporterMessage.Receipts), - ) - Expect(err).Should(BeNil()) - - callData, err := teleportermessenger.PackReceiveCrossChainMessage(0, PrivateKeyToAddress(senderKey)) - Expect(err).Should(BeNil()) - - gasFeeCap, gasTipCap, nonce := CalculateTxParams(ctx, subnetInfo, PrivateKeyToAddress(senderKey)) - - destinationTx := predicateutils.NewPredicateTx( - subnetInfo.EVMChainID, - nonce, - &teleporterContractAddress, - gasLimit, - gasFeeCap, - gasTipCap, - big.NewInt(0), - callData, - types.AccessList{}, - warp.ContractAddress, - signedMessage.Bytes(), - ) - - return SignTransaction(destinationTx, senderKey, subnetInfo.EVMChainID) -} - -// Constructs a transaction to call addProtocolVersion -// Returns the signed transaction. -func CreateAddProtocolVersionTransaction( - ctx context.Context, - signedMessage *avalancheWarp.Message, - teleporterRegistryAddress common.Address, - senderKey *ecdsa.PrivateKey, - subnetInfo interfaces.SubnetTestInfo, -) *types.Transaction { - // Construct the transaction to send the Warp message to the destination chain - log.Info("Constructing addProtocolVersion transaction for the destination chain") - - callData, err := teleporterregistry.PackAddProtocolVersion(0) - Expect(err).Should(BeNil()) - - gasFeeCap, gasTipCap, nonce := CalculateTxParams(ctx, subnetInfo, PrivateKeyToAddress(senderKey)) - - destinationTx := predicateutils.NewPredicateTx( - subnetInfo.EVMChainID, - nonce, - &teleporterRegistryAddress, - 500_000, - gasFeeCap, - gasTipCap, - big.NewInt(0), - callData, - types.AccessList{}, - warp.ContractAddress, - signedMessage.Bytes(), - ) - - return SignTransaction(destinationTx, senderKey, subnetInfo.EVMChainID) -} - -func CreateExecuteCallPredicateTransaction( - ctx context.Context, - signedMessage *avalancheWarp.Message, - validatorSetSigAddress common.Address, - senderKey *ecdsa.PrivateKey, - subnetInfo interfaces.SubnetTestInfo, -) *types.Transaction { - log.Info("Constructing executeCall transaction for the destination chain") - - callData, err := validatorsetsig.PackExecuteCall(0) - Expect(err).Should(BeNil()) - - gasFeeCap, gasTipCap, nonce := CalculateTxParams(ctx, subnetInfo, PrivateKeyToAddress(senderKey)) - - destinationTx := predicateutils.NewPredicateTx( - subnetInfo.EVMChainID, - nonce, - &validatorSetSigAddress, - 500_000, - gasFeeCap, - gasTipCap, - big.NewInt(0), - callData, - types.AccessList{}, - warp.ContractAddress, - signedMessage.Bytes(), - ) - return SignTransaction(destinationTx, senderKey, subnetInfo.EVMChainID) -} - func AddProtocolVersionAndWaitForAcceptance( ctx context.Context, network interfaces.Network, @@ -405,113 +278,15 @@ func AddProtocolVersionAndWaitForAcceptance( Expect(versionUpdatedEvent.NewVersion.Cmp(expectedLatestVersion)).Should(Equal(0)) } -// Returns Receipt for the transaction unlike TeleporterRegistry version since this is a non-teleporter case -// and we don't want to add the ValidatorSetSig ABI to the subnetInfo -func ExecuteValidatorSetSigCallAndVerify( +func SendCrossChainMessageAndWaitForAcceptance( ctx context.Context, - network interfaces.Network, source interfaces.SubnetTestInfo, destination interfaces.SubnetTestInfo, - validatorSetSigAddress common.Address, + input teleportermessenger.TeleporterMessageInput, senderKey *ecdsa.PrivateKey, - unsignedMessage *avalancheWarp.UnsignedMessage, - expectSuccess bool, -) *types.Receipt { - signedWarpMsg := network.GetSignedMessage(ctx, source, destination, unsignedMessage.ID()) - log.Info("Got signed warp message", "messageID", signedWarpMsg.ID()) - - signedPredicateTx := CreateExecuteCallPredicateTransaction( - ctx, - signedWarpMsg, - validatorSetSigAddress, - senderKey, - destination, - ) - - // Wait for tx to be accepted and verify events emitted - if expectSuccess { - return SendTransactionAndWaitForSuccess(ctx, destination, signedPredicateTx) - } - return SendTransactionAndWaitForFailure(ctx, destination, signedPredicateTx) -} - -func CreateNativeTransferTransaction( - ctx context.Context, - subnetInfo interfaces.SubnetTestInfo, - fromKey *ecdsa.PrivateKey, - recipient common.Address, - amount *big.Int, -) *types.Transaction { - fromAddress := crypto.PubkeyToAddress(fromKey.PublicKey) - gasFeeCap, gasTipCap, nonce := CalculateTxParams(ctx, subnetInfo, fromAddress) - - tx := types.NewTx(&types.DynamicFeeTx{ - ChainID: subnetInfo.EVMChainID, - Nonce: nonce, - To: &recipient, - Gas: NativeTransferGas, - GasFeeCap: gasFeeCap, - GasTipCap: gasTipCap, - Value: amount, - }) - - return SignTransaction(tx, fromKey, subnetInfo.EVMChainID) -} - -func SendNativeTransfer( - ctx context.Context, - subnetInfo interfaces.SubnetTestInfo, - fromKey *ecdsa.PrivateKey, - recipient common.Address, - amount *big.Int, -) *types.Receipt { - tx := CreateNativeTransferTransaction(ctx, subnetInfo, fromKey, recipient, amount) - return SendTransactionAndWaitForSuccess(ctx, subnetInfo, tx) -} - -// Sends a tx, and waits for it to be mined. -// Asserts Receipt.status equals success. -func sendAndWaitForTransaction( - ctx context.Context, - subnetInfo interfaces.SubnetTestInfo, - tx *types.Transaction, - success bool, -) *types.Receipt { - err := subnetInfo.RPCClient.SendTransaction(ctx, tx) - Expect(err).Should(BeNil()) - - return waitForTransaction(ctx, subnetInfo, tx.Hash(), success) -} - -// Sends a tx, and waits for it to be mined. -// Asserts Receipt.status equals false. -func SendTransactionAndWaitForFailure( - ctx context.Context, - subnetInfo interfaces.SubnetTestInfo, - tx *types.Transaction, -) *types.Receipt { - return sendAndWaitForTransaction(ctx, subnetInfo, tx, false) -} - -// Sends a tx, and waits for it to be mined. -// Asserts Receipt.status equals true. -func SendTransactionAndWaitForSuccess( - ctx context.Context, - subnetInfo interfaces.SubnetTestInfo, - tx *types.Transaction, -) *types.Receipt { - return sendAndWaitForTransaction(ctx, subnetInfo, tx, true) -} - -func SendCrossChainMessageAndWaitForAcceptance( - ctx context.Context, - source interfaces.SubnetTestInfo, - destination interfaces.SubnetTestInfo, - input teleportermessenger.TeleporterMessageInput, - senderKey *ecdsa.PrivateKey, -) (*types.Receipt, ids.ID) { - opts, err := bind.NewKeyedTransactorWithChainID(senderKey, source.EVMChainID) - Expect(err).Should(BeNil()) +) (*types.Receipt, ids.ID) { + opts, err := bind.NewKeyedTransactorWithChainID(senderKey, source.EVMChainID) + Expect(err).Should(BeNil()) // Send a transaction to the Teleporter contract tx, err := source.TeleporterMessenger.SendCrossChainMessage(opts, input) @@ -532,167 +307,6 @@ func SendCrossChainMessageAndWaitForAcceptance( return receipt, event.MessageID } -// Waits for a transaction to be mined. -// Asserts Receipt.status equals true. -func WaitForTransactionSuccess( - ctx context.Context, - subnetInfo interfaces.SubnetTestInfo, - txHash common.Hash, -) *types.Receipt { - return waitForTransaction(ctx, subnetInfo, txHash, true) -} - -// Waits for a transaction to be mined. -// Asserts Receipt.status equals false. -func WaitForTransactionFailure( - ctx context.Context, - subnetInfo interfaces.SubnetTestInfo, - txHash common.Hash, -) *types.Receipt { - return waitForTransaction(ctx, subnetInfo, txHash, false) -} - -// Waits for a transaction to be mined. -// Asserts Receipt.status equals success. -func waitForTransaction( - ctx context.Context, - subnetInfo interfaces.SubnetTestInfo, - txHash common.Hash, - success bool, -) *types.Receipt { - cctx, cancel := context.WithTimeout(ctx, 10*time.Second) - defer cancel() - - receipt, err := WaitMined(cctx, subnetInfo.RPCClient, txHash) - Expect(err).Should(BeNil()) - - if success { - if receipt.Status == types.ReceiptStatusFailed { - TraceTransactionAndExit(ctx, subnetInfo.RPCClient, receipt.TxHash) - } - } else { - Expect(receipt.Status).Should(Equal(types.ReceiptStatusFailed)) - } - return receipt -} - -// Polls for a transaction receipt of the given txHash on each queryTicker tick until -// either a transaction receipt returned, or the context is cancelled or expired. -func waitForTransactionReceipt( - cctx context.Context, - rpcClient ethclient.Client, - txHash common.Hash, -) (*types.Receipt, error) { - queryTicker := time.NewTicker(200 * time.Millisecond) - defer queryTicker.Stop() - for { - receipt, err := rpcClient.TransactionReceipt(cctx, txHash) - if err == nil { - return receipt, nil - } - - if errors.Is(err, subnetEvmInterfaces.NotFound) { - log.Debug("Transaction not yet mined") - } else { - log.Error("Receipt retrieval failed", "err", err) - return nil, err - } - - // Wait for the next round. - select { - case <-cctx.Done(): - return nil, cctx.Err() - case <-queryTicker.C: - } - } -} - -// Polls for the eth_blockNumber endpoint for the latest blockheight on each queryTicker tick until -// either the returned height is greater than or equal to the expectedBlockNumber, or the context -// is cancelled or expired. -func waitForBlockHeight( - cctx context.Context, - rpcClient ethclient.Client, - expectedBlockNumber uint64, -) error { - queryTicker := time.NewTicker(2 * time.Second) - defer queryTicker.Stop() - for { - currentBlockNumber, err := rpcClient.BlockNumber(cctx) - if err != nil { - return err - } - - if currentBlockNumber >= expectedBlockNumber { - return nil - } else { - log.Info("Waiting for block height where transaction was included", - "blockNumber", expectedBlockNumber) - } - - // Wait for the next round. - select { - case <-cctx.Done(): - return cctx.Err() - case <-queryTicker.C: - } - } -} - -// WaitMined waits for tx to be mined on the blockchain. -// It stops waiting when the context is canceled. -// Takes a tx hash instead of the full tx in the subnet-evm version of this function. -// Copied and modified from https://github.com/ava-labs/subnet-evm/blob/v0.6.0-fuji/accounts/abi/bind/util.go#L42 -func WaitMined(ctx context.Context, rpcClient ethclient.Client, txHash common.Hash) (*types.Receipt, error) { - cctx, cancel := context.WithTimeout(ctx, 20*time.Second) - defer cancel() - - receipt, err := waitForTransactionReceipt(cctx, rpcClient, txHash) - if err != nil { - return nil, err - } - - // Check that the block height endpoint returns a block height as high as the block number that the transaction was - // included in. This is to workaround the issue where multiple nodes behind a public RPC endpoint see - // transactions/blocks at different points in time. Ideally, all nodes in the network should have seen this block - // and transaction before returning from WaitMined. The block height endpoint of public RPC endpoints is - // configured to return the lowest value currently returned by any node behind the load balancer, so waiting for - // it to be at least as high as the block height specified in the receipt should provide a relatively strong - // indication that the transaction has been seen widely throughout the network. - err = waitForBlockHeight(cctx, rpcClient, receipt.BlockNumber.Uint64()) - if err != nil { - return nil, err - } - - return receipt, nil -} - -// Returns the first log in 'logs' that is successfully parsed by 'parser' -// Errors and prints a trace of the transaction if no log is found. -func GetEventFromLogsOrTrace[T any]( - ctx context.Context, - receipt *types.Receipt, - subnetInfo interfaces.SubnetTestInfo, - parser func(log types.Log) (T, error), -) T { - log, err := GetEventFromLogs(receipt.Logs, parser) - if err != nil { - TraceTransactionAndExit(ctx, subnetInfo.RPCClient, receipt.TxHash) - } - return log -} - -// Returns the first log in 'logs' that is successfully parsed by 'parser' -func GetEventFromLogs[T any](logs []*types.Log, parser func(log types.Log) (T, error)) (T, error) { - for _, log := range logs { - event, err := parser(*log) - if err == nil { - return event, nil - } - } - return *new(T), fmt.Errorf("failed to find %T event in receipt logs", *new(T)) -} - // Returns true if the transaction receipt contains a ReceiptReceived log with the specified messageID func CheckReceiptReceived( receipt *types.Receipt, @@ -752,194 +366,6 @@ func GetOutstandingReceiptCount(source interfaces.SubnetTestInfo, destinationBlo return size } -// Signs a transaction using the provided key for the specified chainID -func SignTransaction(tx *types.Transaction, key *ecdsa.PrivateKey, chainID *big.Int) *types.Transaction { - txSigner := types.LatestSignerForChainID(chainID) - signedTx, err := types.SignTx(tx, txSigner, key) - Expect(err).Should(BeNil()) - - return signedTx -} - -// Returns the gasFeeCap, gasTipCap, and nonce the be used when constructing a transaction from fundedAddress -func CalculateTxParams( - ctx context.Context, - subnetInfo interfaces.SubnetTestInfo, - fundedAddress common.Address, -) (*big.Int, *big.Int, uint64) { - baseFee, err := subnetInfo.RPCClient.EstimateBaseFee(ctx) - Expect(err).Should(BeNil()) - - gasTipCap, err := subnetInfo.RPCClient.SuggestGasTipCap(ctx) - Expect(err).Should(BeNil()) - - nonce, err := subnetInfo.RPCClient.NonceAt(ctx, fundedAddress, nil) - Expect(err).Should(BeNil()) - - gasFeeCap := baseFee.Mul(baseFee, big.NewInt(gasUtils.BaseFeeFactor)) - gasFeeCap.Add(gasFeeCap, big.NewInt(gasUtils.MaxPriorityFeePerGas)) - - return gasFeeCap, gasTipCap, nonce -} - -func PrivateKeyToAddress(k *ecdsa.PrivateKey) common.Address { - return crypto.PubkeyToAddress(k.PublicKey) -} - -// Throws a Gomega error if there is a mismatch -func CheckBalance(ctx context.Context, addr common.Address, expectedBalance *big.Int, rpcClient ethclient.Client) { - bal, err := rpcClient.BalanceAt(ctx, addr, nil) - Expect(err).Should(BeNil()) - ExpectBigEqual(bal, expectedBalance) -} - -// Gomega will print the transaction trace and exit -func TraceTransactionAndExit(ctx context.Context, rpcClient ethclient.Client, txHash common.Hash) { - Expect(TraceTransaction(ctx, rpcClient, txHash)).Should(Equal("")) -} - -func TraceTransaction(ctx context.Context, rpcClient ethclient.Client, txHash common.Hash) string { - var result interface{} - ct := "callTracer" - err := rpcClient.Client().Call(&result, "debug_traceTransaction", txHash.String(), tracers.TraceConfig{Tracer: &ct}) - Expect(err).Should(BeNil()) - - jsonStr, err := json.Marshal(result) - Expect(err).Should(BeNil()) - - return string(jsonStr) -} - -func ExpectBigEqual(v1 *big.Int, v2 *big.Int) { - // Compare strings, so gomega will print the numbers if they differ - Expect(v1.String()).Should(Equal(v2.String())) -} - -func BigIntSub(v1 *big.Int, v2 *big.Int) *big.Int { - return big.NewInt(0).Sub(v1, v2) -} - -func BigIntMul(v1 *big.Int, v2 *big.Int) *big.Int { - return big.NewInt(0).Mul(v1, v2) -} - -func ERC20Approve( - ctx context.Context, - token *exampleerc20.ExampleERC20, - spender common.Address, - amount *big.Int, - source interfaces.SubnetTestInfo, - senderKey *ecdsa.PrivateKey, -) { - opts, err := bind.NewKeyedTransactorWithChainID(senderKey, source.EVMChainID) - Expect(err).Should(BeNil()) - tx, err := token.Approve(opts, spender, amount) - Expect(err).Should(BeNil()) - log.Info("Approved ERC20", "spender", spender.Hex(), "txHash", tx.Hash().Hex()) - - WaitForTransactionSuccess(ctx, source, tx.Hash()) -} - -func DeployExampleERC20( - ctx context.Context, - senderKey *ecdsa.PrivateKey, - source interfaces.SubnetTestInfo, -) (common.Address, *exampleerc20.ExampleERC20) { - opts, err := bind.NewKeyedTransactorWithChainID(senderKey, source.EVMChainID) - Expect(err).Should(BeNil()) - - // Deploy Mock ERC20 contract - address, tx, token, err := exampleerc20.DeployExampleERC20(opts, source.RPCClient) - Expect(err).Should(BeNil()) - log.Info("Deployed Mock ERC20 contract", "address", address.Hex(), "txHash", tx.Hash().Hex()) - - // Wait for the transaction to be mined - WaitForTransactionSuccess(ctx, source, tx.Hash()) - - // Check that the deployer has the expected initial balance - senderAddress := crypto.PubkeyToAddress(senderKey.PublicKey) - balance, err := token.BalanceOf(&bind.CallOpts{}, senderAddress) - Expect(err).Should(BeNil()) - Expect(balance).Should(Equal(ExpectedExampleERC20DeployerBalance)) - - return address, token -} - -func DeployTestMessenger( - ctx context.Context, - senderKey *ecdsa.PrivateKey, - teleporterManager common.Address, - subnet interfaces.SubnetTestInfo, -) (common.Address, *testmessenger.TestMessenger) { - opts, err := bind.NewKeyedTransactorWithChainID( - senderKey, - subnet.EVMChainID, - ) - Expect(err).Should(BeNil()) - address, tx, exampleMessenger, err := testmessenger.DeployTestMessenger( - opts, - subnet.RPCClient, - subnet.TeleporterRegistryAddress, - teleporterManager, - ) - Expect(err).Should(BeNil()) - - // Wait for the transaction to be mined - WaitForTransactionSuccess(ctx, subnet, tx.Hash()) - - return address, exampleMessenger -} - -func DeployValidatorSetSig( - ctx context.Context, - senderKey *ecdsa.PrivateKey, - contractSubnet interfaces.SubnetTestInfo, - validatorSubnet interfaces.SubnetTestInfo, -) (common.Address, *validatorsetsig.ValidatorSetSig) { - opts, err := bind.NewKeyedTransactorWithChainID(senderKey, contractSubnet.EVMChainID) - Expect(err).Should(BeNil()) - address, tx, validatorSetSig, err := validatorsetsig.DeployValidatorSetSig( - opts, - contractSubnet.RPCClient, - validatorSubnet.BlockchainID, - ) - Expect(err).Should(BeNil()) - - // Wait for the transaction to be mined - WaitForTransactionSuccess(ctx, contractSubnet, tx.Hash()) - - return address, validatorSetSig -} - -func DeployNativeTokenStakingManager( - ctx context.Context, - senderKey *ecdsa.PrivateKey, - subnet interfaces.SubnetTestInfo, -) (common.Address, *nativetokenstakingmanager.NativeTokenStakingManager) { - opts, err := bind.NewKeyedTransactorWithChainID(senderKey, subnet.EVMChainID) - Expect(err).Should(BeNil()) - address, tx, stakingManager, err := nativetokenstakingmanager.DeployNativeTokenStakingManager( - opts, - subnet.RPCClient, - 0, // ICMInitializable.Allowed - ) - Expect(err).Should(BeNil()) - - // Wait for the transaction to be mined - WaitForTransactionSuccess(ctx, subnet, tx.Hash()) - - return address, stakingManager -} - -func GetTwoSubnets(network interfaces.Network) ( - interfaces.SubnetTestInfo, - interfaces.SubnetTestInfo, -) { - subnets := network.GetSubnetsInfo() - Expect(len(subnets)).Should(BeNumerically(">=", 2)) - return subnets[0], subnets[1] -} - func SendExampleCrossChainMessageAndVerify( ctx context.Context, network interfaces.Network, @@ -1016,6 +442,154 @@ func SendExampleCrossChainMessageAndVerify( } } +// +// Transaction utils +// + +// Constructs a transaction to call sendCrossChainMessage +// Returns the signed transaction. +func CreateSendCrossChainMessageTransaction( + ctx context.Context, + source interfaces.SubnetTestInfo, + input teleportermessenger.TeleporterMessageInput, + senderKey *ecdsa.PrivateKey, + teleporterContractAddress common.Address, +) *types.Transaction { + data, err := teleportermessenger.PackSendCrossChainMessage(input) + Expect(err).Should(BeNil()) + + gasFeeCap, gasTipCap, nonce := CalculateTxParams(ctx, source, PrivateKeyToAddress(senderKey)) + + // Send a transaction to the Teleporter contract + tx := types.NewTx(&types.DynamicFeeTx{ + ChainID: source.EVMChainID, + Nonce: nonce, + To: &teleporterContractAddress, + Gas: DefaultTeleporterTransactionGas, + GasFeeCap: gasFeeCap, + GasTipCap: gasTipCap, + Value: DefaultTeleporterTransactionValue, + Data: data, + }) + + return SignTransaction(tx, senderKey, source.EVMChainID) +} + +// Constructs a transaction to call receiveCrossChainMessage +// Returns the signed transaction. +func CreateReceiveCrossChainMessageTransaction( + ctx context.Context, + signedMessage *avalancheWarp.Message, + requiredGasLimit *big.Int, + teleporterContractAddress common.Address, + senderKey *ecdsa.PrivateKey, + subnetInfo interfaces.SubnetTestInfo, +) *types.Transaction { + // Construct the transaction to send the Warp message to the destination chain + log.Info("Constructing receiveCrossChainMessage transaction for the destination chain") + numSigners, err := signedMessage.Signature.NumSigners() + Expect(err).Should(BeNil()) + + teleporterMessage := ParseTeleporterMessage(signedMessage.UnsignedMessage) + gasLimit, err := gasUtils.CalculateReceiveMessageGasLimit( + numSigners, + requiredGasLimit, + len(signedMessage.Bytes()), + len(signedMessage.Payload), + len(teleporterMessage.Receipts), + ) + Expect(err).Should(BeNil()) + + callData, err := teleportermessenger.PackReceiveCrossChainMessage(0, PrivateKeyToAddress(senderKey)) + Expect(err).Should(BeNil()) + + gasFeeCap, gasTipCap, nonce := CalculateTxParams(ctx, subnetInfo, PrivateKeyToAddress(senderKey)) + + destinationTx := predicateutils.NewPredicateTx( + subnetInfo.EVMChainID, + nonce, + &teleporterContractAddress, + gasLimit, + gasFeeCap, + gasTipCap, + big.NewInt(0), + callData, + types.AccessList{}, + warp.ContractAddress, + signedMessage.Bytes(), + ) + + return SignTransaction(destinationTx, senderKey, subnetInfo.EVMChainID) +} + +// Constructs a transaction to call addProtocolVersion +// Returns the signed transaction. +func CreateAddProtocolVersionTransaction( + ctx context.Context, + signedMessage *avalancheWarp.Message, + teleporterRegistryAddress common.Address, + senderKey *ecdsa.PrivateKey, + subnetInfo interfaces.SubnetTestInfo, +) *types.Transaction { + // Construct the transaction to send the Warp message to the destination chain + log.Info("Constructing addProtocolVersion transaction for the destination chain") + + callData, err := teleporterregistry.PackAddProtocolVersion(0) + Expect(err).Should(BeNil()) + + gasFeeCap, gasTipCap, nonce := CalculateTxParams(ctx, subnetInfo, PrivateKeyToAddress(senderKey)) + + destinationTx := predicateutils.NewPredicateTx( + subnetInfo.EVMChainID, + nonce, + &teleporterRegistryAddress, + 500_000, + gasFeeCap, + gasTipCap, + big.NewInt(0), + callData, + types.AccessList{}, + warp.ContractAddress, + signedMessage.Bytes(), + ) + + return SignTransaction(destinationTx, senderKey, subnetInfo.EVMChainID) +} + +func CreateExecuteCallPredicateTransaction( + ctx context.Context, + signedMessage *avalancheWarp.Message, + validatorSetSigAddress common.Address, + senderKey *ecdsa.PrivateKey, + subnetInfo interfaces.SubnetTestInfo, +) *types.Transaction { + log.Info("Constructing executeCall transaction for the destination chain") + + callData, err := validatorsetsig.PackExecuteCall(0) + Expect(err).Should(BeNil()) + + gasFeeCap, gasTipCap, nonce := CalculateTxParams(ctx, subnetInfo, PrivateKeyToAddress(senderKey)) + + destinationTx := predicateutils.NewPredicateTx( + subnetInfo.EVMChainID, + nonce, + &validatorSetSigAddress, + 500_000, + gasFeeCap, + gasTipCap, + big.NewInt(0), + callData, + types.AccessList{}, + warp.ContractAddress, + signedMessage.Bytes(), + ) + return SignTransaction(destinationTx, senderKey, subnetInfo.EVMChainID) +} + +// +// Off-chain message utils +// + // Creates an Warp message that registers a Teleporter protocol version with TeleporterRegistry. // Returns the Warp message, as well as the chain config adding the message to the list of approved // off-chain Warp messages @@ -1059,172 +633,3 @@ func CreateOffChainRegistryMessage( return unsignedMessage } - -func InitOffChainMessageChainConfigValidatorSetSig( - networkID uint32, - subnet interfaces.SubnetTestInfo, - validatorSetSigAddress common.Address, - validatorSetSigMessages []validatorsetsig.ValidatorSetSigMessage, -) ([]avalancheWarp.UnsignedMessage, string) { - unsignedMessages := []avalancheWarp.UnsignedMessage{} - for _, message := range validatorSetSigMessages { - unsignedMessage := CreateOffChainValidatorSetSigMessage(networkID, subnet, message) - unsignedMessages = append(unsignedMessages, *unsignedMessage) - log.Info("Adding validatorSetSig off-chain message to Warp chain config", - "messageID", unsignedMessage.ID(), - "blockchainID", subnet.BlockchainID.String()) - } - return unsignedMessages, GetChainConfigWithOffChainMessages(unsignedMessages) -} - -// Creates an off-chain Warp message pointing to a function, contract and payload to be executed -// if the validator set signs this message -func CreateOffChainValidatorSetSigMessage( - networkID uint32, - subnet interfaces.SubnetTestInfo, - message validatorsetsig.ValidatorSetSigMessage, -) *avalancheWarp.UnsignedMessage { - sourceAddress := []byte{} - payloadBytes, err := message.Pack() - Expect(err).Should(BeNil()) - - addressedPayload, err := payload.NewAddressedCall(sourceAddress, payloadBytes) - Expect(err).Should(BeNil()) - - unsignedMessage, err := avalancheWarp.NewUnsignedMessage( - networkID, - subnet.BlockchainID, - addressedPayload.Bytes(), - ) - Expect(err).Should(BeNil()) - - return unsignedMessage -} - -// Deploys a new version of Teleporter and returns its address -// Does NOT modify the global Teleporter contract address to provide greater testing flexibility. -func DeployNewTeleporterVersion( - ctx context.Context, - network interfaces.LocalNetwork, - fundedKey *ecdsa.PrivateKey, - teleporterByteCodeFile string, -) common.Address { - contractCreationGasPrice := (&big.Int{}).Add(deploymentUtils.GetDefaultContractCreationGasPrice(), big.NewInt(1)) - teleporterDeployerTransaction, - _, - teleporterDeployerAddress, - teleporterContractAddress, - err := deploymentUtils.ConstructKeylessTransaction( - teleporterByteCodeFile, - false, - contractCreationGasPrice, - ) - Expect(err).Should(BeNil()) - - network.DeployTeleporterContractToAllChains( - teleporterDeployerTransaction, - teleporterDeployerAddress, - teleporterContractAddress, - fundedKey, - ) - return teleporterContractAddress -} - -type ChainConfigMap map[string]string - -// Sets the chain config in customChainConfigs for the specified subnet -func (m ChainConfigMap) Add(subnet interfaces.SubnetTestInfo, chainConfig string) { - if subnet.SubnetID == constants.PrimaryNetworkID { - m[CChainPathSpecifier] = chainConfig - } else { - m[subnet.BlockchainID.String()] = chainConfig - } -} - -func ParseTeleporterMessage(unsignedMessage avalancheWarp.UnsignedMessage) *teleportermessenger.TeleporterMessage { - addressedPayload, err := payload.ParseAddressedCall(unsignedMessage.Payload) - Expect(err).Should(BeNil()) - - teleporterMessage := teleportermessenger.TeleporterMessage{} - err = teleporterMessage.Unpack(addressedPayload.Payload) - Expect(err).Should(BeNil()) - - return &teleporterMessage -} - -func GetChainConfigWithOffChainMessages(offChainMessages []avalancheWarp.UnsignedMessage) string { - // Convert messages to hex - hexOffChainMessages := []string{} - for _, message := range offChainMessages { - hexOffChainMessages = append(hexOffChainMessages, hexutil.Encode(message.Bytes())) - } - - // Create a map to represent the JSON structure - jsonMap := map[string]interface{}{ - "warp-api-enabled": true, - "warp-off-chain-messages": hexOffChainMessages, - "log-level": "debug", - "eth-apis": []string{ - "eth", "eth-filter", "net", "admin", "web3", - "internal-eth", "internal-blockchain", "internal-transaction", - "internal-debug", "internal-account", "internal-personal", - "debug", "debug-tracer", "debug-file-tracer", "debug-handler", - }, - } - - // Marshal the map to JSON - offChainMessageJson, err := json.Marshal(jsonMap) - Expect(err).Should(BeNil()) - - return string(offChainMessageJson) -} - -// read in the template file, make the substitutions declared at the beginning -// of the function, write out the instantiation to a temp file, and then return -// the path to that temp file. -func InstantiateGenesisTemplate( - templateFileName string, - chainID uint64, - teleporterContractAddress common.Address, - teleporterDeployedBytecode string, - teleporterDeployerAddress common.Address, -) string { - substitutions := []struct { - Target string - Value string - }{ - { - "", - strconv.FormatUint(chainID, 10), - }, - { - "", - teleporterContractAddress.Hex(), - }, - { - "", - teleporterDeployedBytecode, - }, - { - "", - teleporterDeployerAddress.Hex(), - }, - } - - templateFileBytes, err := os.ReadFile(templateFileName) - Expect(err).Should(BeNil()) - - subnetGenesisFile, err := os.CreateTemp(os.TempDir(), "") - Expect(err).Should(BeNil()) - - defer subnetGenesisFile.Close() - - var replaced string = string(templateFileBytes[:]) - for _, s := range substitutions { - replaced = strings.ReplaceAll(replaced, s.Target, s.Value) - } - - subnetGenesisFile.WriteString(replaced) - - return subnetGenesisFile.Name() -} From 5c04d20d889b8faadca239b07b90752886eeff95 Mon Sep 17 00:00:00 2001 From: cam-schultz Date: Thu, 15 Aug 2024 16:24:09 -0400 Subject: [PATCH 15/27] staking contract test utils --- tests/flows/native_token_staking.go | 152 ++++++++-------------------- tests/utils/staking_utils.go | 152 ++++++++++++++++++++++++++++ 2 files changed, 194 insertions(+), 110 deletions(-) diff --git a/tests/flows/native_token_staking.go b/tests/flows/native_token_staking.go index fc525f404..71c6d70d0 100644 --- a/tests/flows/native_token_staking.go +++ b/tests/flows/native_token_staking.go @@ -2,23 +2,14 @@ package flows import ( "context" - "encoding/hex" - "math/big" - "time" "github.com/ava-labs/avalanchego/ids" - avalancheWarp "github.com/ava-labs/avalanchego/vms/platformvm/warp" + "github.com/ava-labs/avalanchego/utils/crypto/bls" warpMessages "github.com/ava-labs/avalanchego/vms/platformvm/warp/messages" warpPayload "github.com/ava-labs/avalanchego/vms/platformvm/warp/payload" - "github.com/ava-labs/subnet-evm/accounts/abi/bind" "github.com/ava-labs/subnet-evm/core/types" - "github.com/ava-labs/subnet-evm/precompile/contracts/warp" - predicateutils "github.com/ava-labs/subnet-evm/predicate" - nativetokenstakingmanager "github.com/ava-labs/teleporter/abi-bindings/go/staking/NativeTokenStakingManager" "github.com/ava-labs/teleporter/tests/interfaces" "github.com/ava-labs/teleporter/tests/utils" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/log" . "github.com/onsi/gomega" ) @@ -62,33 +53,26 @@ func NativeTokenStakingManager(network interfaces.LocalNetwork) { // Register a validator // var validationID ids.ID // To be used in the delisting step + stakeAmount := uint64(1e18) + weight := uint64(1e6) // stakeAmount / 1e12 { // Iniatiate validator registration - opts, err := bind.NewKeyedTransactorWithChainID(fundedKey, subnetAInfo.EVMChainID) - Expect(err).Should(BeNil()) - opts.Value = big.NewInt(0).SetUint64(1e18) nodeID := ids.GenerateTestID() - blsPublicKey := [48]byte{} - tx, err := stakingManager.InitializeValidatorRegistration( - opts, + blsPublicKey := [bls.PublicKeyLen]byte{} + var receipt *types.Receipt + receipt, validationID = utils.CallNativeInitializeValidatorRegistration( + fundedKey, + subnetAInfo, + stakeAmount, nodeID, - uint64(time.Now().Add(24*time.Hour).Unix()), - blsPublicKey[:], - ) - Expect(err).Should(BeNil()) - receipt := utils.WaitForTransactionSuccess(context.Background(), subnetAInfo, tx.Hash()) - registrationInitiatedEvent, err := utils.GetEventFromLogs( - receipt.Logs, - stakingManager.ParseValidationPeriodCreated, + blsPublicKey, + stakingManager, ) - Expect(err).Should(BeNil()) - validationID = ids.ID(registrationInitiatedEvent.ValidationID) // Gather subnet-evm Warp signatures for the RegisterSubnetValidatorMessage & relay to the P-Chain // (Sending to the P-Chain will be skipped for now) signedWarpMessage := network.ConstructSignedWarpMessage(context.Background(), receipt, subnetAInfo, pChainInfo) - Expect(err).Should(BeNil()) - log.Info("Constructed signed RegisterSubnetValidator message", "message", signedWarpMessage) + // Validate the Warp message, (this will be done on the P-Chain in the future) msg, err := warpPayload.ParseAddressedCall(signedWarpMessage.UnsignedMessage.Payload) Expect(err).Should(BeNil()) @@ -101,51 +85,27 @@ func NativeTokenStakingManager(network interfaces.LocalNetwork) { Expect(ver).Should(Equal(uint16(warpMessages.CodecVersion))) Expect(registerValidatorPayload.NodeID).Should(Equal(nodeID)) - Expect(registerValidatorPayload.Weight).Should(Equal(uint64(1e6))) + Expect(registerValidatorPayload.Weight).Should(Equal(uint64(weight))) Expect(registerValidatorPayload.SubnetID).Should(Equal(subnetAInfo.SubnetID)) Expect(registerValidatorPayload.BlsPubKey[:]).Should(Equal(blsPublicKey[:])) // Construct a SubnetValidatorRegistrationMessage Warp message from the P-Chain - // Query P-Chain validators for the Warp message - registrationPayload, err := warpMessages.NewSubnetValidatorRegistration(validationID, true) - Expect(err).Should(BeNil()) - registrationAddressedCall, err := warpPayload.NewAddressedCall(common.Address{}.Bytes(), registrationPayload.Bytes()) - Expect(err).Should(BeNil()) - registrationUnsignedMessage, err := avalancheWarp.NewUnsignedMessage(network.GetNetworkID(), pChainInfo.BlockchainID, registrationAddressedCall.Bytes()) - Expect(err).Should(BeNil()) - log.Info("Constructed unsigned SubnetValidatorRegistration message", "message", hex.EncodeToString(registrationUnsignedMessage.Bytes())) - - registrationSignedMessage, err := signatureAggregator.CreateSignedMessage( - registrationUnsignedMessage, - nil, - subnetAInfo.SubnetID, - 67, + registrationSignedMessage := utils.ConstructSubnetValidatorRegistrationMessage( + validationID, + true, + subnetAInfo, + pChainInfo, + network, + signatureAggregator, ) - Expect(err).Should(BeNil()) - log.Info("Constructed signed SubnetValidatorRegistration message", "message", registrationSignedMessage) // Deliver the Warp message to the subnet - abi, err := nativetokenstakingmanager.NativeTokenStakingManagerMetaData.GetAbi() - Expect(err).Should(BeNil()) - callData, err := abi.Pack("completeValidatorRegistration", uint32(0)) - Expect(err).Should(BeNil()) - gasFeeCap, gasTipCap, nonce := utils.CalculateTxParams(context.Background(), subnetAInfo, utils.PrivateKeyToAddress(fundedKey)) - registrationTx := predicateutils.NewPredicateTx( - subnetAInfo.EVMChainID, - nonce, - &stakingManagerContractAddress, - 2_000_000, - gasFeeCap, - gasTipCap, - big.NewInt(0), - callData, - types.AccessList{}, - warp.ContractAddress, - registrationSignedMessage.Bytes(), + receipt = utils.CallCompleteValidatorRegistration( + fundedKey, + subnetAInfo, + stakingManagerContractAddress, + registrationSignedMessage, ) - signedRegistrationTx := utils.SignTransaction(registrationTx, fundedKey, subnetAInfo.EVMChainID) - receipt = utils.SendTransactionAndWaitForSuccess(context.Background(), subnetAInfo, signedRegistrationTx) - // Check that the validator is registered in the staking contract registrationEvent, err := utils.GetEventFromLogs( receipt.Logs, @@ -159,29 +119,24 @@ func NativeTokenStakingManager(network interfaces.LocalNetwork) { // Delist the validator // { - opts, err := bind.NewKeyedTransactorWithChainID(fundedKey, subnetAInfo.EVMChainID) - Expect(err).Should(BeNil()) - tx, err := stakingManager.InitializeEndValidation( - opts, + receipt := utils.CallInitializeEndValidation( + fundedKey, + subnetAInfo, + stakingManager, validationID, - false, - 0, ) - Expect(err).Should(BeNil()) - receipt := utils.WaitForTransactionSuccess(context.Background(), subnetAInfo, tx.Hash()) validatorRemovalEvent, err := utils.GetEventFromLogs( receipt.Logs, stakingManager.ParseValidatorRemovalInitialized, ) Expect(err).Should(BeNil()) Expect(validatorRemovalEvent.ValidationID[:]).Should(Equal(validationID[:])) - Expect(validatorRemovalEvent.StakeAmount.Uint64()).Should(Equal(uint64(1e6))) + Expect(validatorRemovalEvent.StakeAmount.Uint64()).Should(Equal(uint64(weight))) // Gather subnet-evm Warp signatures for the SetSubnetValidatorWeightMessage & relay to the P-Chain // (Sending to the P-Chain will be skipped for now) signedWarpMessage := network.ConstructSignedWarpMessage(context.Background(), receipt, subnetAInfo, pChainInfo) Expect(err).Should(BeNil()) - log.Info("Constructed signed SetSubnetValidatorWeightMessage message", "message", signedWarpMessage) // Validate the Warp message, (this will be done on the P-Chain in the future) msg, err := warpPayload.ParseAddressedCall(signedWarpMessage.UnsignedMessage.Payload) Expect(err).Should(BeNil()) @@ -198,45 +153,22 @@ func NativeTokenStakingManager(network interfaces.LocalNetwork) { Expect(registerValidatorPayload.Nonce).Should(Equal(uint64(0))) // Construct a SubnetValidatorRegistrationMessage Warp message from the P-Chain - // Query P-Chain validators for the Warp message - registrationPayload, err := warpMessages.NewSubnetValidatorRegistration(validationID, false) - Expect(err).Should(BeNil()) - registrationAddressedCall, err := warpPayload.NewAddressedCall(common.Address{}.Bytes(), registrationPayload.Bytes()) - Expect(err).Should(BeNil()) - registrationUnsignedMessage, err := avalancheWarp.NewUnsignedMessage(network.GetNetworkID(), pChainInfo.BlockchainID, registrationAddressedCall.Bytes()) - Expect(err).Should(BeNil()) - log.Info("Constructed unsigned SubnetValidatorRegistration message", "message", hex.EncodeToString(registrationUnsignedMessage.Bytes())) - - registrationSignedMessage, err := signatureAggregator.CreateSignedMessage( - registrationUnsignedMessage, - nil, - subnetAInfo.SubnetID, - 67, + registrationSignedMessage := utils.ConstructSubnetValidatorRegistrationMessage( + validationID, + false, + subnetAInfo, + pChainInfo, + network, + signatureAggregator, ) - Expect(err).Should(BeNil()) - log.Info("Constructed signed SubnetValidatorRegistration message", "message", registrationSignedMessage) // Deliver the Warp message to the subnet - abi, err := nativetokenstakingmanager.NativeTokenStakingManagerMetaData.GetAbi() - Expect(err).Should(BeNil()) - callData, err := abi.Pack("completeEndValidation", uint32(0), false) - Expect(err).Should(BeNil()) - gasFeeCap, gasTipCap, nonce := utils.CalculateTxParams(context.Background(), subnetAInfo, utils.PrivateKeyToAddress(fundedKey)) - registrationTx := predicateutils.NewPredicateTx( - subnetAInfo.EVMChainID, - nonce, - &stakingManagerContractAddress, - 2_000_000, - gasFeeCap, - gasTipCap, - big.NewInt(0), - callData, - types.AccessList{}, - warp.ContractAddress, - registrationSignedMessage.Bytes(), + receipt = utils.CallCompleteEndValidation( + fundedKey, + subnetAInfo, + stakingManagerContractAddress, + registrationSignedMessage, ) - signedRegistrationTx := utils.SignTransaction(registrationTx, fundedKey, subnetAInfo.EVMChainID) - receipt = utils.SendTransactionAndWaitForSuccess(context.Background(), subnetAInfo, signedRegistrationTx) // Check that the validator is registered in the staking contract registrationEvent, err := utils.GetEventFromLogs( diff --git a/tests/utils/staking_utils.go b/tests/utils/staking_utils.go index 443952210..332121304 100644 --- a/tests/utils/staking_utils.go +++ b/tests/utils/staking_utils.go @@ -3,16 +3,32 @@ package utils import ( "context" "crypto/ecdsa" + "encoding/hex" "math/big" "time" + "github.com/ava-labs/avalanchego/ids" + "github.com/ava-labs/avalanchego/utils/crypto/bls" + avalancheWarp "github.com/ava-labs/avalanchego/vms/platformvm/warp" + warpMessages "github.com/ava-labs/avalanchego/vms/platformvm/warp/messages" + warpPayload "github.com/ava-labs/avalanchego/vms/platformvm/warp/payload" + "github.com/ava-labs/awm-relayer/signature-aggregator/aggregator" "github.com/ava-labs/subnet-evm/accounts/abi/bind" + "github.com/ava-labs/subnet-evm/core/types" + "github.com/ava-labs/subnet-evm/precompile/contracts/warp" + predicateutils "github.com/ava-labs/subnet-evm/predicate" nativetokenstakingmanager "github.com/ava-labs/teleporter/abi-bindings/go/staking/NativeTokenStakingManager" "github.com/ava-labs/teleporter/tests/interfaces" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/log" + . "github.com/onsi/gomega" ) +// +// Deployment utils +// + func DeployNativeTokenStakingManager( ctx context.Context, senderKey *ecdsa.PrivateKey, @@ -63,3 +79,139 @@ func DeployAndInitializeNativeTokenStakingManager( return stakingManagerContractAddress, stakingManager } + +// +// Function call utils +// + +func CallNativeInitializeValidatorRegistration( + senderKey *ecdsa.PrivateKey, + subnet interfaces.SubnetTestInfo, + stakeAmount uint64, + nodeID ids.ID, + blsPublicKey [bls.PublicKeyLen]byte, + stakingManager *nativetokenstakingmanager.NativeTokenStakingManager, +) (*types.Receipt, ids.ID) { + opts, err := bind.NewKeyedTransactorWithChainID(senderKey, subnet.EVMChainID) + Expect(err).Should(BeNil()) + opts.Value = big.NewInt(0).SetUint64(stakeAmount) + + tx, err := stakingManager.InitializeValidatorRegistration( + opts, + nodeID, + uint64(time.Now().Add(24*time.Hour).Unix()), + blsPublicKey[:], + ) + Expect(err).Should(BeNil()) + receipt := WaitForTransactionSuccess(context.Background(), subnet, tx.Hash()) + registrationInitiatedEvent, err := GetEventFromLogs( + receipt.Logs, + stakingManager.ParseValidationPeriodCreated, + ) + Expect(err).Should(BeNil()) + return receipt, ids.ID(registrationInitiatedEvent.ValidationID) +} + +func CallCompleteValidatorRegistration( + sendingKey *ecdsa.PrivateKey, + subnet interfaces.SubnetTestInfo, + stakingManagerContractAddress common.Address, + registrationSignedMessage *avalancheWarp.Message, +) *types.Receipt { + abi, err := nativetokenstakingmanager.NativeTokenStakingManagerMetaData.GetAbi() + Expect(err).Should(BeNil()) + callData, err := abi.Pack("completeValidatorRegistration", uint32(0)) + Expect(err).Should(BeNil()) + gasFeeCap, gasTipCap, nonce := CalculateTxParams(context.Background(), subnet, PrivateKeyToAddress(sendingKey)) + registrationTx := predicateutils.NewPredicateTx( + subnet.EVMChainID, + nonce, + &stakingManagerContractAddress, + 2_000_000, + gasFeeCap, + gasTipCap, + big.NewInt(0), + callData, + types.AccessList{}, + warp.ContractAddress, + registrationSignedMessage.Bytes(), + ) + signedRegistrationTx := SignTransaction(registrationTx, sendingKey, subnet.EVMChainID) + return SendTransactionAndWaitForSuccess(context.Background(), subnet, signedRegistrationTx) +} + +func CallInitializeEndValidation( + sendingKey *ecdsa.PrivateKey, + subnet interfaces.SubnetTestInfo, + stakingManager *nativetokenstakingmanager.NativeTokenStakingManager, + validationID ids.ID, +) *types.Receipt { + opts, err := bind.NewKeyedTransactorWithChainID(sendingKey, subnet.EVMChainID) + Expect(err).Should(BeNil()) + tx, err := stakingManager.InitializeEndValidation( + opts, + validationID, + false, + 0, + ) + Expect(err).Should(BeNil()) + return WaitForTransactionSuccess(context.Background(), subnet, tx.Hash()) +} + +func CallCompleteEndValidation( + sendingKey *ecdsa.PrivateKey, + subnet interfaces.SubnetTestInfo, + stakingManagerContractAddress common.Address, + registrationSignedMessage *avalancheWarp.Message, +) *types.Receipt { + abi, err := nativetokenstakingmanager.NativeTokenStakingManagerMetaData.GetAbi() + Expect(err).Should(BeNil()) + callData, err := abi.Pack("completeEndValidation", uint32(0), false) + Expect(err).Should(BeNil()) + gasFeeCap, gasTipCap, nonce := CalculateTxParams(context.Background(), subnet, PrivateKeyToAddress(sendingKey)) + registrationTx := predicateutils.NewPredicateTx( + subnet.EVMChainID, + nonce, + &stakingManagerContractAddress, + 2_000_000, + gasFeeCap, + gasTipCap, + big.NewInt(0), + callData, + types.AccessList{}, + warp.ContractAddress, + registrationSignedMessage.Bytes(), + ) + signedRegistrationTx := SignTransaction(registrationTx, sendingKey, subnet.EVMChainID) + return SendTransactionAndWaitForSuccess(context.Background(), subnet, signedRegistrationTx) +} + +// +// P-Chain utils +// + +func ConstructSubnetValidatorRegistrationMessage( + validationID ids.ID, + valid bool, + subnet interfaces.SubnetTestInfo, + pChainInfo interfaces.SubnetTestInfo, + network interfaces.LocalNetwork, + signatureAggregator *aggregator.SignatureAggregator, +) *avalancheWarp.Message { + registrationPayload, err := warpMessages.NewSubnetValidatorRegistration(validationID, valid) + Expect(err).Should(BeNil()) + registrationAddressedCall, err := warpPayload.NewAddressedCall(common.Address{}.Bytes(), registrationPayload.Bytes()) + Expect(err).Should(BeNil()) + registrationUnsignedMessage, err := avalancheWarp.NewUnsignedMessage(network.GetNetworkID(), pChainInfo.BlockchainID, registrationAddressedCall.Bytes()) + Expect(err).Should(BeNil()) + log.Info("Constructed unsigned SubnetValidatorRegistration message", "message", hex.EncodeToString(registrationUnsignedMessage.Bytes())) + + registrationSignedMessage, err := signatureAggregator.CreateSignedMessage( + registrationUnsignedMessage, + nil, + subnet.SubnetID, + 67, + ) + Expect(err).Should(BeNil()) + return registrationSignedMessage +} From 662b0d2cca6be7877b84962b0c13e5df92013a59 Mon Sep 17 00:00:00 2001 From: cam-schultz Date: Thu, 15 Aug 2024 16:24:52 -0400 Subject: [PATCH 16/27] enable all tests --- tests/local/e2e_test.go | 174 ++++++++++++++++++++-------------------- 1 file changed, 87 insertions(+), 87 deletions(-) diff --git a/tests/local/e2e_test.go b/tests/local/e2e_test.go index 35d021d12..7c88505e4 100644 --- a/tests/local/e2e_test.go +++ b/tests/local/e2e_test.go @@ -108,93 +108,93 @@ var _ = ginkgo.Describe("[Teleporter integration tests]", func() { func() { flows.NativeTokenStakingManager(LocalNetworkInstance) }) - // ginkgo.It("Send a message from Subnet A to Subnet B, and one from B to A", - // ginkgo.Label(teleporterMessengerLabel), - // func() { - // flows.BasicSendReceive(LocalNetworkInstance) - // }) - // ginkgo.It("Deliver to the wrong chain", - // ginkgo.Label(teleporterMessengerLabel), - // func() { - // flows.DeliverToWrongChain(LocalNetworkInstance) - // }) - // ginkgo.It("Deliver to non-existent contract", - // ginkgo.Label(teleporterMessengerLabel), - // func() { - // flows.DeliverToNonExistentContract(LocalNetworkInstance) - // }) - // ginkgo.It("Retry successful execution", - // ginkgo.Label(teleporterMessengerLabel), - // func() { - // flows.RetrySuccessfulExecution(LocalNetworkInstance) - // }) - // ginkgo.It("Unallowed relayer", - // ginkgo.Label(teleporterMessengerLabel), - // func() { - // flows.UnallowedRelayer(LocalNetworkInstance) - // }) - // ginkgo.It("Relay message twice", - // ginkgo.Label(teleporterMessengerLabel), - // func() { - // flows.RelayMessageTwice(LocalNetworkInstance) - // }) - // ginkgo.It("Add additional fee amount", - // ginkgo.Label(teleporterMessengerLabel), - // func() { - // flows.AddFeeAmount(LocalNetworkInstance) - // }) - // ginkgo.It("Send specific receipts", - // ginkgo.Label(teleporterMessengerLabel), - // func() { - // flows.SendSpecificReceipts(LocalNetworkInstance) - // }) - // ginkgo.It("Insufficient gas", - // ginkgo.Label(teleporterMessengerLabel), - // func() { - // flows.InsufficientGas(LocalNetworkInstance) - // }) - // ginkgo.It("Resubmit altered message", - // ginkgo.Label(teleporterMessengerLabel), - // func() { - // flows.ResubmitAlteredMessage(LocalNetworkInstance) - // }) - // ginkgo.It("Check upgrade access", - // ginkgo.Label(upgradabilityLabel), - // func() { - // flows.CheckUpgradeAccess(LocalNetworkInstance) - // }) - // ginkgo.It("Pause and Unpause Teleporter", - // ginkgo.Label(upgradabilityLabel), - // func() { - // flows.PauseTeleporter(LocalNetworkInstance) - // }) - // ginkgo.It("Calculate Teleporter message IDs", - // ginkgo.Label(utilsLabel), - // func() { - // flows.CalculateMessageID(LocalNetworkInstance) - // }) - - // // The following tests require special behavior by the relayer, so we only run them on a local network - // ginkgo.It("Relayer modifies message", - // ginkgo.Label(teleporterMessengerLabel), - // func() { - // flows.RelayerModifiesMessage(LocalNetworkInstance) - // }) - // ginkgo.It("Teleporter registry", - // ginkgo.Label(upgradabilityLabel), - // func() { - // flows.TeleporterRegistry(LocalNetworkInstance) - // }) - // ginkgo.It("Deliver ValidatorSetSig signed message", - // ginkgo.Label(validatorSetSigLabel), - // func() { - // flows.ValidatorSetSig(LocalNetworkInstance) - // }) - // ginkgo.It("Validator churn", - // ginkgo.Label(teleporterMessengerLabel), - // func() { - // flows.ValidatorChurn(LocalNetworkInstance) - // }) + ginkgo.It("Send a message from Subnet A to Subnet B, and one from B to A", + ginkgo.Label(teleporterMessengerLabel), + func() { + flows.BasicSendReceive(LocalNetworkInstance) + }) + ginkgo.It("Deliver to the wrong chain", + ginkgo.Label(teleporterMessengerLabel), + func() { + flows.DeliverToWrongChain(LocalNetworkInstance) + }) + ginkgo.It("Deliver to non-existent contract", + ginkgo.Label(teleporterMessengerLabel), + func() { + flows.DeliverToNonExistentContract(LocalNetworkInstance) + }) + ginkgo.It("Retry successful execution", + ginkgo.Label(teleporterMessengerLabel), + func() { + flows.RetrySuccessfulExecution(LocalNetworkInstance) + }) + ginkgo.It("Unallowed relayer", + ginkgo.Label(teleporterMessengerLabel), + func() { + flows.UnallowedRelayer(LocalNetworkInstance) + }) + ginkgo.It("Relay message twice", + ginkgo.Label(teleporterMessengerLabel), + func() { + flows.RelayMessageTwice(LocalNetworkInstance) + }) + ginkgo.It("Add additional fee amount", + ginkgo.Label(teleporterMessengerLabel), + func() { + flows.AddFeeAmount(LocalNetworkInstance) + }) + ginkgo.It("Send specific receipts", + ginkgo.Label(teleporterMessengerLabel), + func() { + flows.SendSpecificReceipts(LocalNetworkInstance) + }) + ginkgo.It("Insufficient gas", + ginkgo.Label(teleporterMessengerLabel), + func() { + flows.InsufficientGas(LocalNetworkInstance) + }) + ginkgo.It("Resubmit altered message", + ginkgo.Label(teleporterMessengerLabel), + func() { + flows.ResubmitAlteredMessage(LocalNetworkInstance) + }) + ginkgo.It("Check upgrade access", + ginkgo.Label(upgradabilityLabel), + func() { + flows.CheckUpgradeAccess(LocalNetworkInstance) + }) + ginkgo.It("Pause and Unpause Teleporter", + ginkgo.Label(upgradabilityLabel), + func() { + flows.PauseTeleporter(LocalNetworkInstance) + }) + ginkgo.It("Calculate Teleporter message IDs", + ginkgo.Label(utilsLabel), + func() { + flows.CalculateMessageID(LocalNetworkInstance) + }) + + // The following tests require special behavior by the relayer, so we only run them on a local network + ginkgo.It("Relayer modifies message", + ginkgo.Label(teleporterMessengerLabel), + func() { + flows.RelayerModifiesMessage(LocalNetworkInstance) + }) + ginkgo.It("Teleporter registry", + ginkgo.Label(upgradabilityLabel), + func() { + flows.TeleporterRegistry(LocalNetworkInstance) + }) + ginkgo.It("Deliver ValidatorSetSig signed message", + ginkgo.Label(validatorSetSigLabel), + func() { + flows.ValidatorSetSig(LocalNetworkInstance) + }) + ginkgo.It("Validator churn", + ginkgo.Label(teleporterMessengerLabel), + func() { + flows.ValidatorChurn(LocalNetworkInstance) + }) // Since the validator churn test modifies the network topology, we put it last for now. // It should not affect the other tests, but we get some errors if we run it before the other tests. // TODO: we should fix this so that the order of the tests does not matter. From ea47515ef48b1e90fa85a1fce7b59b3d3b49fbf3 Mon Sep 17 00:00:00 2001 From: cam-schultz Date: Thu, 15 Aug 2024 16:29:17 -0400 Subject: [PATCH 17/27] lint --- contracts/staking/StakingMessages.sol | 9 +++++---- tests/flows/native_token_staking.go | 4 ++-- tests/utils/staking_utils.go | 9 +++++---- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/contracts/staking/StakingMessages.sol b/contracts/staking/StakingMessages.sol index 8658af30a..fa65e4dc0 100644 --- a/contracts/staking/StakingMessages.sol +++ b/contracts/staking/StakingMessages.sol @@ -21,7 +21,7 @@ library StakingMessages { // Subnets send a RegisterSubnetValidator message to the P-Chain to register a validator. uint32 internal constant REGISTER_SUBNET_VALIDATOR_MESSAGE_TYPE_ID = 0; - + // Subnets can send a SetSubnetValidatorWeight message to the P-Chain to update a validator's weight. // The P-Chain responds with a SetSubnetValidatorWeight message acknowledging the weight update. uint32 internal constant SET_SUBNET_VALIDATOR_WEIGHT_MESSAGE_TYPE_ID = 1; @@ -29,7 +29,7 @@ library StakingMessages { // The P-Chain responds with a RegisterSubnetValidator message indicating whether the registration was successful // for the given validation ID. uint32 internal constant SUBNET_VALIDATOR_REGISTRATION_MESSAGE_TYPE_ID = 2; - + // The P-Chain responds with a SetSubnetValidatorWeight message indicating whether the weight update was successful // for the given validation ID. uint32 internal constant SET_SUBNET_VALIDATOR_WEIGHT_UPDATE_MESSAGE_TYPE_ID = 3; @@ -70,7 +70,9 @@ library StakingMessages { pure returns (bytes32, bytes memory) { - require(validationInfo.blsPublicKey.length == 48, "StakingMessages: Invalid signature length"); + require( + validationInfo.blsPublicKey.length == 48, "StakingMessages: Invalid signature length" + ); bytes memory res = new bytes(134); // Pack the codec ID for (uint256 i; i < 2; ++i) { @@ -166,7 +168,6 @@ library StakingMessages { expiry |= uint64(uint8(input[i + 126])) << uint64((8 * (7 - i))); } - return ValidationInfo({ subnetID: subnetID, nodeID: nodeID, diff --git a/tests/flows/native_token_staking.go b/tests/flows/native_token_staking.go index 71c6d70d0..17298bd38 100644 --- a/tests/flows/native_token_staking.go +++ b/tests/flows/native_token_staking.go @@ -85,7 +85,7 @@ func NativeTokenStakingManager(network interfaces.LocalNetwork) { Expect(ver).Should(Equal(uint16(warpMessages.CodecVersion))) Expect(registerValidatorPayload.NodeID).Should(Equal(nodeID)) - Expect(registerValidatorPayload.Weight).Should(Equal(uint64(weight))) + Expect(registerValidatorPayload.Weight).Should(Equal(weight)) Expect(registerValidatorPayload.SubnetID).Should(Equal(subnetAInfo.SubnetID)) Expect(registerValidatorPayload.BlsPubKey[:]).Should(Equal(blsPublicKey[:])) @@ -131,7 +131,7 @@ func NativeTokenStakingManager(network interfaces.LocalNetwork) { ) Expect(err).Should(BeNil()) Expect(validatorRemovalEvent.ValidationID[:]).Should(Equal(validationID[:])) - Expect(validatorRemovalEvent.StakeAmount.Uint64()).Should(Equal(uint64(weight))) + Expect(validatorRemovalEvent.StakeAmount.Uint64()).Should(Equal(weight)) // Gather subnet-evm Warp signatures for the SetSubnetValidatorWeightMessage & relay to the P-Chain // (Sending to the P-Chain will be skipped for now) diff --git a/tests/utils/staking_utils.go b/tests/utils/staking_utils.go index 332121304..74979e3ec 100644 --- a/tests/utils/staking_utils.go +++ b/tests/utils/staking_utils.go @@ -3,7 +3,6 @@ package utils import ( "context" "crypto/ecdsa" - "encoding/hex" "math/big" "time" @@ -20,7 +19,6 @@ import ( nativetokenstakingmanager "github.com/ava-labs/teleporter/abi-bindings/go/staking/NativeTokenStakingManager" "github.com/ava-labs/teleporter/tests/interfaces" "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/log" . "github.com/onsi/gomega" ) @@ -202,9 +200,12 @@ func ConstructSubnetValidatorRegistrationMessage( Expect(err).Should(BeNil()) registrationAddressedCall, err := warpPayload.NewAddressedCall(common.Address{}.Bytes(), registrationPayload.Bytes()) Expect(err).Should(BeNil()) - registrationUnsignedMessage, err := avalancheWarp.NewUnsignedMessage(network.GetNetworkID(), pChainInfo.BlockchainID, registrationAddressedCall.Bytes()) + registrationUnsignedMessage, err := avalancheWarp.NewUnsignedMessage( + network.GetNetworkID(), + pChainInfo.BlockchainID, + registrationAddressedCall.Bytes(), + ) Expect(err).Should(BeNil()) - log.Info("Constructed unsigned SubnetValidatorRegistration message", "message", hex.EncodeToString(registrationUnsignedMessage.Bytes())) registrationSignedMessage, err := signatureAggregator.CreateSignedMessage( registrationUnsignedMessage, From 63b38846c16cef7beee35fae88669a124895c7a9 Mon Sep 17 00:00:00 2001 From: cam-schultz Date: Thu, 15 Aug 2024 17:22:38 -0400 Subject: [PATCH 18/27] erc20 staking e2e --- .../ERC20TokenStakingManager.go | 20 +- .../staking/ERC20TokenStakingManager.sol | 4 +- tests/flows/erc20_token_staking.go | 183 +++++++++++++++++ tests/flows/native_token_staking.go | 6 +- tests/local/e2e_test.go | 15 +- tests/utils/chain_utils.go | 5 +- tests/utils/staking_utils.go | 192 +++++++++++++++++- 7 files changed, 400 insertions(+), 25 deletions(-) create mode 100644 tests/flows/erc20_token_staking.go diff --git a/abi-bindings/go/staking/ERC20TokenStakingManager/ERC20TokenStakingManager.go b/abi-bindings/go/staking/ERC20TokenStakingManager/ERC20TokenStakingManager.go index 5a1485209..ee3bb754e 100644 --- a/abi-bindings/go/staking/ERC20TokenStakingManager/ERC20TokenStakingManager.go +++ b/abi-bindings/go/staking/ERC20TokenStakingManager/ERC20TokenStakingManager.go @@ -42,7 +42,7 @@ type StakingManagerSettings struct { // ERC20TokenStakingManagerMetaData contains all meta data concerning the ERC20TokenStakingManager contract. var ERC20TokenStakingManagerMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"init\",\"type\":\"uint8\",\"internalType\":\"enumICMInitializable\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"WARP_MESSENGER\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIWarpMessenger\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"completeEndValidation\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"setWeightMessageType\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"completeValidatorRegistration\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"settings\",\"type\":\"tuple\",\"internalType\":\"structStakingManagerSettings\",\"components\":[{\"name\":\"pChainBlockchainID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"subnetID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"minimumStakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"maximumStakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"minimumStakeDuration\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"maximumHourlyChurn\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"rewardCalculator\",\"type\":\"address\",\"internalType\":\"contractIRewardCalculator\"}]},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeEndValidation\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"includeUptimeProof\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeValidatorRegistration\",\"inputs\":[{\"name\":\"stakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"nodeID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"resendEndValidatorMessage\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"resendRegisterValidatorMessage\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"valueToWeight\",\"inputs\":[{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"weightToValue\",\"inputs\":[{\"name\":\"weight\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"pure\"},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodCreated\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"nodeID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"registerValidationMessageID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"weight\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodEnded\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodRegistered\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"stakeAmount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"timestamp\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidatorRemovalInitialized\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"setWeightMessageID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"stakeAmount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"endTime\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"uptime\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ReentrancyGuardReentrantCall\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"SafeERC20FailedOperation\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}]}]", + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"init\",\"type\":\"uint8\",\"internalType\":\"enumICMInitializable\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"WARP_MESSENGER\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIWarpMessenger\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"completeEndValidation\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"setWeightMessageType\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"completeValidatorRegistration\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"settings\",\"type\":\"tuple\",\"internalType\":\"structStakingManagerSettings\",\"components\":[{\"name\":\"pChainBlockchainID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"subnetID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"minimumStakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"maximumStakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"minimumStakeDuration\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"maximumHourlyChurn\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"rewardCalculator\",\"type\":\"address\",\"internalType\":\"contractIRewardCalculator\"}]},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeEndValidation\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"includeUptimeProof\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeValidatorRegistration\",\"inputs\":[{\"name\":\"stakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"nodeID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"blsPublicKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"resendEndValidatorMessage\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"resendRegisterValidatorMessage\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"valueToWeight\",\"inputs\":[{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"weightToValue\",\"inputs\":[{\"name\":\"weight\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"pure\"},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodCreated\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"nodeID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"registerValidationMessageID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"weight\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodEnded\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodRegistered\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"stakeAmount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"timestamp\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidatorRemovalInitialized\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"setWeightMessageID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"stakeAmount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"endTime\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"uptime\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ReentrancyGuardReentrantCall\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"SafeERC20FailedOperation\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}]}]", Bin: "0x608060405234801561000f575f80fd5b506040516134a93803806134a983398101604081905261002e91610107565b60018160018111156100425761004261012c565b0361004f5761004f610055565b50610140565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156100a55760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146101045780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b5f60208284031215610117575f80fd5b815160028110610125575f80fd5b9392505050565b634e487b7160e01b5f52602160045260245ffd5b61335c8061014d5f395ff3fe608060405234801561000f575f80fd5b506004361061009b575f3560e01c8063872fda6411610063578063872fda641461012b578063a3a65e481461013e578063b771b3bc14610151578063bee0a03f14610177578063fdf94a1a1461018a575f80fd5b80630322ed981461009f5780632e2194d8146100b45780635d0d7466146100e457806362065856146100f757806376f7862114610118575b5f80fd5b6100b26100ad366004612a12565b61019d565b005b6100c76100c2366004612a12565b610393565b6040516001600160401b0390911681526020015b60405180910390f35b6100b26100f2366004612a3d565b6103a9565b61010a610105366004612a95565b6104b7565b6040519081526020016100db565b6100b2610126366004612ad5565b6104d0565b61010a610139366004612ba2565b610a50565b6100b261014c366004612c3e565b610a68565b61015f6005600160991b0181565b6040516001600160a01b0390911681526020016100db565b6100b2610185366004612a12565b610cf5565b6100b2610198366004612c57565b610e09565b5f8181527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab60860205260408082208151610120810190925280545f8051602061333083398151915293929190829060ff1660058111156101fe576101fe612c81565b600581111561020f5761020f612c81565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003928301546001600160a01b03811660c084015260ff600160a01b820416151560e0840152600160a81b90041661010090910152909150815160058111156102a6576102a6612c81565b1461030e5760405162461bcd60e51b815260206004820152602d60248201527f5374616b696e674d616e616765723a2056616c696461746f72206e6f7420706560448201526c1b991a5b99c81c995b5bdd985b609a1b60648201526084015b60405180910390fd5b5f61031f848361010001515f611230565b60405163ee5b48eb60e01b81529091506005600160991b019063ee5b48eb9061034c908490600401612cb7565b6020604051808303815f875af1158015610368573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061038c9190612ce9565b5050505050565b5f6103a364e8d4a5100083612d28565b92915050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff1615906001600160401b03165f811580156103ed5750825b90505f826001600160401b031660011480156104085750303b155b905081158015610416575080155b156104345760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561045e57845460ff60401b1916600160401b1785555b610468878761144d565b83156104ae57845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50505050505050565b5f6103a36001600160401b03831664e8d4a51000612d3b565b5f8381527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab60860205260408082208151610120810190925280545f8051602061333083398151915293929190829060ff16600581111561053157610531612c81565b600581111561054257610542612c81565b8152600182015460208201526002808301546001600160401b038082166040850152600160401b820481166060850152600160801b820481166080850152600160c01b909104811660a08401526003909301546001600160a01b03811660c084015260ff600160a01b820416151560e0840152600160a81b900490921661010090910152909150815160058111156105dc576105dc612c81565b146106355760405162461bcd60e51b8152602060048201526024808201527f5374616b696e674d616e616765723a2056616c696461746f72206e6f742061636044820152637469766560e01b6064820152608401610305565b60c08101516001600160a01b0316336001600160a01b03161461066a5760405162461bcd60e51b815260040161030590612d52565b610677816040015161146b565b60038152426001600160401b031660808201525f8415610850576040516306f8253560e41b815263ffffffff851660048201525f9081906005600160991b0190636f825350906024015f60405180830381865afa1580156106da573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f191682016040526107019190810190612da7565b91509150806107225760405162461bcd60e51b815260040161030590612e79565b6005600160991b016001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa158015610765573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107899190612ce9565b8251146107a85760405162461bcd60e51b815260040161030590612ebd565b60208201516001600160a01b0316156107d35760405162461bcd60e51b815260040161030590612f04565b5f806107e28460400151611618565b91509150818a1461084a5760405162461bcd60e51b815260206004820152602c60248201527f5374616b696e674d616e616765723a20496e76616c696420757074696d65207660448201526b185b1a59185d1a5bdb88125160a21b6064820152608401610305565b93505050505b6001600160401b03811660a08301525f86815260088401602052604090208251815484929190829060ff1916600183600581111561089057610890612c81565b02179055506020820151600182015560408201516002820180546060850151608086015160a08701516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c08301516003909201805460e0850151610100958601516001600160a01b039095166001600160a81b031990921691909117600160a01b911515919091021767ffffffffffffffff60a81b1916600160a81b93909216929092021790558201515f9061098190889083611230565b60405163ee5b48eb60e01b81529091505f906005600160991b019063ee5b48eb906109b0908590600401612cb7565b6020604051808303815f875af11580156109cc573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109f09190612ce9565b60408581015181516001600160401b03918216815242602082015290861681830152905191925082918a917f530b908725650fb1052974f9df59e834fefac78c9ec2f00c6d2464d60cc6add5919081900360600190a35050505050505050565b5f610a5d848685856117f0565b90505b949350505050565b5f5f805160206133308339815191526040516306f8253560e41b815263ffffffff841660048201529091505f9081906005600160991b0190636f825350906024015f60405180830381865afa158015610ac3573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052610aea9190810190612da7565b9150915080610b0b5760405162461bcd60e51b815260040161030590612e79565b8254825114610b2c5760405162461bcd60e51b815260040161030590612ebd565b60208201516001600160a01b031615610b575760405162461bcd60e51b815260040161030590612f04565b5f80610b668460400151611d00565b9150915080610bc65760405162461bcd60e51b815260206004820152602660248201527f5374616b696e674d616e616765723a20526567697374726174696f6e206e6f74604482015265081d985b1a5960d21b6064820152608401610305565b5f82815260078601602052604081208054610be090612f51565b9050118015610c12575060015f83815260088701602052604090205460ff166005811115610c1057610c10612c81565b145b610c2e5760405162461bcd60e51b815260040161030590612f89565b5f8281526007860160205260408120610c46916129c8565b5f8281526008860160208181526040808420805460ff191660029081178255810180546001600160401b0342818116600160401b026fffffffffffffffff000000000000000019909316929092178355600190930154875260098c0185528387208990559588905293835292548151931683529082019290925283917ff8fd1c90fb9cfa2ca2358fdf5806b086ad43315d92b221c929efc7f105ce7568910160405180910390a2505050505050565b5f8181527fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6076020526040812080545f80516020613330833981519152929190610d3d90612f51565b9050118015610d6f575060015f83815260088301602052604090205460ff166005811115610d6d57610d6d612c81565b145b610d8b5760405162461bcd60e51b815260040161030590612f89565b5f82815260078201602052604090819020905163ee5b48eb60e01b81526005600160991b019163ee5b48eb91610dc49190600401612fce565b6020604051808303815f875af1158015610de0573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e049190612ce9565b505050565b5f5f805160206133308339815191526040516306f8253560e41b815263ffffffff851660048201529091505f9081906005600160991b0190636f825350906024015f60405180830381865afa158015610e64573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052610e8b9190810190612da7565b9150915080610eac5760405162461bcd60e51b815260040161030590612e79565b5f8415610f25575f610ec18460400151611ea1565b919350909150506001600160401b03811615610f1f5760405162461bcd60e51b815260206004820181905260248201527f5374616b696e674d616e616765723a20576569676874206d75737420626520306044820152606401610305565b50610f99565b5f610f338460400151611d00565b90925090508015610f975760405162461bcd60e51b815260206004820152602860248201527f5374616b696e674d616e616765723a20526567697374726174696f6e207374696044820152671b1b081d985b1a5960c21b6064820152608401610305565b505b5f818152600885016020526040808220815161012081019092528054829060ff166005811115610fcb57610fcb612c81565b6005811115610fdc57610fdc612c81565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003909201546001600160a01b0380821660c080850191909152600160a01b830460ff16151560e0850152600160a81b9092049093166101009092019190915282015191925016331461108d5760405162461bcd60e51b815260040161030590612d52565b5f6003825160058111156110a3576110a3612c81565b14806110c157506002825160058111156110bf576110bf612c81565b145b156110e457506020808201515f90815260098701909152604081205560046110e8565b5060055b5f83815260088701602052604090208251815484929190829060ff1916600183600581111561111957611119612c81565b0217905550602082015160018201556040808301516002830180546060860151608087015160a08801516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c08401516003909301805460e0860151610100909601516001600160a01b039095166001600160a81b031990911617600160a01b951515959095029490941767ffffffffffffffff60a81b1916600160a81b9390911692909202919091179091555183907f3532ad18e70a039beb4663d48c15acbef558c96ec9b8fd0cc3c0304f774740b8905f90a25050505050505050565b60408051603680825260608281019093525f91906020820181803683370190505090505f5b60028110156112a957611269816001613058565b611274906008612d3b565b5081515f9083908390811061128b5761128b61306b565b60200101906001600160f81b03191690815f1a905350600101611255565b505f5b600481101561130c576112c0816003613058565b6112cb906008612d3b565b6001901c60f81b826112de83600261307f565b815181106112ee576112ee61306b565b60200101906001600160f81b03191690815f1a9053506001016112ac565b505f5b602081101561136e5761132381601f613058565b61132e906008612d3b565b86901c60f81b8261134083600661307f565b815181106113505761135061306b565b60200101906001600160f81b03191690815f1a90535060010161130f565b505f5b60088110156113d957611385816007613058565b611390906008612d3b565b6001600160401b038616901c60f81b826113ab83602661307f565b815181106113bb576113bb61306b565b60200101906001600160f81b03191690815f1a905350600101611371565b505f5b6008811015611444576113f0816007613058565b6113fb906008612d3b565b6001600160401b038516901c60f81b8261141683602e61307f565b815181106114265761142661306b565b60200101906001600160f81b03191690815f1a9053506001016113dc565b50949350505050565b6114556120dc565b61145e82612127565b6114678161214b565b5050565b7fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab604545f8051602061333083398151915290600160e01b900460ff165f036114b0575050565b60408051606081018252600583015480825260068401546001600160401b038082166020850152600160401b9091041692820192909252904290610e10906114f89083613058565b10611514576001600160401b0384166040830152808252611533565b83826040018181516115269190613092565b6001600160401b03169052505b5f82602001518360400151606461154a91906130b9565b61155491906130e4565b600485015490915060ff600160e01b909104811690821611156115d45760405162461bcd60e51b815260206004820152603260248201527f5374616b696e674d616e616765723a204d6178696d756d20686f75726c7920636044820152711a1d5c9b881c985d1948195e18d95959195960721b6064820152608401610305565b5050805160058301556020810151600690920180546040909201516001600160401b03908116600160401b026001600160801b031990931693169290921717905550565b5f808251602e1461163b5760405162461bcd60e51b815260040161030590613109565b5f805b600281101561168a57611652816001613058565b61165d906008612d3b565b61ffff168582815181106116735761167361306b565b016020015160f81c901b919091179060010161163e565b5061ffff8116156116ad5760405162461bcd60e51b815260040161030590613150565b5f805b6004811015611708576116c4816003613058565b6116cf906008612d3b565b63ffffffff16866116e183600261307f565b815181106116f1576116f161306b565b016020015160f81c901b91909117906001016116b0565b5063ffffffff811660041461172f5760405162461bcd60e51b815260040161030590613191565b5f805b60208110156117845761174681601f613058565b611751906008612d3b565b8761175d83600661307f565b8151811061176d5761176d61306b565b016020015160f81c901b9190911790600101611732565b505f805b60088110156117e35761179c816007613058565b6117a7906008612d3b565b6001600160401b0316886117bc83602661307f565b815181106117cc576117cc61306b565b016020015160f81c901b9190911790600101611788565b5090969095509350505050565b5f6117f96121ff565b5f80516020613330833981519152426001600160401b03851611801561183357506001600160401b038416611831426202a30061307f565b115b6118935760405162461bcd60e51b815260206004820152602b60248201527f5374616b696e674d616e616765723a20496e76616c696420726567697374726160448201526a74696f6e2065787069727960a81b6064820152608401610305565b856118e05760405162461bcd60e51b815260206004820152601f60248201527f5374616b696e674d616e616765723a20496e76616c6964206e6f6465204944006044820152606401610305565b5f8681526009820160205260409020541561194c5760405162461bcd60e51b815260206004820152602660248201527f5374616b696e674d616e616765723a204e6f646520494420616c72656164792060448201526561637469766560d01b6064820152608401610305565b82516030146119b15760405162461bcd60e51b815260206004820152602b60248201527f5374616b696e674d616e616765723a20496e76616c696420626c735075626c6960448201526a0c696caf240d8cadccee8d60ab1b6064820152608401610305565b5f6119bb86612249565b90505f6119c782610393565b90506119d28161146b565b8260020154816001600160401b0316101580156119fc57508260030154816001600160401b031611155b611a545760405162461bcd60e51b8152602060048201526024808201527f5374616b696e674d616e616765723a20496e76616c6964207374616b6520616d6044820152631bdd5b9d60e21b6064820152608401610305565b5f80611a9b6040518060a00160405280876001015481526020018c8152602001856001600160401b031681526020018a6001600160401b031681526020018981525061227f565b5f82815260078801602052604090209193509150611ab9828261321a565b5060405163ee5b48eb60e01b81525f906005600160991b019063ee5b48eb90611ae6908590600401612cb7565b6020604051808303815f875af1158015611b02573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611b269190612ce9565b6040805161012081019091529091508060018152602081018d90526001600160401b03861660408201525f606082018190526080820181905260a082015260c001336001600160a01b031681525f6020808301829052604092830182905286825260088a0190522081518154829060ff19166001836005811115611bac57611bac612c81565b021790555060208281015160018301556040808401516002840180546060870151608088015160a08901516001600160401b03908116600160c01b026001600160c01b03928216600160801b02929092166001600160801b03938216600160401b026001600160801b03199095169682169690961793909317919091169390931792909217905560c08501516003909401805460e0870151610100909701518316600160a81b0267ffffffffffffffff60a81b19971515600160a01b026001600160a81b03199092166001600160a01b039097169690961717959095169390931790935582518783168152918c169082015282918d9186917f79b81620b81daf2c08cd5bb3dbb79e75d2d7a87f52171fde5aadc8c47823026e910160405180910390a45090945050505050610a6060017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b5f808251602714611d235760405162461bcd60e51b815260040161030590613109565b5f805b6002811015611d7257611d3a816001613058565b611d45906008612d3b565b61ffff16858281518110611d5b57611d5b61306b565b016020015160f81c901b9190911790600101611d26565b5061ffff811615611d955760405162461bcd60e51b815260040161030590613150565b5f805b6004811015611df057611dac816003613058565b611db7906008612d3b565b63ffffffff1686611dc983600261307f565b81518110611dd957611dd961306b565b016020015160f81c901b9190911790600101611d98565b5063ffffffff8116600214611e175760405162461bcd60e51b815260040161030590613191565b5f805b6020811015611e6c57611e2e81601f613058565b611e39906008612d3b565b87611e4583600661307f565b81518110611e5557611e5561306b565b016020015160f81c901b9190911790600101611e1a565b505f86602681518110611e8157611e8161306b565b016020015191976001600160f81b03199092161515965090945050505050565b5f805f8351603614611ec55760405162461bcd60e51b815260040161030590613109565b5f805b6002811015611f1457611edc816001613058565b611ee7906008612d3b565b61ffff16868281518110611efd57611efd61306b565b016020015160f81c901b9190911790600101611ec8565b5061ffff811615611f375760405162461bcd60e51b815260040161030590613150565b5f805b6004811015611f9257611f4e816003613058565b611f59906008612d3b565b63ffffffff1687611f6b83600261307f565b81518110611f7b57611f7b61306b565b016020015160f81c901b9190911790600101611f3a565b5063ffffffff8116600114611fb95760405162461bcd60e51b815260040161030590613191565b5f805b602081101561200e57611fd081601f613058565b611fdb906008612d3b565b88611fe783600661307f565b81518110611ff757611ff761306b565b016020015160f81c901b9190911790600101611fbc565b505f805b600881101561206d57612026816007613058565b612031906008612d3b565b6001600160401b03168961204683602661307f565b815181106120565761205661306b565b016020015160f81c901b9190911790600101612012565b505f805b60088110156120cc57612085816007613058565b612090906008612d3b565b6001600160401b03168a6120a583602e61307f565b815181106120b5576120b561306b565b016020015160f81c901b9190911790600101612071565b5091989097509095509350505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff1661212557604051631afcd79f60e31b815260040160405180910390fd5b565b61212f6120dc565b61213761264a565b61213f61265a565b61214881612662565b50565b6121536120dc565b7f8568826440873e37a96cb0aab773b28d8154d963d2f0e41bd9b5c15f63625f916001600160a01b0382166121df5760405162461bcd60e51b815260206004820152602c60248201527f4552433230546f6b656e5374616b696e674d616e616765723a207a65726f207460448201526b6f6b656e206164647265737360a01b6064820152608401610305565b80546001600160a01b0319166001600160a01b0392909216919091179055565b7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0080546001190161224357604051633ee5aeb560e01b815260040160405180910390fd5b60029055565b5f6103a3827f8568826440873e37a96cb0aab773b28d8154d963d2f0e41bd9b5c15f63625f91546001600160a01b031690612792565b5f60608260800151516030146122e95760405162461bcd60e51b815260206004820152602960248201527f5374616b696e674d657373616765733a20496e76616c6964207369676e6174756044820152680e4ca40d8cadccee8d60bb1b6064820152608401610305565b60408051608680825260c082019092525f916020820181803683370190505090505f5b600281101561236057612320816001613058565b61232b906008612d3b565b5081515f908390839081106123425761234261306b565b60200101906001600160f81b03191690815f1a90535060010161230c565b505f5b60048110156123be57612377816003613058565b612382906008612d3b565b505f8261239083600261307f565b815181106123a0576123a061306b565b60200101906001600160f81b03191690815f1a905350600101612363565b505f5b602081101561241b57845181602081106123dd576123dd61306b565b1a60f81b826123ed83600661307f565b815181106123fd576123fd61306b565b60200101906001600160f81b03191690815f1a9053506001016123c1565b505f5b602081101561247b578460200151816020811061243d5761243d61306b565b1a60f81b8261244d83602661307f565b8151811061245d5761245d61306b565b60200101906001600160f81b03191690815f1a90535060010161241e565b505f5b60088110156124ef57612492816007613058565b61249d906008612d3b565b60ff1685604001516001600160401b0316901c60f81b828260466124c1919061307f565b815181106124d1576124d161306b565b60200101906001600160f81b03191690815f1a90535060010161247e565b505f5b603081101561255a57846080015181815181106125115761251161306b565b01602001516001600160f81b0319168261252c83604e61307f565b8151811061253c5761253c61306b565b60200101906001600160f81b03191690815f1a9053506001016124f2565b505f5b60088110156125cc57612571816007613058565b61257c906008612d3b565b60608601516001600160401b0390811691161c60f81b8261259e83607e61307f565b815181106125ae576125ae61306b565b60200101906001600160f81b03191690815f1a90535060010161255d565b506002816040516125dd91906132d9565b602060405180830381855afa1580156125f8573d5f803e3d5ffd5b5050506040513d601f19601f8201168201806040525081019061261b9190612ce9565b94909350915050565b60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b6126526120dc565b6121256128f4565b6121256120dc565b61266a6120dc565b80355f8051602061333083398151915290815560208201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6015560408201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6025560608201357fafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab6035561270260a0830160808401612a95565b60048201805467ffffffffffffffff19166001600160401b039290921691909117905561273560c0830160a084016132f4565b60048201805460ff92909216600160e01b0260ff60e01b1990921691909117905561276660e0830160c08401613314565b8160040160086101000a8154816001600160a01b0302191690836001600160a01b031602179055505050565b6040516370a0823160e01b81523060048201525f9081906001600160a01b038516906370a0823190602401602060405180830381865afa1580156127d8573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906127fc9190612ce9565b90506128136001600160a01b0385163330866128fc565b6040516370a0823160e01b81523060048201525f906001600160a01b038616906370a0823190602401602060405180830381865afa158015612857573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061287b9190612ce9565b90508181116128e15760405162461bcd60e51b815260206004820152602c60248201527f5361666545524332305472616e7366657246726f6d3a2062616c616e6365206e60448201526b1bdd081a5b98dc99585cd95960a21b6064820152608401610305565b6128eb8282613058565b95945050505050565b6126246120dc565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b17905261295690859061295c565b50505050565b5f8060205f8451602086015f885af18061297b576040513d5f823e3d81fd5b50505f513d9150811561299257806001141561299f565b6001600160a01b0384163b155b1561295657604051635274afe760e01b81526001600160a01b0385166004820152602401610305565b5080546129d490612f51565b5f825580601f106129e3575050565b601f0160209004905f5260205f209081019061214891905b80821115612a0e575f81556001016129fb565b5090565b5f60208284031215612a22575f80fd5b5035919050565b6001600160a01b0381168114612148575f80fd5b5f80828403610100811215612a50575f80fd5b60e0811215612a5d575f80fd5b5082915060e0830135612a6f81612a29565b809150509250929050565b80356001600160401b0381168114612a90575f80fd5b919050565b5f60208284031215612aa5575f80fd5b612aae82612a7a565b9392505050565b8015158114612148575f80fd5b803563ffffffff81168114612a90575f80fd5b5f805f60608486031215612ae7575f80fd5b833592506020840135612af981612ab5565b9150612b0760408501612ac2565b90509250925092565b634e487b7160e01b5f52604160045260245ffd5b604051606081016001600160401b0381118282101715612b4657612b46612b10565b60405290565b604051601f8201601f191681016001600160401b0381118282101715612b7457612b74612b10565b604052919050565b5f6001600160401b03821115612b9457612b94612b10565b50601f01601f191660200190565b5f805f8060808587031215612bb5575f80fd5b8435935060208501359250612bcc60408601612a7a565b915060608501356001600160401b03811115612be6575f80fd5b8501601f81018713612bf6575f80fd5b8035612c09612c0482612b7c565b612b4c565b818152886020838501011115612c1d575f80fd5b816020840160208301375f6020838301015280935050505092959194509250565b5f60208284031215612c4e575f80fd5b612aae82612ac2565b5f8060408385031215612c68575f80fd5b612c7183612ac2565b91506020830135612a6f81612ab5565b634e487b7160e01b5f52602160045260245ffd5b5f5b83811015612caf578181015183820152602001612c97565b50505f910152565b602081525f8251806020840152612cd5816040850160208701612c95565b601f01601f19169190910160400192915050565b5f60208284031215612cf9575f80fd5b5051919050565b634e487b7160e01b5f52601260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b5f82612d3657612d36612d00565b500490565b80820281158282048414176103a3576103a3612d14565b6020808252602a908201527f5374616b696e674d616e616765723a2053656e646572206e6f742076616c696460408201526930ba37b91037bbb732b960b11b606082015260800190565b8051612a9081612ab5565b5f8060408385031215612db8575f80fd5b82516001600160401b0380821115612dce575f80fd5b9084019060608287031215612de1575f80fd5b612de9612b24565b82518152602080840151612dfc81612a29565b82820152604084015183811115612e11575f80fd5b80850194505087601f850112612e25575f80fd5b83519250612e35612c0484612b7c565b8381528882858701011115612e48575f80fd5b612e5784838301848801612c95565b80604084015250819550612e6c818801612d9c565b9450505050509250929050565b60208082526024908201527f5374616b696e674d616e616765723a20496e76616c69642077617270206d65736040820152637361676560e01b606082015260800190565b60208082526027908201527f5374616b696e674d616e616765723a20496e76616c696420736f7572636520636040820152661a185a5b88125160ca1b606082015260800190565b6020808252602d908201527f5374616b696e674d616e616765723a20496e76616c6964206f726967696e207360408201526c656e646572206164647265737360981b606082015260800190565b600181811c90821680612f6557607f821691505b602082108103612f8357634e487b7160e01b5f52602260045260245ffd5b50919050565b60208082526025908201527f5374616b696e674d616e616765723a20496e76616c69642076616c69646174696040820152641bdb88125160da1b606082015260800190565b5f60208083525f8454612fe081612f51565b806020870152604060018084165f8114613001576001811461301d5761304a565b60ff19851660408a0152604084151560051b8a0101955061304a565b895f5260205f205f5b858110156130415781548b8201860152908301908801613026565b8a016040019650505b509398975050505050505050565b818103818111156103a3576103a3612d14565b634e487b7160e01b5f52603260045260245ffd5b808201808211156103a3576103a3612d14565b6001600160401b038181168382160190808211156130b2576130b2612d14565b5092915050565b6001600160401b038181168382160280821691908281146130dc576130dc612d14565b505092915050565b5f6001600160401b03808416806130fd576130fd612d00565b92169190910492915050565b60208082526027908201527f5374616b696e674d657373616765733a20496e76616c6964206d657373616765604082015266040d8cadccee8d60cb1b606082015260800190565b60208082526021908201527f5374616b696e674d657373616765733a20496e76616c696420636f64656320496040820152601160fa1b606082015260800190565b60208082526025908201527f5374616b696e674d657373616765733a20496e76616c6964206d657373616765604082015264207479706560d81b606082015260800190565b601f821115610e0457805f5260205f20601f840160051c810160208510156131fb5750805b601f840160051c820191505b8181101561038c575f8155600101613207565b81516001600160401b0381111561323357613233612b10565b613247816132418454612f51565b846131d6565b602080601f83116001811461327a575f84156132635750858301515b5f19600386901b1c1916600185901b1785556132d1565b5f85815260208120601f198616915b828110156132a857888601518255948401946001909101908401613289565b50858210156132c557878501515f19600388901b60f8161c191681555b505060018460011b0185555b505050505050565b5f82516132ea818460208701612c95565b9190910192915050565b5f60208284031215613304575f80fd5b813560ff81168114612aae575f80fd5b5f60208284031215613324575f80fd5b8135612aae81612a2956feafe6c4731b852fc2be89a0896ae43d22d8b24989064d841b2a1586b4d39ab600a164736f6c6343000819000a", } @@ -392,23 +392,23 @@ func (_ERC20TokenStakingManager *ERC20TokenStakingManagerTransactorSession) Init // InitializeValidatorRegistration is a paid mutator transaction binding the contract method 0x872fda64. // -// Solidity: function initializeValidatorRegistration(uint256 stakeAmount, bytes32 nodeID, uint64 registrationExpiry, bytes signature) returns(bytes32 validationID) -func (_ERC20TokenStakingManager *ERC20TokenStakingManagerTransactor) InitializeValidatorRegistration(opts *bind.TransactOpts, stakeAmount *big.Int, nodeID [32]byte, registrationExpiry uint64, signature []byte) (*types.Transaction, error) { - return _ERC20TokenStakingManager.contract.Transact(opts, "initializeValidatorRegistration", stakeAmount, nodeID, registrationExpiry, signature) +// Solidity: function initializeValidatorRegistration(uint256 stakeAmount, bytes32 nodeID, uint64 registrationExpiry, bytes blsPublicKey) returns(bytes32 validationID) +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerTransactor) InitializeValidatorRegistration(opts *bind.TransactOpts, stakeAmount *big.Int, nodeID [32]byte, registrationExpiry uint64, blsPublicKey []byte) (*types.Transaction, error) { + return _ERC20TokenStakingManager.contract.Transact(opts, "initializeValidatorRegistration", stakeAmount, nodeID, registrationExpiry, blsPublicKey) } // InitializeValidatorRegistration is a paid mutator transaction binding the contract method 0x872fda64. // -// Solidity: function initializeValidatorRegistration(uint256 stakeAmount, bytes32 nodeID, uint64 registrationExpiry, bytes signature) returns(bytes32 validationID) -func (_ERC20TokenStakingManager *ERC20TokenStakingManagerSession) InitializeValidatorRegistration(stakeAmount *big.Int, nodeID [32]byte, registrationExpiry uint64, signature []byte) (*types.Transaction, error) { - return _ERC20TokenStakingManager.Contract.InitializeValidatorRegistration(&_ERC20TokenStakingManager.TransactOpts, stakeAmount, nodeID, registrationExpiry, signature) +// Solidity: function initializeValidatorRegistration(uint256 stakeAmount, bytes32 nodeID, uint64 registrationExpiry, bytes blsPublicKey) returns(bytes32 validationID) +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerSession) InitializeValidatorRegistration(stakeAmount *big.Int, nodeID [32]byte, registrationExpiry uint64, blsPublicKey []byte) (*types.Transaction, error) { + return _ERC20TokenStakingManager.Contract.InitializeValidatorRegistration(&_ERC20TokenStakingManager.TransactOpts, stakeAmount, nodeID, registrationExpiry, blsPublicKey) } // InitializeValidatorRegistration is a paid mutator transaction binding the contract method 0x872fda64. // -// Solidity: function initializeValidatorRegistration(uint256 stakeAmount, bytes32 nodeID, uint64 registrationExpiry, bytes signature) returns(bytes32 validationID) -func (_ERC20TokenStakingManager *ERC20TokenStakingManagerTransactorSession) InitializeValidatorRegistration(stakeAmount *big.Int, nodeID [32]byte, registrationExpiry uint64, signature []byte) (*types.Transaction, error) { - return _ERC20TokenStakingManager.Contract.InitializeValidatorRegistration(&_ERC20TokenStakingManager.TransactOpts, stakeAmount, nodeID, registrationExpiry, signature) +// Solidity: function initializeValidatorRegistration(uint256 stakeAmount, bytes32 nodeID, uint64 registrationExpiry, bytes blsPublicKey) returns(bytes32 validationID) +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerTransactorSession) InitializeValidatorRegistration(stakeAmount *big.Int, nodeID [32]byte, registrationExpiry uint64, blsPublicKey []byte) (*types.Transaction, error) { + return _ERC20TokenStakingManager.Contract.InitializeValidatorRegistration(&_ERC20TokenStakingManager.TransactOpts, stakeAmount, nodeID, registrationExpiry, blsPublicKey) } // ResendEndValidatorMessage is a paid mutator transaction binding the contract method 0x0322ed98. diff --git a/contracts/staking/ERC20TokenStakingManager.sol b/contracts/staking/ERC20TokenStakingManager.sol index 9fe936db6..58517e113 100644 --- a/contracts/staking/ERC20TokenStakingManager.sol +++ b/contracts/staking/ERC20TokenStakingManager.sol @@ -76,9 +76,9 @@ contract ERC20TokenStakingManager is Initializable, StakingManager, IERC20TokenS uint256 stakeAmount, bytes32 nodeID, uint64 registrationExpiry, - bytes memory signature + bytes memory blsPublicKey ) external override returns (bytes32 validationID) { - return _initializeValidatorRegistration(nodeID, stakeAmount, registrationExpiry, signature); + return _initializeValidatorRegistration(nodeID, stakeAmount, registrationExpiry, blsPublicKey); } // Must be guarded with reentrancy guard for safe transfer from diff --git a/tests/flows/erc20_token_staking.go b/tests/flows/erc20_token_staking.go new file mode 100644 index 000000000..0ba94ea47 --- /dev/null +++ b/tests/flows/erc20_token_staking.go @@ -0,0 +1,183 @@ +package flows + +import ( + "context" + + "github.com/ava-labs/avalanchego/ids" + "github.com/ava-labs/avalanchego/utils/crypto/bls" + warpMessages "github.com/ava-labs/avalanchego/vms/platformvm/warp/messages" + warpPayload "github.com/ava-labs/avalanchego/vms/platformvm/warp/payload" + "github.com/ava-labs/subnet-evm/core/types" + "github.com/ava-labs/teleporter/tests/interfaces" + "github.com/ava-labs/teleporter/tests/utils" + . "github.com/onsi/gomega" +) + +// Registers a erc20 token staking validator on a subnet. The steps are as follows: +// - Deploy the ERCTokenStakingManager +// - Initiate validator registration +// - Deliver the Warp message to the P-Chain (not implemented) +// - Aggregate P-Chain signatures on the response Warp message +// - Deliver the Warp message to the subnet +// - Verify that the validator is registered in the staking contract +// Delists the validator from the subnet. The steps are as follows: +// - Initiate validator delisting +// - Deliver the Warp message to the P-Chain (not implemented) +// - Aggregate P-Chain signatures on the response Warp message +// - Deliver the Warp message to the subnet +// - Verify that the validator is delisted from the staking contract +func ERC20TokenStakingManager(network interfaces.LocalNetwork) { + // Get the subnets info + cChainInfo := network.GetPrimaryNetworkInfo() + subnetAInfo, _ := utils.GetTwoSubnets(network) + _, fundedKey := network.GetFundedAccountInfo() + pChainInfo := utils.GetPChainInfo(cChainInfo) + + signatureAggregator := utils.NewSignatureAggregator( + cChainInfo.NodeURIs[0], + []ids.ID{ + subnetAInfo.SubnetID, + ids.Empty, // Primary network subnet ID + }, + ) + + // Deploy the staking manager contract + stakingManagerAddress, stakingManager, _, erc20 := utils.DeployAndInitializeERC20TokenStakingManager( + context.Background(), + fundedKey, + subnetAInfo, + pChainInfo, + ) + + // + // Register a validator + // + var validationID ids.ID // To be used in the delisting step + stakeAmount := uint64(1e18) + weight := uint64(1e6) // stakeAmount / 1e12 + { + // Iniatiate validator registration + nodeID := ids.GenerateTestID() + blsPublicKey := [bls.PublicKeyLen]byte{} + var receipt *types.Receipt + receipt, validationID = utils.CallERC20InitializeValidatorRegistration( + fundedKey, + subnetAInfo, + stakeAmount, + erc20, + stakingManagerAddress, + nodeID, + blsPublicKey, + stakingManager, + ) + + // Gather subnet-evm Warp signatures for the RegisterSubnetValidatorMessage & relay to the P-Chain + // (Sending to the P-Chain will be skipped for now) + signedWarpMessage := network.ConstructSignedWarpMessage(context.Background(), receipt, subnetAInfo, pChainInfo) + + // Validate the Warp message, (this will be done on the P-Chain in the future) + msg, err := warpPayload.ParseAddressedCall(signedWarpMessage.UnsignedMessage.Payload) + Expect(err).Should(BeNil()) + // Check that the addressed call payload is a registered Warp message type + var payloadInterface warpMessages.Payload + ver, err := warpMessages.Codec.Unmarshal(msg.Payload, &payloadInterface) + Expect(err).Should(BeNil()) + registerValidatorPayload, ok := payloadInterface.(*warpMessages.RegisterSubnetValidator) + Expect(ok).Should(BeTrue()) + + Expect(ver).Should(Equal(uint16(warpMessages.CodecVersion))) + Expect(registerValidatorPayload.NodeID).Should(Equal(nodeID)) + Expect(registerValidatorPayload.Weight).Should(Equal(weight)) + Expect(registerValidatorPayload.SubnetID).Should(Equal(subnetAInfo.SubnetID)) + Expect(registerValidatorPayload.BlsPubKey[:]).Should(Equal(blsPublicKey[:])) + + // Construct a SubnetValidatorRegistrationMessage Warp message from the P-Chain + registrationSignedMessage := utils.ConstructSubnetValidatorRegistrationMessage( + validationID, + true, + subnetAInfo, + pChainInfo, + network, + signatureAggregator, + ) + + // Deliver the Warp message to the subnet + receipt = utils.CallERC20CompleteValidatorRegistration( + fundedKey, + subnetAInfo, + stakingManagerAddress, + registrationSignedMessage, + ) + // Check that the validator is registered in the staking contract + registrationEvent, err := utils.GetEventFromLogs( + receipt.Logs, + stakingManager.ParseValidationPeriodRegistered, + ) + Expect(err).Should(BeNil()) + Expect(registrationEvent.ValidationID[:]).Should(Equal(validationID[:])) + } + + // + // Delist the validator + // + { + receipt := utils.CallERC20InitializeEndValidation( + fundedKey, + subnetAInfo, + stakingManager, + validationID, + ) + validatorRemovalEvent, err := utils.GetEventFromLogs( + receipt.Logs, + stakingManager.ParseValidatorRemovalInitialized, + ) + Expect(err).Should(BeNil()) + Expect(validatorRemovalEvent.ValidationID[:]).Should(Equal(validationID[:])) + Expect(validatorRemovalEvent.StakeAmount.Uint64()).Should(Equal(weight)) + + // Gather subnet-evm Warp signatures for the SetSubnetValidatorWeightMessage & relay to the P-Chain + // (Sending to the P-Chain will be skipped for now) + signedWarpMessage := network.ConstructSignedWarpMessage(context.Background(), receipt, subnetAInfo, pChainInfo) + Expect(err).Should(BeNil()) + // Validate the Warp message, (this will be done on the P-Chain in the future) + msg, err := warpPayload.ParseAddressedCall(signedWarpMessage.UnsignedMessage.Payload) + Expect(err).Should(BeNil()) + // Check that the addressed call payload is a registered Warp message type + var payloadInterface warpMessages.Payload + ver, err := warpMessages.Codec.Unmarshal(msg.Payload, &payloadInterface) + Expect(err).Should(BeNil()) + registerValidatorPayload, ok := payloadInterface.(*warpMessages.SetSubnetValidatorWeight) + Expect(ok).Should(BeTrue()) + + Expect(ver).Should(Equal(uint16(warpMessages.CodecVersion))) + Expect(registerValidatorPayload.ValidationID).Should(Equal(validationID)) + Expect(registerValidatorPayload.Weight).Should(Equal(uint64(0))) + Expect(registerValidatorPayload.Nonce).Should(Equal(uint64(0))) + + // Construct a SubnetValidatorRegistrationMessage Warp message from the P-Chain + registrationSignedMessage := utils.ConstructSubnetValidatorRegistrationMessage( + validationID, + false, + subnetAInfo, + pChainInfo, + network, + signatureAggregator, + ) + + // Deliver the Warp message to the subnet + receipt = utils.CallERC20CompleteEndValidation( + fundedKey, + subnetAInfo, + stakingManagerAddress, + registrationSignedMessage, + ) + + // Check that the validator is registered in the staking contract + registrationEvent, err := utils.GetEventFromLogs( + receipt.Logs, + stakingManager.ParseValidationPeriodEnded, + ) + Expect(err).Should(BeNil()) + Expect(registrationEvent.ValidationID[:]).Should(Equal(validationID[:])) + } +} diff --git a/tests/flows/native_token_staking.go b/tests/flows/native_token_staking.go index 17298bd38..1944bb72d 100644 --- a/tests/flows/native_token_staking.go +++ b/tests/flows/native_token_staking.go @@ -100,7 +100,7 @@ func NativeTokenStakingManager(network interfaces.LocalNetwork) { ) // Deliver the Warp message to the subnet - receipt = utils.CallCompleteValidatorRegistration( + receipt = utils.CallNativeCompleteValidatorRegistration( fundedKey, subnetAInfo, stakingManagerContractAddress, @@ -119,7 +119,7 @@ func NativeTokenStakingManager(network interfaces.LocalNetwork) { // Delist the validator // { - receipt := utils.CallInitializeEndValidation( + receipt := utils.CallNativeInitializeEndValidation( fundedKey, subnetAInfo, stakingManager, @@ -163,7 +163,7 @@ func NativeTokenStakingManager(network interfaces.LocalNetwork) { ) // Deliver the Warp message to the subnet - receipt = utils.CallCompleteEndValidation( + receipt = utils.CallNativeCompleteEndValidation( fundedKey, subnetAInfo, stakingManagerContractAddress, diff --git a/tests/local/e2e_test.go b/tests/local/e2e_test.go index 7c88505e4..8b84c6955 100644 --- a/tests/local/e2e_test.go +++ b/tests/local/e2e_test.go @@ -103,11 +103,6 @@ var _ = ginkgo.AfterSuite(func() { var _ = ginkgo.Describe("[Teleporter integration tests]", func() { // Teleporter tests - ginkgo.It("Native token staking manager", - ginkgo.Label(stakingManagerLabel), - func() { - flows.NativeTokenStakingManager(LocalNetworkInstance) - }) ginkgo.It("Send a message from Subnet A to Subnet B, and one from B to A", ginkgo.Label(teleporterMessengerLabel), func() { @@ -195,6 +190,16 @@ var _ = ginkgo.Describe("[Teleporter integration tests]", func() { func() { flows.ValidatorChurn(LocalNetworkInstance) }) + ginkgo.It("Native token staking manager", + ginkgo.Label(stakingManagerLabel), + func() { + flows.NativeTokenStakingManager(LocalNetworkInstance) + }) + ginkgo.It("ERC20 token staking manager", + ginkgo.Label(stakingManagerLabel), + func() { + flows.ERC20TokenStakingManager(LocalNetworkInstance) + }) // Since the validator churn test modifies the network topology, we put it last for now. // It should not affect the other tests, but we get some errors if we run it before the other tests. // TODO: we should fix this so that the order of the tests does not matter. diff --git a/tests/utils/chain_utils.go b/tests/utils/chain_utils.go index 36244b4f9..07872d456 100644 --- a/tests/utils/chain_utils.go +++ b/tests/utils/chain_utils.go @@ -540,9 +540,10 @@ func NewSignatureAggregator(apiUri string, subnets []ids.ID) *aggregator.Signatu } trackedSubnets := set.NewSet[ids.ID](len(subnets)) trackedSubnets.Add(subnets...) + registry := prometheus.NewRegistry() appRequestNetwork, err := peers.NewNetwork( logging.Debug, - prometheus.DefaultRegisterer, + registry, trackedSubnets, &cfg, ) @@ -550,7 +551,7 @@ func NewSignatureAggregator(apiUri string, subnets []ids.ID) *aggregator.Signatu messageCreator, err := message.NewCreator( logger, - prometheus.DefaultRegisterer, + registry, constants.DefaultNetworkCompressionType, constants.DefaultNetworkMaximumInboundTimeout, ) diff --git a/tests/utils/staking_utils.go b/tests/utils/staking_utils.go index 74979e3ec..5d86ec0e3 100644 --- a/tests/utils/staking_utils.go +++ b/tests/utils/staking_utils.go @@ -12,10 +12,13 @@ import ( warpMessages "github.com/ava-labs/avalanchego/vms/platformvm/warp/messages" warpPayload "github.com/ava-labs/avalanchego/vms/platformvm/warp/payload" "github.com/ava-labs/awm-relayer/signature-aggregator/aggregator" + "github.com/ava-labs/subnet-evm/accounts/abi" "github.com/ava-labs/subnet-evm/accounts/abi/bind" "github.com/ava-labs/subnet-evm/core/types" "github.com/ava-labs/subnet-evm/precompile/contracts/warp" predicateutils "github.com/ava-labs/subnet-evm/predicate" + exampleerc20 "github.com/ava-labs/teleporter/abi-bindings/go/mocks/ExampleERC20" + erc20tokenstakingmanager "github.com/ava-labs/teleporter/abi-bindings/go/staking/ERC20TokenStakingManager" nativetokenstakingmanager "github.com/ava-labs/teleporter/abi-bindings/go/staking/NativeTokenStakingManager" "github.com/ava-labs/teleporter/tests/interfaces" "github.com/ethereum/go-ethereum/common" @@ -78,6 +81,65 @@ func DeployAndInitializeNativeTokenStakingManager( return stakingManagerContractAddress, stakingManager } +func DeployERC20TokenStakingManager( + ctx context.Context, + senderKey *ecdsa.PrivateKey, + subnet interfaces.SubnetTestInfo, +) (common.Address, *erc20tokenstakingmanager.ERC20TokenStakingManager) { + opts, err := bind.NewKeyedTransactorWithChainID(senderKey, subnet.EVMChainID) + Expect(err).Should(BeNil()) + address, tx, stakingManager, err := erc20tokenstakingmanager.DeployERC20TokenStakingManager( + opts, + subnet.RPCClient, + 0, // ICMInitializable.Allowed + ) + Expect(err).Should(BeNil()) + + // Wait for the transaction to be mined + WaitForTransactionSuccess(ctx, subnet, tx.Hash()) + + return address, stakingManager +} + +func DeployAndInitializeERC20TokenStakingManager( + ctx context.Context, + senderKey *ecdsa.PrivateKey, + subnet interfaces.SubnetTestInfo, + pChainInfo interfaces.SubnetTestInfo, +) ( + common.Address, + *erc20tokenstakingmanager.ERC20TokenStakingManager, + common.Address, + *exampleerc20.ExampleERC20, +) { + stakingManagerContractAddress, stakingManager := DeployERC20TokenStakingManager( + ctx, + senderKey, + subnet, + ) + + erc20Address, erc20 := DeployExampleERC20(ctx, senderKey, subnet) + opts, err := bind.NewKeyedTransactorWithChainID(senderKey, subnet.EVMChainID) + Expect(err).Should(BeNil()) + tx, err := stakingManager.Initialize( + opts, + erc20tokenstakingmanager.StakingManagerSettings{ + PChainBlockchainID: pChainInfo.BlockchainID, + SubnetID: subnet.SubnetID, + MinimumStakeAmount: big.NewInt(0).SetUint64(1e6), + MaximumStakeAmount: big.NewInt(0).SetUint64(10e6), + MinimumStakeDuration: uint64(24 * time.Hour), + MaximumHourlyChurn: 0, + RewardCalculator: common.Address{}, + }, + erc20Address, + ) + Expect(err).Should(BeNil()) + WaitForTransactionSuccess(context.Background(), subnet, tx.Hash()) + + return stakingManagerContractAddress, stakingManager, erc20Address, erc20 +} + // // Function call utils // @@ -110,7 +172,47 @@ func CallNativeInitializeValidatorRegistration( return receipt, ids.ID(registrationInitiatedEvent.ValidationID) } -func CallCompleteValidatorRegistration( +func CallERC20InitializeValidatorRegistration( + senderKey *ecdsa.PrivateKey, + subnet interfaces.SubnetTestInfo, + stakeAmount uint64, + token *exampleerc20.ExampleERC20, + stakingManagerAddress common.Address, + nodeID ids.ID, + blsPublicKey [bls.PublicKeyLen]byte, + stakingManager *erc20tokenstakingmanager.ERC20TokenStakingManager, +) (*types.Receipt, ids.ID) { + + ERC20Approve( + context.Background(), + token, + stakingManagerAddress, + big.NewInt(0).SetUint64(stakeAmount), + subnet, + senderKey, + ) + + opts, err := bind.NewKeyedTransactorWithChainID(senderKey, subnet.EVMChainID) + Expect(err).Should(BeNil()) + + tx, err := stakingManager.InitializeValidatorRegistration( + opts, + big.NewInt(0).SetUint64(stakeAmount), + nodeID, + uint64(time.Now().Add(24*time.Hour).Unix()), + blsPublicKey[:], + ) + Expect(err).Should(BeNil()) + receipt := WaitForTransactionSuccess(context.Background(), subnet, tx.Hash()) + registrationInitiatedEvent, err := GetEventFromLogs( + receipt.Logs, + stakingManager.ParseValidationPeriodCreated, + ) + Expect(err).Should(BeNil()) + return receipt, ids.ID(registrationInitiatedEvent.ValidationID) +} + +func CallNativeCompleteValidatorRegistration( sendingKey *ecdsa.PrivateKey, subnet interfaces.SubnetTestInfo, stakingManagerContractAddress common.Address, @@ -118,6 +220,39 @@ func CallCompleteValidatorRegistration( ) *types.Receipt { abi, err := nativetokenstakingmanager.NativeTokenStakingManagerMetaData.GetAbi() Expect(err).Should(BeNil()) + return completeValidatorRegistration( + abi, + sendingKey, + subnet, + stakingManagerContractAddress, + registrationSignedMessage, + ) +} + +func CallERC20CompleteValidatorRegistration( + sendingKey *ecdsa.PrivateKey, + subnet interfaces.SubnetTestInfo, + stakingManagerContractAddress common.Address, + registrationSignedMessage *avalancheWarp.Message, +) *types.Receipt { + abi, err := erc20tokenstakingmanager.ERC20TokenStakingManagerMetaData.GetAbi() + Expect(err).Should(BeNil()) + return completeValidatorRegistration( + abi, + sendingKey, + subnet, + stakingManagerContractAddress, + registrationSignedMessage, + ) +} + +func completeValidatorRegistration( + abi *abi.ABI, + sendingKey *ecdsa.PrivateKey, + subnet interfaces.SubnetTestInfo, + stakingManagerContractAddress common.Address, + registrationSignedMessage *avalancheWarp.Message, +) *types.Receipt { callData, err := abi.Pack("completeValidatorRegistration", uint32(0)) Expect(err).Should(BeNil()) gasFeeCap, gasTipCap, nonce := CalculateTxParams(context.Background(), subnet, PrivateKeyToAddress(sendingKey)) @@ -138,7 +273,7 @@ func CallCompleteValidatorRegistration( return SendTransactionAndWaitForSuccess(context.Background(), subnet, signedRegistrationTx) } -func CallInitializeEndValidation( +func CallNativeInitializeEndValidation( sendingKey *ecdsa.PrivateKey, subnet interfaces.SubnetTestInfo, stakingManager *nativetokenstakingmanager.NativeTokenStakingManager, @@ -156,7 +291,25 @@ func CallInitializeEndValidation( return WaitForTransactionSuccess(context.Background(), subnet, tx.Hash()) } -func CallCompleteEndValidation( +func CallERC20InitializeEndValidation( + sendingKey *ecdsa.PrivateKey, + subnet interfaces.SubnetTestInfo, + stakingManager *erc20tokenstakingmanager.ERC20TokenStakingManager, + validationID ids.ID, +) *types.Receipt { + opts, err := bind.NewKeyedTransactorWithChainID(sendingKey, subnet.EVMChainID) + Expect(err).Should(BeNil()) + tx, err := stakingManager.InitializeEndValidation( + opts, + validationID, + false, + 0, + ) + Expect(err).Should(BeNil()) + return WaitForTransactionSuccess(context.Background(), subnet, tx.Hash()) +} + +func CallNativeCompleteEndValidation( sendingKey *ecdsa.PrivateKey, subnet interfaces.SubnetTestInfo, stakingManagerContractAddress common.Address, @@ -164,6 +317,39 @@ func CallCompleteEndValidation( ) *types.Receipt { abi, err := nativetokenstakingmanager.NativeTokenStakingManagerMetaData.GetAbi() Expect(err).Should(BeNil()) + return callCompleteEndValidation( + abi, + sendingKey, + subnet, + stakingManagerContractAddress, + registrationSignedMessage, + ) +} + +func CallERC20CompleteEndValidation( + sendingKey *ecdsa.PrivateKey, + subnet interfaces.SubnetTestInfo, + stakingManagerContractAddress common.Address, + registrationSignedMessage *avalancheWarp.Message, +) *types.Receipt { + abi, err := erc20tokenstakingmanager.ERC20TokenStakingManagerMetaData.GetAbi() + Expect(err).Should(BeNil()) + return callCompleteEndValidation( + abi, + sendingKey, + subnet, + stakingManagerContractAddress, + registrationSignedMessage, + ) +} + +func callCompleteEndValidation( + abi *abi.ABI, + sendingKey *ecdsa.PrivateKey, + subnet interfaces.SubnetTestInfo, + stakingManagerContractAddress common.Address, + registrationSignedMessage *avalancheWarp.Message, +) *types.Receipt { callData, err := abi.Pack("completeEndValidation", uint32(0), false) Expect(err).Should(BeNil()) gasFeeCap, gasTipCap, nonce := CalculateTxParams(context.Background(), subnet, PrivateKeyToAddress(sendingKey)) From b4baff19d0c945bd7d5efc1c4a1c3e95c7c0030b Mon Sep 17 00:00:00 2001 From: cam-schultz Date: Thu, 15 Aug 2024 17:32:20 -0400 Subject: [PATCH 19/27] format --- contracts/staking/ERC20TokenStakingManager.sol | 3 ++- tests/utils/staking_utils.go | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/staking/ERC20TokenStakingManager.sol b/contracts/staking/ERC20TokenStakingManager.sol index 58517e113..422c12ff6 100644 --- a/contracts/staking/ERC20TokenStakingManager.sol +++ b/contracts/staking/ERC20TokenStakingManager.sol @@ -78,7 +78,8 @@ contract ERC20TokenStakingManager is Initializable, StakingManager, IERC20TokenS uint64 registrationExpiry, bytes memory blsPublicKey ) external override returns (bytes32 validationID) { - return _initializeValidatorRegistration(nodeID, stakeAmount, registrationExpiry, blsPublicKey); + return + _initializeValidatorRegistration(nodeID, stakeAmount, registrationExpiry, blsPublicKey); } // Must be guarded with reentrancy guard for safe transfer from diff --git a/tests/utils/staking_utils.go b/tests/utils/staking_utils.go index 5d86ec0e3..88a3d85e5 100644 --- a/tests/utils/staking_utils.go +++ b/tests/utils/staking_utils.go @@ -182,7 +182,6 @@ func CallERC20InitializeValidatorRegistration( blsPublicKey [bls.PublicKeyLen]byte, stakingManager *erc20tokenstakingmanager.ERC20TokenStakingManager, ) (*types.Receipt, ids.ID) { - ERC20Approve( context.Background(), token, From 50e878bc87953c41b329a2effc8a1895872ecdbc Mon Sep 17 00:00:00 2001 From: cam-schultz Date: Mon, 19 Aug 2024 10:47:41 -0500 Subject: [PATCH 20/27] correct comment --- tests/flows/erc20_token_staking.go | 2 +- tests/flows/native_token_staking.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/flows/erc20_token_staking.go b/tests/flows/erc20_token_staking.go index 0ba94ea47..c65894c96 100644 --- a/tests/flows/erc20_token_staking.go +++ b/tests/flows/erc20_token_staking.go @@ -172,7 +172,7 @@ func ERC20TokenStakingManager(network interfaces.LocalNetwork) { registrationSignedMessage, ) - // Check that the validator is registered in the staking contract + // Check that the validator is has been delisted from the staking contract registrationEvent, err := utils.GetEventFromLogs( receipt.Logs, stakingManager.ParseValidationPeriodEnded, diff --git a/tests/flows/native_token_staking.go b/tests/flows/native_token_staking.go index 1944bb72d..01cb5adbc 100644 --- a/tests/flows/native_token_staking.go +++ b/tests/flows/native_token_staking.go @@ -170,7 +170,7 @@ func NativeTokenStakingManager(network interfaces.LocalNetwork) { registrationSignedMessage, ) - // Check that the validator is registered in the staking contract + // Check that the validator is has been delisted from the staking contract registrationEvent, err := utils.GetEventFromLogs( receipt.Logs, stakingManager.ParseValidationPeriodEnded, From 726f16c5768a39dc725e08b29b49a3696cdc5f0d Mon Sep 17 00:00:00 2001 From: cam-schultz <78878559+cam-schultz@users.noreply.github.com> Date: Tue, 20 Aug 2024 08:50:30 -0500 Subject: [PATCH 21/27] Update tests/flows/erc20_token_staking.go Co-authored-by: minghinmatthewlam Signed-off-by: cam-schultz <78878559+cam-schultz@users.noreply.github.com> --- tests/flows/erc20_token_staking.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/flows/erc20_token_staking.go b/tests/flows/erc20_token_staking.go index c65894c96..e3be47fc0 100644 --- a/tests/flows/erc20_token_staking.go +++ b/tests/flows/erc20_token_staking.go @@ -14,7 +14,7 @@ import ( ) // Registers a erc20 token staking validator on a subnet. The steps are as follows: -// - Deploy the ERCTokenStakingManager +// - Deploy the ERC20TokenStakingManager // - Initiate validator registration // - Deliver the Warp message to the P-Chain (not implemented) // - Aggregate P-Chain signatures on the response Warp message From 2ee977e671d60d09ff93799a0dbd98db4c8962fb Mon Sep 17 00:00:00 2001 From: cam-schultz <78878559+cam-schultz@users.noreply.github.com> Date: Tue, 20 Aug 2024 08:51:51 -0500 Subject: [PATCH 22/27] Update tests/flows/erc20_token_staking.go Co-authored-by: minghinmatthewlam Signed-off-by: cam-schultz <78878559+cam-schultz@users.noreply.github.com> --- tests/flows/erc20_token_staking.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/flows/erc20_token_staking.go b/tests/flows/erc20_token_staking.go index e3be47fc0..11d7044ef 100644 --- a/tests/flows/erc20_token_staking.go +++ b/tests/flows/erc20_token_staking.go @@ -56,7 +56,7 @@ func ERC20TokenStakingManager(network interfaces.LocalNetwork) { stakeAmount := uint64(1e18) weight := uint64(1e6) // stakeAmount / 1e12 { - // Iniatiate validator registration + // Initiate validator registration nodeID := ids.GenerateTestID() blsPublicKey := [bls.PublicKeyLen]byte{} var receipt *types.Receipt From d50cf3f631d85944e675221d01614665c3f15242 Mon Sep 17 00:00:00 2001 From: cam-schultz Date: Tue, 20 Aug 2024 08:57:13 -0500 Subject: [PATCH 23/27] rename helpers --- tests/flows/erc20_token_staking.go | 8 ++++---- tests/flows/native_token_staking.go | 8 ++++---- tests/utils/staking_utils.go | 16 ++++++++-------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/flows/erc20_token_staking.go b/tests/flows/erc20_token_staking.go index c65894c96..03f55f404 100644 --- a/tests/flows/erc20_token_staking.go +++ b/tests/flows/erc20_token_staking.go @@ -60,7 +60,7 @@ func ERC20TokenStakingManager(network interfaces.LocalNetwork) { nodeID := ids.GenerateTestID() blsPublicKey := [bls.PublicKeyLen]byte{} var receipt *types.Receipt - receipt, validationID = utils.CallERC20InitializeValidatorRegistration( + receipt, validationID = utils.InitializeERC20ValidatorRegistration( fundedKey, subnetAInfo, stakeAmount, @@ -102,7 +102,7 @@ func ERC20TokenStakingManager(network interfaces.LocalNetwork) { ) // Deliver the Warp message to the subnet - receipt = utils.CallERC20CompleteValidatorRegistration( + receipt = utils.CompleteERC20ValidatorRegistration( fundedKey, subnetAInfo, stakingManagerAddress, @@ -121,7 +121,7 @@ func ERC20TokenStakingManager(network interfaces.LocalNetwork) { // Delist the validator // { - receipt := utils.CallERC20InitializeEndValidation( + receipt := utils.InitializeEndERC20Validation( fundedKey, subnetAInfo, stakingManager, @@ -165,7 +165,7 @@ func ERC20TokenStakingManager(network interfaces.LocalNetwork) { ) // Deliver the Warp message to the subnet - receipt = utils.CallERC20CompleteEndValidation( + receipt = utils.CompleteEndERC20Validation( fundedKey, subnetAInfo, stakingManagerAddress, diff --git a/tests/flows/native_token_staking.go b/tests/flows/native_token_staking.go index 01cb5adbc..a19f662b7 100644 --- a/tests/flows/native_token_staking.go +++ b/tests/flows/native_token_staking.go @@ -60,7 +60,7 @@ func NativeTokenStakingManager(network interfaces.LocalNetwork) { nodeID := ids.GenerateTestID() blsPublicKey := [bls.PublicKeyLen]byte{} var receipt *types.Receipt - receipt, validationID = utils.CallNativeInitializeValidatorRegistration( + receipt, validationID = utils.InitializeNativeValidatorRegistration( fundedKey, subnetAInfo, stakeAmount, @@ -100,7 +100,7 @@ func NativeTokenStakingManager(network interfaces.LocalNetwork) { ) // Deliver the Warp message to the subnet - receipt = utils.CallNativeCompleteValidatorRegistration( + receipt = utils.CompleteNativeValidatorRegistration( fundedKey, subnetAInfo, stakingManagerContractAddress, @@ -119,7 +119,7 @@ func NativeTokenStakingManager(network interfaces.LocalNetwork) { // Delist the validator // { - receipt := utils.CallNativeInitializeEndValidation( + receipt := utils.InitializeEndNativeValidation( fundedKey, subnetAInfo, stakingManager, @@ -163,7 +163,7 @@ func NativeTokenStakingManager(network interfaces.LocalNetwork) { ) // Deliver the Warp message to the subnet - receipt = utils.CallNativeCompleteEndValidation( + receipt = utils.CompleteEndNativeValidation( fundedKey, subnetAInfo, stakingManagerContractAddress, diff --git a/tests/utils/staking_utils.go b/tests/utils/staking_utils.go index 88a3d85e5..ef4ea063b 100644 --- a/tests/utils/staking_utils.go +++ b/tests/utils/staking_utils.go @@ -144,7 +144,7 @@ func DeployAndInitializeERC20TokenStakingManager( // Function call utils // -func CallNativeInitializeValidatorRegistration( +func InitializeNativeValidatorRegistration( senderKey *ecdsa.PrivateKey, subnet interfaces.SubnetTestInfo, stakeAmount uint64, @@ -172,7 +172,7 @@ func CallNativeInitializeValidatorRegistration( return receipt, ids.ID(registrationInitiatedEvent.ValidationID) } -func CallERC20InitializeValidatorRegistration( +func InitializeERC20ValidatorRegistration( senderKey *ecdsa.PrivateKey, subnet interfaces.SubnetTestInfo, stakeAmount uint64, @@ -211,7 +211,7 @@ func CallERC20InitializeValidatorRegistration( return receipt, ids.ID(registrationInitiatedEvent.ValidationID) } -func CallNativeCompleteValidatorRegistration( +func CompleteNativeValidatorRegistration( sendingKey *ecdsa.PrivateKey, subnet interfaces.SubnetTestInfo, stakingManagerContractAddress common.Address, @@ -228,7 +228,7 @@ func CallNativeCompleteValidatorRegistration( ) } -func CallERC20CompleteValidatorRegistration( +func CompleteERC20ValidatorRegistration( sendingKey *ecdsa.PrivateKey, subnet interfaces.SubnetTestInfo, stakingManagerContractAddress common.Address, @@ -272,7 +272,7 @@ func completeValidatorRegistration( return SendTransactionAndWaitForSuccess(context.Background(), subnet, signedRegistrationTx) } -func CallNativeInitializeEndValidation( +func InitializeEndNativeValidation( sendingKey *ecdsa.PrivateKey, subnet interfaces.SubnetTestInfo, stakingManager *nativetokenstakingmanager.NativeTokenStakingManager, @@ -290,7 +290,7 @@ func CallNativeInitializeEndValidation( return WaitForTransactionSuccess(context.Background(), subnet, tx.Hash()) } -func CallERC20InitializeEndValidation( +func InitializeEndERC20Validation( sendingKey *ecdsa.PrivateKey, subnet interfaces.SubnetTestInfo, stakingManager *erc20tokenstakingmanager.ERC20TokenStakingManager, @@ -308,7 +308,7 @@ func CallERC20InitializeEndValidation( return WaitForTransactionSuccess(context.Background(), subnet, tx.Hash()) } -func CallNativeCompleteEndValidation( +func CompleteEndNativeValidation( sendingKey *ecdsa.PrivateKey, subnet interfaces.SubnetTestInfo, stakingManagerContractAddress common.Address, @@ -325,7 +325,7 @@ func CallNativeCompleteEndValidation( ) } -func CallERC20CompleteEndValidation( +func CompleteEndERC20Validation( sendingKey *ecdsa.PrivateKey, subnet interfaces.SubnetTestInfo, stakingManagerContractAddress common.Address, From e1eabfda0956837233cae60af15e12cd8a9907e6 Mon Sep 17 00:00:00 2001 From: cam-schultz Date: Tue, 20 Aug 2024 08:59:33 -0500 Subject: [PATCH 24/27] set weight via contract helper --- tests/flows/erc20_token_staking.go | 8 +++++++- tests/flows/native_token_staking.go | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/tests/flows/erc20_token_staking.go b/tests/flows/erc20_token_staking.go index 03f55f404..a2460f08e 100644 --- a/tests/flows/erc20_token_staking.go +++ b/tests/flows/erc20_token_staking.go @@ -2,11 +2,13 @@ package flows import ( "context" + "math/big" "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/utils/crypto/bls" warpMessages "github.com/ava-labs/avalanchego/vms/platformvm/warp/messages" warpPayload "github.com/ava-labs/avalanchego/vms/platformvm/warp/payload" + "github.com/ava-labs/subnet-evm/accounts/abi/bind" "github.com/ava-labs/subnet-evm/core/types" "github.com/ava-labs/teleporter/tests/interfaces" "github.com/ava-labs/teleporter/tests/utils" @@ -54,7 +56,11 @@ func ERC20TokenStakingManager(network interfaces.LocalNetwork) { // var validationID ids.ID // To be used in the delisting step stakeAmount := uint64(1e18) - weight := uint64(1e6) // stakeAmount / 1e12 + weight, err := stakingManager.ValueToWeight( + &bind.CallOpts{}, + big.NewInt(int64(stakeAmount)), + ) + Expect(err).Should(BeNil()) { // Iniatiate validator registration nodeID := ids.GenerateTestID() diff --git a/tests/flows/native_token_staking.go b/tests/flows/native_token_staking.go index a19f662b7..f9f979ae5 100644 --- a/tests/flows/native_token_staking.go +++ b/tests/flows/native_token_staking.go @@ -2,11 +2,13 @@ package flows import ( "context" + "math/big" "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/utils/crypto/bls" warpMessages "github.com/ava-labs/avalanchego/vms/platformvm/warp/messages" warpPayload "github.com/ava-labs/avalanchego/vms/platformvm/warp/payload" + "github.com/ava-labs/subnet-evm/accounts/abi/bind" "github.com/ava-labs/subnet-evm/core/types" "github.com/ava-labs/teleporter/tests/interfaces" "github.com/ava-labs/teleporter/tests/utils" @@ -54,7 +56,11 @@ func NativeTokenStakingManager(network interfaces.LocalNetwork) { // var validationID ids.ID // To be used in the delisting step stakeAmount := uint64(1e18) - weight := uint64(1e6) // stakeAmount / 1e12 + weight, err := stakingManager.ValueToWeight( + &bind.CallOpts{}, + big.NewInt(int64(stakeAmount)), + ) + Expect(err).Should(BeNil()) { // Iniatiate validator registration nodeID := ids.GenerateTestID() From 5f5b74a5701b6694d6c62fe933655aae42b5797a Mon Sep 17 00:00:00 2001 From: cam-schultz Date: Tue, 20 Aug 2024 09:01:07 -0500 Subject: [PATCH 25/27] remove utils suffix from fname --- tests/utils/{chain_utils.go => chain.go} | 0 tests/utils/{erc20_utils.go => erc20.go} | 0 tests/utils/{governance_utils.go => governance.go} | 0 tests/utils/{staking_utils.go => staking.go} | 0 tests/utils/{teleporter_utils.go => teleporter.go} | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename tests/utils/{chain_utils.go => chain.go} (100%) rename tests/utils/{erc20_utils.go => erc20.go} (100%) rename tests/utils/{governance_utils.go => governance.go} (100%) rename tests/utils/{staking_utils.go => staking.go} (100%) rename tests/utils/{teleporter_utils.go => teleporter.go} (100%) diff --git a/tests/utils/chain_utils.go b/tests/utils/chain.go similarity index 100% rename from tests/utils/chain_utils.go rename to tests/utils/chain.go diff --git a/tests/utils/erc20_utils.go b/tests/utils/erc20.go similarity index 100% rename from tests/utils/erc20_utils.go rename to tests/utils/erc20.go diff --git a/tests/utils/governance_utils.go b/tests/utils/governance.go similarity index 100% rename from tests/utils/governance_utils.go rename to tests/utils/governance.go diff --git a/tests/utils/staking_utils.go b/tests/utils/staking.go similarity index 100% rename from tests/utils/staking_utils.go rename to tests/utils/staking.go diff --git a/tests/utils/teleporter_utils.go b/tests/utils/teleporter.go similarity index 100% rename from tests/utils/teleporter_utils.go rename to tests/utils/teleporter.go From 9a485b907297f91fc532d9f577d5f0017c20737a Mon Sep 17 00:00:00 2001 From: cam-schultz Date: Tue, 20 Aug 2024 09:11:14 -0500 Subject: [PATCH 26/27] format comment --- tests/flows/erc20_token_staking.go | 29 ++++++++++++++++------------- tests/flows/native_token_staking.go | 29 ++++++++++++++++------------- 2 files changed, 32 insertions(+), 26 deletions(-) diff --git a/tests/flows/erc20_token_staking.go b/tests/flows/erc20_token_staking.go index a2460f08e..dbb106ad1 100644 --- a/tests/flows/erc20_token_staking.go +++ b/tests/flows/erc20_token_staking.go @@ -15,19 +15,22 @@ import ( . "github.com/onsi/gomega" ) -// Registers a erc20 token staking validator on a subnet. The steps are as follows: -// - Deploy the ERCTokenStakingManager -// - Initiate validator registration -// - Deliver the Warp message to the P-Chain (not implemented) -// - Aggregate P-Chain signatures on the response Warp message -// - Deliver the Warp message to the subnet -// - Verify that the validator is registered in the staking contract -// Delists the validator from the subnet. The steps are as follows: -// - Initiate validator delisting -// - Deliver the Warp message to the P-Chain (not implemented) -// - Aggregate P-Chain signatures on the response Warp message -// - Deliver the Warp message to the subnet -// - Verify that the validator is delisted from the staking contract +/* + * Registers a erc20 token staking validator on a subnet. The steps are as follows: + * - Deploy the ERCTokenStakingManager + * - Initiate validator registration + * - Deliver the Warp message to the P-Chain (not implemented) + * - Aggregate P-Chain signatures on the response Warp message + * - Deliver the Warp message to the subnet + * - Verify that the validator is registered in the staking contract + * + * Delists the validator from the subnet. The steps are as follows: + * - Initiate validator delisting + * - Deliver the Warp message to the P-Chain (not implemented) + * - Aggregate P-Chain signatures on the response Warp message + * - Deliver the Warp message to the subnet + * - Verify that the validator is delisted from the staking contract + */ func ERC20TokenStakingManager(network interfaces.LocalNetwork) { // Get the subnets info cChainInfo := network.GetPrimaryNetworkInfo() diff --git a/tests/flows/native_token_staking.go b/tests/flows/native_token_staking.go index f9f979ae5..dd5b44ad0 100644 --- a/tests/flows/native_token_staking.go +++ b/tests/flows/native_token_staking.go @@ -15,19 +15,22 @@ import ( . "github.com/onsi/gomega" ) -// Registers a native token staking validator on a subnet. The steps are as follows: -// - Deploy the NativeTokenStakingManager -// - Initiate validator registration -// - Deliver the Warp message to the P-Chain (not implemented) -// - Aggregate P-Chain signatures on the response Warp message -// - Deliver the Warp message to the subnet -// - Verify that the validator is registered in the staking contract -// Delists the validator from the subnet. The steps are as follows: -// - Initiate validator delisting -// - Deliver the Warp message to the P-Chain (not implemented) -// - Aggregate P-Chain signatures on the response Warp message -// - Deliver the Warp message to the subnet -// - Verify that the validator is delisted from the staking contract +/* + * Registers a native token staking validator on a subnet. The steps are as follows: + * - Deploy the NativeTokenStakingManager + * - Initiate validator registration + * - Deliver the Warp message to the P-Chain (not implemented) + * - Aggregate P-Chain signatures on the response Warp message + * - Deliver the Warp message to the subnet + * - Verify that the validator is registered in the staking contract + * + * Delists the validator from the subnet. The steps are as follows: + * - Initiate validator delisting + * - Deliver the Warp message to the P-Chain (not implemented) + * - Aggregate P-Chain signatures on the response Warp message + * - Deliver the Warp message to the subnet + * - Verify that the validator is delisted from the staking contract + */ func NativeTokenStakingManager(network interfaces.LocalNetwork) { // Get the subnets info cChainInfo := network.GetPrimaryNetworkInfo() From a315e0f3b06c5d44fdeca7dad04f6cfe5f839f6f Mon Sep 17 00:00:00 2001 From: cam-schultz Date: Tue, 20 Aug 2024 09:17:28 -0500 Subject: [PATCH 27/27] (temp) warp validation helpers --- tests/flows/erc20_token_staking.go | 39 ++++++---------------- tests/flows/native_token_staking.go | 38 ++++++---------------- tests/utils/staking.go | 50 +++++++++++++++++++++++++++++ 3 files changed, 69 insertions(+), 58 deletions(-) diff --git a/tests/flows/erc20_token_staking.go b/tests/flows/erc20_token_staking.go index dbb106ad1..fbd410982 100644 --- a/tests/flows/erc20_token_staking.go +++ b/tests/flows/erc20_token_staking.go @@ -6,8 +6,6 @@ import ( "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/utils/crypto/bls" - warpMessages "github.com/ava-labs/avalanchego/vms/platformvm/warp/messages" - warpPayload "github.com/ava-labs/avalanchego/vms/platformvm/warp/payload" "github.com/ava-labs/subnet-evm/accounts/abi/bind" "github.com/ava-labs/subnet-evm/core/types" "github.com/ava-labs/teleporter/tests/interfaces" @@ -85,20 +83,14 @@ func ERC20TokenStakingManager(network interfaces.LocalNetwork) { signedWarpMessage := network.ConstructSignedWarpMessage(context.Background(), receipt, subnetAInfo, pChainInfo) // Validate the Warp message, (this will be done on the P-Chain in the future) - msg, err := warpPayload.ParseAddressedCall(signedWarpMessage.UnsignedMessage.Payload) - Expect(err).Should(BeNil()) - // Check that the addressed call payload is a registered Warp message type - var payloadInterface warpMessages.Payload - ver, err := warpMessages.Codec.Unmarshal(msg.Payload, &payloadInterface) - Expect(err).Should(BeNil()) - registerValidatorPayload, ok := payloadInterface.(*warpMessages.RegisterSubnetValidator) - Expect(ok).Should(BeTrue()) - - Expect(ver).Should(Equal(uint16(warpMessages.CodecVersion))) - Expect(registerValidatorPayload.NodeID).Should(Equal(nodeID)) - Expect(registerValidatorPayload.Weight).Should(Equal(weight)) - Expect(registerValidatorPayload.SubnetID).Should(Equal(subnetAInfo.SubnetID)) - Expect(registerValidatorPayload.BlsPubKey[:]).Should(Equal(blsPublicKey[:])) + // Validate the Warp message, (this will be done on the P-Chain in the future) + utils.ValidateRegisterSubnetValidatorMessage( + signedWarpMessage, + nodeID, + weight, + subnetAInfo.SubnetID, + blsPublicKey, + ) // Construct a SubnetValidatorRegistrationMessage Warp message from the P-Chain registrationSignedMessage := utils.ConstructSubnetValidatorRegistrationMessage( @@ -148,20 +140,9 @@ func ERC20TokenStakingManager(network interfaces.LocalNetwork) { // (Sending to the P-Chain will be skipped for now) signedWarpMessage := network.ConstructSignedWarpMessage(context.Background(), receipt, subnetAInfo, pChainInfo) Expect(err).Should(BeNil()) - // Validate the Warp message, (this will be done on the P-Chain in the future) - msg, err := warpPayload.ParseAddressedCall(signedWarpMessage.UnsignedMessage.Payload) - Expect(err).Should(BeNil()) - // Check that the addressed call payload is a registered Warp message type - var payloadInterface warpMessages.Payload - ver, err := warpMessages.Codec.Unmarshal(msg.Payload, &payloadInterface) - Expect(err).Should(BeNil()) - registerValidatorPayload, ok := payloadInterface.(*warpMessages.SetSubnetValidatorWeight) - Expect(ok).Should(BeTrue()) - Expect(ver).Should(Equal(uint16(warpMessages.CodecVersion))) - Expect(registerValidatorPayload.ValidationID).Should(Equal(validationID)) - Expect(registerValidatorPayload.Weight).Should(Equal(uint64(0))) - Expect(registerValidatorPayload.Nonce).Should(Equal(uint64(0))) + // Validate the Warp message, (this will be done on the P-Chain in the future) + utils.ValidateSetSubnetValidatorWeightMessage(signedWarpMessage, validationID, 0, 0) // Construct a SubnetValidatorRegistrationMessage Warp message from the P-Chain registrationSignedMessage := utils.ConstructSubnetValidatorRegistrationMessage( diff --git a/tests/flows/native_token_staking.go b/tests/flows/native_token_staking.go index dd5b44ad0..e66602083 100644 --- a/tests/flows/native_token_staking.go +++ b/tests/flows/native_token_staking.go @@ -6,8 +6,6 @@ import ( "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/utils/crypto/bls" - warpMessages "github.com/ava-labs/avalanchego/vms/platformvm/warp/messages" - warpPayload "github.com/ava-labs/avalanchego/vms/platformvm/warp/payload" "github.com/ava-labs/subnet-evm/accounts/abi/bind" "github.com/ava-labs/subnet-evm/core/types" "github.com/ava-labs/teleporter/tests/interfaces" @@ -83,20 +81,13 @@ func NativeTokenStakingManager(network interfaces.LocalNetwork) { signedWarpMessage := network.ConstructSignedWarpMessage(context.Background(), receipt, subnetAInfo, pChainInfo) // Validate the Warp message, (this will be done on the P-Chain in the future) - msg, err := warpPayload.ParseAddressedCall(signedWarpMessage.UnsignedMessage.Payload) - Expect(err).Should(BeNil()) - // Check that the addressed call payload is a registered Warp message type - var payloadInterface warpMessages.Payload - ver, err := warpMessages.Codec.Unmarshal(msg.Payload, &payloadInterface) - Expect(err).Should(BeNil()) - registerValidatorPayload, ok := payloadInterface.(*warpMessages.RegisterSubnetValidator) - Expect(ok).Should(BeTrue()) - - Expect(ver).Should(Equal(uint16(warpMessages.CodecVersion))) - Expect(registerValidatorPayload.NodeID).Should(Equal(nodeID)) - Expect(registerValidatorPayload.Weight).Should(Equal(weight)) - Expect(registerValidatorPayload.SubnetID).Should(Equal(subnetAInfo.SubnetID)) - Expect(registerValidatorPayload.BlsPubKey[:]).Should(Equal(blsPublicKey[:])) + utils.ValidateRegisterSubnetValidatorMessage( + signedWarpMessage, + nodeID, + weight, + subnetAInfo.SubnetID, + blsPublicKey, + ) // Construct a SubnetValidatorRegistrationMessage Warp message from the P-Chain registrationSignedMessage := utils.ConstructSubnetValidatorRegistrationMessage( @@ -146,20 +137,9 @@ func NativeTokenStakingManager(network interfaces.LocalNetwork) { // (Sending to the P-Chain will be skipped for now) signedWarpMessage := network.ConstructSignedWarpMessage(context.Background(), receipt, subnetAInfo, pChainInfo) Expect(err).Should(BeNil()) - // Validate the Warp message, (this will be done on the P-Chain in the future) - msg, err := warpPayload.ParseAddressedCall(signedWarpMessage.UnsignedMessage.Payload) - Expect(err).Should(BeNil()) - // Check that the addressed call payload is a registered Warp message type - var payloadInterface warpMessages.Payload - ver, err := warpMessages.Codec.Unmarshal(msg.Payload, &payloadInterface) - Expect(err).Should(BeNil()) - registerValidatorPayload, ok := payloadInterface.(*warpMessages.SetSubnetValidatorWeight) - Expect(ok).Should(BeTrue()) - Expect(ver).Should(Equal(uint16(warpMessages.CodecVersion))) - Expect(registerValidatorPayload.ValidationID).Should(Equal(validationID)) - Expect(registerValidatorPayload.Weight).Should(Equal(uint64(0))) - Expect(registerValidatorPayload.Nonce).Should(Equal(uint64(0))) + // Validate the Warp message, (this will be done on the P-Chain in the future) + utils.ValidateSetSubnetValidatorWeightMessage(signedWarpMessage, validationID, 0, 0) // Construct a SubnetValidatorRegistrationMessage Warp message from the P-Chain registrationSignedMessage := utils.ConstructSubnetValidatorRegistrationMessage( diff --git a/tests/utils/staking.go b/tests/utils/staking.go index ef4ea063b..8be531e5c 100644 --- a/tests/utils/staking.go +++ b/tests/utils/staking.go @@ -401,3 +401,53 @@ func ConstructSubnetValidatorRegistrationMessage( Expect(err).Should(BeNil()) return registrationSignedMessage } + +// +// Warp message validiation utils +// These will be replaced by the actual implementation on the P-Chain in the future +// + +func ValidateRegisterSubnetValidatorMessage( + signedWarpMessage *avalancheWarp.Message, + nodeID ids.ID, + weight uint64, + subnetID ids.ID, + blsPublicKey [bls.PublicKeyLen]byte, +) { + // Validate the Warp message, (this will be done on the P-Chain in the future) + msg, err := warpPayload.ParseAddressedCall(signedWarpMessage.UnsignedMessage.Payload) + Expect(err).Should(BeNil()) + // Check that the addressed call payload is a registered Warp message type + var payloadInterface warpMessages.Payload + ver, err := warpMessages.Codec.Unmarshal(msg.Payload, &payloadInterface) + Expect(err).Should(BeNil()) + registerValidatorPayload, ok := payloadInterface.(*warpMessages.RegisterSubnetValidator) + Expect(ok).Should(BeTrue()) + + Expect(ver).Should(Equal(uint16(warpMessages.CodecVersion))) + Expect(registerValidatorPayload.NodeID).Should(Equal(nodeID)) + Expect(registerValidatorPayload.Weight).Should(Equal(weight)) + Expect(registerValidatorPayload.SubnetID).Should(Equal(subnetID)) + Expect(registerValidatorPayload.BlsPubKey[:]).Should(Equal(blsPublicKey[:])) +} + +func ValidateSetSubnetValidatorWeightMessage( + signedWarpMessage *avalancheWarp.Message, + validationID ids.ID, + weight uint64, + nonce uint64, +) { + msg, err := warpPayload.ParseAddressedCall(signedWarpMessage.UnsignedMessage.Payload) + Expect(err).Should(BeNil()) + // Check that the addressed call payload is a registered Warp message type + var payloadInterface warpMessages.Payload + ver, err := warpMessages.Codec.Unmarshal(msg.Payload, &payloadInterface) + Expect(err).Should(BeNil()) + registerValidatorPayload, ok := payloadInterface.(*warpMessages.SetSubnetValidatorWeight) + Expect(ok).Should(BeTrue()) + + Expect(ver).Should(Equal(uint16(warpMessages.CodecVersion))) + Expect(registerValidatorPayload.ValidationID).Should(Equal(validationID)) + Expect(registerValidatorPayload.Weight).Should(Equal(weight)) + Expect(registerValidatorPayload.Nonce).Should(Equal(nonce)) +}