From bb7c46ba144ceb40c05b958707b5c7228b8d4451 Mon Sep 17 00:00:00 2001 From: Serge Khorun <104387024+sergekh2@users.noreply.github.com> Date: Wed, 26 Jun 2024 10:45:48 -0700 Subject: [PATCH] Move xchain contract bindings into core/contracts (#284) Also drop v3/dev versions --- core/cmd/register_xchain_node_cmd.go | 14 +- core/config/config.go | 24 +- .../base/deploy}/entitlement_checker.go | 2 +- .../base/deploy}/mock_custom_entitlement.go | 2 +- .../base/deploy}/mock_entitlement_checker.go | 2 +- .../base/deploy}/mock_entitlement_gated.go | 158 +- .../base/deploy}/mock_erc20.go | 2 +- .../base/deploy}/mock_erc721.go | 2 +- .../base/deploy}/wallet_link.go | 156 +- .../base}/i_custom_entitlement.go | 2 +- .../v3 => contracts/base}/i_entitlement.go | 2 +- .../base}/i_entitlement_checker.go | 2 +- .../base}/i_entitlement_gated.go | 2 +- core/contracts/base/rule_entitlement.go | 78 +- core/node/auth/architect.go | 2 +- core/node/auth/banning.go | 1 - core/node/auth/channels.go | 3 +- core/node/auth/entitlement.go | 5 +- core/node/auth/pausable.go | 3 +- core/node/auth/space_contract.go | 4 +- core/node/auth/space_contract_v3.go | 40 +- core/node/auth/wallet_link.go | 2 +- .../registries/river_registry_contract.go | 9 - .../client_simulator/client_simulator.go | 124 +- core/xchain/contracts/README.md | 1 - core/xchain/contracts/contracts.go | 825 +---- .../contracts/dev/i_custom_entitlement.go | 212 -- core/xchain/contracts/dev/i_entitlement.go | 430 --- .../contracts/dev/i_entitlement_gated.go | 406 --- core/xchain/contracts/dev/i_wallet_link.go | 680 ---- .../contracts/dev/mock_entitlement_gated.go | 895 ----- .../contracts/v3/entitlement_checker.go | 1290 ------- .../contracts/v3/i_entitlement_checker.go | 825 ----- core/xchain/contracts/v3/i_wallet_link.go | 680 ---- .../contracts/v3/mock_custom_entitlement.go | 255 -- .../contracts/v3/mock_entitlement_checker.go | 2949 ----------------- core/xchain/contracts/v3/wallet_link.go | 1139 ------- core/xchain/entitlement/check_operation.go | 13 +- core/xchain/entitlement/entitlement.go | 7 +- core/xchain/entitlement/evaluator.go | 8 +- core/xchain/entitlement/linkedwallets.go | 6 +- core/xchain/server/server.go | 83 +- core/xchain/server/server_test.go | 64 +- scripts/build-contract-types.sh | 1 - scripts/gen-river-node-bindings.sh | 20 + scripts/gen-xchain-bindings.sh | 83 - 46 files changed, 425 insertions(+), 11088 deletions(-) rename core/{xchain/contracts/dev => contracts/base/deploy}/entitlement_checker.go (99%) rename core/{xchain/contracts/dev => contracts/base/deploy}/mock_custom_entitlement.go (99%) rename core/{xchain/contracts/dev => contracts/base/deploy}/mock_entitlement_checker.go (99%) rename core/{xchain/contracts/v3 => contracts/base/deploy}/mock_entitlement_gated.go (92%) rename core/{xchain/contracts/test => contracts/base/deploy}/mock_erc20.go (99%) rename core/{xchain/contracts/test => contracts/base/deploy}/mock_erc721.go (99%) rename core/{xchain/contracts/dev => contracts/base/deploy}/wallet_link.go (92%) rename core/{xchain/contracts/v3 => contracts/base}/i_custom_entitlement.go (99%) rename core/{xchain/contracts/v3 => contracts/base}/i_entitlement.go (99%) rename core/{xchain/contracts/dev => contracts/base}/i_entitlement_checker.go (99%) rename core/{xchain/contracts/v3 => contracts/base}/i_entitlement_gated.go (99%) delete mode 100644 core/xchain/contracts/README.md delete mode 100644 core/xchain/contracts/dev/i_custom_entitlement.go delete mode 100644 core/xchain/contracts/dev/i_entitlement.go delete mode 100644 core/xchain/contracts/dev/i_entitlement_gated.go delete mode 100644 core/xchain/contracts/dev/i_wallet_link.go delete mode 100644 core/xchain/contracts/dev/mock_entitlement_gated.go delete mode 100644 core/xchain/contracts/v3/entitlement_checker.go delete mode 100644 core/xchain/contracts/v3/i_entitlement_checker.go delete mode 100644 core/xchain/contracts/v3/i_wallet_link.go delete mode 100644 core/xchain/contracts/v3/mock_custom_entitlement.go delete mode 100644 core/xchain/contracts/v3/mock_entitlement_checker.go delete mode 100644 core/xchain/contracts/v3/wallet_link.go delete mode 100755 scripts/gen-xchain-bindings.sh diff --git a/core/cmd/register_xchain_node_cmd.go b/core/cmd/register_xchain_node_cmd.go index 0bd43bb6d..a4c0af353 100644 --- a/core/cmd/register_xchain_node_cmd.go +++ b/core/cmd/register_xchain_node_cmd.go @@ -7,14 +7,14 @@ import ( "os" "time" - "github.com/river-build/river/core/xchain/contracts" - "github.com/river-build/river/core/xchain/util" - "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/core/types" + "github.com/spf13/cobra" + + "github.com/river-build/river/core/contracts/base" "github.com/river-build/river/core/node/crypto" "github.com/river-build/river/core/node/infra" - "github.com/spf13/cobra" + "github.com/river-build/river/core/xchain/util" ) var ( @@ -64,7 +64,6 @@ func registerImpl(operatorKeyfile string, userConfirmationMessage string, regist ctx, cancel = context.WithTimeout(context.Background(), time.Minute) xchainWallet, xWalletErr = util.LoadWallet(ctx) operatorWallet, oWalletErr = crypto.LoadWallet(ctx, operatorKeyfile) - entitlementGatedMetaData = contracts.NewEntitlementGatedMetaData(cmdConfig.GetContractVersion()) ) defer cancel() @@ -93,13 +92,12 @@ func registerImpl(operatorKeyfile string, userConfirmationMessage string, regist metrics, ) - checker, err := contracts.NewIEntitlementChecker( - cmdConfig.GetEntitlementContractAddress(), baseChain.Client, cmdConfig.GetContractVersion()) + checker, err := base.NewIEntitlementChecker(cmdConfig.GetEntitlementContractAddress(), baseChain.Client) if err != nil { return err } - decoder, err := crypto.NewEVMErrorDecoder(checker.GetMetadata(), entitlementGatedMetaData.GetMetadata()) + decoder, err := crypto.NewEVMErrorDecoder(base.IEntitlementCheckerMetaData, base.IEntitlementGatedMetaData) if err != nil { return err } diff --git a/core/config/config.go b/core/config/config.go index 459e6b77f..fcdb8f16f 100644 --- a/core/config/config.go +++ b/core/config/config.go @@ -11,13 +11,6 @@ import ( . "github.com/river-build/river/core/node/protocol" ) -type ContractVersion string - -const ( - VersionDev ContractVersion = "dev" - VersionV3 ContractVersion = "v3" -) - func GetDefaultConfig() *Config { return &Config{ Port: 443, @@ -143,10 +136,9 @@ type Config struct { XChainBlockchains []uint64 // extra xChain configuration - EntitlementContract ContractConfig `mapstructure:"entitlement_contract"` - contractVersion ContractVersion `mapstructure:"contract_version"` - TestEntitlementContract ContractConfig `mapstructure:"test_contract"` - TestCustomEntitlementContract ContractConfig `mapstructure:"test_custom_entitlement_contract"` + EntitlementContract ContractConfig `mapstructure:"entitlement_contract"` + TestEntitlementContract ContractConfig `mapstructure:"test_contract"` + TestCustomEntitlementContract ContractConfig `mapstructure:"test_custom_entitlement_contract"` // History indicates how far back xchain must look for entitlement check requests after start History time.Duration @@ -248,8 +240,6 @@ type PerformanceTrackingConfig struct { type ContractConfig struct { // Address of the contract Address common.Address - // Version of the contract to use. - Version string } type ArchiveConfig struct { @@ -355,14 +345,6 @@ func (c *Config) GetGraffiti() string { return c.Graffiti } -func (c *Config) GetContractVersion() ContractVersion { - if c.contractVersion == VersionV3 { - return VersionV3 - } else { - return VersionDev - } -} - func (c *Config) GetEntitlementContractAddress() common.Address { return c.EntitlementContract.Address } diff --git a/core/xchain/contracts/dev/entitlement_checker.go b/core/contracts/base/deploy/entitlement_checker.go similarity index 99% rename from core/xchain/contracts/dev/entitlement_checker.go rename to core/contracts/base/deploy/entitlement_checker.go index 44ecab192..7ef67da4f 100644 --- a/core/xchain/contracts/dev/entitlement_checker.go +++ b/core/contracts/base/deploy/entitlement_checker.go @@ -1,7 +1,7 @@ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. -package dev +package deploy import ( "errors" diff --git a/core/xchain/contracts/dev/mock_custom_entitlement.go b/core/contracts/base/deploy/mock_custom_entitlement.go similarity index 99% rename from core/xchain/contracts/dev/mock_custom_entitlement.go rename to core/contracts/base/deploy/mock_custom_entitlement.go index aaaeb7804..caa71c56a 100644 --- a/core/xchain/contracts/dev/mock_custom_entitlement.go +++ b/core/contracts/base/deploy/mock_custom_entitlement.go @@ -1,7 +1,7 @@ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. -package dev +package deploy import ( "errors" diff --git a/core/xchain/contracts/dev/mock_entitlement_checker.go b/core/contracts/base/deploy/mock_entitlement_checker.go similarity index 99% rename from core/xchain/contracts/dev/mock_entitlement_checker.go rename to core/contracts/base/deploy/mock_entitlement_checker.go index 8c4724ae4..eb50611f8 100644 --- a/core/xchain/contracts/dev/mock_entitlement_checker.go +++ b/core/contracts/base/deploy/mock_entitlement_checker.go @@ -1,7 +1,7 @@ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. -package dev +package deploy import ( "errors" diff --git a/core/xchain/contracts/v3/mock_entitlement_gated.go b/core/contracts/base/deploy/mock_entitlement_gated.go similarity index 92% rename from core/xchain/contracts/v3/mock_entitlement_gated.go rename to core/contracts/base/deploy/mock_entitlement_gated.go index f1692ac0c..2c145c548 100644 --- a/core/xchain/contracts/v3/mock_entitlement_gated.go +++ b/core/contracts/base/deploy/mock_entitlement_gated.go @@ -1,7 +1,7 @@ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. -package v3 +package deploy import ( "errors" @@ -18,21 +18,49 @@ import ( // Reference imports to suppress errors if they are not otherwise used. var ( - _ = errors.New - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription - _ = abi.ConvertType + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType ) +// IRuleEntitlementCheckOperation is an auto generated low-level Go binding around an user-defined struct. +type IRuleEntitlementCheckOperation struct { + OpType uint8 + ChainId *big.Int + ContractAddress common.Address + Threshold *big.Int +} + +// IRuleEntitlementLogicalOperation is an auto generated low-level Go binding around an user-defined struct. +type IRuleEntitlementLogicalOperation struct { + LogOpType uint8 + LeftOperationIndex uint8 + RightOperationIndex uint8 +} + +// IRuleEntitlementOperation is an auto generated low-level Go binding around an user-defined struct. +type IRuleEntitlementOperation struct { + OpType uint8 + Index uint8 +} + +// IRuleEntitlementRuleData is an auto generated low-level Go binding around an user-defined struct. +type IRuleEntitlementRuleData struct { + Operations []IRuleEntitlementOperation + CheckOperations []IRuleEntitlementCheckOperation + LogicalOperations []IRuleEntitlementLogicalOperation +} + // MockEntitlementGatedMetaData contains all meta data concerning the MockEntitlementGated contract. var MockEntitlementGatedMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"checker\",\"type\":\"address\",\"internalType\":\"contractIEntitlementChecker\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"__EntitlementGated_init\",\"inputs\":[{\"name\":\"entitlementChecker\",\"type\":\"address\",\"internalType\":\"contractIEntitlementChecker\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"getRuleData\",\"inputs\":[{\"name\":\"roleId\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIRuleEntitlement.RuleData\",\"components\":[{\"name\":\"operations\",\"type\":\"tuple[]\",\"internalType\":\"structIRuleEntitlement.Operation[]\",\"components\":[{\"name\":\"opType\",\"type\":\"uint8\",\"internalType\":\"enumIRuleEntitlement.CombinedOperationType\"},{\"name\":\"index\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]},{\"name\":\"checkOperations\",\"type\":\"tuple[]\",\"internalType\":\"structIRuleEntitlement.CheckOperation[]\",\"components\":[{\"name\":\"opType\",\"type\":\"uint8\",\"internalType\":\"enumIRuleEntitlement.CheckOperationType\"},{\"name\":\"chainId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"contractAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"threshold\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"logicalOperations\",\"type\":\"tuple[]\",\"internalType\":\"structIRuleEntitlement.LogicalOperation[]\",\"components\":[{\"name\":\"logOpType\",\"type\":\"uint8\",\"internalType\":\"enumIRuleEntitlement.LogicalOperationType\"},{\"name\":\"leftOperationIndex\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"rightOperationIndex\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getRuleData\",\"inputs\":[{\"name\":\"transactionId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"roleId\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIRuleEntitlement.RuleData\",\"components\":[{\"name\":\"operations\",\"type\":\"tuple[]\",\"internalType\":\"structIRuleEntitlement.Operation[]\",\"components\":[{\"name\":\"opType\",\"type\":\"uint8\",\"internalType\":\"enumIRuleEntitlement.CombinedOperationType\"},{\"name\":\"index\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]},{\"name\":\"checkOperations\",\"type\":\"tuple[]\",\"internalType\":\"structIRuleEntitlement.CheckOperation[]\",\"components\":[{\"name\":\"opType\",\"type\":\"uint8\",\"internalType\":\"enumIRuleEntitlement.CheckOperationType\"},{\"name\":\"chainId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"contractAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"threshold\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"logicalOperations\",\"type\":\"tuple[]\",\"internalType\":\"structIRuleEntitlement.LogicalOperation[]\",\"components\":[{\"name\":\"logOpType\",\"type\":\"uint8\",\"internalType\":\"enumIRuleEntitlement.LogicalOperationType\"},{\"name\":\"leftOperationIndex\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"rightOperationIndex\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"postEntitlementCheckResult\",\"inputs\":[{\"name\":\"transactionId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"roleId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"result\",\"type\":\"uint8\",\"internalType\":\"enumIEntitlementGatedBase.NodeVoteStatus\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"requestEntitlementCheck\",\"inputs\":[{\"name\":\"roleId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"ruleData\",\"type\":\"tuple\",\"internalType\":\"structIRuleEntitlement.RuleData\",\"components\":[{\"name\":\"operations\",\"type\":\"tuple[]\",\"internalType\":\"structIRuleEntitlement.Operation[]\",\"components\":[{\"name\":\"opType\",\"type\":\"uint8\",\"internalType\":\"enumIRuleEntitlement.CombinedOperationType\"},{\"name\":\"index\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]},{\"name\":\"checkOperations\",\"type\":\"tuple[]\",\"internalType\":\"structIRuleEntitlement.CheckOperation[]\",\"components\":[{\"name\":\"opType\",\"type\":\"uint8\",\"internalType\":\"enumIRuleEntitlement.CheckOperationType\"},{\"name\":\"chainId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"contractAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"threshold\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"logicalOperations\",\"type\":\"tuple[]\",\"internalType\":\"structIRuleEntitlement.LogicalOperation[]\",\"components\":[{\"name\":\"logOpType\",\"type\":\"uint8\",\"internalType\":\"enumIRuleEntitlement.LogicalOperationType\"},{\"name\":\"leftOperationIndex\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"rightOperationIndex\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"EntitlementCheckResultPosted\",\"inputs\":[{\"name\":\"transactionId\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"result\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"enumIEntitlementGatedBase.NodeVoteStatus\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"InterfaceAdded\",\"inputs\":[{\"name\":\"interfaceId\",\"type\":\"bytes4\",\"indexed\":true,\"internalType\":\"bytes4\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"InterfaceRemoved\",\"inputs\":[{\"name\":\"interfaceId\",\"type\":\"bytes4\",\"indexed\":true,\"internalType\":\"bytes4\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"EntitlementGated_InvalidAddress\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EntitlementGated_NodeAlreadyVoted\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EntitlementGated_NodeNotFound\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EntitlementGated_TransactionCheckAlreadyCompleted\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EntitlementGated_TransactionCheckAlreadyRegistered\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EntitlementGated_TransactionNotRegistered\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Initializable_InInitializingState\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Initializable_NotInInitializingState\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Introspection_AlreadySupported\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Introspection_NotSupported\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ReentrancyGuard__ReentrantCall\",\"inputs\":[]}]", - Bin: "0x60806040523480156200001157600080fd5b5060405162001b9a38038062001b9a833981016040819052620000349162000127565b6200003e6200007f565b7f9075c515a635ba70c9696f31149324218d75cf00afe836c482e6473f38b19e0080546001600160a01b0319166001600160a01b0383161790555062000159565b7f59b501c3653afc186af7d48dda36cf6732bd21629a6295693664240a6ef520008054640100000000900460ff1615620000cc576040516366008a2d60e01b815260040160405180910390fd5b805463ffffffff90811610156200012457805463ffffffff191663ffffffff90811782556040519081527fe9c9b456cb2994b80aeef036cf59d26e9617df80f816a6ee5a5b4166e07e2f5c9060200160405180910390a15b50565b6000602082840312156200013a57600080fd5b81516001600160a01b03811681146200015257600080fd5b9392505050565b611a3180620001696000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c8063069a3ee91461005c5780634739e8051461008557806357e700271461009a5780637adc9cbe146100bb57806392c399ff146100ce575b600080fd5b61006f61006a366004610e1e565b6100e1565b60405161007c9190610f28565b60405180910390f35b610098610093366004610fd8565b610314565b005b6100ad6100a8366004611011565b6103b8565b60405190815260200161007c565b6100986100c9366004611074565b610426565b61006f6100dc366004611091565b61047c565b61010560405180606001604052806060815260200160608152602001606081525090565b6000828152602081815260408083208151815460809481028201850190935260608101838152909491938593919285929185015b828210156101a257600084815260209020604080518082019091529083018054829060ff16600281111561016f5761016f610e37565b600281111561018057610180610e37565b81529054610100900460ff166020918201529082526001929092019101610139565b50505050815260200160018201805480602002602001604051908101604052809291908181526020016000905b8282101561025a576000848152602090206040805160808101909152600484029091018054829060ff16600581111561020a5761020a610e37565b600581111561021b5761021b610e37565b815260018281015460208084019190915260028401546001600160a01b03166040840152600390930154606090920191909152918352920191016101cf565b50505050815260200160028201805480602002602001604051908101604052809291908181526020016000905b828210156103065760008481526020902060408051606081019091529083018054829060ff1660028111156102be576102be610e37565b60028111156102cf576102cf610e37565b8152905460ff6101008204811660208085019190915262010000909204166040909201919091529082526001929092019101610287565b505050915250909392505050565b60027f54f22f54f370bd020e00ee80e1a5099a71652e2ccbcf6a75281e4c70a3e11a00540361035657604051635db5c7cd60e11b815260040160405180910390fd5b61037f60027f54f22f54f370bd020e00ee80e1a5099a71652e2ccbcf6a75281e4c70a3e11a0055565b61038a8383836104aa565b6103b360017f54f22f54f370bd020e00ee80e1a5099a71652e2ccbcf6a75281e4c70a3e11a0055565b505050565b600082815260208190526040812082906103d2828261140a565b50506040516bffffffffffffffffffffffff193260601b16602082015243603482015260009060540160405160208183030381529060405280519060200120905061041f81306000610743565b9392505050565b7f59b501c3653afc186af7d48dda36cf6732bd21629a6295693664240a6ef5200054640100000000900460ff1661047057604051630ef4733760e31b815260040160405180910390fd5b610479816109f2565b50565b6104a060405180606001604052806060815260200160608152602001606081525090565b61041f8383610a2d565b6000838152600080516020611a118339815191526020526040902080546000805160206119f1833981519152919061010090046001600160a01b031615806104f45750805460ff16155b1561051257604051637ad5a43960e11b815260040160405180910390fd5b600084815260028201602052604090205460ff161561054457604051637912b73960e01b815260040160405180910390fd5b600084815260018201602052604081205481908190815b8181101561068257600089815260018701602052604081208054839081106105855761058561150e565b60009182526020909120018054909150336001600160a01b03909116036106115760008154600160a01b900460ff1660028111156105c5576105c5610e37565b146105e3576040516347592a4d60e01b815260040160405180910390fd5b80548990829060ff60a01b1916600160a01b83600281111561060757610607610e37565b0217905550600195505b60018154600160a01b900460ff16600281111561063057610630610e37565b03610647578461063f81611524565b955050610679565b60028154600160a01b900460ff16600281111561066657610666610e37565b03610679578361067581611524565b9450505b5060010161055b565b50836106a157604051638223a7e960e01b815260040160405180910390fd5b6106ac60028261153d565b8311806106c257506106bf60028261153d565b82115b156107385760008881526002860160205260408120805460ff191660011790558284116106f05760026106f3565b60015b9050897fb9d6ce397e562841871d119aaf77469c60a3b5bf8b99a5d9851656015015c63382604051610725919061155f565b60405180910390a26107368a610b27565b505b505050505050505050565b6000838152600080516020611a118339815191526020526040902080546000805160206119f1833981519152919060ff1615156001036107d55760005b60048201548110156107d357838260040182815481106107a2576107a261150e565b9060005260206000200154036107cb576040516301ab53df60e31b815260040160405180910390fd5b600101610780565b505b81546001600160a01b03166107ec576107ec610bfb565b8154604051634f84544560e01b8152600560048201526000916001600160a01b031690634f84544590602401600060405180830381865afa158015610835573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261085d9190810190611636565b825490915060ff1661089e5781546003830180546001600160a01b0319166001600160a01b0388161790556001600160a81b03191661010033021760011782555b600482018054600181018255600091825260208220018590555b815181101561098e5782600101600086815260200190815260200160002060405180604001604052808484815181106108f3576108f361150e565b60200260200101516001600160a01b031681526020016000600281111561091c5761091c610e37565b9052815460018101835560009283526020928390208251910180546001600160a01b031981166001600160a01b03909316928317825593830151929390929183916001600160a81b03191617600160a01b83600281111561097f5761097f610e37565b021790555050506001016108b8565b50825460405163541da4e560e01b81526001600160a01b039091169063541da4e5906109c49033908a90899087906004016116ca565b600060405180830381600087803b1580156109de57600080fd5b505af1158015610736573d6000803e3d6000fd5b610a02636afd38fd60e11b610ccc565b6000805160206119f183398151915280546001600160a01b0319166001600160a01b03831617905550565b610a5160405180606001604052806060815260200160608152602001606081525090565b6000838152600080516020611a118339815191526020526040812080546000805160206119f18339815191529260ff90911615159003610aa457604051637ad5a43960e11b815260040160405180910390fd5b600381015460405163069a3ee960e01b8152600481018690526001600160a01b0390911690600090829063069a3ee990602401600060405180830381865afa158015610af4573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610b1c9190810190611893565b979650505050505050565b6000818152600080516020611a11833981519152602052604081206000805160206119f1833981519152915b6004820154811015610ba757816001016000836004018381548110610b7a57610b7a61150e565b906000526020600020015481526020019081526020016000206000610b9f9190610daa565b600101610b53565b50610bb6600482016000610dc8565b6000838152600183016020526040812080546001600160a81b03191681556003810180546001600160a01b031916905590610bf46004830182610dc8565b5050505050565b60006000805160206119f1833981519152905060007fc21004fcc619240a31f006438274d15cd813308303284436eef6055f0fdcb60060060154604051628956cd60e71b81526c29b830b1b2a7b832b930ba37b960991b60048201526001600160a01b03909116906344ab668090602401602060405180830381865afa158015610c89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cad91906119d3565b82546001600160a01b0319166001600160a01b03919091161790915550565b6001600160e01b0319811660009081527f81088bbc801e045ea3e7620779ab349988f58afbdfba10dff983df3f33522b00602052604090205460ff161515600114610d59576001600160e01b0319811660009081527f81088bbc801e045ea3e7620779ab349988f58afbdfba10dff983df3f33522b0060205260409020805460ff19166001179055610d72565b604051637967f77d60e11b815260040160405180910390fd5b6040516001600160e01b03198216907f78f84e5b1c5c05be2b5ad3800781dd404d6d6c6302bc755c0fe20f58a33a7f2290600090a250565b50805460008255906000526020600020908101906104799190610de6565b50805460008255906000526020600020908101906104799190610e09565b5b80821115610e055780546001600160a81b0319168155600101610de7565b5090565b5b80821115610e055760008155600101610e0a565b600060208284031215610e3057600080fd5b5035919050565b634e487b7160e01b600052602160045260246000fd5b6003811061047957610479610e37565b60008151808452602080850194506020840160005b83811015610ec7578151805160068110610e8e57610e8e610e37565b885280840151848901526040808201516001600160a01b0316908901526060908101519088015260809096019590820190600101610e72565b509495945050505050565b60008151808452602080850194506020840160005b83811015610ec75781518051610efc81610e4d565b88528084015160ff908116858a0152604091820151169088015260609096019590820190600101610ee7565b6020808252825160608383015280516080840181905260009291820190839060a08601905b80831015610f845783518051610f6281610e4d565b835285015160ff16858301529284019260019290920191604090910190610f4d565b50838701519350601f19925082868203016040870152610fa48185610e5d565b93505050604085015181858403016060860152610fc18382610ed2565b9695505050505050565b6003811061047957600080fd5b600080600060608486031215610fed57600080fd5b8335925060208401359150604084013561100681610fcb565b809150509250925092565b6000806040838503121561102457600080fd5b82359150602083013567ffffffffffffffff81111561104257600080fd5b83016060818603121561105457600080fd5b809150509250929050565b6001600160a01b038116811461047957600080fd5b60006020828403121561108657600080fd5b813561041f8161105f565b600080604083850312156110a457600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60ff8116811461047957600080fd5b81356110f981610fcb565b61110281610e4d565b60ff1982541660ff82168117835550506020820135611120816110df565b815461ff001916600882901b61ff0016178255505050565b6000808335601e1984360301811261114f57600080fd5b83018035915067ffffffffffffffff82111561116a57600080fd5b6020019150600781901b360382131561118257600080fd5b9250929050565b6006811061047957600080fd5b81356111a181611189565b600681106111b1576111b1610e37565b60ff1982541660ff8216811783555050602082013560018201556002810160408301356111dd8161105f565b81546001600160a01b0319166001600160a01b03919091161790556060919091013560039190910155565b600160401b83111561121c5761121c6110b3565b80548382558084101561129a5760026001600160fe1b038281168314611244576112446110c9565b8086168614611255576112556110c9565b506000838152602081208360021b81018760021b820191505b8082101561129557828255826001830155828483015582600383015560048201915061126e565b505050505b5060008181526020812083915b858110156112cf576112b98383611196565b60809290920191600491909101906001016112a7565b505050505050565b6000808335601e198436030181126112ee57600080fd5b83018035915067ffffffffffffffff82111561130957600080fd5b602001915060608102360382131561118257600080fd5b813561132b81610fcb565b61133481610e4d565b60ff1982541660ff82168117835550506020820135611352816110df565b815461ff001916600882901b61ff0016178255506040820135611374816110df565b815462ff0000191660109190911b62ff00001617905550565b600160401b8311156113a1576113a16110b3565b8054838255808410156113d8576000828152602081208581019083015b808210156113d4578282556001820191506113be565b5050505b5060008181526020812083915b858110156112cf576113f78383611320565b60609290920191600191820191016113e5565b8135601e1983360301811261141e57600080fd5b8201803567ffffffffffffffff81111561143757600080fd5b6020820191508060061b360382131561144f57600080fd5b600160401b811115611463576114636110b3565b82548184558082101561149a576000848152602081208381019083015b8082101561149657828255600182019150611480565b5050505b5060008381526020902060005b828110156114cc576114b984836110ee565b60409390930192600191820191016114a7565b505050506114dd6020830183611138565b6114eb818360018601611208565b50506114fa60408301836112d7565b61150881836002860161138d565b50505050565b634e487b7160e01b600052603260045260246000fd5b600060018201611536576115366110c9565b5060010190565b60008261155a57634e487b7160e01b600052601260045260246000fd5b500490565b6020810161156c83610e4d565b91905290565b6040516080810167ffffffffffffffff81118282101715611595576115956110b3565b60405290565b6040516060810167ffffffffffffffff81118282101715611595576115956110b3565b6040805190810167ffffffffffffffff81118282101715611595576115956110b3565b604051601f8201601f1916810167ffffffffffffffff8111828210171561160a5761160a6110b3565b604052919050565b600067ffffffffffffffff82111561162c5761162c6110b3565b5060051b60200190565b6000602080838503121561164957600080fd5b825167ffffffffffffffff81111561166057600080fd5b8301601f8101851361167157600080fd5b805161168461167f82611612565b6115e1565b81815260059190911b820183019083810190878311156116a357600080fd5b928401925b82841015610b1c5783516116bb8161105f565b825292840192908401906116a8565b60006080820160018060a01b03808816845260208760208601528660408601526080606086015282865180855260a08701915060208801945060005b81811015611724578551851683529483019491830191600101611706565b50909a9950505050505050505050565b600082601f83011261174557600080fd5b8151602061175561167f83611612565b82815260079290921b8401810191818101908684111561177457600080fd5b8286015b848110156117d957608081890312156117915760008081fd5b611799611572565b81516117a481611189565b815281850151858201526040808301516117bd8161105f565b9082015260608281015190820152835291830191608001611778565b509695505050505050565b600082601f8301126117f557600080fd5b8151602061180561167f83611612565b8281526060928302850182019282820191908785111561182457600080fd5b8387015b858110156118865781818a0312156118405760008081fd5b61184861159b565b815161185381610fcb565b815281860151611862816110df565b81870152604082810151611875816110df565b908201528452928401928101611828565b5090979650505050505050565b600060208083850312156118a657600080fd5b825167ffffffffffffffff808211156118be57600080fd5b90840190606082870312156118d257600080fd5b6118da61159b565b8251828111156118e957600080fd5b8301601f810188136118fa57600080fd5b805161190861167f82611612565b81815260069190911b8201860190868101908a83111561192757600080fd5b928701925b8284101561197d576040848c0312156119455760008081fd5b61194d6115be565b845161195881610fcb565b815284890151611967816110df565b818a01528252604093909301929087019061192c565b8452505050828401518281111561199357600080fd5b61199f88828601611734565b858301525060408301519350818411156119b857600080fd5b6119c4878585016117e4565b60408201529695505050505050565b6000602082840312156119e557600080fd5b815161041f8161105f56fe9075c515a635ba70c9696f31149324218d75cf00afe836c482e6473f38b19e009075c515a635ba70c9696f31149324218d75cf00afe836c482e6473f38b19e01", + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"checker\",\"type\":\"address\",\"internalType\":\"contractIEntitlementChecker\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"__EntitlementGated_init\",\"inputs\":[{\"name\":\"entitlementChecker\",\"type\":\"address\",\"internalType\":\"contractIEntitlementChecker\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"getRuleData\",\"inputs\":[{\"name\":\"roleId\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIRuleEntitlement.RuleData\",\"components\":[{\"name\":\"operations\",\"type\":\"tuple[]\",\"internalType\":\"structIRuleEntitlement.Operation[]\",\"components\":[{\"name\":\"opType\",\"type\":\"uint8\",\"internalType\":\"enumIRuleEntitlement.CombinedOperationType\"},{\"name\":\"index\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]},{\"name\":\"checkOperations\",\"type\":\"tuple[]\",\"internalType\":\"structIRuleEntitlement.CheckOperation[]\",\"components\":[{\"name\":\"opType\",\"type\":\"uint8\",\"internalType\":\"enumIRuleEntitlement.CheckOperationType\"},{\"name\":\"chainId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"contractAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"threshold\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"logicalOperations\",\"type\":\"tuple[]\",\"internalType\":\"structIRuleEntitlement.LogicalOperation[]\",\"components\":[{\"name\":\"logOpType\",\"type\":\"uint8\",\"internalType\":\"enumIRuleEntitlement.LogicalOperationType\"},{\"name\":\"leftOperationIndex\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"rightOperationIndex\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getRuleData\",\"inputs\":[{\"name\":\"transactionId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"roleId\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIRuleEntitlement.RuleData\",\"components\":[{\"name\":\"operations\",\"type\":\"tuple[]\",\"internalType\":\"structIRuleEntitlement.Operation[]\",\"components\":[{\"name\":\"opType\",\"type\":\"uint8\",\"internalType\":\"enumIRuleEntitlement.CombinedOperationType\"},{\"name\":\"index\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]},{\"name\":\"checkOperations\",\"type\":\"tuple[]\",\"internalType\":\"structIRuleEntitlement.CheckOperation[]\",\"components\":[{\"name\":\"opType\",\"type\":\"uint8\",\"internalType\":\"enumIRuleEntitlement.CheckOperationType\"},{\"name\":\"chainId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"contractAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"threshold\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"logicalOperations\",\"type\":\"tuple[]\",\"internalType\":\"structIRuleEntitlement.LogicalOperation[]\",\"components\":[{\"name\":\"logOpType\",\"type\":\"uint8\",\"internalType\":\"enumIRuleEntitlement.LogicalOperationType\"},{\"name\":\"leftOperationIndex\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"rightOperationIndex\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"postEntitlementCheckResult\",\"inputs\":[{\"name\":\"transactionId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"roleId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"result\",\"type\":\"uint8\",\"internalType\":\"enumIEntitlementGatedBase.NodeVoteStatus\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"requestEntitlementCheck\",\"inputs\":[{\"name\":\"roleId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"ruleData\",\"type\":\"tuple\",\"internalType\":\"structIRuleEntitlement.RuleData\",\"components\":[{\"name\":\"operations\",\"type\":\"tuple[]\",\"internalType\":\"structIRuleEntitlement.Operation[]\",\"components\":[{\"name\":\"opType\",\"type\":\"uint8\",\"internalType\":\"enumIRuleEntitlement.CombinedOperationType\"},{\"name\":\"index\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]},{\"name\":\"checkOperations\",\"type\":\"tuple[]\",\"internalType\":\"structIRuleEntitlement.CheckOperation[]\",\"components\":[{\"name\":\"opType\",\"type\":\"uint8\",\"internalType\":\"enumIRuleEntitlement.CheckOperationType\"},{\"name\":\"chainId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"contractAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"threshold\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"logicalOperations\",\"type\":\"tuple[]\",\"internalType\":\"structIRuleEntitlement.LogicalOperation[]\",\"components\":[{\"name\":\"logOpType\",\"type\":\"uint8\",\"internalType\":\"enumIRuleEntitlement.LogicalOperationType\"},{\"name\":\"leftOperationIndex\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"rightOperationIndex\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"EntitlementCheckResultPosted\",\"inputs\":[{\"name\":\"transactionId\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"result\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"enumIEntitlementGatedBase.NodeVoteStatus\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"InterfaceAdded\",\"inputs\":[{\"name\":\"interfaceId\",\"type\":\"bytes4\",\"indexed\":true,\"internalType\":\"bytes4\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"InterfaceRemoved\",\"inputs\":[{\"name\":\"interfaceId\",\"type\":\"bytes4\",\"indexed\":true,\"internalType\":\"bytes4\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"EntitlementGated_InvalidAddress\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EntitlementGated_NodeAlreadyVoted\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EntitlementGated_NodeNotFound\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EntitlementGated_TransactionCheckAlreadyCompleted\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EntitlementGated_TransactionCheckAlreadyRegistered\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EntitlementGated_TransactionNotRegistered\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Initializable_InInitializingState\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Initializable_NotInInitializingState\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Introspection_AlreadySupported\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Introspection_NotSupported\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ReentrancyGuard__ReentrantCall\",\"inputs\":[]}]", + Bin: "0x60806040523480156200001157600080fd5b5060405162001b9a38038062001b9a833981016040819052620000349162000127565b6200003e6200007f565b7f9075c515a635ba70c9696f31149324218d75cf00afe836c482e6473f38b19e0080546001600160a01b0319166001600160a01b0383161790555062000159565b7f59b501c3653afc186af7d48dda36cf6732bd21629a6295693664240a6ef520008054640100000000900460ff1615620000cc576040516366008a2d60e01b815260040160405180910390fd5b805463ffffffff90811610156200012457805463ffffffff191663ffffffff90811782556040519081527fe9c9b456cb2994b80aeef036cf59d26e9617df80f816a6ee5a5b4166e07e2f5c9060200160405180910390a15b50565b6000602082840312156200013a57600080fd5b81516001600160a01b03811681146200015257600080fd5b9392505050565b611a3180620001696000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c8063069a3ee91461005c5780634739e8051461008557806357e700271461009a5780637adc9cbe146100bb57806392c399ff146100ce575b600080fd5b61006f61006a366004610e1e565b6100e1565b60405161007c9190610f28565b60405180910390f35b610098610093366004610fd8565b610314565b005b6100ad6100a8366004611011565b6103b8565b60405190815260200161007c565b6100986100c9366004611074565b610426565b61006f6100dc366004611091565b61047c565b61010560405180606001604052806060815260200160608152602001606081525090565b6000828152602081815260408083208151815460809481028201850190935260608101838152909491938593919285929185015b828210156101a257600084815260209020604080518082019091529083018054829060ff16600281111561016f5761016f610e37565b600281111561018057610180610e37565b81529054610100900460ff166020918201529082526001929092019101610139565b50505050815260200160018201805480602002602001604051908101604052809291908181526020016000905b8282101561025a576000848152602090206040805160808101909152600484029091018054829060ff16600581111561020a5761020a610e37565b600581111561021b5761021b610e37565b815260018281015460208084019190915260028401546001600160a01b03166040840152600390930154606090920191909152918352920191016101cf565b50505050815260200160028201805480602002602001604051908101604052809291908181526020016000905b828210156103065760008481526020902060408051606081019091529083018054829060ff1660028111156102be576102be610e37565b60028111156102cf576102cf610e37565b8152905460ff6101008204811660208085019190915262010000909204166040909201919091529082526001929092019101610287565b505050915250909392505050565b60027f54f22f54f370bd020e00ee80e1a5099a71652e2ccbcf6a75281e4c70a3e11a00540361035657604051635db5c7cd60e11b815260040160405180910390fd5b61037f60027f54f22f54f370bd020e00ee80e1a5099a71652e2ccbcf6a75281e4c70a3e11a0055565b61038a8383836104aa565b6103b360017f54f22f54f370bd020e00ee80e1a5099a71652e2ccbcf6a75281e4c70a3e11a0055565b505050565b600082815260208190526040812082906103d2828261140a565b50506040516bffffffffffffffffffffffff193260601b16602082015243603482015260009060540160405160208183030381529060405280519060200120905061041f81306000610743565b9392505050565b7f59b501c3653afc186af7d48dda36cf6732bd21629a6295693664240a6ef5200054640100000000900460ff1661047057604051630ef4733760e31b815260040160405180910390fd5b610479816109f2565b50565b6104a060405180606001604052806060815260200160608152602001606081525090565b61041f8383610a2d565b6000838152600080516020611a118339815191526020526040902080546000805160206119f1833981519152919061010090046001600160a01b031615806104f45750805460ff16155b1561051257604051637ad5a43960e11b815260040160405180910390fd5b600084815260028201602052604090205460ff161561054457604051637912b73960e01b815260040160405180910390fd5b600084815260018201602052604081205481908190815b8181101561068257600089815260018701602052604081208054839081106105855761058561150e565b60009182526020909120018054909150336001600160a01b03909116036106115760008154600160a01b900460ff1660028111156105c5576105c5610e37565b146105e3576040516347592a4d60e01b815260040160405180910390fd5b80548990829060ff60a01b1916600160a01b83600281111561060757610607610e37565b0217905550600195505b60018154600160a01b900460ff16600281111561063057610630610e37565b03610647578461063f81611524565b955050610679565b60028154600160a01b900460ff16600281111561066657610666610e37565b03610679578361067581611524565b9450505b5060010161055b565b50836106a157604051638223a7e960e01b815260040160405180910390fd5b6106ac60028261153d565b8311806106c257506106bf60028261153d565b82115b156107385760008881526002860160205260408120805460ff191660011790558284116106f05760026106f3565b60015b9050897fb9d6ce397e562841871d119aaf77469c60a3b5bf8b99a5d9851656015015c63382604051610725919061155f565b60405180910390a26107368a610b27565b505b505050505050505050565b6000838152600080516020611a118339815191526020526040902080546000805160206119f1833981519152919060ff1615156001036107d55760005b60048201548110156107d357838260040182815481106107a2576107a261150e565b9060005260206000200154036107cb576040516301ab53df60e31b815260040160405180910390fd5b600101610780565b505b81546001600160a01b03166107ec576107ec610bfb565b8154604051634f84544560e01b8152600560048201526000916001600160a01b031690634f84544590602401600060405180830381865afa158015610835573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261085d9190810190611636565b825490915060ff1661089e5781546003830180546001600160a01b0319166001600160a01b0388161790556001600160a81b03191661010033021760011782555b600482018054600181018255600091825260208220018590555b815181101561098e5782600101600086815260200190815260200160002060405180604001604052808484815181106108f3576108f361150e565b60200260200101516001600160a01b031681526020016000600281111561091c5761091c610e37565b9052815460018101835560009283526020928390208251910180546001600160a01b031981166001600160a01b03909316928317825593830151929390929183916001600160a81b03191617600160a01b83600281111561097f5761097f610e37565b021790555050506001016108b8565b50825460405163541da4e560e01b81526001600160a01b039091169063541da4e5906109c49033908a90899087906004016116ca565b600060405180830381600087803b1580156109de57600080fd5b505af1158015610736573d6000803e3d6000fd5b610a02636afd38fd60e11b610ccc565b6000805160206119f183398151915280546001600160a01b0319166001600160a01b03831617905550565b610a5160405180606001604052806060815260200160608152602001606081525090565b6000838152600080516020611a118339815191526020526040812080546000805160206119f18339815191529260ff90911615159003610aa457604051637ad5a43960e11b815260040160405180910390fd5b600381015460405163069a3ee960e01b8152600481018690526001600160a01b0390911690600090829063069a3ee990602401600060405180830381865afa158015610af4573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610b1c9190810190611893565b979650505050505050565b6000818152600080516020611a11833981519152602052604081206000805160206119f1833981519152915b6004820154811015610ba757816001016000836004018381548110610b7a57610b7a61150e565b906000526020600020015481526020019081526020016000206000610b9f9190610daa565b600101610b53565b50610bb6600482016000610dc8565b6000838152600183016020526040812080546001600160a81b03191681556003810180546001600160a01b031916905590610bf46004830182610dc8565b5050505050565b60006000805160206119f1833981519152905060007fc21004fcc619240a31f006438274d15cd813308303284436eef6055f0fdcb60060060154604051628956cd60e71b81526c29b830b1b2a7b832b930ba37b960991b60048201526001600160a01b03909116906344ab668090602401602060405180830381865afa158015610c89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cad91906119d3565b82546001600160a01b0319166001600160a01b03919091161790915550565b6001600160e01b0319811660009081527f81088bbc801e045ea3e7620779ab349988f58afbdfba10dff983df3f33522b00602052604090205460ff161515600114610d59576001600160e01b0319811660009081527f81088bbc801e045ea3e7620779ab349988f58afbdfba10dff983df3f33522b0060205260409020805460ff19166001179055610d72565b604051637967f77d60e11b815260040160405180910390fd5b6040516001600160e01b03198216907f78f84e5b1c5c05be2b5ad3800781dd404d6d6c6302bc755c0fe20f58a33a7f2290600090a250565b50805460008255906000526020600020908101906104799190610de6565b50805460008255906000526020600020908101906104799190610e09565b5b80821115610e055780546001600160a81b0319168155600101610de7565b5090565b5b80821115610e055760008155600101610e0a565b600060208284031215610e3057600080fd5b5035919050565b634e487b7160e01b600052602160045260246000fd5b6003811061047957610479610e37565b60008151808452602080850194506020840160005b83811015610ec7578151805160068110610e8e57610e8e610e37565b885280840151848901526040808201516001600160a01b0316908901526060908101519088015260809096019590820190600101610e72565b509495945050505050565b60008151808452602080850194506020840160005b83811015610ec75781518051610efc81610e4d565b88528084015160ff908116858a0152604091820151169088015260609096019590820190600101610ee7565b6020808252825160608383015280516080840181905260009291820190839060a08601905b80831015610f845783518051610f6281610e4d565b835285015160ff16858301529284019260019290920191604090910190610f4d565b50838701519350601f19925082868203016040870152610fa48185610e5d565b93505050604085015181858403016060860152610fc18382610ed2565b9695505050505050565b6003811061047957600080fd5b600080600060608486031215610fed57600080fd5b8335925060208401359150604084013561100681610fcb565b809150509250925092565b6000806040838503121561102457600080fd5b82359150602083013567ffffffffffffffff81111561104257600080fd5b83016060818603121561105457600080fd5b809150509250929050565b6001600160a01b038116811461047957600080fd5b60006020828403121561108657600080fd5b813561041f8161105f565b600080604083850312156110a457600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60ff8116811461047957600080fd5b81356110f981610fcb565b61110281610e4d565b60ff1982541660ff82168117835550506020820135611120816110df565b815461ff001916600882901b61ff0016178255505050565b6000808335601e1984360301811261114f57600080fd5b83018035915067ffffffffffffffff82111561116a57600080fd5b6020019150600781901b360382131561118257600080fd5b9250929050565b6006811061047957600080fd5b81356111a181611189565b600681106111b1576111b1610e37565b60ff1982541660ff8216811783555050602082013560018201556002810160408301356111dd8161105f565b81546001600160a01b0319166001600160a01b03919091161790556060919091013560039190910155565b600160401b83111561121c5761121c6110b3565b80548382558084101561129a5760026001600160fe1b038281168314611244576112446110c9565b8086168614611255576112556110c9565b506000838152602081208360021b81018760021b820191505b8082101561129557828255826001830155828483015582600383015560048201915061126e565b505050505b5060008181526020812083915b858110156112cf576112b98383611196565b60809290920191600491909101906001016112a7565b505050505050565b6000808335601e198436030181126112ee57600080fd5b83018035915067ffffffffffffffff82111561130957600080fd5b602001915060608102360382131561118257600080fd5b813561132b81610fcb565b61133481610e4d565b60ff1982541660ff82168117835550506020820135611352816110df565b815461ff001916600882901b61ff0016178255506040820135611374816110df565b815462ff0000191660109190911b62ff00001617905550565b600160401b8311156113a1576113a16110b3565b8054838255808410156113d8576000828152602081208581019083015b808210156113d4578282556001820191506113be565b5050505b5060008181526020812083915b858110156112cf576113f78383611320565b60609290920191600191820191016113e5565b8135601e1983360301811261141e57600080fd5b8201803567ffffffffffffffff81111561143757600080fd5b6020820191508060061b360382131561144f57600080fd5b600160401b811115611463576114636110b3565b82548184558082101561149a576000848152602081208381019083015b8082101561149657828255600182019150611480565b5050505b5060008381526020902060005b828110156114cc576114b984836110ee565b60409390930192600191820191016114a7565b505050506114dd6020830183611138565b6114eb818360018601611208565b50506114fa60408301836112d7565b61150881836002860161138d565b50505050565b634e487b7160e01b600052603260045260246000fd5b600060018201611536576115366110c9565b5060010190565b60008261155a57634e487b7160e01b600052601260045260246000fd5b500490565b6020810161156c83610e4d565b91905290565b6040516080810167ffffffffffffffff81118282101715611595576115956110b3565b60405290565b6040516060810167ffffffffffffffff81118282101715611595576115956110b3565b6040805190810167ffffffffffffffff81118282101715611595576115956110b3565b604051601f8201601f1916810167ffffffffffffffff8111828210171561160a5761160a6110b3565b604052919050565b600067ffffffffffffffff82111561162c5761162c6110b3565b5060051b60200190565b6000602080838503121561164957600080fd5b825167ffffffffffffffff81111561166057600080fd5b8301601f8101851361167157600080fd5b805161168461167f82611612565b6115e1565b81815260059190911b820183019083810190878311156116a357600080fd5b928401925b82841015610b1c5783516116bb8161105f565b825292840192908401906116a8565b60006080820160018060a01b03808816845260208760208601528660408601526080606086015282865180855260a08701915060208801945060005b81811015611724578551851683529483019491830191600101611706565b50909a9950505050505050505050565b600082601f83011261174557600080fd5b8151602061175561167f83611612565b82815260079290921b8401810191818101908684111561177457600080fd5b8286015b848110156117d957608081890312156117915760008081fd5b611799611572565b81516117a481611189565b815281850151858201526040808301516117bd8161105f565b9082015260608281015190820152835291830191608001611778565b509695505050505050565b600082601f8301126117f557600080fd5b8151602061180561167f83611612565b8281526060928302850182019282820191908785111561182457600080fd5b8387015b858110156118865781818a0312156118405760008081fd5b61184861159b565b815161185381610fcb565b815281860151611862816110df565b81870152604082810151611875816110df565b908201528452928401928101611828565b5090979650505050505050565b600060208083850312156118a657600080fd5b825167ffffffffffffffff808211156118be57600080fd5b90840190606082870312156118d257600080fd5b6118da61159b565b8251828111156118e957600080fd5b8301601f810188136118fa57600080fd5b805161190861167f82611612565b81815260069190911b8201860190868101908a83111561192757600080fd5b928701925b8284101561197d576040848c0312156119455760008081fd5b61194d6115be565b845161195881610fcb565b815284890151611967816110df565b818a01528252604093909301929087019061192c565b8452505050828401518281111561199357600080fd5b61199f88828601611734565b858301525060408301519350818411156119b857600080fd5b6119c4878585016117e4565b60408201529695505050505050565b6000602082840312156119e557600080fd5b815161041f8161105f56fe9075c515a635ba70c9696f31149324218d75cf00afe836c482e6473f38b19e009075c515a635ba70c9696f31149324218d75cf00afe836c482e6473f38b19e01", } // MockEntitlementGatedABI is the input ABI used to generate the binding from. @@ -62,61 +90,61 @@ func DeployMockEntitlementGated(auth *bind.TransactOpts, backend bind.ContractBa // MockEntitlementGated is an auto generated Go binding around an Ethereum contract. type MockEntitlementGated struct { - MockEntitlementGatedCaller // Read-only binding to the contract - MockEntitlementGatedTransactor // Write-only binding to the contract - MockEntitlementGatedFilterer // Log filterer for contract events + MockEntitlementGatedCaller // Read-only binding to the contract + MockEntitlementGatedTransactor // Write-only binding to the contract + MockEntitlementGatedFilterer // Log filterer for contract events } // MockEntitlementGatedCaller is an auto generated read-only Go binding around an Ethereum contract. type MockEntitlementGatedCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls + contract *bind.BoundContract // Generic contract wrapper for the low level calls } // MockEntitlementGatedTransactor is an auto generated write-only Go binding around an Ethereum contract. type MockEntitlementGatedTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls + contract *bind.BoundContract // Generic contract wrapper for the low level calls } // MockEntitlementGatedFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type MockEntitlementGatedFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls + contract *bind.BoundContract // Generic contract wrapper for the low level calls } // MockEntitlementGatedSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type MockEntitlementGatedSession struct { - Contract *MockEntitlementGated // 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 + Contract *MockEntitlementGated // 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 } // MockEntitlementGatedCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type MockEntitlementGatedCallerSession struct { - Contract *MockEntitlementGatedCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session + Contract *MockEntitlementGatedCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session } // MockEntitlementGatedTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type MockEntitlementGatedTransactorSession struct { - Contract *MockEntitlementGatedTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session + Contract *MockEntitlementGatedTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // MockEntitlementGatedRaw is an auto generated low-level Go binding around an Ethereum contract. type MockEntitlementGatedRaw struct { - Contract *MockEntitlementGated // Generic contract binding to access the raw methods on + Contract *MockEntitlementGated // Generic contract binding to access the raw methods on } // MockEntitlementGatedCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type MockEntitlementGatedCallerRaw struct { - Contract *MockEntitlementGatedCaller // Generic read-only contract binding to access the raw methods on + Contract *MockEntitlementGatedCaller // Generic read-only contract binding to access the raw methods on } // MockEntitlementGatedTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type MockEntitlementGatedTransactorRaw struct { - Contract *MockEntitlementGatedTransactor // Generic write-only contract binding to access the raw methods on + Contract *MockEntitlementGatedTransactor // Generic write-only contract binding to access the raw methods on } // NewMockEntitlementGated creates a new instance of MockEntitlementGated, bound to a specific deployed contract. @@ -329,15 +357,15 @@ func (_MockEntitlementGated *MockEntitlementGatedTransactorSession) RequestEntit // MockEntitlementGatedEntitlementCheckResultPostedIterator is returned from FilterEntitlementCheckResultPosted and is used to iterate over the raw logs and unpacked data for EntitlementCheckResultPosted events raised by the MockEntitlementGated contract. type MockEntitlementGatedEntitlementCheckResultPostedIterator struct { - Event *MockEntitlementGatedEntitlementCheckResultPosted // Event containing the contract specifics and raw log + Event *MockEntitlementGatedEntitlementCheckResultPosted // 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 + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there @@ -396,9 +424,9 @@ func (it *MockEntitlementGatedEntitlementCheckResultPostedIterator) Close() erro // MockEntitlementGatedEntitlementCheckResultPosted represents a EntitlementCheckResultPosted event raised by the MockEntitlementGated contract. type MockEntitlementGatedEntitlementCheckResultPosted struct { - TransactionId [32]byte - Result uint8 - Raw types.Log // Blockchain specific contextual infos + TransactionId [32]byte + Result uint8 + Raw types.Log // Blockchain specific contextual infos } // FilterEntitlementCheckResultPosted is a free log retrieval operation binding the contract event 0xb9d6ce397e562841871d119aaf77469c60a3b5bf8b99a5d9851656015015c633. @@ -474,15 +502,15 @@ func (_MockEntitlementGated *MockEntitlementGatedFilterer) ParseEntitlementCheck // MockEntitlementGatedInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the MockEntitlementGated contract. type MockEntitlementGatedInitializedIterator struct { - Event *MockEntitlementGatedInitialized // Event containing the contract specifics and raw log + Event *MockEntitlementGatedInitialized // 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 + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there @@ -541,8 +569,8 @@ func (it *MockEntitlementGatedInitializedIterator) Close() error { // MockEntitlementGatedInitialized represents a Initialized event raised by the MockEntitlementGated contract. type MockEntitlementGatedInitialized struct { - Version uint32 - Raw types.Log // Blockchain specific contextual infos + Version uint32 + Raw types.Log // Blockchain specific contextual infos } // FilterInitialized is a free log retrieval operation binding the contract event 0xe9c9b456cb2994b80aeef036cf59d26e9617df80f816a6ee5a5b4166e07e2f5c. @@ -608,15 +636,15 @@ func (_MockEntitlementGated *MockEntitlementGatedFilterer) ParseInitialized(log // MockEntitlementGatedInterfaceAddedIterator is returned from FilterInterfaceAdded and is used to iterate over the raw logs and unpacked data for InterfaceAdded events raised by the MockEntitlementGated contract. type MockEntitlementGatedInterfaceAddedIterator struct { - Event *MockEntitlementGatedInterfaceAdded // Event containing the contract specifics and raw log + Event *MockEntitlementGatedInterfaceAdded // 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 + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there @@ -675,8 +703,8 @@ func (it *MockEntitlementGatedInterfaceAddedIterator) Close() error { // MockEntitlementGatedInterfaceAdded represents a InterfaceAdded event raised by the MockEntitlementGated contract. type MockEntitlementGatedInterfaceAdded struct { - InterfaceId [4]byte - Raw types.Log // Blockchain specific contextual infos + InterfaceId [4]byte + Raw types.Log // Blockchain specific contextual infos } // FilterInterfaceAdded is a free log retrieval operation binding the contract event 0x78f84e5b1c5c05be2b5ad3800781dd404d6d6c6302bc755c0fe20f58a33a7f22. @@ -752,15 +780,15 @@ func (_MockEntitlementGated *MockEntitlementGatedFilterer) ParseInterfaceAdded(l // MockEntitlementGatedInterfaceRemovedIterator is returned from FilterInterfaceRemoved and is used to iterate over the raw logs and unpacked data for InterfaceRemoved events raised by the MockEntitlementGated contract. type MockEntitlementGatedInterfaceRemovedIterator struct { - Event *MockEntitlementGatedInterfaceRemoved // Event containing the contract specifics and raw log + Event *MockEntitlementGatedInterfaceRemoved // 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 + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there @@ -819,8 +847,8 @@ func (it *MockEntitlementGatedInterfaceRemovedIterator) Close() error { // MockEntitlementGatedInterfaceRemoved represents a InterfaceRemoved event raised by the MockEntitlementGated contract. type MockEntitlementGatedInterfaceRemoved struct { - InterfaceId [4]byte - Raw types.Log // Blockchain specific contextual infos + InterfaceId [4]byte + Raw types.Log // Blockchain specific contextual infos } // FilterInterfaceRemoved is a free log retrieval operation binding the contract event 0x8bd383568d0bc57b64b8e424138fc19ae827e694e05757faa8fea8f63fb87315. diff --git a/core/xchain/contracts/test/mock_erc20.go b/core/contracts/base/deploy/mock_erc20.go similarity index 99% rename from core/xchain/contracts/test/mock_erc20.go rename to core/contracts/base/deploy/mock_erc20.go index e64c350de..620d034df 100644 --- a/core/xchain/contracts/test/mock_erc20.go +++ b/core/contracts/base/deploy/mock_erc20.go @@ -1,7 +1,7 @@ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. -package dev +package deploy import ( "errors" diff --git a/core/xchain/contracts/test/mock_erc721.go b/core/contracts/base/deploy/mock_erc721.go similarity index 99% rename from core/xchain/contracts/test/mock_erc721.go rename to core/contracts/base/deploy/mock_erc721.go index 0a7b786f0..c95be49a2 100644 --- a/core/xchain/contracts/test/mock_erc721.go +++ b/core/contracts/base/deploy/mock_erc721.go @@ -1,7 +1,7 @@ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. -package dev +package deploy import ( "errors" diff --git a/core/xchain/contracts/dev/wallet_link.go b/core/contracts/base/deploy/wallet_link.go similarity index 92% rename from core/xchain/contracts/dev/wallet_link.go rename to core/contracts/base/deploy/wallet_link.go index a460be941..ee9dd1506 100644 --- a/core/xchain/contracts/dev/wallet_link.go +++ b/core/contracts/base/deploy/wallet_link.go @@ -1,7 +1,7 @@ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. -package dev +package deploy import ( "errors" @@ -18,21 +18,27 @@ import ( // Reference imports to suppress errors if they are not otherwise used. var ( - _ = errors.New - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription - _ = abi.ConvertType + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType ) +// IWalletLinkBaseLinkedWallet is an auto generated low-level Go binding around an user-defined struct. +type IWalletLinkBaseLinkedWallet struct { + Addr common.Address + Signature []byte +} + // WalletLinkMetaData contains all meta data concerning the WalletLink contract. var WalletLinkMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"function\",\"name\":\"__WalletLink_init\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"checkIfLinked\",\"inputs\":[{\"name\":\"rootKey\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"wallet\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getLatestNonceForRootKey\",\"inputs\":[{\"name\":\"rootKey\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getRootKeyForWallet\",\"inputs\":[{\"name\":\"wallet\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"rootKey\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getWalletsByRootKey\",\"inputs\":[{\"name\":\"rootKey\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"wallets\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"linkCallerToRootKey\",\"inputs\":[{\"name\":\"rootWallet\",\"type\":\"tuple\",\"internalType\":\"structIWalletLinkBase.LinkedWallet\",\"components\":[{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"linkWalletToRootKey\",\"inputs\":[{\"name\":\"wallet\",\"type\":\"tuple\",\"internalType\":\"structIWalletLinkBase.LinkedWallet\",\"components\":[{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"rootWallet\",\"type\":\"tuple\",\"internalType\":\"structIWalletLinkBase.LinkedWallet\",\"components\":[{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"removeLink\",\"inputs\":[{\"name\":\"wallet\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"rootWallet\",\"type\":\"tuple\",\"internalType\":\"structIWalletLinkBase.LinkedWallet\",\"components\":[{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"InterfaceAdded\",\"inputs\":[{\"name\":\"interfaceId\",\"type\":\"bytes4\",\"indexed\":true,\"internalType\":\"bytes4\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"InterfaceRemoved\",\"inputs\":[{\"name\":\"interfaceId\",\"type\":\"bytes4\",\"indexed\":true,\"internalType\":\"bytes4\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"LinkWalletToRootKey\",\"inputs\":[{\"name\":\"wallet\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"rootKey\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RemoveLink\",\"inputs\":[{\"name\":\"wallet\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"secondWallet\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"ECDSAInvalidSignature\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ECDSAInvalidSignatureLength\",\"inputs\":[{\"name\":\"length\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"ECDSAInvalidSignatureS\",\"inputs\":[{\"name\":\"s\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"Initializable_InInitializingState\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Initializable_NotInInitializingState\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Introspection_AlreadySupported\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Introspection_NotSupported\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidAccountNonce\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"currentNonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"WalletLink__CannotLinkToRootWallet\",\"inputs\":[{\"name\":\"wallet\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"rootKey\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"WalletLink__CannotLinkToSelf\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"WalletLink__CannotRemoveRootWallet\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"WalletLink__InvalidAddress\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"WalletLink__InvalidSignature\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"WalletLink__LinkAlreadyExists\",\"inputs\":[{\"name\":\"wallet\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"rootKey\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"WalletLink__LinkedToAnotherRootKey\",\"inputs\":[{\"name\":\"wallet\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"rootKey\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"WalletLink__NotLinked\",\"inputs\":[{\"name\":\"wallet\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"rootKey\",\"type\":\"address\",\"internalType\":\"address\"}]}]", - Bin: "0x608060405234801561001057600080fd5b5061001961001e565b6100c4565b7f59b501c3653afc186af7d48dda36cf6732bd21629a6295693664240a6ef520008054640100000000900460ff161561006a576040516366008a2d60e01b815260040160405180910390fd5b805463ffffffff90811610156100c157805463ffffffff191663ffffffff90811782556040519081527fe9c9b456cb2994b80aeef036cf59d26e9617df80f816a6ee5a5b4166e07e2f5c9060200160405180910390a15b50565b6111ba806100d36000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c8063912b97581161005b578063912b9758146100f4578063d80bd3b914610117578063e65dfe9d1461012a578063f82103981461013d57600080fd5b806302345b981461008d5780631a31fc8d146100b657806320a00ac8146100cb578063260a409d146100ec575b600080fd5b6100a061009b366004610e84565b610168565b6040516100ad9190610e9f565b60405180910390f35b6100c96100c436600461100b565b610179565b005b6100de6100d9366004610e84565b610189565b6040519081526020016100ad565b6100c96101c6565b610107610102366004611078565b610222565b60405190151581526020016100ad565b6100c96101253660046110ab565b61026b565b6100c96101383660046110f1565b610276565b61015061014b366004610e84565b610284565b6040516001600160a01b0390911681526020016100ad565b6060610173826102c5565b92915050565b6101848383836102f6565b505050565b6001600160a01b03811660009081527fda5d6d87446d81938877f0ee239dac391146dd7466ea30567f72becf06773c006020526040812054610173565b7f59b501c3653afc186af7d48dda36cf6732bd21629a6295693664240a6ef5200054640100000000900460ff1661021057604051630ef4733760e31b815260040160405180910390fd5b610220636ff9143960e01b6104da565b565b6001600160a01b0381811660009081527f19511ce7944c192b1007be99b82019218d1decfc513f05239612743360a0dc01602052604081205490918481169116145b9392505050565b6101848383836105b8565b6102808282610780565b5050565b6001600160a01b0380821660009081527f19511ce7944c192b1007be99b82019218d1decfc513f05239612743360a0dc016020526040812054909116610173565b6001600160a01b038116600090815260008051602061119a83398151915260205260409020606090610173906108a7565b8251825160008051602061119a83398151915291610316918391906108b4565b8351604080516001600160a01b0390921660208301528101839052600090610385906060015b604051602081830303815290604052805190602001207f19457468657265756d205369676e6564204d6573736167653a0a3332000000006000908152601c91909152603c902090565b905083600001516001600160a01b03166103a3828660200151610a25565b6001600160a01b0316146103ca57604051632af0041d60e11b815260040160405180910390fd5b8351604080516001600160a01b03909216602083015281018490526000906103f49060600161033c565b905085600001516001600160a01b0316610412828860200151610a25565b6001600160a01b03161461043957604051632af0041d60e11b815260040160405180910390fd5b84516104459085610a4f565b855185516001600160a01b0316600090815260208590526040902061046991610ac1565b50845186516001600160a01b03908116600090815260018601602052604080822080546001600160a01b0319169484169490941790935587518951935190831693909216917f64126824352170c4025060d1f6e215159635e4b08e649830695f26ef6d2b57219190a3505050505050565b6001600160e01b0319811660009081527f81088bbc801e045ea3e7620779ab349988f58afbdfba10dff983df3f33522b00602052604090205460ff161515600114610567576001600160e01b0319811660009081527f81088bbc801e045ea3e7620779ab349988f58afbdfba10dff983df3f33522b0060205260409020805460ff19166001179055610580565b604051637967f77d60e11b815260040160405180910390fd5b6040516001600160e01b03198216907f78f84e5b1c5c05be2b5ad3800781dd404d6d6c6302bc755c0fe20f58a33a7f2290600090a250565b60008051602061119a8339815191526001600160a01b03841615806105e5575082516001600160a01b0316155b1561060357604051636df3f5c360e01b815260040160405180910390fd5b82600001516001600160a01b0316846001600160a01b031603610639576040516333976e3b60e11b815260040160405180910390fd5b82516001600160a01b0385811660009081526001840160205260409020548116911614610694578251604051635e300c8360e01b81526001600160a01b03808716600483015290911660248201526044015b60405180910390fd5b604080516001600160a01b03861660208201529081018390526000906106bc9060600161033c565b905083600001516001600160a01b03166106da828660200151610a25565b6001600160a01b03161461070157604051632af0041d60e11b815260040160405180910390fd5b6001600160a01b038086166000908152600184016020908152604080832080546001600160a01b031916905587519093168252849052206107429086610ad6565b5060405133906001600160a01b038716907f9a9d98629b39adf596077fc95a0712ba55c38f40a354e99d366a10f9c3e27da290600090a35050505050565b815160008051602061119a8339815191529033906107a190839083906108b4565b604080516001600160a01b03831660208201529081018490526000906107c99060600161033c565b905084600001516001600160a01b03166107e7828760200151610a25565b6001600160a01b03161461080e57604051632af0041d60e11b815260040160405180910390fd5b845161081a9085610a4f565b84516001600160a01b0316600090815260208490526040902061083d9083610ac1565b5084516001600160a01b03838116600081815260018701602052604080822080546001600160a01b0319169585169590951790945588519351939092169290917f64126824352170c4025060d1f6e215159635e4b08e649830695f26ef6d2b572191a35050505050565b6060600061026483610aeb565b6001600160a01b03821615806108d157506001600160a01b038116155b156108ef57604051636df3f5c360e01b815260040160405180910390fd5b806001600160a01b0316826001600160a01b0316036109215760405163848ba26d60e01b815260040160405180910390fd5b6001600160a01b038281166000908152600185016020526040902054161561096f576040516314790b7f60e01b81526001600160a01b0380841660048301528216602482015260440161068b565b6001600160a01b03818116600090815260018501602052604090205416156109d2576001600160a01b038181166000908152600185016020526040908190205490516347227b5d60e01b815284831660048201529116602482015260440161068b565b6001600160a01b03821660009081526020849052604081206109f390610b47565b111561018457604051637b815eed60e11b81526001600160a01b0380841660048301528216602482015260440161068b565b600080600080610a358686610b51565b925092509250610a458282610b9e565b5090949350505050565b6001600160a01b03821660009081527fda5d6d87446d81938877f0ee239dac391146dd7466ea30567f72becf06773c0060205260409020805460018101909155818114610184576040516301d4b62360e61b81526001600160a01b03841660048201526024810182905260440161068b565b6000610264836001600160a01b038416610c57565b6000610264836001600160a01b038416610ca6565b606081600001805480602002602001604051908101604052809291908181526020018280548015610b3b57602002820191906000526020600020905b815481526020019060010190808311610b27575b50505050509050919050565b6000610173825490565b60008060008351604103610b8b5760208401516040850151606086015160001a610b7d88828585610d99565b955095509550505050610b97565b50508151600091506002905b9250925092565b6000826003811115610bb257610bb2611136565b03610bbb575050565b6001826003811115610bcf57610bcf611136565b03610bed5760405163f645eedf60e01b815260040160405180910390fd5b6002826003811115610c0157610c01611136565b03610c225760405163fce698f760e01b81526004810182905260240161068b565b6003826003811115610c3657610c36611136565b03610280576040516335e2f38360e21b81526004810182905260240161068b565b6000818152600183016020526040812054610c9e57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610173565b506000610173565b60008181526001830160205260408120548015610d8f576000610cca60018361114c565b8554909150600090610cde9060019061114c565b9050808214610d43576000866000018281548110610cfe57610cfe61116d565b9060005260206000200154905080876000018481548110610d2157610d2161116d565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080610d5457610d54611183565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610173565b6000915050610173565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0841115610dd45750600091506003905082610e5e565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015610e28573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610e5457506000925060019150829050610e5e565b9250600091508190505b9450945094915050565b80356001600160a01b0381168114610e7f57600080fd5b919050565b600060208284031215610e9657600080fd5b61026482610e68565b6020808252825182820181905260009190848201906040850190845b81811015610ee05783516001600160a01b031683529284019291840191600101610ebb565b50909695505050505050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715610f2557610f25610eec565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610f5457610f54610eec565b604052919050565b600060408284031215610f6e57600080fd5b610f76610f02565b9050610f8182610e68565b815260208083013567ffffffffffffffff80821115610f9f57600080fd5b818501915085601f830112610fb357600080fd5b813581811115610fc557610fc5610eec565b610fd7601f8201601f19168501610f2b565b91508082528684828501011115610fed57600080fd5b80848401858401376000908201840152918301919091525092915050565b60008060006060848603121561102057600080fd5b833567ffffffffffffffff8082111561103857600080fd5b61104487838801610f5c565b9450602086013591508082111561105a57600080fd5b5061106786828701610f5c565b925050604084013590509250925092565b6000806040838503121561108b57600080fd5b61109483610e68565b91506110a260208401610e68565b90509250929050565b6000806000606084860312156110c057600080fd5b6110c984610e68565b9250602084013567ffffffffffffffff8111156110e557600080fd5b61106786828701610f5c565b6000806040838503121561110457600080fd5b823567ffffffffffffffff81111561111b57600080fd5b61112785828601610f5c565b95602094909401359450505050565b634e487b7160e01b600052602160045260246000fd5b8181038181111561017357634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fdfe19511ce7944c192b1007be99b82019218d1decfc513f05239612743360a0dc00", + ABI: "[{\"type\":\"function\",\"name\":\"__WalletLink_init\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"checkIfLinked\",\"inputs\":[{\"name\":\"rootKey\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"wallet\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getLatestNonceForRootKey\",\"inputs\":[{\"name\":\"rootKey\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getRootKeyForWallet\",\"inputs\":[{\"name\":\"wallet\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"rootKey\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getWalletsByRootKey\",\"inputs\":[{\"name\":\"rootKey\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"wallets\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"linkCallerToRootKey\",\"inputs\":[{\"name\":\"rootWallet\",\"type\":\"tuple\",\"internalType\":\"structIWalletLinkBase.LinkedWallet\",\"components\":[{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"linkWalletToRootKey\",\"inputs\":[{\"name\":\"wallet\",\"type\":\"tuple\",\"internalType\":\"structIWalletLinkBase.LinkedWallet\",\"components\":[{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"rootWallet\",\"type\":\"tuple\",\"internalType\":\"structIWalletLinkBase.LinkedWallet\",\"components\":[{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"removeLink\",\"inputs\":[{\"name\":\"wallet\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"rootWallet\",\"type\":\"tuple\",\"internalType\":\"structIWalletLinkBase.LinkedWallet\",\"components\":[{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"InterfaceAdded\",\"inputs\":[{\"name\":\"interfaceId\",\"type\":\"bytes4\",\"indexed\":true,\"internalType\":\"bytes4\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"InterfaceRemoved\",\"inputs\":[{\"name\":\"interfaceId\",\"type\":\"bytes4\",\"indexed\":true,\"internalType\":\"bytes4\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"LinkWalletToRootKey\",\"inputs\":[{\"name\":\"wallet\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"rootKey\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RemoveLink\",\"inputs\":[{\"name\":\"wallet\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"secondWallet\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"ECDSAInvalidSignature\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ECDSAInvalidSignatureLength\",\"inputs\":[{\"name\":\"length\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"ECDSAInvalidSignatureS\",\"inputs\":[{\"name\":\"s\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"Initializable_InInitializingState\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Initializable_NotInInitializingState\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Introspection_AlreadySupported\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Introspection_NotSupported\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidAccountNonce\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"currentNonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"WalletLink__CannotLinkToRootWallet\",\"inputs\":[{\"name\":\"wallet\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"rootKey\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"WalletLink__CannotLinkToSelf\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"WalletLink__CannotRemoveRootWallet\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"WalletLink__InvalidAddress\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"WalletLink__InvalidSignature\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"WalletLink__LinkAlreadyExists\",\"inputs\":[{\"name\":\"wallet\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"rootKey\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"WalletLink__LinkedToAnotherRootKey\",\"inputs\":[{\"name\":\"wallet\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"rootKey\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"WalletLink__NotLinked\",\"inputs\":[{\"name\":\"wallet\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"rootKey\",\"type\":\"address\",\"internalType\":\"address\"}]}]", + Bin: "0x608060405234801561001057600080fd5b5061001961001e565b6100c4565b7f59b501c3653afc186af7d48dda36cf6732bd21629a6295693664240a6ef520008054640100000000900460ff161561006a576040516366008a2d60e01b815260040160405180910390fd5b805463ffffffff90811610156100c157805463ffffffff191663ffffffff90811782556040519081527fe9c9b456cb2994b80aeef036cf59d26e9617df80f816a6ee5a5b4166e07e2f5c9060200160405180910390a15b50565b6111ba806100d36000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c8063912b97581161005b578063912b9758146100f4578063d80bd3b914610117578063e65dfe9d1461012a578063f82103981461013d57600080fd5b806302345b981461008d5780631a31fc8d146100b657806320a00ac8146100cb578063260a409d146100ec575b600080fd5b6100a061009b366004610e84565b610168565b6040516100ad9190610e9f565b60405180910390f35b6100c96100c436600461100b565b610179565b005b6100de6100d9366004610e84565b610189565b6040519081526020016100ad565b6100c96101c6565b610107610102366004611078565b610222565b60405190151581526020016100ad565b6100c96101253660046110ab565b61026b565b6100c96101383660046110f1565b610276565b61015061014b366004610e84565b610284565b6040516001600160a01b0390911681526020016100ad565b6060610173826102c5565b92915050565b6101848383836102f6565b505050565b6001600160a01b03811660009081527fda5d6d87446d81938877f0ee239dac391146dd7466ea30567f72becf06773c006020526040812054610173565b7f59b501c3653afc186af7d48dda36cf6732bd21629a6295693664240a6ef5200054640100000000900460ff1661021057604051630ef4733760e31b815260040160405180910390fd5b610220636ff9143960e01b6104da565b565b6001600160a01b0381811660009081527f19511ce7944c192b1007be99b82019218d1decfc513f05239612743360a0dc01602052604081205490918481169116145b9392505050565b6101848383836105b8565b6102808282610780565b5050565b6001600160a01b0380821660009081527f19511ce7944c192b1007be99b82019218d1decfc513f05239612743360a0dc016020526040812054909116610173565b6001600160a01b038116600090815260008051602061119a83398151915260205260409020606090610173906108a7565b8251825160008051602061119a83398151915291610316918391906108b4565b8351604080516001600160a01b0390921660208301528101839052600090610385906060015b604051602081830303815290604052805190602001207f19457468657265756d205369676e6564204d6573736167653a0a3332000000006000908152601c91909152603c902090565b905083600001516001600160a01b03166103a3828660200151610a25565b6001600160a01b0316146103ca57604051632af0041d60e11b815260040160405180910390fd5b8351604080516001600160a01b03909216602083015281018490526000906103f49060600161033c565b905085600001516001600160a01b0316610412828860200151610a25565b6001600160a01b03161461043957604051632af0041d60e11b815260040160405180910390fd5b84516104459085610a4f565b855185516001600160a01b0316600090815260208590526040902061046991610ac1565b50845186516001600160a01b03908116600090815260018601602052604080822080546001600160a01b0319169484169490941790935587518951935190831693909216917f64126824352170c4025060d1f6e215159635e4b08e649830695f26ef6d2b57219190a3505050505050565b6001600160e01b0319811660009081527f81088bbc801e045ea3e7620779ab349988f58afbdfba10dff983df3f33522b00602052604090205460ff161515600114610567576001600160e01b0319811660009081527f81088bbc801e045ea3e7620779ab349988f58afbdfba10dff983df3f33522b0060205260409020805460ff19166001179055610580565b604051637967f77d60e11b815260040160405180910390fd5b6040516001600160e01b03198216907f78f84e5b1c5c05be2b5ad3800781dd404d6d6c6302bc755c0fe20f58a33a7f2290600090a250565b60008051602061119a8339815191526001600160a01b03841615806105e5575082516001600160a01b0316155b1561060357604051636df3f5c360e01b815260040160405180910390fd5b82600001516001600160a01b0316846001600160a01b031603610639576040516333976e3b60e11b815260040160405180910390fd5b82516001600160a01b0385811660009081526001840160205260409020548116911614610694578251604051635e300c8360e01b81526001600160a01b03808716600483015290911660248201526044015b60405180910390fd5b604080516001600160a01b03861660208201529081018390526000906106bc9060600161033c565b905083600001516001600160a01b03166106da828660200151610a25565b6001600160a01b03161461070157604051632af0041d60e11b815260040160405180910390fd5b6001600160a01b038086166000908152600184016020908152604080832080546001600160a01b031916905587519093168252849052206107429086610ad6565b5060405133906001600160a01b038716907f9a9d98629b39adf596077fc95a0712ba55c38f40a354e99d366a10f9c3e27da290600090a35050505050565b815160008051602061119a8339815191529033906107a190839083906108b4565b604080516001600160a01b03831660208201529081018490526000906107c99060600161033c565b905084600001516001600160a01b03166107e7828760200151610a25565b6001600160a01b03161461080e57604051632af0041d60e11b815260040160405180910390fd5b845161081a9085610a4f565b84516001600160a01b0316600090815260208490526040902061083d9083610ac1565b5084516001600160a01b03838116600081815260018701602052604080822080546001600160a01b0319169585169590951790945588519351939092169290917f64126824352170c4025060d1f6e215159635e4b08e649830695f26ef6d2b572191a35050505050565b6060600061026483610aeb565b6001600160a01b03821615806108d157506001600160a01b038116155b156108ef57604051636df3f5c360e01b815260040160405180910390fd5b806001600160a01b0316826001600160a01b0316036109215760405163848ba26d60e01b815260040160405180910390fd5b6001600160a01b038281166000908152600185016020526040902054161561096f576040516314790b7f60e01b81526001600160a01b0380841660048301528216602482015260440161068b565b6001600160a01b03818116600090815260018501602052604090205416156109d2576001600160a01b038181166000908152600185016020526040908190205490516347227b5d60e01b815284831660048201529116602482015260440161068b565b6001600160a01b03821660009081526020849052604081206109f390610b47565b111561018457604051637b815eed60e11b81526001600160a01b0380841660048301528216602482015260440161068b565b600080600080610a358686610b51565b925092509250610a458282610b9e565b5090949350505050565b6001600160a01b03821660009081527fda5d6d87446d81938877f0ee239dac391146dd7466ea30567f72becf06773c0060205260409020805460018101909155818114610184576040516301d4b62360e61b81526001600160a01b03841660048201526024810182905260440161068b565b6000610264836001600160a01b038416610c57565b6000610264836001600160a01b038416610ca6565b606081600001805480602002602001604051908101604052809291908181526020018280548015610b3b57602002820191906000526020600020905b815481526020019060010190808311610b27575b50505050509050919050565b6000610173825490565b60008060008351604103610b8b5760208401516040850151606086015160001a610b7d88828585610d99565b955095509550505050610b97565b50508151600091506002905b9250925092565b6000826003811115610bb257610bb2611136565b03610bbb575050565b6001826003811115610bcf57610bcf611136565b03610bed5760405163f645eedf60e01b815260040160405180910390fd5b6002826003811115610c0157610c01611136565b03610c225760405163fce698f760e01b81526004810182905260240161068b565b6003826003811115610c3657610c36611136565b03610280576040516335e2f38360e21b81526004810182905260240161068b565b6000818152600183016020526040812054610c9e57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610173565b506000610173565b60008181526001830160205260408120548015610d8f576000610cca60018361114c565b8554909150600090610cde9060019061114c565b9050808214610d43576000866000018281548110610cfe57610cfe61116d565b9060005260206000200154905080876000018481548110610d2157610d2161116d565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080610d5457610d54611183565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610173565b6000915050610173565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0841115610dd45750600091506003905082610e5e565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015610e28573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610e5457506000925060019150829050610e5e565b9250600091508190505b9450945094915050565b80356001600160a01b0381168114610e7f57600080fd5b919050565b600060208284031215610e9657600080fd5b61026482610e68565b6020808252825182820181905260009190848201906040850190845b81811015610ee05783516001600160a01b031683529284019291840191600101610ebb565b50909695505050505050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715610f2557610f25610eec565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610f5457610f54610eec565b604052919050565b600060408284031215610f6e57600080fd5b610f76610f02565b9050610f8182610e68565b815260208083013567ffffffffffffffff80821115610f9f57600080fd5b818501915085601f830112610fb357600080fd5b813581811115610fc557610fc5610eec565b610fd7601f8201601f19168501610f2b565b91508082528684828501011115610fed57600080fd5b80848401858401376000908201840152918301919091525092915050565b60008060006060848603121561102057600080fd5b833567ffffffffffffffff8082111561103857600080fd5b61104487838801610f5c565b9450602086013591508082111561105a57600080fd5b5061106786828701610f5c565b925050604084013590509250925092565b6000806040838503121561108b57600080fd5b61109483610e68565b91506110a260208401610e68565b90509250929050565b6000806000606084860312156110c057600080fd5b6110c984610e68565b9250602084013567ffffffffffffffff8111156110e557600080fd5b61106786828701610f5c565b6000806040838503121561110457600080fd5b823567ffffffffffffffff81111561111b57600080fd5b61112785828601610f5c565b95602094909401359450505050565b634e487b7160e01b600052602160045260246000fd5b8181038181111561017357634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fdfe19511ce7944c192b1007be99b82019218d1decfc513f05239612743360a0dc00", } // WalletLinkABI is the input ABI used to generate the binding from. @@ -62,61 +68,61 @@ func DeployWalletLink(auth *bind.TransactOpts, backend bind.ContractBackend) (co // WalletLink is an auto generated Go binding around an Ethereum contract. type WalletLink struct { - WalletLinkCaller // Read-only binding to the contract - WalletLinkTransactor // Write-only binding to the contract - WalletLinkFilterer // Log filterer for contract events + WalletLinkCaller // Read-only binding to the contract + WalletLinkTransactor // Write-only binding to the contract + WalletLinkFilterer // Log filterer for contract events } // WalletLinkCaller is an auto generated read-only Go binding around an Ethereum contract. type WalletLinkCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls + contract *bind.BoundContract // Generic contract wrapper for the low level calls } // WalletLinkTransactor is an auto generated write-only Go binding around an Ethereum contract. type WalletLinkTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls + contract *bind.BoundContract // Generic contract wrapper for the low level calls } // WalletLinkFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type WalletLinkFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls + contract *bind.BoundContract // Generic contract wrapper for the low level calls } // WalletLinkSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type WalletLinkSession struct { - Contract *WalletLink // 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 + Contract *WalletLink // 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 } // WalletLinkCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type WalletLinkCallerSession struct { - Contract *WalletLinkCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session + Contract *WalletLinkCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session } // WalletLinkTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type WalletLinkTransactorSession struct { - Contract *WalletLinkTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session + Contract *WalletLinkTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // WalletLinkRaw is an auto generated low-level Go binding around an Ethereum contract. type WalletLinkRaw struct { - Contract *WalletLink // Generic contract binding to access the raw methods on + Contract *WalletLink // Generic contract binding to access the raw methods on } // WalletLinkCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type WalletLinkCallerRaw struct { - Contract *WalletLinkCaller // Generic read-only contract binding to access the raw methods on + Contract *WalletLinkCaller // Generic read-only contract binding to access the raw methods on } // WalletLinkTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type WalletLinkTransactorRaw struct { - Contract *WalletLinkTransactor // Generic write-only contract binding to access the raw methods on + Contract *WalletLinkTransactor // Generic write-only contract binding to access the raw methods on } // NewWalletLink creates a new instance of WalletLink, bound to a specific deployed contract. @@ -412,15 +418,15 @@ func (_WalletLink *WalletLinkTransactorSession) RemoveLink(wallet common.Address // WalletLinkInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the WalletLink contract. type WalletLinkInitializedIterator struct { - Event *WalletLinkInitialized // Event containing the contract specifics and raw log + Event *WalletLinkInitialized // 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 + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there @@ -479,8 +485,8 @@ func (it *WalletLinkInitializedIterator) Close() error { // WalletLinkInitialized represents a Initialized event raised by the WalletLink contract. type WalletLinkInitialized struct { - Version uint32 - Raw types.Log // Blockchain specific contextual infos + Version uint32 + Raw types.Log // Blockchain specific contextual infos } // FilterInitialized is a free log retrieval operation binding the contract event 0xe9c9b456cb2994b80aeef036cf59d26e9617df80f816a6ee5a5b4166e07e2f5c. @@ -546,15 +552,15 @@ func (_WalletLink *WalletLinkFilterer) ParseInitialized(log types.Log) (*WalletL // WalletLinkInterfaceAddedIterator is returned from FilterInterfaceAdded and is used to iterate over the raw logs and unpacked data for InterfaceAdded events raised by the WalletLink contract. type WalletLinkInterfaceAddedIterator struct { - Event *WalletLinkInterfaceAdded // Event containing the contract specifics and raw log + Event *WalletLinkInterfaceAdded // 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 + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there @@ -613,8 +619,8 @@ func (it *WalletLinkInterfaceAddedIterator) Close() error { // WalletLinkInterfaceAdded represents a InterfaceAdded event raised by the WalletLink contract. type WalletLinkInterfaceAdded struct { - InterfaceId [4]byte - Raw types.Log // Blockchain specific contextual infos + InterfaceId [4]byte + Raw types.Log // Blockchain specific contextual infos } // FilterInterfaceAdded is a free log retrieval operation binding the contract event 0x78f84e5b1c5c05be2b5ad3800781dd404d6d6c6302bc755c0fe20f58a33a7f22. @@ -690,15 +696,15 @@ func (_WalletLink *WalletLinkFilterer) ParseInterfaceAdded(log types.Log) (*Wall // WalletLinkInterfaceRemovedIterator is returned from FilterInterfaceRemoved and is used to iterate over the raw logs and unpacked data for InterfaceRemoved events raised by the WalletLink contract. type WalletLinkInterfaceRemovedIterator struct { - Event *WalletLinkInterfaceRemoved // Event containing the contract specifics and raw log + Event *WalletLinkInterfaceRemoved // 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 + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there @@ -757,8 +763,8 @@ func (it *WalletLinkInterfaceRemovedIterator) Close() error { // WalletLinkInterfaceRemoved represents a InterfaceRemoved event raised by the WalletLink contract. type WalletLinkInterfaceRemoved struct { - InterfaceId [4]byte - Raw types.Log // Blockchain specific contextual infos + InterfaceId [4]byte + Raw types.Log // Blockchain specific contextual infos } // FilterInterfaceRemoved is a free log retrieval operation binding the contract event 0x8bd383568d0bc57b64b8e424138fc19ae827e694e05757faa8fea8f63fb87315. @@ -834,15 +840,15 @@ func (_WalletLink *WalletLinkFilterer) ParseInterfaceRemoved(log types.Log) (*Wa // WalletLinkLinkWalletToRootKeyIterator is returned from FilterLinkWalletToRootKey and is used to iterate over the raw logs and unpacked data for LinkWalletToRootKey events raised by the WalletLink contract. type WalletLinkLinkWalletToRootKeyIterator struct { - Event *WalletLinkLinkWalletToRootKey // Event containing the contract specifics and raw log + Event *WalletLinkLinkWalletToRootKey // 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 + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there @@ -901,9 +907,9 @@ func (it *WalletLinkLinkWalletToRootKeyIterator) Close() error { // WalletLinkLinkWalletToRootKey represents a LinkWalletToRootKey event raised by the WalletLink contract. type WalletLinkLinkWalletToRootKey struct { - Wallet common.Address - RootKey common.Address - Raw types.Log // Blockchain specific contextual infos + Wallet common.Address + RootKey common.Address + Raw types.Log // Blockchain specific contextual infos } // FilterLinkWalletToRootKey is a free log retrieval operation binding the contract event 0x64126824352170c4025060d1f6e215159635e4b08e649830695f26ef6d2b5721. @@ -987,15 +993,15 @@ func (_WalletLink *WalletLinkFilterer) ParseLinkWalletToRootKey(log types.Log) ( // WalletLinkRemoveLinkIterator is returned from FilterRemoveLink and is used to iterate over the raw logs and unpacked data for RemoveLink events raised by the WalletLink contract. type WalletLinkRemoveLinkIterator struct { - Event *WalletLinkRemoveLink // Event containing the contract specifics and raw log + Event *WalletLinkRemoveLink // 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 + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there @@ -1054,9 +1060,9 @@ func (it *WalletLinkRemoveLinkIterator) Close() error { // WalletLinkRemoveLink represents a RemoveLink event raised by the WalletLink contract. type WalletLinkRemoveLink struct { - Wallet common.Address - SecondWallet common.Address - Raw types.Log // Blockchain specific contextual infos + Wallet common.Address + SecondWallet common.Address + Raw types.Log // Blockchain specific contextual infos } // FilterRemoveLink is a free log retrieval operation binding the contract event 0x9a9d98629b39adf596077fc95a0712ba55c38f40a354e99d366a10f9c3e27da2. diff --git a/core/xchain/contracts/v3/i_custom_entitlement.go b/core/contracts/base/i_custom_entitlement.go similarity index 99% rename from core/xchain/contracts/v3/i_custom_entitlement.go rename to core/contracts/base/i_custom_entitlement.go index 99b0881fc..cada99eaa 100644 --- a/core/xchain/contracts/v3/i_custom_entitlement.go +++ b/core/contracts/base/i_custom_entitlement.go @@ -1,7 +1,7 @@ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. -package v3 +package base import ( "errors" diff --git a/core/xchain/contracts/v3/i_entitlement.go b/core/contracts/base/i_entitlement.go similarity index 99% rename from core/xchain/contracts/v3/i_entitlement.go rename to core/contracts/base/i_entitlement.go index 08c54fac7..2e4be80f7 100644 --- a/core/xchain/contracts/v3/i_entitlement.go +++ b/core/contracts/base/i_entitlement.go @@ -1,7 +1,7 @@ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. -package v3 +package base import ( "errors" diff --git a/core/xchain/contracts/dev/i_entitlement_checker.go b/core/contracts/base/i_entitlement_checker.go similarity index 99% rename from core/xchain/contracts/dev/i_entitlement_checker.go rename to core/contracts/base/i_entitlement_checker.go index ba368be18..226d53025 100644 --- a/core/xchain/contracts/dev/i_entitlement_checker.go +++ b/core/contracts/base/i_entitlement_checker.go @@ -1,7 +1,7 @@ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. -package dev +package base import ( "errors" diff --git a/core/xchain/contracts/v3/i_entitlement_gated.go b/core/contracts/base/i_entitlement_gated.go similarity index 99% rename from core/xchain/contracts/v3/i_entitlement_gated.go rename to core/contracts/base/i_entitlement_gated.go index e806f61b2..3ba9b4d9f 100644 --- a/core/xchain/contracts/v3/i_entitlement_gated.go +++ b/core/contracts/base/i_entitlement_gated.go @@ -1,7 +1,7 @@ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. -package v3 +package base import ( "errors" diff --git a/core/contracts/base/rule_entitlement.go b/core/contracts/base/rule_entitlement.go index af1ce9973..472f2fb8a 100644 --- a/core/contracts/base/rule_entitlement.go +++ b/core/contracts/base/rule_entitlement.go @@ -18,45 +18,17 @@ import ( // Reference imports to suppress errors if they are not otherwise used. var ( - _ = errors.New - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription - _ = abi.ConvertType + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType ) -// IRuleEntitlementCheckOperation is an auto generated low-level Go binding around an user-defined struct. -type IRuleEntitlementCheckOperation struct { - OpType uint8 - ChainId *big.Int - ContractAddress common.Address - Threshold *big.Int -} - -// IRuleEntitlementLogicalOperation is an auto generated low-level Go binding around an user-defined struct. -type IRuleEntitlementLogicalOperation struct { - LogOpType uint8 - LeftOperationIndex uint8 - RightOperationIndex uint8 -} - -// IRuleEntitlementOperation is an auto generated low-level Go binding around an user-defined struct. -type IRuleEntitlementOperation struct { - OpType uint8 - Index uint8 -} - -// IRuleEntitlementRuleData is an auto generated low-level Go binding around an user-defined struct. -type IRuleEntitlementRuleData struct { - Operations []IRuleEntitlementOperation - CheckOperations []IRuleEntitlementCheckOperation - LogicalOperations []IRuleEntitlementLogicalOperation -} - // RuleEntitlementMetaData contains all meta data concerning the RuleEntitlement contract. var RuleEntitlementMetaData = &bind.MetaData{ ABI: "[{\"type\":\"function\",\"name\":\"description\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"encodeRuleData\",\"inputs\":[{\"name\":\"data\",\"type\":\"tuple\",\"internalType\":\"structIRuleEntitlement.RuleData\",\"components\":[{\"name\":\"operations\",\"type\":\"tuple[]\",\"internalType\":\"structIRuleEntitlement.Operation[]\",\"components\":[{\"name\":\"opType\",\"type\":\"uint8\",\"internalType\":\"enumIRuleEntitlement.CombinedOperationType\"},{\"name\":\"index\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]},{\"name\":\"checkOperations\",\"type\":\"tuple[]\",\"internalType\":\"structIRuleEntitlement.CheckOperation[]\",\"components\":[{\"name\":\"opType\",\"type\":\"uint8\",\"internalType\":\"enumIRuleEntitlement.CheckOperationType\"},{\"name\":\"chainId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"contractAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"threshold\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"logicalOperations\",\"type\":\"tuple[]\",\"internalType\":\"structIRuleEntitlement.LogicalOperation[]\",\"components\":[{\"name\":\"logOpType\",\"type\":\"uint8\",\"internalType\":\"enumIRuleEntitlement.LogicalOperationType\"},{\"name\":\"leftOperationIndex\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"rightOperationIndex\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"getCheckOperations\",\"inputs\":[{\"name\":\"roleId\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple[]\",\"internalType\":\"structIRuleEntitlement.CheckOperation[]\",\"components\":[{\"name\":\"opType\",\"type\":\"uint8\",\"internalType\":\"enumIRuleEntitlement.CheckOperationType\"},{\"name\":\"chainId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"contractAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"threshold\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getEntitlementDataByRoleId\",\"inputs\":[{\"name\":\"roleId\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getLogicalOperations\",\"inputs\":[{\"name\":\"roleId\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple[]\",\"internalType\":\"structIRuleEntitlement.LogicalOperation[]\",\"components\":[{\"name\":\"logOpType\",\"type\":\"uint8\",\"internalType\":\"enumIRuleEntitlement.LogicalOperationType\"},{\"name\":\"leftOperationIndex\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"rightOperationIndex\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperations\",\"inputs\":[{\"name\":\"roleId\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple[]\",\"internalType\":\"structIRuleEntitlement.Operation[]\",\"components\":[{\"name\":\"opType\",\"type\":\"uint8\",\"internalType\":\"enumIRuleEntitlement.CombinedOperationType\"},{\"name\":\"index\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getRuleData\",\"inputs\":[{\"name\":\"roleId\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"data\",\"type\":\"tuple\",\"internalType\":\"structIRuleEntitlement.RuleData\",\"components\":[{\"name\":\"operations\",\"type\":\"tuple[]\",\"internalType\":\"structIRuleEntitlement.Operation[]\",\"components\":[{\"name\":\"opType\",\"type\":\"uint8\",\"internalType\":\"enumIRuleEntitlement.CombinedOperationType\"},{\"name\":\"index\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]},{\"name\":\"checkOperations\",\"type\":\"tuple[]\",\"internalType\":\"structIRuleEntitlement.CheckOperation[]\",\"components\":[{\"name\":\"opType\",\"type\":\"uint8\",\"internalType\":\"enumIRuleEntitlement.CheckOperationType\"},{\"name\":\"chainId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"contractAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"threshold\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"logicalOperations\",\"type\":\"tuple[]\",\"internalType\":\"structIRuleEntitlement.LogicalOperation[]\",\"components\":[{\"name\":\"logOpType\",\"type\":\"uint8\",\"internalType\":\"enumIRuleEntitlement.LogicalOperationType\"},{\"name\":\"leftOperationIndex\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"rightOperationIndex\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"space\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"isCrosschain\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isEntitled\",\"inputs\":[{\"name\":\"channelId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"user\",\"type\":\"address[]\",\"internalType\":\"address[]\"},{\"name\":\"permission\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"moduleType\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"name\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"removeEntitlement\",\"inputs\":[{\"name\":\"roleId\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setEntitlement\",\"inputs\":[{\"name\":\"roleId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"entitlementData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"error\",\"name\":\"CheckOperationsLimitReaced\",\"inputs\":[{\"name\":\"limit\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"Entitlement__InvalidValue\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Entitlement__NotAllowed\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Entitlement__NotMember\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Entitlement__ValueAlreadyExists\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidCheckOperationIndex\",\"inputs\":[{\"name\":\"operationIndex\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"checkOperationsLength\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]},{\"type\":\"error\",\"name\":\"InvalidLeftOperationIndex\",\"inputs\":[{\"name\":\"leftOperationIndex\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"currentOperationIndex\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]},{\"type\":\"error\",\"name\":\"InvalidLogicalOperationIndex\",\"inputs\":[{\"name\":\"operationIndex\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"logicalOperationsLength\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]},{\"type\":\"error\",\"name\":\"InvalidOperationType\",\"inputs\":[{\"name\":\"opType\",\"type\":\"uint8\",\"internalType\":\"enumIRuleEntitlement.CombinedOperationType\"}]},{\"type\":\"error\",\"name\":\"InvalidRightOperationIndex\",\"inputs\":[{\"name\":\"rightOperationIndex\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"currentOperationIndex\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]},{\"type\":\"error\",\"name\":\"LogicalOperationLimitReached\",\"inputs\":[{\"name\":\"limit\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"OperationsLimitReached\",\"inputs\":[{\"name\":\"limit\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}]", @@ -68,61 +40,61 @@ var RuleEntitlementABI = RuleEntitlementMetaData.ABI // RuleEntitlement is an auto generated Go binding around an Ethereum contract. type RuleEntitlement struct { - RuleEntitlementCaller // Read-only binding to the contract - RuleEntitlementTransactor // Write-only binding to the contract - RuleEntitlementFilterer // Log filterer for contract events + RuleEntitlementCaller // Read-only binding to the contract + RuleEntitlementTransactor // Write-only binding to the contract + RuleEntitlementFilterer // Log filterer for contract events } // RuleEntitlementCaller is an auto generated read-only Go binding around an Ethereum contract. type RuleEntitlementCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls + contract *bind.BoundContract // Generic contract wrapper for the low level calls } // RuleEntitlementTransactor is an auto generated write-only Go binding around an Ethereum contract. type RuleEntitlementTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls + contract *bind.BoundContract // Generic contract wrapper for the low level calls } // RuleEntitlementFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type RuleEntitlementFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls + contract *bind.BoundContract // Generic contract wrapper for the low level calls } // RuleEntitlementSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type RuleEntitlementSession struct { - Contract *RuleEntitlement // 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 + Contract *RuleEntitlement // 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 } // RuleEntitlementCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type RuleEntitlementCallerSession struct { - Contract *RuleEntitlementCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session + Contract *RuleEntitlementCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session } // RuleEntitlementTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type RuleEntitlementTransactorSession struct { - Contract *RuleEntitlementTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session + Contract *RuleEntitlementTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // RuleEntitlementRaw is an auto generated low-level Go binding around an Ethereum contract. type RuleEntitlementRaw struct { - Contract *RuleEntitlement // Generic contract binding to access the raw methods on + Contract *RuleEntitlement // Generic contract binding to access the raw methods on } // RuleEntitlementCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type RuleEntitlementCallerRaw struct { - Contract *RuleEntitlementCaller // Generic read-only contract binding to access the raw methods on + Contract *RuleEntitlementCaller // Generic read-only contract binding to access the raw methods on } // RuleEntitlementTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type RuleEntitlementTransactorRaw struct { - Contract *RuleEntitlementTransactor // Generic write-only contract binding to access the raw methods on + Contract *RuleEntitlementTransactor // Generic write-only contract binding to access the raw methods on } // NewRuleEntitlement creates a new instance of RuleEntitlement, bound to a specific deployed contract. diff --git a/core/node/auth/architect.go b/core/node/auth/architect.go index 5436a7631..6e18eb944 100644 --- a/core/node/auth/architect.go +++ b/core/node/auth/architect.go @@ -33,7 +33,7 @@ func NewArchitect(ctx context.Context, cfg *config.ContractConfig, backend bind. return nil, WrapRiverError( Err_CANNOT_CONNECT, err, - ).Tags("address", cfg.Address, "version", cfg.Version). + ).Tags("address", cfg.Address). Func("NewArchitect"). Message("Failed to initialize contract") } diff --git a/core/node/auth/banning.go b/core/node/auth/banning.go index 572f5abae..b3b557f9c 100644 --- a/core/node/auth/banning.go +++ b/core/node/auth/banning.go @@ -95,7 +95,6 @@ func (b *banning) IsBanned(ctx context.Context, wallets []common.Address) (bool, func NewBanning( ctx context.Context, cfg *config.ChainConfig, - version string, spaceAddress common.Address, backend bind.ContractBackend, ) (Banning, error) { diff --git a/core/node/auth/channels.go b/core/node/auth/channels.go index 19c627293..27e16d472 100644 --- a/core/node/auth/channels.go +++ b/core/node/auth/channels.go @@ -20,7 +20,6 @@ type Channels interface { func NewChannels( ctx context.Context, - version string, address common.Address, backend bind.ContractBackend, ) (Channels, error) { @@ -31,7 +30,7 @@ func NewChannels( return nil, WrapRiverError( Err_CANNOT_CONNECT, err, - ).Tags("address", address, "version", version). + ).Tags("address", address). Func("NewChannels"). Message("Failed to initialize contract") } diff --git a/core/node/auth/entitlement.go b/core/node/auth/entitlement.go index 39c676d29..b22151b1a 100644 --- a/core/node/auth/entitlement.go +++ b/core/node/auth/entitlement.go @@ -35,7 +35,6 @@ type entitlementsProxy struct { func NewEntitlements( ctx context.Context, - version string, address common.Address, backend bind.ContractBackend, ) (Entitlements, error) { @@ -44,7 +43,7 @@ func NewEntitlements( return nil, WrapRiverError( Err_CANNOT_CONNECT, err, - ).Tags("address", address, "version", version, "contract", "EntitlementsManager"). + ).Tags("address", address, "contract", "EntitlementsManager"). Func("NewEntitlements"). Message("Failed to initialize contract") } @@ -53,7 +52,7 @@ func NewEntitlements( return nil, WrapRiverError( Err_CANNOT_CONNECT, err, - ).Tags("address", address, "version", version, "contract", "EntitlementDataQueryable"). + ).Tags("address", address, "contract", "EntitlementDataQueryable"). Func("NewEntitlements"). Message("Failed to initialize contract") } diff --git a/core/node/auth/pausable.go b/core/node/auth/pausable.go index 561f51fee..35701c49c 100644 --- a/core/node/auth/pausable.go +++ b/core/node/auth/pausable.go @@ -25,7 +25,6 @@ type pausableProxy struct { func NewPausable( ctx context.Context, - version string, address common.Address, backend bind.ContractBackend, ) (Pausable, error) { @@ -36,7 +35,7 @@ func NewPausable( return nil, WrapRiverError( Err_CANNOT_CONNECT, err, - ).Tags("address", address, "version", version). + ).Tags("address", address). Func("NewPausable"). Message("Failed to initialize contract") } diff --git a/core/node/auth/space_contract.go b/core/node/auth/space_contract.go index 6958ae502..db35ccf94 100644 --- a/core/node/auth/space_contract.go +++ b/core/node/auth/space_contract.go @@ -4,13 +4,13 @@ import ( "context" "github.com/ethereum/go-ethereum/common" + "github.com/river-build/river/core/contracts/base" "github.com/river-build/river/core/node/shared" - "github.com/river-build/river/core/xchain/contracts" ) type Entitlement struct { entitlementType string - ruleEntitlement *contracts.IRuleData + ruleEntitlement *base.IRuleEntitlementRuleData userEntitlement []common.Address } diff --git a/core/node/auth/space_contract_v3.go b/core/node/auth/space_contract_v3.go index 521230503..cc1066a3f 100644 --- a/core/node/auth/space_contract_v3.go +++ b/core/node/auth/space_contract_v3.go @@ -7,21 +7,18 @@ import ( "strings" "sync" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + + "github.com/river-build/river/core/config" "github.com/river-build/river/core/contracts/base" . "github.com/river-build/river/core/node/base" "github.com/river-build/river/core/node/dlog" . "github.com/river-build/river/core/node/protocol" - - "github.com/river-build/river/core/config" "github.com/river-build/river/core/node/shared" "github.com/river-build/river/core/xchain/bindings/erc721" "github.com/river-build/river/core/xchain/bindings/ierc5313" - "github.com/river-build/river/core/xchain/contracts" - v3 "github.com/river-build/river/core/xchain/contracts/v3" - - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" ) type Space struct { @@ -36,7 +33,6 @@ type Space struct { type SpaceContractV3 struct { architect Architect chainCfg *config.ChainConfig - version string backend bind.ContractBackend spaces map[shared.StreamId]*Space spacesLock sync.Mutex @@ -59,7 +55,6 @@ func NewSpaceContractV3( spaceContract := &SpaceContractV3{ architect: architect, chainCfg: chainCfg, - version: architectCfg.Version, backend: backend, spaces: make(map[shared.StreamId]*Space), } @@ -108,19 +103,6 @@ func (sc *SpaceContractV3) IsEntitledToSpace( return isEntitled, err } -var ( - parsedABI abi.ABI - once sync.Once -) - -func getABI() (abi.ABI, error) { - var err error - once.Do(func() { - parsedABI, err = abi.JSON(strings.NewReader(v3.IEntitlementGatedMetaData.ABI)) - }) - return parsedABI, err -} - func (sc *SpaceContractV3) marshalEntitlements( ctx context.Context, entitlementData []base.IEntitlementDataQueryableBaseEntitlementData, @@ -133,13 +115,13 @@ func (sc *SpaceContractV3) marshalEntitlements( entitlements[i].entitlementType = entitlement.EntitlementType log.Info("Entitlement data", "entitlement_data", entitlement.EntitlementData) // Parse the ABI definition - parsedABI, err := getABI() + parsedABI, err := base.IEntitlementGatedMetaData.GetAbi() if err != nil { log.Error("Failed to parse ABI", "error", err) return nil, err } - var ruleData contracts.IRuleData + var ruleData base.IRuleEntitlementRuleData unpackedData, err := parsedABI.Unpack("getRuleData", entitlement.EntitlementData) if err != nil { @@ -408,15 +390,15 @@ func (sc *SpaceContractV3) getSpace(ctx context.Context, spaceId shared.StreamId if err != nil || address == EMPTY_ADDRESS { return nil, err } - entitlements, err := NewEntitlements(ctx, sc.version, address, sc.backend) + entitlements, err := NewEntitlements(ctx, address, sc.backend) if err != nil { return nil, err } - pausable, err := NewPausable(ctx, sc.version, address, sc.backend) + pausable, err := NewPausable(ctx, address, sc.backend) if err != nil { return nil, err } - banning, err := NewBanning(ctx, sc.chainCfg, sc.version, address, sc.backend) + banning, err := NewBanning(ctx, sc.chainCfg, address, sc.backend) if err != nil { return nil, err } @@ -445,7 +427,7 @@ func (sc *SpaceContractV3) getChannel( space.channelsLock.Lock() defer space.channelsLock.Unlock() if space.channels[channelId] == nil { - channel, err := NewChannels(ctx, sc.version, space.address, sc.backend) + channel, err := NewChannels(ctx, space.address, sc.backend) if err != nil { return nil, err } diff --git a/core/node/auth/wallet_link.go b/core/node/auth/wallet_link.go index 7ad47a922..f2c3440a6 100644 --- a/core/node/auth/wallet_link.go +++ b/core/node/auth/wallet_link.go @@ -31,7 +31,7 @@ func NewWalletLink(ctx context.Context, cfg *config.ContractConfig, backend bind return nil, WrapRiverError( Err_CANNOT_CONNECT, err, - ).Tags("address", cfg.Address, "version", cfg.Version). + ).Tags("address", cfg.Address). Func("NewWalletLink"). Message("Failed to initialize contract") } diff --git a/core/node/registries/river_registry_contract.go b/core/node/registries/river_registry_contract.go index 93203ce10..f4370a6f7 100644 --- a/core/node/registries/river_registry_contract.go +++ b/core/node/registries/river_registry_contract.go @@ -108,15 +108,6 @@ func NewRiverRegistryContract( blockchain *crypto.Blockchain, cfg *config.ContractConfig, ) (*RiverRegistryContract, error) { - if cfg.Version != "" { - return nil, RiverError( - Err_BAD_CONFIG, - "Always binding to same interface, version should be empty", - "version", - cfg.Version, - ).Func("NewRiverRegistryContract") - } - c := &RiverRegistryContract{ Blockchain: blockchain, Address: cfg.Address, diff --git a/core/xchain/client_simulator/client_simulator.go b/core/xchain/client_simulator/client_simulator.go index 05735c0cf..acb281498 100644 --- a/core/xchain/client_simulator/client_simulator.go +++ b/core/xchain/client_simulator/client_simulator.go @@ -18,7 +18,8 @@ import ( xc "github.com/river-build/river/core/xchain/common" - e "github.com/river-build/river/core/xchain/contracts" + "github.com/river-build/river/core/contracts/base" + "github.com/river-build/river/core/contracts/base/deploy" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" @@ -64,10 +65,9 @@ func toggleCustomEntitlement( auth.GasLimit = uint64(30000000) // in units auth.GasPrice = gasPrice - mockCustomContract, err := e.NewMockCustomEntitlement( + mockCustomContract, err := deploy.NewMockCustomEntitlement( cfg.GetTestCustomEntitlementContractAddress(), client, - cfg.GetContractVersion(), ) if err != nil { log.Error("Failed to parse contract ABI", "err", err) @@ -100,15 +100,15 @@ func toggleCustomEntitlement( ) } -func customEntitlementExample(cfg *config.Config) e.IRuleData { - return e.IRuleData{ - Operations: []e.IRuleEntitlementOperation{ +func customEntitlementExample(cfg *config.Config) base.IRuleEntitlementRuleData { + return base.IRuleEntitlementRuleData{ + Operations: []base.IRuleEntitlementOperation{ { OpType: uint8(entitlement.CHECK), Index: 0, }, }, - CheckOperations: []e.IRuleEntitlementCheckOperation{ + CheckOperations: []base.IRuleEntitlementCheckOperation{ { OpType: uint8(entitlement.ISENTITLED), ChainId: big.NewInt(1), @@ -120,15 +120,15 @@ func customEntitlementExample(cfg *config.Config) e.IRuleData { } } -func erc721Example() e.IRuleData { - return e.IRuleData{ - Operations: []e.IRuleEntitlementOperation{ +func erc721Example() base.IRuleEntitlementRuleData { + return base.IRuleEntitlementRuleData{ + Operations: []base.IRuleEntitlementOperation{ { OpType: uint8(entitlement.CHECK), Index: 0, }, }, - CheckOperations: []e.IRuleEntitlementCheckOperation{ + CheckOperations: []base.IRuleEntitlementCheckOperation{ { OpType: uint8(entitlement.ERC721), ChainId: examples.EthSepoliaChainId, @@ -140,15 +140,15 @@ func erc721Example() e.IRuleData { } } -func erc20Example() e.IRuleData { - return e.IRuleData{ - Operations: []e.IRuleEntitlementOperation{ +func erc20Example() base.IRuleEntitlementRuleData { + return base.IRuleEntitlementRuleData{ + Operations: []base.IRuleEntitlementOperation{ { OpType: uint8(entitlement.CHECK), Index: 0, }, }, - CheckOperations: []e.IRuleEntitlementCheckOperation{ + CheckOperations: []base.IRuleEntitlementCheckOperation{ { OpType: uint8(entitlement.ERC20), ChainId: examples.EthSepoliaChainId, @@ -178,7 +178,7 @@ type postResult struct { type ClientSimulator interface { Start(ctx context.Context) Stop() - EvaluateRuleData(ctx context.Context, cfg *config.Config, ruleData e.IRuleData) (bool, error) + EvaluateRuleData(ctx context.Context, cfg *config.Config, ruleData base.IRuleEntitlementRuleData) (bool, error) Wallet() *node_crypto.Wallet } @@ -189,11 +189,11 @@ type clientSimulator struct { decoder *node_crypto.EvmErrorDecoder - entitlementGated *contracts.MockEntitlementGated + entitlementGated *deploy.MockEntitlementGated entitlementGatedABI *abi.ABI entitlementGatedContract *bind.BoundContract - checker *contracts.IEntitlementChecker + checker *base.IEntitlementChecker checkerABI *abi.ABI checkerContract *bind.BoundContract @@ -213,31 +213,38 @@ func New( baseChain *node_crypto.Blockchain, wallet *node_crypto.Wallet, ) (ClientSimulator, error) { - entitlementGated, err := e.NewMockEntitlementGated( + entitlementGated, err := deploy.NewMockEntitlementGated( cfg.GetTestEntitlementContractAddress(), nil, - cfg.GetContractVersion(), ) if err != nil { return nil, err } - checker, err := e.NewIEntitlementChecker(cfg.GetEntitlementContractAddress(), nil, cfg.GetContractVersion()) + checker, err := base.NewIEntitlementChecker(cfg.GetEntitlementContractAddress(), nil) + if err != nil { + return nil, err + } + + entitlementGatedABI, err := deploy.MockEntitlementGatedMetaData.GetAbi() + if err != nil { + return nil, err + } + + checkerABI, err := base.IEntitlementCheckerMetaData.GetAbi() if err != nil { return nil, err } var ( - entitlementGatedABI = entitlementGated.GetAbi() entitlementGatedContract = bind.NewBoundContract( cfg.GetTestEntitlementContractAddress(), - *entitlementGated.GetAbi(), + *entitlementGatedABI, nil, nil, nil, ) - checkerABI = checker.GetAbi() - checkerContract = bind.NewBoundContract(cfg.GetEntitlementContractAddress(), *checker.GetAbi(), nil, nil, nil) + checkerContract = bind.NewBoundContract(cfg.GetEntitlementContractAddress(), *checkerABI, nil, nil, nil) ) metrics := infra.NewMetrics("xchain", "simulator") @@ -257,7 +264,7 @@ func New( ) } - decoder, err := node_crypto.NewEVMErrorDecoder(entitlementGated.GetMetadata(), checker.GetMetadata()) + decoder, err := node_crypto.NewEVMErrorDecoder(deploy.MockEntitlementGatedMetaData, base.IEntitlementCheckerMetaData) if err != nil { return nil, err } @@ -307,7 +314,7 @@ func (cs *clientSimulator) Start(ctx context.Context) { ) } -func (cs *clientSimulator) executeCheck(ctx context.Context, ruleData *e.IRuleData) error { +func (cs *clientSimulator) executeCheck(ctx context.Context, ruleData *deploy.IRuleEntitlementRuleData) error { log := dlog.FromCtx(ctx).With("application", "clientSimulator") log.Info("ClientSimulator executing check", "ruleData", ruleData, "cfg", cs.cfg) @@ -316,10 +323,9 @@ func (cs *clientSimulator) executeCheck(ctx context.Context, ruleData *e.IRuleDa "RequestEntitlementCheck", func(opts *bind.TransactOpts) (*types.Transaction, error) { log.Info("Calling RequestEntitlementCheck", "opts", opts, "ruleData", ruleData) - gated, err := contracts.NewMockEntitlementGated( + gated, err := deploy.NewMockEntitlementGated( cs.cfg.GetTestEntitlementContractAddress(), cs.baseChain.Client, - cs.cfg.GetContractVersion(), ) if err != nil { log.Error("Failed to get NewMockEntitlementGated", "err", err) @@ -415,7 +421,7 @@ func (cs *clientSimulator) onEntitlementCheckResultPosted( event types.Log, postedResults chan postResult, ) { - entitlementCheckResultPosted := cs.entitlementGated.EntitlementCheckResultPosted(cs.cfg.GetContractVersion()) + entitlementCheckResultPosted := base.IEntitlementGatedEntitlementCheckResultPosted{} log := dlog.FromCtx(ctx).With("application", "clientSimulator").With("function", "onEntitlementCheckResultPosted") log.Info( @@ -426,19 +432,19 @@ func (cs *clientSimulator) onEntitlementCheckResultPosted( entitlementCheckResultPosted, ) - if err := cs.entitlementGatedContract.UnpackLog(entitlementCheckResultPosted.Raw(), "EntitlementCheckResultPosted", event); err != nil { + if err := cs.entitlementGatedContract.UnpackLog(&entitlementCheckResultPosted, "EntitlementCheckResultPosted", event); err != nil { log.Error("Failed to unpack EntitlementCheckResultPosted event", "err", err) return } log.Info("Received EntitlementCheckResultPosted event", - "TransactionId", entitlementCheckResultPosted.TransactionID(), - "Result", entitlementCheckResultPosted.Result(), + "TransactionId", entitlementCheckResultPosted.TransactionId, + "Result", entitlementCheckResultPosted.Result, ) postedResults <- postResult{ - transactionId: entitlementCheckResultPosted.TransactionID(), - result: entitlementCheckResultPosted.Result() == contracts.NodeVoteStatus__PASSED, + transactionId: entitlementCheckResultPosted.TransactionId, + result: entitlementCheckResultPosted.Result == contracts.NodeVoteStatus__PASSED, } } @@ -447,7 +453,7 @@ func (cs *clientSimulator) onEntitlementCheckRequested( event types.Log, checkRequests chan [32]byte, ) { - entitlementCheckRequest := cs.checker.EntitlementCheckRequestEvent() + entitlementCheckRequest := base.IEntitlementCheckerEntitlementCheckRequested{} log := dlog.FromCtx(ctx).With("application", "clientSimulator").With("function", "onEntitlementCheckRequested") log.Info( @@ -458,28 +464,62 @@ func (cs *clientSimulator) onEntitlementCheckRequested( entitlementCheckRequest, ) - if err := cs.checkerContract.UnpackLog(entitlementCheckRequest.Raw(), "EntitlementCheckRequested", event); err != nil { + if err := cs.checkerContract.UnpackLog(&entitlementCheckRequest, "EntitlementCheckRequested", event); err != nil { log.Error("Failed to unpack EntitlementCheckRequested event", "err", err) return } log.Info("Received EntitlementCheckRequested event", - "TransactionId", entitlementCheckRequest.TransactionID(), - "selectedNodes", entitlementCheckRequest.SelectedNodes(), + "TransactionId", entitlementCheckRequest.TransactionId, + "selectedNodes", entitlementCheckRequest.SelectedNodes, ) - checkRequests <- entitlementCheckRequest.TransactionID() + checkRequests <- entitlementCheckRequest.TransactionId } func (cs *clientSimulator) Wallet() *node_crypto.Wallet { return cs.wallet } +func convertRuleDataFromBaseToDeploy(ruleData base.IRuleEntitlementRuleData) deploy.IRuleEntitlementRuleData { + operations := make([]deploy.IRuleEntitlementOperation, len(ruleData.Operations)) + for i, op := range ruleData.Operations { + operations[i] = deploy.IRuleEntitlementOperation{ + OpType: op.OpType, + Index: op.Index, + } + } + checkOperations := make([]deploy.IRuleEntitlementCheckOperation, len(ruleData.CheckOperations)) + for i, op := range ruleData.CheckOperations { + checkOperations[i] = deploy.IRuleEntitlementCheckOperation{ + OpType: op.OpType, + ChainId: op.ChainId, + ContractAddress: op.ContractAddress, + Threshold: op.Threshold, + } + } + logicalOperations := make([]deploy.IRuleEntitlementLogicalOperation, len(ruleData.LogicalOperations)) + for i, op := range ruleData.LogicalOperations { + logicalOperations[i] = deploy.IRuleEntitlementLogicalOperation{ + LogOpType: op.LogOpType, + LeftOperationIndex: op.LeftOperationIndex, + RightOperationIndex: op.RightOperationIndex, + } + } + return deploy.IRuleEntitlementRuleData{ + Operations: operations, + CheckOperations: checkOperations, + LogicalOperations: logicalOperations, + } +} + func (cs *clientSimulator) EvaluateRuleData( ctx context.Context, cfg *config.Config, - ruleData e.IRuleData, + baseRuleData base.IRuleEntitlementRuleData, ) (bool, error) { + ruleData := convertRuleDataFromBaseToDeploy(baseRuleData) + log := dlog.FromCtx(ctx).With("application", "clientSimulator") log.Info("ClientSimulator evaluating rule data", "ruleData", ruleData) @@ -530,7 +570,7 @@ func RunClientSimulator(ctx context.Context, cfg *config.Config, wallet *node_cr cs.Start(ctx) defer cs.Stop() - var ruleData e.IRuleData + var ruleData base.IRuleEntitlementRuleData switch simType { case ERC721: ruleData = erc721Example() diff --git a/core/xchain/contracts/README.md b/core/xchain/contracts/README.md deleted file mode 100644 index f3e9a0ec8..000000000 --- a/core/xchain/contracts/README.md +++ /dev/null @@ -1 +0,0 @@ -Contents of v3 and dev directories are generated by ./scripts/build-town-types.sh diff --git a/core/xchain/contracts/contracts.go b/core/xchain/contracts/contracts.go index 4da86cd66..93f22d2fa 100644 --- a/core/xchain/contracts/contracts.go +++ b/core/xchain/contracts/contracts.go @@ -1,826 +1,7 @@ package contracts -import ( - "context" - "math/big" - - "github.com/river-build/river/core/config" - dev "github.com/river-build/river/core/xchain/contracts/dev" - v3 "github.com/river-build/river/core/xchain/contracts/v3" - - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethclient" - "github.com/ethereum/go-ethereum/event" - "github.com/river-build/river/core/node/dlog" -) - -type IWalletLinkBaseLinkedWallet struct { - Addr common.Address - Signature []byte -} - -func (w IWalletLinkBaseLinkedWallet) v3() v3.IWalletLinkBaseLinkedWallet { - return v3.IWalletLinkBaseLinkedWallet{ - Addr: w.Addr, - Signature: w.Signature, - } -} - -func (w IWalletLinkBaseLinkedWallet) dev() dev.IWalletLinkBaseLinkedWallet { - return dev.IWalletLinkBaseLinkedWallet{ - Addr: w.Addr, - Signature: w.Signature, - } -} - -type WalletLink struct { - v3WalletLink *v3.WalletLink - devWalletLink *dev.WalletLink -} - -func DeployWalletLink(auth *bind.TransactOpts, backend bind.ContractBackend, version config.ContractVersion) ( - common.Address, - *types.Transaction, - *WalletLink, - error, -) { - if version == "v3" { - address, tx, contract, err := v3.DeployWalletLink(auth, backend) - return address, tx, &WalletLink{v3WalletLink: contract}, err - } else { - address, tx, contract, err := dev.DeployWalletLink(auth, backend) - return address, tx, &WalletLink{devWalletLink: contract}, err - } -} - -type IWalletLink struct { - v3IWalletLink *v3.IWalletLink - devIWalletLink *dev.IWalletLink -} - -func NewIWalletLink(address common.Address, backend bind.ContractBackend, version config.ContractVersion) (*IWalletLink, error) { - res := &IWalletLink{} - if version == "v3" { - contract, err := v3.NewIWalletLink(address, backend) - res.v3IWalletLink = contract - return res, err - } else { - contract, err := dev.NewIWalletLink(address, backend) - res.devIWalletLink = contract - return res, err - } -} - -func (w *IWalletLink) CheckIfLinked(opts *bind.CallOpts, rootKey common.Address, linkedWallet common.Address) (bool, error) { - if w.v3IWalletLink != nil { - return w.v3IWalletLink.CheckIfLinked(opts, rootKey, linkedWallet) - } - return w.devIWalletLink.CheckIfLinked(opts, rootKey, linkedWallet) -} - -func (w *IWalletLink) GetMetadata() *bind.MetaData { - if w.v3IWalletLink != nil { - return v3.IWalletLinkMetaData - } - return dev.IWalletLinkMetaData -} - -func (w *IWalletLink) GetAbi() *abi.ABI { - md := w.GetMetadata() - abi, err := md.GetAbi() - if err != nil { - panic("Failed to parse WalletLink ABI") - } - return abi -} - -func (w *IWalletLink) GetRootKeyForWallet(opts *bind.CallOpts, wallet common.Address) (common.Address, error) { - if w.v3IWalletLink != nil { - return w.v3IWalletLink.GetRootKeyForWallet(opts, wallet) - } - return w.devIWalletLink.GetRootKeyForWallet(opts, wallet) -} - -func (w *IWalletLink) GetWalletsByRootKey(opts *bind.CallOpts, rootKey common.Address) ([]common.Address, error) { - if w.v3IWalletLink != nil { - return w.v3IWalletLink.GetWalletsByRootKey(opts, rootKey) - } - return w.devIWalletLink.GetWalletsByRootKey(opts, rootKey) -} - -func (w *IWalletLink) GetLatestNonceForRootKey(opts *bind.CallOpts, rootKey common.Address) (*big.Int, error) { - if w.v3IWalletLink != nil { - return w.v3IWalletLink.GetLatestNonceForRootKey(opts, rootKey) - } - return w.devIWalletLink.GetLatestNonceForRootKey(opts, rootKey) -} - -func (w *IWalletLink) CheckIfLinkedWallet(opts *bind.CallOpts, rootKey common.Address, linkedWallet common.Address) (bool, error) { - if w.v3IWalletLink != nil { - return w.v3IWalletLink.CheckIfLinked(opts, rootKey, linkedWallet) - } - return w.devIWalletLink.CheckIfLinked(opts, rootKey, linkedWallet) -} - -func (w *IWalletLink) LinkWalletToRootKey(opts *bind.TransactOpts, wallet IWalletLinkBaseLinkedWallet, rootWallet IWalletLinkBaseLinkedWallet, nonce *big.Int) (*types.Transaction, error) { - if w.v3IWalletLink != nil { - return w.v3IWalletLink.LinkWalletToRootKey(opts, wallet.v3(), rootWallet.v3(), nonce) - } - return w.devIWalletLink.LinkWalletToRootKey(opts, wallet.dev(), rootWallet.dev(), nonce) -} - -type EntitlementChecker struct { - v3EntitlementChecker *v3.EntitlementChecker - devEntitlementChecker *dev.EntitlementChecker -} - -func DeployEntitlementChecker(auth *bind.TransactOpts, backend bind.ContractBackend, version config.ContractVersion) (common.Address, *types.Transaction, *EntitlementChecker, error) { - if version == "v3" { - address, tx, v3Checker, err := v3.DeployEntitlementChecker(auth, backend) - return address, tx, &EntitlementChecker{v3EntitlementChecker: v3Checker}, err - } else { - address, tx, devChecker, err := dev.DeployEntitlementChecker(auth, backend) - return address, tx, &EntitlementChecker{devEntitlementChecker: devChecker}, err - } -} - -type MockEntitlementChecker struct { - v3MockEntitlementChecker *v3.MockEntitlementChecker - devMockEntitlementChecker *dev.MockEntitlementChecker -} - -func DeployMockEntitlementChecker(auth *bind.TransactOpts, backend bind.ContractBackend, approvedOperators []common.Address, version config.ContractVersion) (common.Address, *types.Transaction, *MockEntitlementChecker, error) { - if version == "v3" { - address, tx, v3Checker, err := v3.DeployMockEntitlementChecker(auth, backend, approvedOperators) - return address, tx, &MockEntitlementChecker{v3MockEntitlementChecker: v3Checker}, err - } else { - address, tx, devChecker, err := dev.DeployMockEntitlementChecker(auth, backend, approvedOperators) - return address, tx, &MockEntitlementChecker{devMockEntitlementChecker: devChecker}, err - } -} - -type IRuleData struct { - Operations []IRuleEntitlementOperation - CheckOperations []IRuleEntitlementCheckOperation - LogicalOperations []IRuleEntitlementLogicalOperation -} - -type IRuleEntitlementOperation struct { - OpType uint8 - Index uint8 -} - -type IRuleEntitlementCheckOperation struct { - OpType uint8 - ChainId *big.Int - ContractAddress common.Address - Threshold *big.Int -} - -// IRuleEntitlementLogicalOperation is an auto generated low-level Go binding around an user-defined struct. -type IRuleEntitlementLogicalOperation struct { - LogOpType uint8 - LeftOperationIndex uint8 - RightOperationIndex uint8 -} - -type IEntitlementGated struct { - v3IEntitlementGated *v3.IEntitlementGated - devIEntitlementGated *dev.IEntitlementGated -} - -type MockEntitlementGated struct { - v3MockEntitlementGated *v3.MockEntitlementGated - devMockEntitlementGated *dev.MockEntitlementGated -} - -type NodeVoteStatus uint8 - const ( - NodeVoteStatus__NOT_VOTED NodeVoteStatus = iota - NodeVoteStatus__PASSED - NodeVoteStatus__FAILED + NodeVoteStatus__NOT_VOTED uint8 = 0 + NodeVoteStatus__PASSED uint8 = 1 + NodeVoteStatus__FAILED uint8 = 2 ) - -type IEntitlementCheckResultPosted interface { - TransactionID() common.Hash - Result() NodeVoteStatus - Raw() interface{} -} - -type entitlementCheckResultPosted struct { - v3Inner *v3.IEntitlementGatedEntitlementCheckResultPosted - devInner *dev.IEntitlementGatedEntitlementCheckResultPosted -} - -func (e *entitlementCheckResultPosted) TransactionID() common.Hash { - if e.v3Inner != nil { - return e.v3Inner.TransactionId - } - return e.devInner.TransactionId -} - -func (e *entitlementCheckResultPosted) Result() NodeVoteStatus { - if e.v3Inner != nil { - return NodeVoteStatus(e.v3Inner.Result) - } - return NodeVoteStatus(e.devInner.Result) -} - -func (e *entitlementCheckResultPosted) Raw() interface{} { - if e.v3Inner != nil { - return e.v3Inner - } - return e.devInner -} - -func DeployMockEntitlementGated(auth *bind.TransactOpts, backend bind.ContractBackend, checker common.Address, version config.ContractVersion) (common.Address, *types.Transaction, *MockEntitlementGated, error) { - if version == "v3" { - address, tx, contract, err := v3.DeployMockEntitlementGated(auth, backend, checker) - return address, tx, &MockEntitlementGated{v3MockEntitlementGated: contract}, err - } else { - address, tx, contract, err := dev.DeployMockEntitlementGated(auth, backend, checker) - return address, tx, &MockEntitlementGated{devMockEntitlementGated: contract}, err - } -} - -func NewMockEntitlementGated(address common.Address, backend bind.ContractBackend, version config.ContractVersion) (*MockEntitlementGated, error) { - res := &MockEntitlementGated{} - if version == "v3" { - contract, err := v3.NewMockEntitlementGated(address, backend) - res.v3MockEntitlementGated = contract - return res, err - } else { - contract, err := dev.NewMockEntitlementGated(address, backend) - res.devMockEntitlementGated = contract - return res, err - } -} - -func (g *MockEntitlementGated) EntitlementCheckResultPosted(version config.ContractVersion) IEntitlementCheckResultPosted { - if g.v3MockEntitlementGated != nil { - return &entitlementCheckResultPosted{&v3.IEntitlementGatedEntitlementCheckResultPosted{}, nil} - } else { - return &entitlementCheckResultPosted{nil, &dev.IEntitlementGatedEntitlementCheckResultPosted{}} - } -} - -func (g *MockEntitlementGated) GetMetadata() *bind.MetaData { - if g.v3MockEntitlementGated != nil { - return v3.MockEntitlementGatedMetaData - } else { - return dev.MockEntitlementGatedMetaData - } -} - -func (g *MockEntitlementGated) GetAbi() *abi.ABI { - md := g.GetMetadata() - abi, err := md.GetAbi() - if err != nil { - panic("Failed to parse EntitlementGated ABI") - } - return abi -} - -func (g *MockEntitlementGated) RequestEntitlementCheck(opts *bind.TransactOpts, roleId *big.Int, ruledata IRuleData) (*types.Transaction, error) { - if g.v3MockEntitlementGated != nil { - return g.v3MockEntitlementGated.RequestEntitlementCheck(opts, roleId, convertRuleDataToV3(ruledata)) - } else { - return g.devMockEntitlementGated.RequestEntitlementCheck(opts, roleId, convertRuleDataToDev(ruledata)) - } -} - -type MockCustomEntitlement struct { - v3MockCustomEntitlement *v3.MockCustomEntitlement - devMockCustomEntitlement *dev.MockCustomEntitlement -} - -func DeployMockCustomEntitlement(auth *bind.TransactOpts, backend bind.ContractBackend, version config.ContractVersion) (common.Address, *types.Transaction, *MockCustomEntitlement, error) { - if version == "v3" { - address, tx, contract, err := v3.DeployMockCustomEntitlement(auth, backend) - return address, tx, &MockCustomEntitlement{v3MockCustomEntitlement: contract}, err - } else { - address, tx, contract, err := dev.DeployMockCustomEntitlement(auth, backend) - return address, tx, &MockCustomEntitlement{devMockCustomEntitlement: contract}, err - } -} - -func NewMockCustomEntitlement(address common.Address, backend bind.ContractBackend, version config.ContractVersion) (*MockCustomEntitlement, error) { - res := &MockCustomEntitlement{} - if version == "v3" { - contract, err := v3.NewMockCustomEntitlement(address, backend) - res.v3MockCustomEntitlement = contract - return res, err - } else { - contract, err := dev.NewMockCustomEntitlement(address, backend) - res.devMockCustomEntitlement = contract - return res, err - } -} - -func (m *MockCustomEntitlement) SetEntitled( - opts *bind.TransactOpts, - user []common.Address, - userIsEntitled bool, -) (*types.Transaction, error) { - if m.v3MockCustomEntitlement != nil { - return m.v3MockCustomEntitlement.SetEntitled(opts, user, userIsEntitled) - } else { - return m.devMockCustomEntitlement.SetEntitled(opts, user, userIsEntitled) - } -} - -func NewIEntitlementGated(address common.Address, backend bind.ContractBackend, version config.ContractVersion) (*IEntitlementGated, error) { - res := &IEntitlementGated{} - if version == "v3" { - contract, err := v3.NewIEntitlementGated(address, backend) - res.v3IEntitlementGated = contract - return res, err - } else { - contract, err := dev.NewIEntitlementGated(address, backend) - res.devIEntitlementGated = contract - return res, err - } -} - -func (g *IEntitlementGated) PostEntitlementCheckResult(opts *bind.TransactOpts, transactionId [32]byte, roleId *big.Int, result uint8) (*types.Transaction, error) { - if g.v3IEntitlementGated != nil { - return g.v3IEntitlementGated.PostEntitlementCheckResult(opts, transactionId, roleId, result) - } else { - return g.devIEntitlementGated.PostEntitlementCheckResult(opts, transactionId, roleId, result) - } -} - -func (g *IEntitlementGated) WatchEntitlementCheckResultPosted(opts *bind.WatchOpts, sink chan<- *IEntitlementGatedEntitlementCheckResultPosted, transactionId [][32]byte) (event.Subscription, error) { - if g.v3IEntitlementGated != nil { - v3Sink := make(chan *v3.IEntitlementGatedEntitlementCheckResultPosted) - sub, err := g.v3IEntitlementGated.WatchEntitlementCheckResultPosted(opts, v3Sink, transactionId) - go func() { - for v3Event := range v3Sink { - shimEvent := convertV3ToShimResultPosted(v3Event) - sink <- shimEvent - } - }() - return sub, err - } else { - devSink := make(chan *dev.IEntitlementGatedEntitlementCheckResultPosted) - sub, err := g.devIEntitlementGated.WatchEntitlementCheckResultPosted(opts, devSink, transactionId) - go func() { - for devEvent := range devSink { - shimEvent := converDevToShimResultPosted(devEvent) - sink <- shimEvent - } - }() - return sub, err - } -} - -func (g *IEntitlementGated) GetRuleData(opts *bind.CallOpts, transactionId [32]byte, roleId *big.Int) (*IRuleData, error) { - var ruleData IRuleData - if g.v3IEntitlementGated != nil { - v3RuleData, err := g.v3IEntitlementGated.GetRuleData(opts, transactionId, roleId) - if err != nil { - return nil, err - } - ruleData = IRuleData{ - Operations: make([]IRuleEntitlementOperation, len(v3RuleData.Operations)), - CheckOperations: make([]IRuleEntitlementCheckOperation, len(v3RuleData.CheckOperations)), - LogicalOperations: make([]IRuleEntitlementLogicalOperation, len(v3RuleData.LogicalOperations)), - } - for i, op := range v3RuleData.Operations { - ruleData.Operations[i] = IRuleEntitlementOperation{ - OpType: op.OpType, - Index: op.Index, - } - } - for i, op := range v3RuleData.CheckOperations { - ruleData.CheckOperations[i] = IRuleEntitlementCheckOperation{ - OpType: op.OpType, - ChainId: op.ChainId, - ContractAddress: op.ContractAddress, - Threshold: op.Threshold, - } - } - for i, op := range v3RuleData.LogicalOperations { - ruleData.LogicalOperations[i] = IRuleEntitlementLogicalOperation{ - LogOpType: op.LogOpType, - LeftOperationIndex: op.LeftOperationIndex, - RightOperationIndex: op.RightOperationIndex, - } - } - return &ruleData, nil - } else { - devRuleDtata, err := g.devIEntitlementGated.GetRuleData(opts, transactionId, roleId) - if err != nil { - return nil, err - } - ruleData = IRuleData{ - Operations: make([]IRuleEntitlementOperation, len(devRuleDtata.Operations)), - CheckOperations: make([]IRuleEntitlementCheckOperation, len(devRuleDtata.CheckOperations)), - LogicalOperations: make([]IRuleEntitlementLogicalOperation, len(devRuleDtata.LogicalOperations)), - } - for i, op := range devRuleDtata.Operations { - ruleData.Operations[i] = IRuleEntitlementOperation{ - OpType: op.OpType, - Index: op.Index, - } - } - for i, op := range devRuleDtata.CheckOperations { - ruleData.CheckOperations[i] = IRuleEntitlementCheckOperation{ - OpType: op.OpType, - ChainId: op.ChainId, - ContractAddress: op.ContractAddress, - Threshold: op.Threshold, - } - } - for i, op := range devRuleDtata.LogicalOperations { - ruleData.LogicalOperations[i] = IRuleEntitlementLogicalOperation{ - LogOpType: op.LogOpType, - LeftOperationIndex: op.LeftOperationIndex, - RightOperationIndex: op.RightOperationIndex, - } - } - return &ruleData, nil - } -} - -type ICustomEntitlement struct { - v3ICustomEntitlement *v3.ICustomEntitlement - devICustomEntitlement *dev.ICustomEntitlement -} - -func NewICustomEntitlement(address common.Address, backend bind.ContractBackend, version config.ContractVersion) (*ICustomEntitlement, error) { - res := &ICustomEntitlement{} - if version == "v3" { - contract, err := v3.NewICustomEntitlement(address, backend) - res.v3ICustomEntitlement = contract - return res, err - } else { - contract, err := dev.NewICustomEntitlement(address, backend) - res.devICustomEntitlement = contract - return res, err - } -} - -func (c *ICustomEntitlement) GetMetadata() *bind.MetaData { - if c.v3ICustomEntitlement != nil { - return v3.ICustomEntitlementMetaData - } else { - return dev.ICustomEntitlementMetaData - } -} - -func (c *ICustomEntitlement) GetAbi() *abi.ABI { - md := c.GetMetadata() - abi, err := md.GetAbi() - if err != nil { - panic("Failed to parse CustomEntitlement ABI") - } - return abi -} - -func (c *ICustomEntitlement) IsEntitled(opts *bind.CallOpts, user []common.Address) (bool, error) { - if c.v3ICustomEntitlement != nil { - return c.v3ICustomEntitlement.IsEntitled(opts, user) - } else { - return c.devICustomEntitlement.IsEntitled(opts, user) - } -} - -func (g *MockEntitlementGated) EntitlementGatedMetaData() *bind.MetaData { - if g.v3MockEntitlementGated != nil { - return v3.IEntitlementGatedMetaData - } else { - return dev.IEntitlementGatedMetaData - } -} - -type EntitlementGatedMetaData struct { - v3IEntitlementGatedMetaData *bind.MetaData - devIEntitlementGatedMetaData *bind.MetaData -} - -func NewEntitlementGatedMetaData(version config.ContractVersion) EntitlementGatedMetaData { - if version == "v3" { - return EntitlementGatedMetaData{ - v3IEntitlementGatedMetaData: v3.IEntitlementGatedMetaData, - } - } else { - return EntitlementGatedMetaData{ - devIEntitlementGatedMetaData: dev.IEntitlementGatedMetaData, - } - } -} - -func (e EntitlementGatedMetaData) GetMetadata() *bind.MetaData { - if e.v3IEntitlementGatedMetaData != nil { - return e.v3IEntitlementGatedMetaData - } - return e.devIEntitlementGatedMetaData -} - -type IEntitlementChecker struct { - v3IEntitlementChecker *v3.IEntitlementChecker - devIEntitlementChecker *dev.IEntitlementChecker -} - -func NewIEntitlementChecker(address common.Address, backend bind.ContractBackend, version config.ContractVersion) (*IEntitlementChecker, error) { - res := &IEntitlementChecker{} - if version == "v3" { - contract, err := v3.NewIEntitlementChecker(address, backend) - res.v3IEntitlementChecker = contract - return res, err - } else { - contract, err := dev.NewIEntitlementChecker(address, backend) - res.devIEntitlementChecker = contract - return res, err - } -} - -func (c *IEntitlementChecker) IsValidNode(opts *bind.CallOpts, node common.Address) (bool, error) { - if c.v3IEntitlementChecker != nil { - return c.v3IEntitlementChecker.IsValidNode(opts, node) - } - return c.devIEntitlementChecker.IsValidNode(opts, node) -} - -func (c *IEntitlementChecker) GetMetadata() *bind.MetaData { - if v3.IEntitlementCheckerMetaData != nil { - return v3.IEntitlementCheckerMetaData - } else { - return dev.IEntitlementCheckerMetaData - } -} - -func (c *IEntitlementChecker) GetAbi() *abi.ABI { - md := c.GetMetadata() - abi, err := md.GetAbi() - if err != nil { - panic("Failed to parse EntitlementChecker ABI") - } - return abi -} - -type IEntitlementCheckRequestEvent interface { - CallerAddress() common.Address - TransactionID() common.Hash - RoleId() *big.Int - SelectedNodes() []common.Address - ContractAddress() common.Address - Raw() interface{} -} - -type entitlementCheckRequestEvent struct { - v3Inner *v3.IEntitlementCheckerEntitlementCheckRequested - devInner *dev.IEntitlementCheckerEntitlementCheckRequested -} - -func (e *entitlementCheckRequestEvent) CallerAddress() common.Address { - if e.v3Inner != nil { - return e.v3Inner.CallerAddress - } - return e.devInner.CallerAddress -} - -func (e *entitlementCheckRequestEvent) TransactionID() common.Hash { - if e.v3Inner != nil { - return e.v3Inner.TransactionId - } - return e.devInner.TransactionId -} - -func (e *entitlementCheckRequestEvent) SelectedNodes() []common.Address { - if e.v3Inner != nil { - return e.v3Inner.SelectedNodes - } - return e.devInner.SelectedNodes -} - -func (e *entitlementCheckRequestEvent) ContractAddress() common.Address { - if e.v3Inner != nil { - return e.v3Inner.ContractAddress - } - return e.devInner.ContractAddress -} - -func (e *entitlementCheckRequestEvent) RoleId() *big.Int { - if e.v3Inner != nil { - return e.v3Inner.RoleId - } - return e.devInner.RoleId -} - -func (e *entitlementCheckRequestEvent) Raw() interface{} { - if e.v3Inner != nil { - return e.v3Inner - } - return e.devInner - -} - -func (c *IEntitlementChecker) EntitlementCheckRequestEvent() IEntitlementCheckRequestEvent { - if c.v3IEntitlementChecker != nil { - return &entitlementCheckRequestEvent{&v3.IEntitlementCheckerEntitlementCheckRequested{}, nil} - } else { - return &entitlementCheckRequestEvent{nil, &dev.IEntitlementCheckerEntitlementCheckRequested{}} - } -} - -func (c *IEntitlementChecker) EstimateGas(ctx context.Context, client *ethclient.Client, From common.Address, To *common.Address, name string, args ...interface{}) (*uint64, error) { - log := dlog.FromCtx(ctx) - // Generate the data for the contract method call - // You must replace `YourContractABI` with the actual ABI of your contract - // and `registerNodeMethodID` with the actual method ID you wish to call. - // The following line is a placeholder for the encoded data of your method call. - parsedABI := c.GetAbi() - - method, err := parsedABI.Pack(name, args...) - if err != nil { - return nil, err - } - - // Prepare the transaction call message - msg := ethereum.CallMsg{ - From: From, // Sender of the transaction (optional) - To: To, // Contract address - Data: method, // Encoded method call - } - - // Estimate the gas required for the transaction - estimatedGas, err := client.EstimateGas(ctx, msg) - if err != nil { - log.Error("Failed to estimate gas", "err", err) - return nil, err - } - - log.Debug("estimatedGas", "estimatedGas", estimatedGas) - return &estimatedGas, nil - -} - -func (c *IEntitlementChecker) NodeCount(opts *bind.CallOpts) (*big.Int, error) { - if c.v3IEntitlementChecker != nil { - return c.v3IEntitlementChecker.GetNodeCount(opts) - } else { - return c.devIEntitlementChecker.GetNodeCount(opts) - } -} - -func (c *IEntitlementChecker) RegisterNode(opts *bind.TransactOpts, node common.Address) (*types.Transaction, error) { - if c.v3IEntitlementChecker != nil { - return c.v3IEntitlementChecker.RegisterNode(opts, node) - } else { - return c.devIEntitlementChecker.RegisterNode(opts, node) - } -} - -func (c *IEntitlementChecker) UnregisterNode(opts *bind.TransactOpts, node common.Address) (*types.Transaction, error) { - if c.v3IEntitlementChecker != nil { - return c.v3IEntitlementChecker.UnregisterNode(opts, node) - } else { - return c.devIEntitlementChecker.UnregisterNode(opts, node) - } -} - -func (c *IEntitlementChecker) WatchEntitlementCheckRequested(opts *bind.WatchOpts, sink chan<- *IEntitlementCheckerEntitlementCheckRequested, nodeAddress []common.Address) (event.Subscription, error) { - if c.v3IEntitlementChecker != nil { - v3Sink := make(chan *v3.IEntitlementCheckerEntitlementCheckRequested) - sub, err := c.v3IEntitlementChecker.WatchEntitlementCheckRequested(opts, v3Sink) - go func() { - for v3Event := range v3Sink { - shimEvent := convertV3ToShimCheckRequested(v3Event) - sink <- shimEvent - } - }() - return sub, err - } else { - devSink := make(chan *dev.IEntitlementCheckerEntitlementCheckRequested) - sub, err := c.devIEntitlementChecker.WatchEntitlementCheckRequested(opts, devSink) - go func() { - for devEvent := range devSink { - shimEvent := convertDevToShimCheckRequested(devEvent) - sink <- shimEvent - } - }() - return sub, err - } -} - -type IEntitlementGatedEntitlementCheckResultPosted struct { - TransactionId [32]byte - Result uint8 - Raw types.Log // Blockchain specific contextual infos -} - -type IEntitlementCheckerEntitlementCheckRequested struct { - CallerAddress common.Address - TransactionId [32]byte - SelectedNodes []common.Address - ContractAddress common.Address - Raw types.Log // Blockchain specific contextual infos -} - -func convertV3ToShimCheckRequested(v3Event *v3.IEntitlementCheckerEntitlementCheckRequested) *IEntitlementCheckerEntitlementCheckRequested { - return &IEntitlementCheckerEntitlementCheckRequested{ - CallerAddress: v3Event.CallerAddress, - TransactionId: v3Event.TransactionId, - SelectedNodes: v3Event.SelectedNodes, - ContractAddress: v3Event.ContractAddress, - Raw: v3Event.Raw, - } -} - -func convertDevToShimCheckRequested(devEvent *dev.IEntitlementCheckerEntitlementCheckRequested) *IEntitlementCheckerEntitlementCheckRequested { - return &IEntitlementCheckerEntitlementCheckRequested{ - CallerAddress: devEvent.CallerAddress, - TransactionId: devEvent.TransactionId, - SelectedNodes: devEvent.SelectedNodes, - ContractAddress: devEvent.ContractAddress, - Raw: devEvent.Raw, - } -} - -func convertV3ToShimResultPosted(v3Event *v3.IEntitlementGatedEntitlementCheckResultPosted) *IEntitlementGatedEntitlementCheckResultPosted { - return &IEntitlementGatedEntitlementCheckResultPosted{ - TransactionId: v3Event.TransactionId, - Result: v3Event.Result, - Raw: v3Event.Raw, - } -} - -func converDevToShimResultPosted(devEvent *dev.IEntitlementGatedEntitlementCheckResultPosted) *IEntitlementGatedEntitlementCheckResultPosted { - return &IEntitlementGatedEntitlementCheckResultPosted{ - TransactionId: devEvent.TransactionId, - Result: devEvent.Result, - Raw: devEvent.Raw, - } -} - -func convertRuleDataToV3(ruleData IRuleData) v3.IRuleEntitlementRuleData { - operations := make([]v3.IRuleEntitlementOperation, len(ruleData.Operations)) - for i, op := range ruleData.Operations { - operations[i] = v3.IRuleEntitlementOperation{ - OpType: op.OpType, - Index: op.Index, - } - } - checkOperations := make([]v3.IRuleEntitlementCheckOperation, len(ruleData.CheckOperations)) - for i, op := range ruleData.CheckOperations { - checkOperations[i] = v3.IRuleEntitlementCheckOperation{ - OpType: op.OpType, - ChainId: op.ChainId, - ContractAddress: op.ContractAddress, - Threshold: op.Threshold, - } - } - logicalOperations := make([]v3.IRuleEntitlementLogicalOperation, len(ruleData.LogicalOperations)) - for i, op := range ruleData.LogicalOperations { - logicalOperations[i] = v3.IRuleEntitlementLogicalOperation{ - LogOpType: op.LogOpType, - LeftOperationIndex: op.LeftOperationIndex, - RightOperationIndex: op.RightOperationIndex, - } - } - return v3.IRuleEntitlementRuleData{ - Operations: operations, - CheckOperations: checkOperations, - LogicalOperations: logicalOperations, - } -} - -func convertRuleDataToDev(ruleData IRuleData) dev.IRuleEntitlementRuleData { - operations := make([]dev.IRuleEntitlementOperation, len(ruleData.Operations)) - for i, op := range ruleData.Operations { - operations[i] = dev.IRuleEntitlementOperation{ - OpType: op.OpType, - Index: op.Index, - } - } - checkOperations := make([]dev.IRuleEntitlementCheckOperation, len(ruleData.CheckOperations)) - for i, op := range ruleData.CheckOperations { - checkOperations[i] = dev.IRuleEntitlementCheckOperation{ - OpType: op.OpType, - ChainId: op.ChainId, - ContractAddress: op.ContractAddress, - Threshold: op.Threshold, - } - } - logicalOperations := make([]dev.IRuleEntitlementLogicalOperation, len(ruleData.LogicalOperations)) - for i, op := range ruleData.LogicalOperations { - logicalOperations[i] = dev.IRuleEntitlementLogicalOperation{ - LogOpType: op.LogOpType, - LeftOperationIndex: op.LeftOperationIndex, - RightOperationIndex: op.RightOperationIndex, - } - } - return dev.IRuleEntitlementRuleData{ - Operations: operations, - CheckOperations: checkOperations, - LogicalOperations: logicalOperations, - } - -} diff --git a/core/xchain/contracts/dev/i_custom_entitlement.go b/core/xchain/contracts/dev/i_custom_entitlement.go deleted file mode 100644 index 4cc6be39c..000000000 --- a/core/xchain/contracts/dev/i_custom_entitlement.go +++ /dev/null @@ -1,212 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package dev - -import ( - "errors" - "math/big" - "strings" - - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" -) - -// Reference imports to suppress errors if they are not otherwise used. -var ( - _ = errors.New - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription - _ = abi.ConvertType -) - -// ICustomEntitlementMetaData contains all meta data concerning the ICustomEntitlement contract. -var ICustomEntitlementMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"function\",\"name\":\"isEntitled\",\"inputs\":[{\"name\":\"user\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"}]", -} - -// ICustomEntitlementABI is the input ABI used to generate the binding from. -// Deprecated: Use ICustomEntitlementMetaData.ABI instead. -var ICustomEntitlementABI = ICustomEntitlementMetaData.ABI - -// ICustomEntitlement is an auto generated Go binding around an Ethereum contract. -type ICustomEntitlement struct { - ICustomEntitlementCaller // Read-only binding to the contract - ICustomEntitlementTransactor // Write-only binding to the contract - ICustomEntitlementFilterer // Log filterer for contract events -} - -// ICustomEntitlementCaller is an auto generated read-only Go binding around an Ethereum contract. -type ICustomEntitlementCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// ICustomEntitlementTransactor is an auto generated write-only Go binding around an Ethereum contract. -type ICustomEntitlementTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// ICustomEntitlementFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type ICustomEntitlementFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// ICustomEntitlementSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type ICustomEntitlementSession struct { - Contract *ICustomEntitlement // 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 -} - -// ICustomEntitlementCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type ICustomEntitlementCallerSession struct { - Contract *ICustomEntitlementCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// ICustomEntitlementTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type ICustomEntitlementTransactorSession struct { - Contract *ICustomEntitlementTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// ICustomEntitlementRaw is an auto generated low-level Go binding around an Ethereum contract. -type ICustomEntitlementRaw struct { - Contract *ICustomEntitlement // Generic contract binding to access the raw methods on -} - -// ICustomEntitlementCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type ICustomEntitlementCallerRaw struct { - Contract *ICustomEntitlementCaller // Generic read-only contract binding to access the raw methods on -} - -// ICustomEntitlementTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type ICustomEntitlementTransactorRaw struct { - Contract *ICustomEntitlementTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewICustomEntitlement creates a new instance of ICustomEntitlement, bound to a specific deployed contract. -func NewICustomEntitlement(address common.Address, backend bind.ContractBackend) (*ICustomEntitlement, error) { - contract, err := bindICustomEntitlement(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &ICustomEntitlement{ICustomEntitlementCaller: ICustomEntitlementCaller{contract: contract}, ICustomEntitlementTransactor: ICustomEntitlementTransactor{contract: contract}, ICustomEntitlementFilterer: ICustomEntitlementFilterer{contract: contract}}, nil -} - -// NewICustomEntitlementCaller creates a new read-only instance of ICustomEntitlement, bound to a specific deployed contract. -func NewICustomEntitlementCaller(address common.Address, caller bind.ContractCaller) (*ICustomEntitlementCaller, error) { - contract, err := bindICustomEntitlement(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &ICustomEntitlementCaller{contract: contract}, nil -} - -// NewICustomEntitlementTransactor creates a new write-only instance of ICustomEntitlement, bound to a specific deployed contract. -func NewICustomEntitlementTransactor(address common.Address, transactor bind.ContractTransactor) (*ICustomEntitlementTransactor, error) { - contract, err := bindICustomEntitlement(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &ICustomEntitlementTransactor{contract: contract}, nil -} - -// NewICustomEntitlementFilterer creates a new log filterer instance of ICustomEntitlement, bound to a specific deployed contract. -func NewICustomEntitlementFilterer(address common.Address, filterer bind.ContractFilterer) (*ICustomEntitlementFilterer, error) { - contract, err := bindICustomEntitlement(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &ICustomEntitlementFilterer{contract: contract}, nil -} - -// bindICustomEntitlement binds a generic wrapper to an already deployed contract. -func bindICustomEntitlement(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := ICustomEntitlementMetaData.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 (_ICustomEntitlement *ICustomEntitlementRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _ICustomEntitlement.Contract.ICustomEntitlementCaller.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 (_ICustomEntitlement *ICustomEntitlementRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _ICustomEntitlement.Contract.ICustomEntitlementTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_ICustomEntitlement *ICustomEntitlementRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _ICustomEntitlement.Contract.ICustomEntitlementTransactor.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 (_ICustomEntitlement *ICustomEntitlementCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _ICustomEntitlement.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 (_ICustomEntitlement *ICustomEntitlementTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _ICustomEntitlement.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_ICustomEntitlement *ICustomEntitlementTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _ICustomEntitlement.Contract.contract.Transact(opts, method, params...) -} - -// IsEntitled is a free data retrieval call binding the contract method 0xddc6e68e. -// -// Solidity: function isEntitled(address[] user) view returns(bool) -func (_ICustomEntitlement *ICustomEntitlementCaller) IsEntitled(opts *bind.CallOpts, user []common.Address) (bool, error) { - var out []interface{} - err := _ICustomEntitlement.contract.Call(opts, &out, "isEntitled", user) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// IsEntitled is a free data retrieval call binding the contract method 0xddc6e68e. -// -// Solidity: function isEntitled(address[] user) view returns(bool) -func (_ICustomEntitlement *ICustomEntitlementSession) IsEntitled(user []common.Address) (bool, error) { - return _ICustomEntitlement.Contract.IsEntitled(&_ICustomEntitlement.CallOpts, user) -} - -// IsEntitled is a free data retrieval call binding the contract method 0xddc6e68e. -// -// Solidity: function isEntitled(address[] user) view returns(bool) -func (_ICustomEntitlement *ICustomEntitlementCallerSession) IsEntitled(user []common.Address) (bool, error) { - return _ICustomEntitlement.Contract.IsEntitled(&_ICustomEntitlement.CallOpts, user) -} diff --git a/core/xchain/contracts/dev/i_entitlement.go b/core/xchain/contracts/dev/i_entitlement.go deleted file mode 100644 index 7830053db..000000000 --- a/core/xchain/contracts/dev/i_entitlement.go +++ /dev/null @@ -1,430 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package dev - -import ( - "errors" - "math/big" - "strings" - - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" -) - -// Reference imports to suppress errors if they are not otherwise used. -var ( - _ = errors.New - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription - _ = abi.ConvertType -) - -// IEntitlementMetaData contains all meta data concerning the IEntitlement contract. -var IEntitlementMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"function\",\"name\":\"description\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getEntitlementDataByRoleId\",\"inputs\":[{\"name\":\"roleId\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"space\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"isCrosschain\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isEntitled\",\"inputs\":[{\"name\":\"channelId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"user\",\"type\":\"address[]\",\"internalType\":\"address[]\"},{\"name\":\"permission\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"moduleType\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"name\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"removeEntitlement\",\"inputs\":[{\"name\":\"roleId\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setEntitlement\",\"inputs\":[{\"name\":\"roleId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"entitlementData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"error\",\"name\":\"Entitlement__InvalidValue\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Entitlement__NotAllowed\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Entitlement__NotMember\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Entitlement__ValueAlreadyExists\",\"inputs\":[]}]", -} - -// IEntitlementABI is the input ABI used to generate the binding from. -// Deprecated: Use IEntitlementMetaData.ABI instead. -var IEntitlementABI = IEntitlementMetaData.ABI - -// IEntitlement is an auto generated Go binding around an Ethereum contract. -type IEntitlement struct { - IEntitlementCaller // Read-only binding to the contract - IEntitlementTransactor // Write-only binding to the contract - IEntitlementFilterer // Log filterer for contract events -} - -// IEntitlementCaller is an auto generated read-only Go binding around an Ethereum contract. -type IEntitlementCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// IEntitlementTransactor is an auto generated write-only Go binding around an Ethereum contract. -type IEntitlementTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// IEntitlementFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type IEntitlementFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// IEntitlementSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type IEntitlementSession struct { - Contract *IEntitlement // 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 -} - -// IEntitlementCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type IEntitlementCallerSession struct { - Contract *IEntitlementCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// IEntitlementTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type IEntitlementTransactorSession struct { - Contract *IEntitlementTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// IEntitlementRaw is an auto generated low-level Go binding around an Ethereum contract. -type IEntitlementRaw struct { - Contract *IEntitlement // Generic contract binding to access the raw methods on -} - -// IEntitlementCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type IEntitlementCallerRaw struct { - Contract *IEntitlementCaller // Generic read-only contract binding to access the raw methods on -} - -// IEntitlementTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type IEntitlementTransactorRaw struct { - Contract *IEntitlementTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewIEntitlement creates a new instance of IEntitlement, bound to a specific deployed contract. -func NewIEntitlement(address common.Address, backend bind.ContractBackend) (*IEntitlement, error) { - contract, err := bindIEntitlement(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &IEntitlement{IEntitlementCaller: IEntitlementCaller{contract: contract}, IEntitlementTransactor: IEntitlementTransactor{contract: contract}, IEntitlementFilterer: IEntitlementFilterer{contract: contract}}, nil -} - -// NewIEntitlementCaller creates a new read-only instance of IEntitlement, bound to a specific deployed contract. -func NewIEntitlementCaller(address common.Address, caller bind.ContractCaller) (*IEntitlementCaller, error) { - contract, err := bindIEntitlement(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &IEntitlementCaller{contract: contract}, nil -} - -// NewIEntitlementTransactor creates a new write-only instance of IEntitlement, bound to a specific deployed contract. -func NewIEntitlementTransactor(address common.Address, transactor bind.ContractTransactor) (*IEntitlementTransactor, error) { - contract, err := bindIEntitlement(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &IEntitlementTransactor{contract: contract}, nil -} - -// NewIEntitlementFilterer creates a new log filterer instance of IEntitlement, bound to a specific deployed contract. -func NewIEntitlementFilterer(address common.Address, filterer bind.ContractFilterer) (*IEntitlementFilterer, error) { - contract, err := bindIEntitlement(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &IEntitlementFilterer{contract: contract}, nil -} - -// bindIEntitlement binds a generic wrapper to an already deployed contract. -func bindIEntitlement(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := IEntitlementMetaData.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 (_IEntitlement *IEntitlementRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _IEntitlement.Contract.IEntitlementCaller.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 (_IEntitlement *IEntitlementRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _IEntitlement.Contract.IEntitlementTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_IEntitlement *IEntitlementRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _IEntitlement.Contract.IEntitlementTransactor.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 (_IEntitlement *IEntitlementCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _IEntitlement.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 (_IEntitlement *IEntitlementTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _IEntitlement.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_IEntitlement *IEntitlementTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _IEntitlement.Contract.contract.Transact(opts, method, params...) -} - -// Description is a free data retrieval call binding the contract method 0x7284e416. -// -// Solidity: function description() view returns(string) -func (_IEntitlement *IEntitlementCaller) Description(opts *bind.CallOpts) (string, error) { - var out []interface{} - err := _IEntitlement.contract.Call(opts, &out, "description") - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -// Description is a free data retrieval call binding the contract method 0x7284e416. -// -// Solidity: function description() view returns(string) -func (_IEntitlement *IEntitlementSession) Description() (string, error) { - return _IEntitlement.Contract.Description(&_IEntitlement.CallOpts) -} - -// Description is a free data retrieval call binding the contract method 0x7284e416. -// -// Solidity: function description() view returns(string) -func (_IEntitlement *IEntitlementCallerSession) Description() (string, error) { - return _IEntitlement.Contract.Description(&_IEntitlement.CallOpts) -} - -// GetEntitlementDataByRoleId is a free data retrieval call binding the contract method 0x1eee07b2. -// -// Solidity: function getEntitlementDataByRoleId(uint256 roleId) view returns(bytes) -func (_IEntitlement *IEntitlementCaller) GetEntitlementDataByRoleId(opts *bind.CallOpts, roleId *big.Int) ([]byte, error) { - var out []interface{} - err := _IEntitlement.contract.Call(opts, &out, "getEntitlementDataByRoleId", roleId) - - if err != nil { - return *new([]byte), err - } - - out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) - - return out0, err - -} - -// GetEntitlementDataByRoleId is a free data retrieval call binding the contract method 0x1eee07b2. -// -// Solidity: function getEntitlementDataByRoleId(uint256 roleId) view returns(bytes) -func (_IEntitlement *IEntitlementSession) GetEntitlementDataByRoleId(roleId *big.Int) ([]byte, error) { - return _IEntitlement.Contract.GetEntitlementDataByRoleId(&_IEntitlement.CallOpts, roleId) -} - -// GetEntitlementDataByRoleId is a free data retrieval call binding the contract method 0x1eee07b2. -// -// Solidity: function getEntitlementDataByRoleId(uint256 roleId) view returns(bytes) -func (_IEntitlement *IEntitlementCallerSession) GetEntitlementDataByRoleId(roleId *big.Int) ([]byte, error) { - return _IEntitlement.Contract.GetEntitlementDataByRoleId(&_IEntitlement.CallOpts, roleId) -} - -// IsCrosschain is a free data retrieval call binding the contract method 0x2e1b61e4. -// -// Solidity: function isCrosschain() view returns(bool) -func (_IEntitlement *IEntitlementCaller) IsCrosschain(opts *bind.CallOpts) (bool, error) { - var out []interface{} - err := _IEntitlement.contract.Call(opts, &out, "isCrosschain") - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// IsCrosschain is a free data retrieval call binding the contract method 0x2e1b61e4. -// -// Solidity: function isCrosschain() view returns(bool) -func (_IEntitlement *IEntitlementSession) IsCrosschain() (bool, error) { - return _IEntitlement.Contract.IsCrosschain(&_IEntitlement.CallOpts) -} - -// IsCrosschain is a free data retrieval call binding the contract method 0x2e1b61e4. -// -// Solidity: function isCrosschain() view returns(bool) -func (_IEntitlement *IEntitlementCallerSession) IsCrosschain() (bool, error) { - return _IEntitlement.Contract.IsCrosschain(&_IEntitlement.CallOpts) -} - -// IsEntitled is a free data retrieval call binding the contract method 0x0cf0b533. -// -// Solidity: function isEntitled(bytes32 channelId, address[] user, bytes32 permission) view returns(bool) -func (_IEntitlement *IEntitlementCaller) IsEntitled(opts *bind.CallOpts, channelId [32]byte, user []common.Address, permission [32]byte) (bool, error) { - var out []interface{} - err := _IEntitlement.contract.Call(opts, &out, "isEntitled", channelId, user, permission) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// IsEntitled is a free data retrieval call binding the contract method 0x0cf0b533. -// -// Solidity: function isEntitled(bytes32 channelId, address[] user, bytes32 permission) view returns(bool) -func (_IEntitlement *IEntitlementSession) IsEntitled(channelId [32]byte, user []common.Address, permission [32]byte) (bool, error) { - return _IEntitlement.Contract.IsEntitled(&_IEntitlement.CallOpts, channelId, user, permission) -} - -// IsEntitled is a free data retrieval call binding the contract method 0x0cf0b533. -// -// Solidity: function isEntitled(bytes32 channelId, address[] user, bytes32 permission) view returns(bool) -func (_IEntitlement *IEntitlementCallerSession) IsEntitled(channelId [32]byte, user []common.Address, permission [32]byte) (bool, error) { - return _IEntitlement.Contract.IsEntitled(&_IEntitlement.CallOpts, channelId, user, permission) -} - -// ModuleType is a free data retrieval call binding the contract method 0x6465e69f. -// -// Solidity: function moduleType() view returns(string) -func (_IEntitlement *IEntitlementCaller) ModuleType(opts *bind.CallOpts) (string, error) { - var out []interface{} - err := _IEntitlement.contract.Call(opts, &out, "moduleType") - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -// ModuleType is a free data retrieval call binding the contract method 0x6465e69f. -// -// Solidity: function moduleType() view returns(string) -func (_IEntitlement *IEntitlementSession) ModuleType() (string, error) { - return _IEntitlement.Contract.ModuleType(&_IEntitlement.CallOpts) -} - -// ModuleType is a free data retrieval call binding the contract method 0x6465e69f. -// -// Solidity: function moduleType() view returns(string) -func (_IEntitlement *IEntitlementCallerSession) ModuleType() (string, error) { - return _IEntitlement.Contract.ModuleType(&_IEntitlement.CallOpts) -} - -// Name is a free data retrieval call binding the contract method 0x06fdde03. -// -// Solidity: function name() view returns(string) -func (_IEntitlement *IEntitlementCaller) Name(opts *bind.CallOpts) (string, error) { - var out []interface{} - err := _IEntitlement.contract.Call(opts, &out, "name") - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -// Name is a free data retrieval call binding the contract method 0x06fdde03. -// -// Solidity: function name() view returns(string) -func (_IEntitlement *IEntitlementSession) Name() (string, error) { - return _IEntitlement.Contract.Name(&_IEntitlement.CallOpts) -} - -// Name is a free data retrieval call binding the contract method 0x06fdde03. -// -// Solidity: function name() view returns(string) -func (_IEntitlement *IEntitlementCallerSession) Name() (string, error) { - return _IEntitlement.Contract.Name(&_IEntitlement.CallOpts) -} - -// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. -// -// Solidity: function initialize(address space) returns() -func (_IEntitlement *IEntitlementTransactor) Initialize(opts *bind.TransactOpts, space common.Address) (*types.Transaction, error) { - return _IEntitlement.contract.Transact(opts, "initialize", space) -} - -// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. -// -// Solidity: function initialize(address space) returns() -func (_IEntitlement *IEntitlementSession) Initialize(space common.Address) (*types.Transaction, error) { - return _IEntitlement.Contract.Initialize(&_IEntitlement.TransactOpts, space) -} - -// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. -// -// Solidity: function initialize(address space) returns() -func (_IEntitlement *IEntitlementTransactorSession) Initialize(space common.Address) (*types.Transaction, error) { - return _IEntitlement.Contract.Initialize(&_IEntitlement.TransactOpts, space) -} - -// RemoveEntitlement is a paid mutator transaction binding the contract method 0xf0c111f9. -// -// Solidity: function removeEntitlement(uint256 roleId) returns() -func (_IEntitlement *IEntitlementTransactor) RemoveEntitlement(opts *bind.TransactOpts, roleId *big.Int) (*types.Transaction, error) { - return _IEntitlement.contract.Transact(opts, "removeEntitlement", roleId) -} - -// RemoveEntitlement is a paid mutator transaction binding the contract method 0xf0c111f9. -// -// Solidity: function removeEntitlement(uint256 roleId) returns() -func (_IEntitlement *IEntitlementSession) RemoveEntitlement(roleId *big.Int) (*types.Transaction, error) { - return _IEntitlement.Contract.RemoveEntitlement(&_IEntitlement.TransactOpts, roleId) -} - -// RemoveEntitlement is a paid mutator transaction binding the contract method 0xf0c111f9. -// -// Solidity: function removeEntitlement(uint256 roleId) returns() -func (_IEntitlement *IEntitlementTransactorSession) RemoveEntitlement(roleId *big.Int) (*types.Transaction, error) { - return _IEntitlement.Contract.RemoveEntitlement(&_IEntitlement.TransactOpts, roleId) -} - -// SetEntitlement is a paid mutator transaction binding the contract method 0xef8be574. -// -// Solidity: function setEntitlement(uint256 roleId, bytes entitlementData) returns() -func (_IEntitlement *IEntitlementTransactor) SetEntitlement(opts *bind.TransactOpts, roleId *big.Int, entitlementData []byte) (*types.Transaction, error) { - return _IEntitlement.contract.Transact(opts, "setEntitlement", roleId, entitlementData) -} - -// SetEntitlement is a paid mutator transaction binding the contract method 0xef8be574. -// -// Solidity: function setEntitlement(uint256 roleId, bytes entitlementData) returns() -func (_IEntitlement *IEntitlementSession) SetEntitlement(roleId *big.Int, entitlementData []byte) (*types.Transaction, error) { - return _IEntitlement.Contract.SetEntitlement(&_IEntitlement.TransactOpts, roleId, entitlementData) -} - -// SetEntitlement is a paid mutator transaction binding the contract method 0xef8be574. -// -// Solidity: function setEntitlement(uint256 roleId, bytes entitlementData) returns() -func (_IEntitlement *IEntitlementTransactorSession) SetEntitlement(roleId *big.Int, entitlementData []byte) (*types.Transaction, error) { - return _IEntitlement.Contract.SetEntitlement(&_IEntitlement.TransactOpts, roleId, entitlementData) -} diff --git a/core/xchain/contracts/dev/i_entitlement_gated.go b/core/xchain/contracts/dev/i_entitlement_gated.go deleted file mode 100644 index 57497cd0c..000000000 --- a/core/xchain/contracts/dev/i_entitlement_gated.go +++ /dev/null @@ -1,406 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package dev - -import ( - "errors" - "math/big" - "strings" - - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" -) - -// Reference imports to suppress errors if they are not otherwise used. -var ( - _ = errors.New - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription - _ = abi.ConvertType -) - -// IRuleEntitlementCheckOperation is an auto generated low-level Go binding around an user-defined struct. -type IRuleEntitlementCheckOperation struct { - OpType uint8 - ChainId *big.Int - ContractAddress common.Address - Threshold *big.Int -} - -// IRuleEntitlementLogicalOperation is an auto generated low-level Go binding around an user-defined struct. -type IRuleEntitlementLogicalOperation struct { - LogOpType uint8 - LeftOperationIndex uint8 - RightOperationIndex uint8 -} - -// IRuleEntitlementOperation is an auto generated low-level Go binding around an user-defined struct. -type IRuleEntitlementOperation struct { - OpType uint8 - Index uint8 -} - -// IRuleEntitlementRuleData is an auto generated low-level Go binding around an user-defined struct. -type IRuleEntitlementRuleData struct { - Operations []IRuleEntitlementOperation - CheckOperations []IRuleEntitlementCheckOperation - LogicalOperations []IRuleEntitlementLogicalOperation -} - -// IEntitlementGatedMetaData contains all meta data concerning the IEntitlementGated contract. -var IEntitlementGatedMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"function\",\"name\":\"getRuleData\",\"inputs\":[{\"name\":\"transactionId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"roleId\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIRuleEntitlement.RuleData\",\"components\":[{\"name\":\"operations\",\"type\":\"tuple[]\",\"internalType\":\"structIRuleEntitlement.Operation[]\",\"components\":[{\"name\":\"opType\",\"type\":\"uint8\",\"internalType\":\"enumIRuleEntitlement.CombinedOperationType\"},{\"name\":\"index\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]},{\"name\":\"checkOperations\",\"type\":\"tuple[]\",\"internalType\":\"structIRuleEntitlement.CheckOperation[]\",\"components\":[{\"name\":\"opType\",\"type\":\"uint8\",\"internalType\":\"enumIRuleEntitlement.CheckOperationType\"},{\"name\":\"chainId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"contractAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"threshold\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"logicalOperations\",\"type\":\"tuple[]\",\"internalType\":\"structIRuleEntitlement.LogicalOperation[]\",\"components\":[{\"name\":\"logOpType\",\"type\":\"uint8\",\"internalType\":\"enumIRuleEntitlement.LogicalOperationType\"},{\"name\":\"leftOperationIndex\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"rightOperationIndex\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"postEntitlementCheckResult\",\"inputs\":[{\"name\":\"transactionId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"roleId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"result\",\"type\":\"uint8\",\"internalType\":\"enumIEntitlementGatedBase.NodeVoteStatus\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"EntitlementCheckResultPosted\",\"inputs\":[{\"name\":\"transactionId\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"result\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"enumIEntitlementGatedBase.NodeVoteStatus\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"EntitlementGated_InvalidAddress\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EntitlementGated_NodeAlreadyVoted\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EntitlementGated_NodeNotFound\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EntitlementGated_TransactionCheckAlreadyCompleted\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EntitlementGated_TransactionCheckAlreadyRegistered\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EntitlementGated_TransactionNotRegistered\",\"inputs\":[]}]", -} - -// IEntitlementGatedABI is the input ABI used to generate the binding from. -// Deprecated: Use IEntitlementGatedMetaData.ABI instead. -var IEntitlementGatedABI = IEntitlementGatedMetaData.ABI - -// IEntitlementGated is an auto generated Go binding around an Ethereum contract. -type IEntitlementGated struct { - IEntitlementGatedCaller // Read-only binding to the contract - IEntitlementGatedTransactor // Write-only binding to the contract - IEntitlementGatedFilterer // Log filterer for contract events -} - -// IEntitlementGatedCaller is an auto generated read-only Go binding around an Ethereum contract. -type IEntitlementGatedCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// IEntitlementGatedTransactor is an auto generated write-only Go binding around an Ethereum contract. -type IEntitlementGatedTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// IEntitlementGatedFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type IEntitlementGatedFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// IEntitlementGatedSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type IEntitlementGatedSession struct { - Contract *IEntitlementGated // 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 -} - -// IEntitlementGatedCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type IEntitlementGatedCallerSession struct { - Contract *IEntitlementGatedCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// IEntitlementGatedTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type IEntitlementGatedTransactorSession struct { - Contract *IEntitlementGatedTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// IEntitlementGatedRaw is an auto generated low-level Go binding around an Ethereum contract. -type IEntitlementGatedRaw struct { - Contract *IEntitlementGated // Generic contract binding to access the raw methods on -} - -// IEntitlementGatedCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type IEntitlementGatedCallerRaw struct { - Contract *IEntitlementGatedCaller // Generic read-only contract binding to access the raw methods on -} - -// IEntitlementGatedTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type IEntitlementGatedTransactorRaw struct { - Contract *IEntitlementGatedTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewIEntitlementGated creates a new instance of IEntitlementGated, bound to a specific deployed contract. -func NewIEntitlementGated(address common.Address, backend bind.ContractBackend) (*IEntitlementGated, error) { - contract, err := bindIEntitlementGated(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &IEntitlementGated{IEntitlementGatedCaller: IEntitlementGatedCaller{contract: contract}, IEntitlementGatedTransactor: IEntitlementGatedTransactor{contract: contract}, IEntitlementGatedFilterer: IEntitlementGatedFilterer{contract: contract}}, nil -} - -// NewIEntitlementGatedCaller creates a new read-only instance of IEntitlementGated, bound to a specific deployed contract. -func NewIEntitlementGatedCaller(address common.Address, caller bind.ContractCaller) (*IEntitlementGatedCaller, error) { - contract, err := bindIEntitlementGated(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &IEntitlementGatedCaller{contract: contract}, nil -} - -// NewIEntitlementGatedTransactor creates a new write-only instance of IEntitlementGated, bound to a specific deployed contract. -func NewIEntitlementGatedTransactor(address common.Address, transactor bind.ContractTransactor) (*IEntitlementGatedTransactor, error) { - contract, err := bindIEntitlementGated(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &IEntitlementGatedTransactor{contract: contract}, nil -} - -// NewIEntitlementGatedFilterer creates a new log filterer instance of IEntitlementGated, bound to a specific deployed contract. -func NewIEntitlementGatedFilterer(address common.Address, filterer bind.ContractFilterer) (*IEntitlementGatedFilterer, error) { - contract, err := bindIEntitlementGated(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &IEntitlementGatedFilterer{contract: contract}, nil -} - -// bindIEntitlementGated binds a generic wrapper to an already deployed contract. -func bindIEntitlementGated(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := IEntitlementGatedMetaData.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 (_IEntitlementGated *IEntitlementGatedRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _IEntitlementGated.Contract.IEntitlementGatedCaller.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 (_IEntitlementGated *IEntitlementGatedRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _IEntitlementGated.Contract.IEntitlementGatedTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_IEntitlementGated *IEntitlementGatedRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _IEntitlementGated.Contract.IEntitlementGatedTransactor.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 (_IEntitlementGated *IEntitlementGatedCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _IEntitlementGated.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 (_IEntitlementGated *IEntitlementGatedTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _IEntitlementGated.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_IEntitlementGated *IEntitlementGatedTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _IEntitlementGated.Contract.contract.Transact(opts, method, params...) -} - -// GetRuleData is a free data retrieval call binding the contract method 0x92c399ff. -// -// Solidity: function getRuleData(bytes32 transactionId, uint256 roleId) view returns(((uint8,uint8)[],(uint8,uint256,address,uint256)[],(uint8,uint8,uint8)[])) -func (_IEntitlementGated *IEntitlementGatedCaller) GetRuleData(opts *bind.CallOpts, transactionId [32]byte, roleId *big.Int) (IRuleEntitlementRuleData, error) { - var out []interface{} - err := _IEntitlementGated.contract.Call(opts, &out, "getRuleData", transactionId, roleId) - - if err != nil { - return *new(IRuleEntitlementRuleData), err - } - - out0 := *abi.ConvertType(out[0], new(IRuleEntitlementRuleData)).(*IRuleEntitlementRuleData) - - return out0, err - -} - -// GetRuleData is a free data retrieval call binding the contract method 0x92c399ff. -// -// Solidity: function getRuleData(bytes32 transactionId, uint256 roleId) view returns(((uint8,uint8)[],(uint8,uint256,address,uint256)[],(uint8,uint8,uint8)[])) -func (_IEntitlementGated *IEntitlementGatedSession) GetRuleData(transactionId [32]byte, roleId *big.Int) (IRuleEntitlementRuleData, error) { - return _IEntitlementGated.Contract.GetRuleData(&_IEntitlementGated.CallOpts, transactionId, roleId) -} - -// GetRuleData is a free data retrieval call binding the contract method 0x92c399ff. -// -// Solidity: function getRuleData(bytes32 transactionId, uint256 roleId) view returns(((uint8,uint8)[],(uint8,uint256,address,uint256)[],(uint8,uint8,uint8)[])) -func (_IEntitlementGated *IEntitlementGatedCallerSession) GetRuleData(transactionId [32]byte, roleId *big.Int) (IRuleEntitlementRuleData, error) { - return _IEntitlementGated.Contract.GetRuleData(&_IEntitlementGated.CallOpts, transactionId, roleId) -} - -// PostEntitlementCheckResult is a paid mutator transaction binding the contract method 0x4739e805. -// -// Solidity: function postEntitlementCheckResult(bytes32 transactionId, uint256 roleId, uint8 result) returns() -func (_IEntitlementGated *IEntitlementGatedTransactor) PostEntitlementCheckResult(opts *bind.TransactOpts, transactionId [32]byte, roleId *big.Int, result uint8) (*types.Transaction, error) { - return _IEntitlementGated.contract.Transact(opts, "postEntitlementCheckResult", transactionId, roleId, result) -} - -// PostEntitlementCheckResult is a paid mutator transaction binding the contract method 0x4739e805. -// -// Solidity: function postEntitlementCheckResult(bytes32 transactionId, uint256 roleId, uint8 result) returns() -func (_IEntitlementGated *IEntitlementGatedSession) PostEntitlementCheckResult(transactionId [32]byte, roleId *big.Int, result uint8) (*types.Transaction, error) { - return _IEntitlementGated.Contract.PostEntitlementCheckResult(&_IEntitlementGated.TransactOpts, transactionId, roleId, result) -} - -// PostEntitlementCheckResult is a paid mutator transaction binding the contract method 0x4739e805. -// -// Solidity: function postEntitlementCheckResult(bytes32 transactionId, uint256 roleId, uint8 result) returns() -func (_IEntitlementGated *IEntitlementGatedTransactorSession) PostEntitlementCheckResult(transactionId [32]byte, roleId *big.Int, result uint8) (*types.Transaction, error) { - return _IEntitlementGated.Contract.PostEntitlementCheckResult(&_IEntitlementGated.TransactOpts, transactionId, roleId, result) -} - -// IEntitlementGatedEntitlementCheckResultPostedIterator is returned from FilterEntitlementCheckResultPosted and is used to iterate over the raw logs and unpacked data for EntitlementCheckResultPosted events raised by the IEntitlementGated contract. -type IEntitlementGatedEntitlementCheckResultPostedIterator struct { - Event *IEntitlementGatedEntitlementCheckResultPosted // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *IEntitlementGatedEntitlementCheckResultPostedIterator) 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(IEntitlementGatedEntitlementCheckResultPosted) - 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(IEntitlementGatedEntitlementCheckResultPosted) - 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 *IEntitlementGatedEntitlementCheckResultPostedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *IEntitlementGatedEntitlementCheckResultPostedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// IEntitlementGatedEntitlementCheckResultPosted represents a EntitlementCheckResultPosted event raised by the IEntitlementGated contract. -type IEntitlementGatedEntitlementCheckResultPosted struct { - TransactionId [32]byte - Result uint8 - Raw types.Log // Blockchain specific contextual infos -} - -// FilterEntitlementCheckResultPosted is a free log retrieval operation binding the contract event 0xb9d6ce397e562841871d119aaf77469c60a3b5bf8b99a5d9851656015015c633. -// -// Solidity: event EntitlementCheckResultPosted(bytes32 indexed transactionId, uint8 result) -func (_IEntitlementGated *IEntitlementGatedFilterer) FilterEntitlementCheckResultPosted(opts *bind.FilterOpts, transactionId [][32]byte) (*IEntitlementGatedEntitlementCheckResultPostedIterator, error) { - - var transactionIdRule []interface{} - for _, transactionIdItem := range transactionId { - transactionIdRule = append(transactionIdRule, transactionIdItem) - } - - logs, sub, err := _IEntitlementGated.contract.FilterLogs(opts, "EntitlementCheckResultPosted", transactionIdRule) - if err != nil { - return nil, err - } - return &IEntitlementGatedEntitlementCheckResultPostedIterator{contract: _IEntitlementGated.contract, event: "EntitlementCheckResultPosted", logs: logs, sub: sub}, nil -} - -// WatchEntitlementCheckResultPosted is a free log subscription operation binding the contract event 0xb9d6ce397e562841871d119aaf77469c60a3b5bf8b99a5d9851656015015c633. -// -// Solidity: event EntitlementCheckResultPosted(bytes32 indexed transactionId, uint8 result) -func (_IEntitlementGated *IEntitlementGatedFilterer) WatchEntitlementCheckResultPosted(opts *bind.WatchOpts, sink chan<- *IEntitlementGatedEntitlementCheckResultPosted, transactionId [][32]byte) (event.Subscription, error) { - - var transactionIdRule []interface{} - for _, transactionIdItem := range transactionId { - transactionIdRule = append(transactionIdRule, transactionIdItem) - } - - logs, sub, err := _IEntitlementGated.contract.WatchLogs(opts, "EntitlementCheckResultPosted", transactionIdRule) - 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(IEntitlementGatedEntitlementCheckResultPosted) - if err := _IEntitlementGated.contract.UnpackLog(event, "EntitlementCheckResultPosted", 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 -} - -// ParseEntitlementCheckResultPosted is a log parse operation binding the contract event 0xb9d6ce397e562841871d119aaf77469c60a3b5bf8b99a5d9851656015015c633. -// -// Solidity: event EntitlementCheckResultPosted(bytes32 indexed transactionId, uint8 result) -func (_IEntitlementGated *IEntitlementGatedFilterer) ParseEntitlementCheckResultPosted(log types.Log) (*IEntitlementGatedEntitlementCheckResultPosted, error) { - event := new(IEntitlementGatedEntitlementCheckResultPosted) - if err := _IEntitlementGated.contract.UnpackLog(event, "EntitlementCheckResultPosted", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} diff --git a/core/xchain/contracts/dev/i_wallet_link.go b/core/xchain/contracts/dev/i_wallet_link.go deleted file mode 100644 index a92b5c886..000000000 --- a/core/xchain/contracts/dev/i_wallet_link.go +++ /dev/null @@ -1,680 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package dev - -import ( - "errors" - "math/big" - "strings" - - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" -) - -// Reference imports to suppress errors if they are not otherwise used. -var ( - _ = errors.New - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription - _ = abi.ConvertType -) - -// IWalletLinkBaseLinkedWallet is an auto generated low-level Go binding around an user-defined struct. -type IWalletLinkBaseLinkedWallet struct { - Addr common.Address - Signature []byte -} - -// IWalletLinkMetaData contains all meta data concerning the IWalletLink contract. -var IWalletLinkMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"function\",\"name\":\"checkIfLinked\",\"inputs\":[{\"name\":\"rootKey\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"wallet\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getLatestNonceForRootKey\",\"inputs\":[{\"name\":\"rootKey\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getRootKeyForWallet\",\"inputs\":[{\"name\":\"wallet\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"rootKey\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getWalletsByRootKey\",\"inputs\":[{\"name\":\"rootKey\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"wallets\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"linkCallerToRootKey\",\"inputs\":[{\"name\":\"rootWallet\",\"type\":\"tuple\",\"internalType\":\"structIWalletLinkBase.LinkedWallet\",\"components\":[{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"linkWalletToRootKey\",\"inputs\":[{\"name\":\"wallet\",\"type\":\"tuple\",\"internalType\":\"structIWalletLinkBase.LinkedWallet\",\"components\":[{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"rootWallet\",\"type\":\"tuple\",\"internalType\":\"structIWalletLinkBase.LinkedWallet\",\"components\":[{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"removeLink\",\"inputs\":[{\"name\":\"wallet\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"rootWallet\",\"type\":\"tuple\",\"internalType\":\"structIWalletLinkBase.LinkedWallet\",\"components\":[{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"LinkWalletToRootKey\",\"inputs\":[{\"name\":\"wallet\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"rootKey\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RemoveLink\",\"inputs\":[{\"name\":\"wallet\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"secondWallet\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"WalletLink__CannotLinkToRootWallet\",\"inputs\":[{\"name\":\"wallet\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"rootKey\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"WalletLink__CannotLinkToSelf\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"WalletLink__CannotRemoveRootWallet\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"WalletLink__InvalidAddress\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"WalletLink__InvalidSignature\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"WalletLink__LinkAlreadyExists\",\"inputs\":[{\"name\":\"wallet\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"rootKey\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"WalletLink__LinkedToAnotherRootKey\",\"inputs\":[{\"name\":\"wallet\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"rootKey\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"WalletLink__NotLinked\",\"inputs\":[{\"name\":\"wallet\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"rootKey\",\"type\":\"address\",\"internalType\":\"address\"}]}]", -} - -// IWalletLinkABI is the input ABI used to generate the binding from. -// Deprecated: Use IWalletLinkMetaData.ABI instead. -var IWalletLinkABI = IWalletLinkMetaData.ABI - -// IWalletLink is an auto generated Go binding around an Ethereum contract. -type IWalletLink struct { - IWalletLinkCaller // Read-only binding to the contract - IWalletLinkTransactor // Write-only binding to the contract - IWalletLinkFilterer // Log filterer for contract events -} - -// IWalletLinkCaller is an auto generated read-only Go binding around an Ethereum contract. -type IWalletLinkCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// IWalletLinkTransactor is an auto generated write-only Go binding around an Ethereum contract. -type IWalletLinkTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// IWalletLinkFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type IWalletLinkFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// IWalletLinkSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type IWalletLinkSession struct { - Contract *IWalletLink // 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 -} - -// IWalletLinkCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type IWalletLinkCallerSession struct { - Contract *IWalletLinkCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// IWalletLinkTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type IWalletLinkTransactorSession struct { - Contract *IWalletLinkTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// IWalletLinkRaw is an auto generated low-level Go binding around an Ethereum contract. -type IWalletLinkRaw struct { - Contract *IWalletLink // Generic contract binding to access the raw methods on -} - -// IWalletLinkCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type IWalletLinkCallerRaw struct { - Contract *IWalletLinkCaller // Generic read-only contract binding to access the raw methods on -} - -// IWalletLinkTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type IWalletLinkTransactorRaw struct { - Contract *IWalletLinkTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewIWalletLink creates a new instance of IWalletLink, bound to a specific deployed contract. -func NewIWalletLink(address common.Address, backend bind.ContractBackend) (*IWalletLink, error) { - contract, err := bindIWalletLink(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &IWalletLink{IWalletLinkCaller: IWalletLinkCaller{contract: contract}, IWalletLinkTransactor: IWalletLinkTransactor{contract: contract}, IWalletLinkFilterer: IWalletLinkFilterer{contract: contract}}, nil -} - -// NewIWalletLinkCaller creates a new read-only instance of IWalletLink, bound to a specific deployed contract. -func NewIWalletLinkCaller(address common.Address, caller bind.ContractCaller) (*IWalletLinkCaller, error) { - contract, err := bindIWalletLink(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &IWalletLinkCaller{contract: contract}, nil -} - -// NewIWalletLinkTransactor creates a new write-only instance of IWalletLink, bound to a specific deployed contract. -func NewIWalletLinkTransactor(address common.Address, transactor bind.ContractTransactor) (*IWalletLinkTransactor, error) { - contract, err := bindIWalletLink(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &IWalletLinkTransactor{contract: contract}, nil -} - -// NewIWalletLinkFilterer creates a new log filterer instance of IWalletLink, bound to a specific deployed contract. -func NewIWalletLinkFilterer(address common.Address, filterer bind.ContractFilterer) (*IWalletLinkFilterer, error) { - contract, err := bindIWalletLink(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &IWalletLinkFilterer{contract: contract}, nil -} - -// bindIWalletLink binds a generic wrapper to an already deployed contract. -func bindIWalletLink(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := IWalletLinkMetaData.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 (_IWalletLink *IWalletLinkRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _IWalletLink.Contract.IWalletLinkCaller.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 (_IWalletLink *IWalletLinkRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _IWalletLink.Contract.IWalletLinkTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_IWalletLink *IWalletLinkRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _IWalletLink.Contract.IWalletLinkTransactor.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 (_IWalletLink *IWalletLinkCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _IWalletLink.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 (_IWalletLink *IWalletLinkTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _IWalletLink.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_IWalletLink *IWalletLinkTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _IWalletLink.Contract.contract.Transact(opts, method, params...) -} - -// CheckIfLinked is a free data retrieval call binding the contract method 0x912b9758. -// -// Solidity: function checkIfLinked(address rootKey, address wallet) view returns(bool) -func (_IWalletLink *IWalletLinkCaller) CheckIfLinked(opts *bind.CallOpts, rootKey common.Address, wallet common.Address) (bool, error) { - var out []interface{} - err := _IWalletLink.contract.Call(opts, &out, "checkIfLinked", rootKey, wallet) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// CheckIfLinked is a free data retrieval call binding the contract method 0x912b9758. -// -// Solidity: function checkIfLinked(address rootKey, address wallet) view returns(bool) -func (_IWalletLink *IWalletLinkSession) CheckIfLinked(rootKey common.Address, wallet common.Address) (bool, error) { - return _IWalletLink.Contract.CheckIfLinked(&_IWalletLink.CallOpts, rootKey, wallet) -} - -// CheckIfLinked is a free data retrieval call binding the contract method 0x912b9758. -// -// Solidity: function checkIfLinked(address rootKey, address wallet) view returns(bool) -func (_IWalletLink *IWalletLinkCallerSession) CheckIfLinked(rootKey common.Address, wallet common.Address) (bool, error) { - return _IWalletLink.Contract.CheckIfLinked(&_IWalletLink.CallOpts, rootKey, wallet) -} - -// GetLatestNonceForRootKey is a free data retrieval call binding the contract method 0x20a00ac8. -// -// Solidity: function getLatestNonceForRootKey(address rootKey) view returns(uint256) -func (_IWalletLink *IWalletLinkCaller) GetLatestNonceForRootKey(opts *bind.CallOpts, rootKey common.Address) (*big.Int, error) { - var out []interface{} - err := _IWalletLink.contract.Call(opts, &out, "getLatestNonceForRootKey", rootKey) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// GetLatestNonceForRootKey is a free data retrieval call binding the contract method 0x20a00ac8. -// -// Solidity: function getLatestNonceForRootKey(address rootKey) view returns(uint256) -func (_IWalletLink *IWalletLinkSession) GetLatestNonceForRootKey(rootKey common.Address) (*big.Int, error) { - return _IWalletLink.Contract.GetLatestNonceForRootKey(&_IWalletLink.CallOpts, rootKey) -} - -// GetLatestNonceForRootKey is a free data retrieval call binding the contract method 0x20a00ac8. -// -// Solidity: function getLatestNonceForRootKey(address rootKey) view returns(uint256) -func (_IWalletLink *IWalletLinkCallerSession) GetLatestNonceForRootKey(rootKey common.Address) (*big.Int, error) { - return _IWalletLink.Contract.GetLatestNonceForRootKey(&_IWalletLink.CallOpts, rootKey) -} - -// GetRootKeyForWallet is a free data retrieval call binding the contract method 0xf8210398. -// -// Solidity: function getRootKeyForWallet(address wallet) view returns(address rootKey) -func (_IWalletLink *IWalletLinkCaller) GetRootKeyForWallet(opts *bind.CallOpts, wallet common.Address) (common.Address, error) { - var out []interface{} - err := _IWalletLink.contract.Call(opts, &out, "getRootKeyForWallet", wallet) - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// GetRootKeyForWallet is a free data retrieval call binding the contract method 0xf8210398. -// -// Solidity: function getRootKeyForWallet(address wallet) view returns(address rootKey) -func (_IWalletLink *IWalletLinkSession) GetRootKeyForWallet(wallet common.Address) (common.Address, error) { - return _IWalletLink.Contract.GetRootKeyForWallet(&_IWalletLink.CallOpts, wallet) -} - -// GetRootKeyForWallet is a free data retrieval call binding the contract method 0xf8210398. -// -// Solidity: function getRootKeyForWallet(address wallet) view returns(address rootKey) -func (_IWalletLink *IWalletLinkCallerSession) GetRootKeyForWallet(wallet common.Address) (common.Address, error) { - return _IWalletLink.Contract.GetRootKeyForWallet(&_IWalletLink.CallOpts, wallet) -} - -// GetWalletsByRootKey is a free data retrieval call binding the contract method 0x02345b98. -// -// Solidity: function getWalletsByRootKey(address rootKey) view returns(address[] wallets) -func (_IWalletLink *IWalletLinkCaller) GetWalletsByRootKey(opts *bind.CallOpts, rootKey common.Address) ([]common.Address, error) { - var out []interface{} - err := _IWalletLink.contract.Call(opts, &out, "getWalletsByRootKey", rootKey) - - if err != nil { - return *new([]common.Address), err - } - - out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) - - return out0, err - -} - -// GetWalletsByRootKey is a free data retrieval call binding the contract method 0x02345b98. -// -// Solidity: function getWalletsByRootKey(address rootKey) view returns(address[] wallets) -func (_IWalletLink *IWalletLinkSession) GetWalletsByRootKey(rootKey common.Address) ([]common.Address, error) { - return _IWalletLink.Contract.GetWalletsByRootKey(&_IWalletLink.CallOpts, rootKey) -} - -// GetWalletsByRootKey is a free data retrieval call binding the contract method 0x02345b98. -// -// Solidity: function getWalletsByRootKey(address rootKey) view returns(address[] wallets) -func (_IWalletLink *IWalletLinkCallerSession) GetWalletsByRootKey(rootKey common.Address) ([]common.Address, error) { - return _IWalletLink.Contract.GetWalletsByRootKey(&_IWalletLink.CallOpts, rootKey) -} - -// LinkCallerToRootKey is a paid mutator transaction binding the contract method 0xe65dfe9d. -// -// Solidity: function linkCallerToRootKey((address,bytes) rootWallet, uint256 nonce) returns() -func (_IWalletLink *IWalletLinkTransactor) LinkCallerToRootKey(opts *bind.TransactOpts, rootWallet IWalletLinkBaseLinkedWallet, nonce *big.Int) (*types.Transaction, error) { - return _IWalletLink.contract.Transact(opts, "linkCallerToRootKey", rootWallet, nonce) -} - -// LinkCallerToRootKey is a paid mutator transaction binding the contract method 0xe65dfe9d. -// -// Solidity: function linkCallerToRootKey((address,bytes) rootWallet, uint256 nonce) returns() -func (_IWalletLink *IWalletLinkSession) LinkCallerToRootKey(rootWallet IWalletLinkBaseLinkedWallet, nonce *big.Int) (*types.Transaction, error) { - return _IWalletLink.Contract.LinkCallerToRootKey(&_IWalletLink.TransactOpts, rootWallet, nonce) -} - -// LinkCallerToRootKey is a paid mutator transaction binding the contract method 0xe65dfe9d. -// -// Solidity: function linkCallerToRootKey((address,bytes) rootWallet, uint256 nonce) returns() -func (_IWalletLink *IWalletLinkTransactorSession) LinkCallerToRootKey(rootWallet IWalletLinkBaseLinkedWallet, nonce *big.Int) (*types.Transaction, error) { - return _IWalletLink.Contract.LinkCallerToRootKey(&_IWalletLink.TransactOpts, rootWallet, nonce) -} - -// LinkWalletToRootKey is a paid mutator transaction binding the contract method 0x1a31fc8d. -// -// Solidity: function linkWalletToRootKey((address,bytes) wallet, (address,bytes) rootWallet, uint256 nonce) returns() -func (_IWalletLink *IWalletLinkTransactor) LinkWalletToRootKey(opts *bind.TransactOpts, wallet IWalletLinkBaseLinkedWallet, rootWallet IWalletLinkBaseLinkedWallet, nonce *big.Int) (*types.Transaction, error) { - return _IWalletLink.contract.Transact(opts, "linkWalletToRootKey", wallet, rootWallet, nonce) -} - -// LinkWalletToRootKey is a paid mutator transaction binding the contract method 0x1a31fc8d. -// -// Solidity: function linkWalletToRootKey((address,bytes) wallet, (address,bytes) rootWallet, uint256 nonce) returns() -func (_IWalletLink *IWalletLinkSession) LinkWalletToRootKey(wallet IWalletLinkBaseLinkedWallet, rootWallet IWalletLinkBaseLinkedWallet, nonce *big.Int) (*types.Transaction, error) { - return _IWalletLink.Contract.LinkWalletToRootKey(&_IWalletLink.TransactOpts, wallet, rootWallet, nonce) -} - -// LinkWalletToRootKey is a paid mutator transaction binding the contract method 0x1a31fc8d. -// -// Solidity: function linkWalletToRootKey((address,bytes) wallet, (address,bytes) rootWallet, uint256 nonce) returns() -func (_IWalletLink *IWalletLinkTransactorSession) LinkWalletToRootKey(wallet IWalletLinkBaseLinkedWallet, rootWallet IWalletLinkBaseLinkedWallet, nonce *big.Int) (*types.Transaction, error) { - return _IWalletLink.Contract.LinkWalletToRootKey(&_IWalletLink.TransactOpts, wallet, rootWallet, nonce) -} - -// RemoveLink is a paid mutator transaction binding the contract method 0xd80bd3b9. -// -// Solidity: function removeLink(address wallet, (address,bytes) rootWallet, uint256 nonce) returns() -func (_IWalletLink *IWalletLinkTransactor) RemoveLink(opts *bind.TransactOpts, wallet common.Address, rootWallet IWalletLinkBaseLinkedWallet, nonce *big.Int) (*types.Transaction, error) { - return _IWalletLink.contract.Transact(opts, "removeLink", wallet, rootWallet, nonce) -} - -// RemoveLink is a paid mutator transaction binding the contract method 0xd80bd3b9. -// -// Solidity: function removeLink(address wallet, (address,bytes) rootWallet, uint256 nonce) returns() -func (_IWalletLink *IWalletLinkSession) RemoveLink(wallet common.Address, rootWallet IWalletLinkBaseLinkedWallet, nonce *big.Int) (*types.Transaction, error) { - return _IWalletLink.Contract.RemoveLink(&_IWalletLink.TransactOpts, wallet, rootWallet, nonce) -} - -// RemoveLink is a paid mutator transaction binding the contract method 0xd80bd3b9. -// -// Solidity: function removeLink(address wallet, (address,bytes) rootWallet, uint256 nonce) returns() -func (_IWalletLink *IWalletLinkTransactorSession) RemoveLink(wallet common.Address, rootWallet IWalletLinkBaseLinkedWallet, nonce *big.Int) (*types.Transaction, error) { - return _IWalletLink.Contract.RemoveLink(&_IWalletLink.TransactOpts, wallet, rootWallet, nonce) -} - -// IWalletLinkLinkWalletToRootKeyIterator is returned from FilterLinkWalletToRootKey and is used to iterate over the raw logs and unpacked data for LinkWalletToRootKey events raised by the IWalletLink contract. -type IWalletLinkLinkWalletToRootKeyIterator struct { - Event *IWalletLinkLinkWalletToRootKey // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *IWalletLinkLinkWalletToRootKeyIterator) 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(IWalletLinkLinkWalletToRootKey) - 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(IWalletLinkLinkWalletToRootKey) - 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 *IWalletLinkLinkWalletToRootKeyIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *IWalletLinkLinkWalletToRootKeyIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// IWalletLinkLinkWalletToRootKey represents a LinkWalletToRootKey event raised by the IWalletLink contract. -type IWalletLinkLinkWalletToRootKey struct { - Wallet common.Address - RootKey common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterLinkWalletToRootKey is a free log retrieval operation binding the contract event 0x64126824352170c4025060d1f6e215159635e4b08e649830695f26ef6d2b5721. -// -// Solidity: event LinkWalletToRootKey(address indexed wallet, address indexed rootKey) -func (_IWalletLink *IWalletLinkFilterer) FilterLinkWalletToRootKey(opts *bind.FilterOpts, wallet []common.Address, rootKey []common.Address) (*IWalletLinkLinkWalletToRootKeyIterator, error) { - - var walletRule []interface{} - for _, walletItem := range wallet { - walletRule = append(walletRule, walletItem) - } - var rootKeyRule []interface{} - for _, rootKeyItem := range rootKey { - rootKeyRule = append(rootKeyRule, rootKeyItem) - } - - logs, sub, err := _IWalletLink.contract.FilterLogs(opts, "LinkWalletToRootKey", walletRule, rootKeyRule) - if err != nil { - return nil, err - } - return &IWalletLinkLinkWalletToRootKeyIterator{contract: _IWalletLink.contract, event: "LinkWalletToRootKey", logs: logs, sub: sub}, nil -} - -// WatchLinkWalletToRootKey is a free log subscription operation binding the contract event 0x64126824352170c4025060d1f6e215159635e4b08e649830695f26ef6d2b5721. -// -// Solidity: event LinkWalletToRootKey(address indexed wallet, address indexed rootKey) -func (_IWalletLink *IWalletLinkFilterer) WatchLinkWalletToRootKey(opts *bind.WatchOpts, sink chan<- *IWalletLinkLinkWalletToRootKey, wallet []common.Address, rootKey []common.Address) (event.Subscription, error) { - - var walletRule []interface{} - for _, walletItem := range wallet { - walletRule = append(walletRule, walletItem) - } - var rootKeyRule []interface{} - for _, rootKeyItem := range rootKey { - rootKeyRule = append(rootKeyRule, rootKeyItem) - } - - logs, sub, err := _IWalletLink.contract.WatchLogs(opts, "LinkWalletToRootKey", walletRule, rootKeyRule) - 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(IWalletLinkLinkWalletToRootKey) - if err := _IWalletLink.contract.UnpackLog(event, "LinkWalletToRootKey", 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 -} - -// ParseLinkWalletToRootKey is a log parse operation binding the contract event 0x64126824352170c4025060d1f6e215159635e4b08e649830695f26ef6d2b5721. -// -// Solidity: event LinkWalletToRootKey(address indexed wallet, address indexed rootKey) -func (_IWalletLink *IWalletLinkFilterer) ParseLinkWalletToRootKey(log types.Log) (*IWalletLinkLinkWalletToRootKey, error) { - event := new(IWalletLinkLinkWalletToRootKey) - if err := _IWalletLink.contract.UnpackLog(event, "LinkWalletToRootKey", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// IWalletLinkRemoveLinkIterator is returned from FilterRemoveLink and is used to iterate over the raw logs and unpacked data for RemoveLink events raised by the IWalletLink contract. -type IWalletLinkRemoveLinkIterator struct { - Event *IWalletLinkRemoveLink // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *IWalletLinkRemoveLinkIterator) 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(IWalletLinkRemoveLink) - 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(IWalletLinkRemoveLink) - 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 *IWalletLinkRemoveLinkIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *IWalletLinkRemoveLinkIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// IWalletLinkRemoveLink represents a RemoveLink event raised by the IWalletLink contract. -type IWalletLinkRemoveLink struct { - Wallet common.Address - SecondWallet common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterRemoveLink is a free log retrieval operation binding the contract event 0x9a9d98629b39adf596077fc95a0712ba55c38f40a354e99d366a10f9c3e27da2. -// -// Solidity: event RemoveLink(address indexed wallet, address indexed secondWallet) -func (_IWalletLink *IWalletLinkFilterer) FilterRemoveLink(opts *bind.FilterOpts, wallet []common.Address, secondWallet []common.Address) (*IWalletLinkRemoveLinkIterator, error) { - - var walletRule []interface{} - for _, walletItem := range wallet { - walletRule = append(walletRule, walletItem) - } - var secondWalletRule []interface{} - for _, secondWalletItem := range secondWallet { - secondWalletRule = append(secondWalletRule, secondWalletItem) - } - - logs, sub, err := _IWalletLink.contract.FilterLogs(opts, "RemoveLink", walletRule, secondWalletRule) - if err != nil { - return nil, err - } - return &IWalletLinkRemoveLinkIterator{contract: _IWalletLink.contract, event: "RemoveLink", logs: logs, sub: sub}, nil -} - -// WatchRemoveLink is a free log subscription operation binding the contract event 0x9a9d98629b39adf596077fc95a0712ba55c38f40a354e99d366a10f9c3e27da2. -// -// Solidity: event RemoveLink(address indexed wallet, address indexed secondWallet) -func (_IWalletLink *IWalletLinkFilterer) WatchRemoveLink(opts *bind.WatchOpts, sink chan<- *IWalletLinkRemoveLink, wallet []common.Address, secondWallet []common.Address) (event.Subscription, error) { - - var walletRule []interface{} - for _, walletItem := range wallet { - walletRule = append(walletRule, walletItem) - } - var secondWalletRule []interface{} - for _, secondWalletItem := range secondWallet { - secondWalletRule = append(secondWalletRule, secondWalletItem) - } - - logs, sub, err := _IWalletLink.contract.WatchLogs(opts, "RemoveLink", walletRule, secondWalletRule) - 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(IWalletLinkRemoveLink) - if err := _IWalletLink.contract.UnpackLog(event, "RemoveLink", 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 -} - -// ParseRemoveLink is a log parse operation binding the contract event 0x9a9d98629b39adf596077fc95a0712ba55c38f40a354e99d366a10f9c3e27da2. -// -// Solidity: event RemoveLink(address indexed wallet, address indexed secondWallet) -func (_IWalletLink *IWalletLinkFilterer) ParseRemoveLink(log types.Log) (*IWalletLinkRemoveLink, error) { - event := new(IWalletLinkRemoveLink) - if err := _IWalletLink.contract.UnpackLog(event, "RemoveLink", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} diff --git a/core/xchain/contracts/dev/mock_entitlement_gated.go b/core/xchain/contracts/dev/mock_entitlement_gated.go deleted file mode 100644 index 57699f623..000000000 --- a/core/xchain/contracts/dev/mock_entitlement_gated.go +++ /dev/null @@ -1,895 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package dev - -import ( - "errors" - "math/big" - "strings" - - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" -) - -// Reference imports to suppress errors if they are not otherwise used. -var ( - _ = errors.New - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription - _ = abi.ConvertType -) - -// MockEntitlementGatedMetaData contains all meta data concerning the MockEntitlementGated contract. -var MockEntitlementGatedMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"checker\",\"type\":\"address\",\"internalType\":\"contractIEntitlementChecker\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"__EntitlementGated_init\",\"inputs\":[{\"name\":\"entitlementChecker\",\"type\":\"address\",\"internalType\":\"contractIEntitlementChecker\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"getRuleData\",\"inputs\":[{\"name\":\"roleId\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIRuleEntitlement.RuleData\",\"components\":[{\"name\":\"operations\",\"type\":\"tuple[]\",\"internalType\":\"structIRuleEntitlement.Operation[]\",\"components\":[{\"name\":\"opType\",\"type\":\"uint8\",\"internalType\":\"enumIRuleEntitlement.CombinedOperationType\"},{\"name\":\"index\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]},{\"name\":\"checkOperations\",\"type\":\"tuple[]\",\"internalType\":\"structIRuleEntitlement.CheckOperation[]\",\"components\":[{\"name\":\"opType\",\"type\":\"uint8\",\"internalType\":\"enumIRuleEntitlement.CheckOperationType\"},{\"name\":\"chainId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"contractAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"threshold\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"logicalOperations\",\"type\":\"tuple[]\",\"internalType\":\"structIRuleEntitlement.LogicalOperation[]\",\"components\":[{\"name\":\"logOpType\",\"type\":\"uint8\",\"internalType\":\"enumIRuleEntitlement.LogicalOperationType\"},{\"name\":\"leftOperationIndex\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"rightOperationIndex\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getRuleData\",\"inputs\":[{\"name\":\"transactionId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"roleId\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIRuleEntitlement.RuleData\",\"components\":[{\"name\":\"operations\",\"type\":\"tuple[]\",\"internalType\":\"structIRuleEntitlement.Operation[]\",\"components\":[{\"name\":\"opType\",\"type\":\"uint8\",\"internalType\":\"enumIRuleEntitlement.CombinedOperationType\"},{\"name\":\"index\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]},{\"name\":\"checkOperations\",\"type\":\"tuple[]\",\"internalType\":\"structIRuleEntitlement.CheckOperation[]\",\"components\":[{\"name\":\"opType\",\"type\":\"uint8\",\"internalType\":\"enumIRuleEntitlement.CheckOperationType\"},{\"name\":\"chainId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"contractAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"threshold\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"logicalOperations\",\"type\":\"tuple[]\",\"internalType\":\"structIRuleEntitlement.LogicalOperation[]\",\"components\":[{\"name\":\"logOpType\",\"type\":\"uint8\",\"internalType\":\"enumIRuleEntitlement.LogicalOperationType\"},{\"name\":\"leftOperationIndex\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"rightOperationIndex\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"postEntitlementCheckResult\",\"inputs\":[{\"name\":\"transactionId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"roleId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"result\",\"type\":\"uint8\",\"internalType\":\"enumIEntitlementGatedBase.NodeVoteStatus\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"requestEntitlementCheck\",\"inputs\":[{\"name\":\"roleId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"ruleData\",\"type\":\"tuple\",\"internalType\":\"structIRuleEntitlement.RuleData\",\"components\":[{\"name\":\"operations\",\"type\":\"tuple[]\",\"internalType\":\"structIRuleEntitlement.Operation[]\",\"components\":[{\"name\":\"opType\",\"type\":\"uint8\",\"internalType\":\"enumIRuleEntitlement.CombinedOperationType\"},{\"name\":\"index\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]},{\"name\":\"checkOperations\",\"type\":\"tuple[]\",\"internalType\":\"structIRuleEntitlement.CheckOperation[]\",\"components\":[{\"name\":\"opType\",\"type\":\"uint8\",\"internalType\":\"enumIRuleEntitlement.CheckOperationType\"},{\"name\":\"chainId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"contractAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"threshold\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"logicalOperations\",\"type\":\"tuple[]\",\"internalType\":\"structIRuleEntitlement.LogicalOperation[]\",\"components\":[{\"name\":\"logOpType\",\"type\":\"uint8\",\"internalType\":\"enumIRuleEntitlement.LogicalOperationType\"},{\"name\":\"leftOperationIndex\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"rightOperationIndex\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"EntitlementCheckResultPosted\",\"inputs\":[{\"name\":\"transactionId\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"result\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"enumIEntitlementGatedBase.NodeVoteStatus\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"InterfaceAdded\",\"inputs\":[{\"name\":\"interfaceId\",\"type\":\"bytes4\",\"indexed\":true,\"internalType\":\"bytes4\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"InterfaceRemoved\",\"inputs\":[{\"name\":\"interfaceId\",\"type\":\"bytes4\",\"indexed\":true,\"internalType\":\"bytes4\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"EntitlementGated_InvalidAddress\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EntitlementGated_NodeAlreadyVoted\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EntitlementGated_NodeNotFound\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EntitlementGated_TransactionCheckAlreadyCompleted\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EntitlementGated_TransactionCheckAlreadyRegistered\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EntitlementGated_TransactionNotRegistered\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Initializable_InInitializingState\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Initializable_NotInInitializingState\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Introspection_AlreadySupported\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Introspection_NotSupported\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ReentrancyGuard__ReentrantCall\",\"inputs\":[]}]", - Bin: "0x60806040523480156200001157600080fd5b5060405162001b9a38038062001b9a833981016040819052620000349162000127565b6200003e6200007f565b7f9075c515a635ba70c9696f31149324218d75cf00afe836c482e6473f38b19e0080546001600160a01b0319166001600160a01b0383161790555062000159565b7f59b501c3653afc186af7d48dda36cf6732bd21629a6295693664240a6ef520008054640100000000900460ff1615620000cc576040516366008a2d60e01b815260040160405180910390fd5b805463ffffffff90811610156200012457805463ffffffff191663ffffffff90811782556040519081527fe9c9b456cb2994b80aeef036cf59d26e9617df80f816a6ee5a5b4166e07e2f5c9060200160405180910390a15b50565b6000602082840312156200013a57600080fd5b81516001600160a01b03811681146200015257600080fd5b9392505050565b611a3180620001696000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c8063069a3ee91461005c5780634739e8051461008557806357e700271461009a5780637adc9cbe146100bb57806392c399ff146100ce575b600080fd5b61006f61006a366004610e1e565b6100e1565b60405161007c9190610f28565b60405180910390f35b610098610093366004610fd8565b610314565b005b6100ad6100a8366004611011565b6103b8565b60405190815260200161007c565b6100986100c9366004611074565b610426565b61006f6100dc366004611091565b61047c565b61010560405180606001604052806060815260200160608152602001606081525090565b6000828152602081815260408083208151815460809481028201850190935260608101838152909491938593919285929185015b828210156101a257600084815260209020604080518082019091529083018054829060ff16600281111561016f5761016f610e37565b600281111561018057610180610e37565b81529054610100900460ff166020918201529082526001929092019101610139565b50505050815260200160018201805480602002602001604051908101604052809291908181526020016000905b8282101561025a576000848152602090206040805160808101909152600484029091018054829060ff16600581111561020a5761020a610e37565b600581111561021b5761021b610e37565b815260018281015460208084019190915260028401546001600160a01b03166040840152600390930154606090920191909152918352920191016101cf565b50505050815260200160028201805480602002602001604051908101604052809291908181526020016000905b828210156103065760008481526020902060408051606081019091529083018054829060ff1660028111156102be576102be610e37565b60028111156102cf576102cf610e37565b8152905460ff6101008204811660208085019190915262010000909204166040909201919091529082526001929092019101610287565b505050915250909392505050565b60027f54f22f54f370bd020e00ee80e1a5099a71652e2ccbcf6a75281e4c70a3e11a00540361035657604051635db5c7cd60e11b815260040160405180910390fd5b61037f60027f54f22f54f370bd020e00ee80e1a5099a71652e2ccbcf6a75281e4c70a3e11a0055565b61038a8383836104aa565b6103b360017f54f22f54f370bd020e00ee80e1a5099a71652e2ccbcf6a75281e4c70a3e11a0055565b505050565b600082815260208190526040812082906103d2828261140a565b50506040516bffffffffffffffffffffffff193260601b16602082015243603482015260009060540160405160208183030381529060405280519060200120905061041f81306000610743565b9392505050565b7f59b501c3653afc186af7d48dda36cf6732bd21629a6295693664240a6ef5200054640100000000900460ff1661047057604051630ef4733760e31b815260040160405180910390fd5b610479816109f2565b50565b6104a060405180606001604052806060815260200160608152602001606081525090565b61041f8383610a2d565b6000838152600080516020611a118339815191526020526040902080546000805160206119f1833981519152919061010090046001600160a01b031615806104f45750805460ff16155b1561051257604051637ad5a43960e11b815260040160405180910390fd5b600084815260028201602052604090205460ff161561054457604051637912b73960e01b815260040160405180910390fd5b600084815260018201602052604081205481908190815b8181101561068257600089815260018701602052604081208054839081106105855761058561150e565b60009182526020909120018054909150336001600160a01b03909116036106115760008154600160a01b900460ff1660028111156105c5576105c5610e37565b146105e3576040516347592a4d60e01b815260040160405180910390fd5b80548990829060ff60a01b1916600160a01b83600281111561060757610607610e37565b0217905550600195505b60018154600160a01b900460ff16600281111561063057610630610e37565b03610647578461063f81611524565b955050610679565b60028154600160a01b900460ff16600281111561066657610666610e37565b03610679578361067581611524565b9450505b5060010161055b565b50836106a157604051638223a7e960e01b815260040160405180910390fd5b6106ac60028261153d565b8311806106c257506106bf60028261153d565b82115b156107385760008881526002860160205260408120805460ff191660011790558284116106f05760026106f3565b60015b9050897fb9d6ce397e562841871d119aaf77469c60a3b5bf8b99a5d9851656015015c63382604051610725919061155f565b60405180910390a26107368a610b27565b505b505050505050505050565b6000838152600080516020611a118339815191526020526040902080546000805160206119f1833981519152919060ff1615156001036107d55760005b60048201548110156107d357838260040182815481106107a2576107a261150e565b9060005260206000200154036107cb576040516301ab53df60e31b815260040160405180910390fd5b600101610780565b505b81546001600160a01b03166107ec576107ec610bfb565b8154604051634f84544560e01b8152600560048201526000916001600160a01b031690634f84544590602401600060405180830381865afa158015610835573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261085d9190810190611636565b825490915060ff1661089e5781546003830180546001600160a01b0319166001600160a01b0388161790556001600160a81b03191661010033021760011782555b600482018054600181018255600091825260208220018590555b815181101561098e5782600101600086815260200190815260200160002060405180604001604052808484815181106108f3576108f361150e565b60200260200101516001600160a01b031681526020016000600281111561091c5761091c610e37565b9052815460018101835560009283526020928390208251910180546001600160a01b031981166001600160a01b03909316928317825593830151929390929183916001600160a81b03191617600160a01b83600281111561097f5761097f610e37565b021790555050506001016108b8565b50825460405163541da4e560e01b81526001600160a01b039091169063541da4e5906109c49033908a90899087906004016116ca565b600060405180830381600087803b1580156109de57600080fd5b505af1158015610736573d6000803e3d6000fd5b610a02636afd38fd60e11b610ccc565b6000805160206119f183398151915280546001600160a01b0319166001600160a01b03831617905550565b610a5160405180606001604052806060815260200160608152602001606081525090565b6000838152600080516020611a118339815191526020526040812080546000805160206119f18339815191529260ff90911615159003610aa457604051637ad5a43960e11b815260040160405180910390fd5b600381015460405163069a3ee960e01b8152600481018690526001600160a01b0390911690600090829063069a3ee990602401600060405180830381865afa158015610af4573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610b1c9190810190611893565b979650505050505050565b6000818152600080516020611a11833981519152602052604081206000805160206119f1833981519152915b6004820154811015610ba757816001016000836004018381548110610b7a57610b7a61150e565b906000526020600020015481526020019081526020016000206000610b9f9190610daa565b600101610b53565b50610bb6600482016000610dc8565b6000838152600183016020526040812080546001600160a81b03191681556003810180546001600160a01b031916905590610bf46004830182610dc8565b5050505050565b60006000805160206119f1833981519152905060007fc21004fcc619240a31f006438274d15cd813308303284436eef6055f0fdcb60060060154604051628956cd60e71b81526c29b830b1b2a7b832b930ba37b960991b60048201526001600160a01b03909116906344ab668090602401602060405180830381865afa158015610c89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cad91906119d3565b82546001600160a01b0319166001600160a01b03919091161790915550565b6001600160e01b0319811660009081527f81088bbc801e045ea3e7620779ab349988f58afbdfba10dff983df3f33522b00602052604090205460ff161515600114610d59576001600160e01b0319811660009081527f81088bbc801e045ea3e7620779ab349988f58afbdfba10dff983df3f33522b0060205260409020805460ff19166001179055610d72565b604051637967f77d60e11b815260040160405180910390fd5b6040516001600160e01b03198216907f78f84e5b1c5c05be2b5ad3800781dd404d6d6c6302bc755c0fe20f58a33a7f2290600090a250565b50805460008255906000526020600020908101906104799190610de6565b50805460008255906000526020600020908101906104799190610e09565b5b80821115610e055780546001600160a81b0319168155600101610de7565b5090565b5b80821115610e055760008155600101610e0a565b600060208284031215610e3057600080fd5b5035919050565b634e487b7160e01b600052602160045260246000fd5b6003811061047957610479610e37565b60008151808452602080850194506020840160005b83811015610ec7578151805160068110610e8e57610e8e610e37565b885280840151848901526040808201516001600160a01b0316908901526060908101519088015260809096019590820190600101610e72565b509495945050505050565b60008151808452602080850194506020840160005b83811015610ec75781518051610efc81610e4d565b88528084015160ff908116858a0152604091820151169088015260609096019590820190600101610ee7565b6020808252825160608383015280516080840181905260009291820190839060a08601905b80831015610f845783518051610f6281610e4d565b835285015160ff16858301529284019260019290920191604090910190610f4d565b50838701519350601f19925082868203016040870152610fa48185610e5d565b93505050604085015181858403016060860152610fc18382610ed2565b9695505050505050565b6003811061047957600080fd5b600080600060608486031215610fed57600080fd5b8335925060208401359150604084013561100681610fcb565b809150509250925092565b6000806040838503121561102457600080fd5b82359150602083013567ffffffffffffffff81111561104257600080fd5b83016060818603121561105457600080fd5b809150509250929050565b6001600160a01b038116811461047957600080fd5b60006020828403121561108657600080fd5b813561041f8161105f565b600080604083850312156110a457600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60ff8116811461047957600080fd5b81356110f981610fcb565b61110281610e4d565b60ff1982541660ff82168117835550506020820135611120816110df565b815461ff001916600882901b61ff0016178255505050565b6000808335601e1984360301811261114f57600080fd5b83018035915067ffffffffffffffff82111561116a57600080fd5b6020019150600781901b360382131561118257600080fd5b9250929050565b6006811061047957600080fd5b81356111a181611189565b600681106111b1576111b1610e37565b60ff1982541660ff8216811783555050602082013560018201556002810160408301356111dd8161105f565b81546001600160a01b0319166001600160a01b03919091161790556060919091013560039190910155565b600160401b83111561121c5761121c6110b3565b80548382558084101561129a5760026001600160fe1b038281168314611244576112446110c9565b8086168614611255576112556110c9565b506000838152602081208360021b81018760021b820191505b8082101561129557828255826001830155828483015582600383015560048201915061126e565b505050505b5060008181526020812083915b858110156112cf576112b98383611196565b60809290920191600491909101906001016112a7565b505050505050565b6000808335601e198436030181126112ee57600080fd5b83018035915067ffffffffffffffff82111561130957600080fd5b602001915060608102360382131561118257600080fd5b813561132b81610fcb565b61133481610e4d565b60ff1982541660ff82168117835550506020820135611352816110df565b815461ff001916600882901b61ff0016178255506040820135611374816110df565b815462ff0000191660109190911b62ff00001617905550565b600160401b8311156113a1576113a16110b3565b8054838255808410156113d8576000828152602081208581019083015b808210156113d4578282556001820191506113be565b5050505b5060008181526020812083915b858110156112cf576113f78383611320565b60609290920191600191820191016113e5565b8135601e1983360301811261141e57600080fd5b8201803567ffffffffffffffff81111561143757600080fd5b6020820191508060061b360382131561144f57600080fd5b600160401b811115611463576114636110b3565b82548184558082101561149a576000848152602081208381019083015b8082101561149657828255600182019150611480565b5050505b5060008381526020902060005b828110156114cc576114b984836110ee565b60409390930192600191820191016114a7565b505050506114dd6020830183611138565b6114eb818360018601611208565b50506114fa60408301836112d7565b61150881836002860161138d565b50505050565b634e487b7160e01b600052603260045260246000fd5b600060018201611536576115366110c9565b5060010190565b60008261155a57634e487b7160e01b600052601260045260246000fd5b500490565b6020810161156c83610e4d565b91905290565b6040516080810167ffffffffffffffff81118282101715611595576115956110b3565b60405290565b6040516060810167ffffffffffffffff81118282101715611595576115956110b3565b6040805190810167ffffffffffffffff81118282101715611595576115956110b3565b604051601f8201601f1916810167ffffffffffffffff8111828210171561160a5761160a6110b3565b604052919050565b600067ffffffffffffffff82111561162c5761162c6110b3565b5060051b60200190565b6000602080838503121561164957600080fd5b825167ffffffffffffffff81111561166057600080fd5b8301601f8101851361167157600080fd5b805161168461167f82611612565b6115e1565b81815260059190911b820183019083810190878311156116a357600080fd5b928401925b82841015610b1c5783516116bb8161105f565b825292840192908401906116a8565b60006080820160018060a01b03808816845260208760208601528660408601526080606086015282865180855260a08701915060208801945060005b81811015611724578551851683529483019491830191600101611706565b50909a9950505050505050505050565b600082601f83011261174557600080fd5b8151602061175561167f83611612565b82815260079290921b8401810191818101908684111561177457600080fd5b8286015b848110156117d957608081890312156117915760008081fd5b611799611572565b81516117a481611189565b815281850151858201526040808301516117bd8161105f565b9082015260608281015190820152835291830191608001611778565b509695505050505050565b600082601f8301126117f557600080fd5b8151602061180561167f83611612565b8281526060928302850182019282820191908785111561182457600080fd5b8387015b858110156118865781818a0312156118405760008081fd5b61184861159b565b815161185381610fcb565b815281860151611862816110df565b81870152604082810151611875816110df565b908201528452928401928101611828565b5090979650505050505050565b600060208083850312156118a657600080fd5b825167ffffffffffffffff808211156118be57600080fd5b90840190606082870312156118d257600080fd5b6118da61159b565b8251828111156118e957600080fd5b8301601f810188136118fa57600080fd5b805161190861167f82611612565b81815260069190911b8201860190868101908a83111561192757600080fd5b928701925b8284101561197d576040848c0312156119455760008081fd5b61194d6115be565b845161195881610fcb565b815284890151611967816110df565b818a01528252604093909301929087019061192c565b8452505050828401518281111561199357600080fd5b61199f88828601611734565b858301525060408301519350818411156119b857600080fd5b6119c4878585016117e4565b60408201529695505050505050565b6000602082840312156119e557600080fd5b815161041f8161105f56fe9075c515a635ba70c9696f31149324218d75cf00afe836c482e6473f38b19e009075c515a635ba70c9696f31149324218d75cf00afe836c482e6473f38b19e01", -} - -// MockEntitlementGatedABI is the input ABI used to generate the binding from. -// Deprecated: Use MockEntitlementGatedMetaData.ABI instead. -var MockEntitlementGatedABI = MockEntitlementGatedMetaData.ABI - -// MockEntitlementGatedBin is the compiled bytecode used for deploying new contracts. -// Deprecated: Use MockEntitlementGatedMetaData.Bin instead. -var MockEntitlementGatedBin = MockEntitlementGatedMetaData.Bin - -// DeployMockEntitlementGated deploys a new Ethereum contract, binding an instance of MockEntitlementGated to it. -func DeployMockEntitlementGated(auth *bind.TransactOpts, backend bind.ContractBackend, checker common.Address) (common.Address, *types.Transaction, *MockEntitlementGated, error) { - parsed, err := MockEntitlementGatedMetaData.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(MockEntitlementGatedBin), backend, checker) - if err != nil { - return common.Address{}, nil, nil, err - } - return address, tx, &MockEntitlementGated{MockEntitlementGatedCaller: MockEntitlementGatedCaller{contract: contract}, MockEntitlementGatedTransactor: MockEntitlementGatedTransactor{contract: contract}, MockEntitlementGatedFilterer: MockEntitlementGatedFilterer{contract: contract}}, nil -} - -// MockEntitlementGated is an auto generated Go binding around an Ethereum contract. -type MockEntitlementGated struct { - MockEntitlementGatedCaller // Read-only binding to the contract - MockEntitlementGatedTransactor // Write-only binding to the contract - MockEntitlementGatedFilterer // Log filterer for contract events -} - -// MockEntitlementGatedCaller is an auto generated read-only Go binding around an Ethereum contract. -type MockEntitlementGatedCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// MockEntitlementGatedTransactor is an auto generated write-only Go binding around an Ethereum contract. -type MockEntitlementGatedTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// MockEntitlementGatedFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type MockEntitlementGatedFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// MockEntitlementGatedSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type MockEntitlementGatedSession struct { - Contract *MockEntitlementGated // 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 -} - -// MockEntitlementGatedCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type MockEntitlementGatedCallerSession struct { - Contract *MockEntitlementGatedCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// MockEntitlementGatedTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type MockEntitlementGatedTransactorSession struct { - Contract *MockEntitlementGatedTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// MockEntitlementGatedRaw is an auto generated low-level Go binding around an Ethereum contract. -type MockEntitlementGatedRaw struct { - Contract *MockEntitlementGated // Generic contract binding to access the raw methods on -} - -// MockEntitlementGatedCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type MockEntitlementGatedCallerRaw struct { - Contract *MockEntitlementGatedCaller // Generic read-only contract binding to access the raw methods on -} - -// MockEntitlementGatedTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type MockEntitlementGatedTransactorRaw struct { - Contract *MockEntitlementGatedTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewMockEntitlementGated creates a new instance of MockEntitlementGated, bound to a specific deployed contract. -func NewMockEntitlementGated(address common.Address, backend bind.ContractBackend) (*MockEntitlementGated, error) { - contract, err := bindMockEntitlementGated(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &MockEntitlementGated{MockEntitlementGatedCaller: MockEntitlementGatedCaller{contract: contract}, MockEntitlementGatedTransactor: MockEntitlementGatedTransactor{contract: contract}, MockEntitlementGatedFilterer: MockEntitlementGatedFilterer{contract: contract}}, nil -} - -// NewMockEntitlementGatedCaller creates a new read-only instance of MockEntitlementGated, bound to a specific deployed contract. -func NewMockEntitlementGatedCaller(address common.Address, caller bind.ContractCaller) (*MockEntitlementGatedCaller, error) { - contract, err := bindMockEntitlementGated(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &MockEntitlementGatedCaller{contract: contract}, nil -} - -// NewMockEntitlementGatedTransactor creates a new write-only instance of MockEntitlementGated, bound to a specific deployed contract. -func NewMockEntitlementGatedTransactor(address common.Address, transactor bind.ContractTransactor) (*MockEntitlementGatedTransactor, error) { - contract, err := bindMockEntitlementGated(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &MockEntitlementGatedTransactor{contract: contract}, nil -} - -// NewMockEntitlementGatedFilterer creates a new log filterer instance of MockEntitlementGated, bound to a specific deployed contract. -func NewMockEntitlementGatedFilterer(address common.Address, filterer bind.ContractFilterer) (*MockEntitlementGatedFilterer, error) { - contract, err := bindMockEntitlementGated(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &MockEntitlementGatedFilterer{contract: contract}, nil -} - -// bindMockEntitlementGated binds a generic wrapper to an already deployed contract. -func bindMockEntitlementGated(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := MockEntitlementGatedMetaData.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 (_MockEntitlementGated *MockEntitlementGatedRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _MockEntitlementGated.Contract.MockEntitlementGatedCaller.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 (_MockEntitlementGated *MockEntitlementGatedRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _MockEntitlementGated.Contract.MockEntitlementGatedTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_MockEntitlementGated *MockEntitlementGatedRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _MockEntitlementGated.Contract.MockEntitlementGatedTransactor.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 (_MockEntitlementGated *MockEntitlementGatedCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _MockEntitlementGated.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 (_MockEntitlementGated *MockEntitlementGatedTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _MockEntitlementGated.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_MockEntitlementGated *MockEntitlementGatedTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _MockEntitlementGated.Contract.contract.Transact(opts, method, params...) -} - -// GetRuleData is a free data retrieval call binding the contract method 0x069a3ee9. -// -// Solidity: function getRuleData(uint256 roleId) view returns(((uint8,uint8)[],(uint8,uint256,address,uint256)[],(uint8,uint8,uint8)[])) -func (_MockEntitlementGated *MockEntitlementGatedCaller) GetRuleData(opts *bind.CallOpts, roleId *big.Int) (IRuleEntitlementRuleData, error) { - var out []interface{} - err := _MockEntitlementGated.contract.Call(opts, &out, "getRuleData", roleId) - - if err != nil { - return *new(IRuleEntitlementRuleData), err - } - - out0 := *abi.ConvertType(out[0], new(IRuleEntitlementRuleData)).(*IRuleEntitlementRuleData) - - return out0, err - -} - -// GetRuleData is a free data retrieval call binding the contract method 0x069a3ee9. -// -// Solidity: function getRuleData(uint256 roleId) view returns(((uint8,uint8)[],(uint8,uint256,address,uint256)[],(uint8,uint8,uint8)[])) -func (_MockEntitlementGated *MockEntitlementGatedSession) GetRuleData(roleId *big.Int) (IRuleEntitlementRuleData, error) { - return _MockEntitlementGated.Contract.GetRuleData(&_MockEntitlementGated.CallOpts, roleId) -} - -// GetRuleData is a free data retrieval call binding the contract method 0x069a3ee9. -// -// Solidity: function getRuleData(uint256 roleId) view returns(((uint8,uint8)[],(uint8,uint256,address,uint256)[],(uint8,uint8,uint8)[])) -func (_MockEntitlementGated *MockEntitlementGatedCallerSession) GetRuleData(roleId *big.Int) (IRuleEntitlementRuleData, error) { - return _MockEntitlementGated.Contract.GetRuleData(&_MockEntitlementGated.CallOpts, roleId) -} - -// GetRuleData0 is a free data retrieval call binding the contract method 0x92c399ff. -// -// Solidity: function getRuleData(bytes32 transactionId, uint256 roleId) view returns(((uint8,uint8)[],(uint8,uint256,address,uint256)[],(uint8,uint8,uint8)[])) -func (_MockEntitlementGated *MockEntitlementGatedCaller) GetRuleData0(opts *bind.CallOpts, transactionId [32]byte, roleId *big.Int) (IRuleEntitlementRuleData, error) { - var out []interface{} - err := _MockEntitlementGated.contract.Call(opts, &out, "getRuleData0", transactionId, roleId) - - if err != nil { - return *new(IRuleEntitlementRuleData), err - } - - out0 := *abi.ConvertType(out[0], new(IRuleEntitlementRuleData)).(*IRuleEntitlementRuleData) - - return out0, err - -} - -// GetRuleData0 is a free data retrieval call binding the contract method 0x92c399ff. -// -// Solidity: function getRuleData(bytes32 transactionId, uint256 roleId) view returns(((uint8,uint8)[],(uint8,uint256,address,uint256)[],(uint8,uint8,uint8)[])) -func (_MockEntitlementGated *MockEntitlementGatedSession) GetRuleData0(transactionId [32]byte, roleId *big.Int) (IRuleEntitlementRuleData, error) { - return _MockEntitlementGated.Contract.GetRuleData0(&_MockEntitlementGated.CallOpts, transactionId, roleId) -} - -// GetRuleData0 is a free data retrieval call binding the contract method 0x92c399ff. -// -// Solidity: function getRuleData(bytes32 transactionId, uint256 roleId) view returns(((uint8,uint8)[],(uint8,uint256,address,uint256)[],(uint8,uint8,uint8)[])) -func (_MockEntitlementGated *MockEntitlementGatedCallerSession) GetRuleData0(transactionId [32]byte, roleId *big.Int) (IRuleEntitlementRuleData, error) { - return _MockEntitlementGated.Contract.GetRuleData0(&_MockEntitlementGated.CallOpts, transactionId, roleId) -} - -// EntitlementGatedInit is a paid mutator transaction binding the contract method 0x7adc9cbe. -// -// Solidity: function __EntitlementGated_init(address entitlementChecker) returns() -func (_MockEntitlementGated *MockEntitlementGatedTransactor) EntitlementGatedInit(opts *bind.TransactOpts, entitlementChecker common.Address) (*types.Transaction, error) { - return _MockEntitlementGated.contract.Transact(opts, "__EntitlementGated_init", entitlementChecker) -} - -// EntitlementGatedInit is a paid mutator transaction binding the contract method 0x7adc9cbe. -// -// Solidity: function __EntitlementGated_init(address entitlementChecker) returns() -func (_MockEntitlementGated *MockEntitlementGatedSession) EntitlementGatedInit(entitlementChecker common.Address) (*types.Transaction, error) { - return _MockEntitlementGated.Contract.EntitlementGatedInit(&_MockEntitlementGated.TransactOpts, entitlementChecker) -} - -// EntitlementGatedInit is a paid mutator transaction binding the contract method 0x7adc9cbe. -// -// Solidity: function __EntitlementGated_init(address entitlementChecker) returns() -func (_MockEntitlementGated *MockEntitlementGatedTransactorSession) EntitlementGatedInit(entitlementChecker common.Address) (*types.Transaction, error) { - return _MockEntitlementGated.Contract.EntitlementGatedInit(&_MockEntitlementGated.TransactOpts, entitlementChecker) -} - -// PostEntitlementCheckResult is a paid mutator transaction binding the contract method 0x4739e805. -// -// Solidity: function postEntitlementCheckResult(bytes32 transactionId, uint256 roleId, uint8 result) returns() -func (_MockEntitlementGated *MockEntitlementGatedTransactor) PostEntitlementCheckResult(opts *bind.TransactOpts, transactionId [32]byte, roleId *big.Int, result uint8) (*types.Transaction, error) { - return _MockEntitlementGated.contract.Transact(opts, "postEntitlementCheckResult", transactionId, roleId, result) -} - -// PostEntitlementCheckResult is a paid mutator transaction binding the contract method 0x4739e805. -// -// Solidity: function postEntitlementCheckResult(bytes32 transactionId, uint256 roleId, uint8 result) returns() -func (_MockEntitlementGated *MockEntitlementGatedSession) PostEntitlementCheckResult(transactionId [32]byte, roleId *big.Int, result uint8) (*types.Transaction, error) { - return _MockEntitlementGated.Contract.PostEntitlementCheckResult(&_MockEntitlementGated.TransactOpts, transactionId, roleId, result) -} - -// PostEntitlementCheckResult is a paid mutator transaction binding the contract method 0x4739e805. -// -// Solidity: function postEntitlementCheckResult(bytes32 transactionId, uint256 roleId, uint8 result) returns() -func (_MockEntitlementGated *MockEntitlementGatedTransactorSession) PostEntitlementCheckResult(transactionId [32]byte, roleId *big.Int, result uint8) (*types.Transaction, error) { - return _MockEntitlementGated.Contract.PostEntitlementCheckResult(&_MockEntitlementGated.TransactOpts, transactionId, roleId, result) -} - -// RequestEntitlementCheck is a paid mutator transaction binding the contract method 0x57e70027. -// -// Solidity: function requestEntitlementCheck(uint256 roleId, ((uint8,uint8)[],(uint8,uint256,address,uint256)[],(uint8,uint8,uint8)[]) ruleData) returns(bytes32) -func (_MockEntitlementGated *MockEntitlementGatedTransactor) RequestEntitlementCheck(opts *bind.TransactOpts, roleId *big.Int, ruleData IRuleEntitlementRuleData) (*types.Transaction, error) { - return _MockEntitlementGated.contract.Transact(opts, "requestEntitlementCheck", roleId, ruleData) -} - -// RequestEntitlementCheck is a paid mutator transaction binding the contract method 0x57e70027. -// -// Solidity: function requestEntitlementCheck(uint256 roleId, ((uint8,uint8)[],(uint8,uint256,address,uint256)[],(uint8,uint8,uint8)[]) ruleData) returns(bytes32) -func (_MockEntitlementGated *MockEntitlementGatedSession) RequestEntitlementCheck(roleId *big.Int, ruleData IRuleEntitlementRuleData) (*types.Transaction, error) { - return _MockEntitlementGated.Contract.RequestEntitlementCheck(&_MockEntitlementGated.TransactOpts, roleId, ruleData) -} - -// RequestEntitlementCheck is a paid mutator transaction binding the contract method 0x57e70027. -// -// Solidity: function requestEntitlementCheck(uint256 roleId, ((uint8,uint8)[],(uint8,uint256,address,uint256)[],(uint8,uint8,uint8)[]) ruleData) returns(bytes32) -func (_MockEntitlementGated *MockEntitlementGatedTransactorSession) RequestEntitlementCheck(roleId *big.Int, ruleData IRuleEntitlementRuleData) (*types.Transaction, error) { - return _MockEntitlementGated.Contract.RequestEntitlementCheck(&_MockEntitlementGated.TransactOpts, roleId, ruleData) -} - -// MockEntitlementGatedEntitlementCheckResultPostedIterator is returned from FilterEntitlementCheckResultPosted and is used to iterate over the raw logs and unpacked data for EntitlementCheckResultPosted events raised by the MockEntitlementGated contract. -type MockEntitlementGatedEntitlementCheckResultPostedIterator struct { - Event *MockEntitlementGatedEntitlementCheckResultPosted // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *MockEntitlementGatedEntitlementCheckResultPostedIterator) 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(MockEntitlementGatedEntitlementCheckResultPosted) - 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(MockEntitlementGatedEntitlementCheckResultPosted) - 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 *MockEntitlementGatedEntitlementCheckResultPostedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *MockEntitlementGatedEntitlementCheckResultPostedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// MockEntitlementGatedEntitlementCheckResultPosted represents a EntitlementCheckResultPosted event raised by the MockEntitlementGated contract. -type MockEntitlementGatedEntitlementCheckResultPosted struct { - TransactionId [32]byte - Result uint8 - Raw types.Log // Blockchain specific contextual infos -} - -// FilterEntitlementCheckResultPosted is a free log retrieval operation binding the contract event 0xb9d6ce397e562841871d119aaf77469c60a3b5bf8b99a5d9851656015015c633. -// -// Solidity: event EntitlementCheckResultPosted(bytes32 indexed transactionId, uint8 result) -func (_MockEntitlementGated *MockEntitlementGatedFilterer) FilterEntitlementCheckResultPosted(opts *bind.FilterOpts, transactionId [][32]byte) (*MockEntitlementGatedEntitlementCheckResultPostedIterator, error) { - - var transactionIdRule []interface{} - for _, transactionIdItem := range transactionId { - transactionIdRule = append(transactionIdRule, transactionIdItem) - } - - logs, sub, err := _MockEntitlementGated.contract.FilterLogs(opts, "EntitlementCheckResultPosted", transactionIdRule) - if err != nil { - return nil, err - } - return &MockEntitlementGatedEntitlementCheckResultPostedIterator{contract: _MockEntitlementGated.contract, event: "EntitlementCheckResultPosted", logs: logs, sub: sub}, nil -} - -// WatchEntitlementCheckResultPosted is a free log subscription operation binding the contract event 0xb9d6ce397e562841871d119aaf77469c60a3b5bf8b99a5d9851656015015c633. -// -// Solidity: event EntitlementCheckResultPosted(bytes32 indexed transactionId, uint8 result) -func (_MockEntitlementGated *MockEntitlementGatedFilterer) WatchEntitlementCheckResultPosted(opts *bind.WatchOpts, sink chan<- *MockEntitlementGatedEntitlementCheckResultPosted, transactionId [][32]byte) (event.Subscription, error) { - - var transactionIdRule []interface{} - for _, transactionIdItem := range transactionId { - transactionIdRule = append(transactionIdRule, transactionIdItem) - } - - logs, sub, err := _MockEntitlementGated.contract.WatchLogs(opts, "EntitlementCheckResultPosted", transactionIdRule) - 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(MockEntitlementGatedEntitlementCheckResultPosted) - if err := _MockEntitlementGated.contract.UnpackLog(event, "EntitlementCheckResultPosted", 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 -} - -// ParseEntitlementCheckResultPosted is a log parse operation binding the contract event 0xb9d6ce397e562841871d119aaf77469c60a3b5bf8b99a5d9851656015015c633. -// -// Solidity: event EntitlementCheckResultPosted(bytes32 indexed transactionId, uint8 result) -func (_MockEntitlementGated *MockEntitlementGatedFilterer) ParseEntitlementCheckResultPosted(log types.Log) (*MockEntitlementGatedEntitlementCheckResultPosted, error) { - event := new(MockEntitlementGatedEntitlementCheckResultPosted) - if err := _MockEntitlementGated.contract.UnpackLog(event, "EntitlementCheckResultPosted", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// MockEntitlementGatedInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the MockEntitlementGated contract. -type MockEntitlementGatedInitializedIterator struct { - Event *MockEntitlementGatedInitialized // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *MockEntitlementGatedInitializedIterator) 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(MockEntitlementGatedInitialized) - 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(MockEntitlementGatedInitialized) - 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 *MockEntitlementGatedInitializedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *MockEntitlementGatedInitializedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// MockEntitlementGatedInitialized represents a Initialized event raised by the MockEntitlementGated contract. -type MockEntitlementGatedInitialized struct { - Version uint32 - Raw types.Log // Blockchain specific contextual infos -} - -// FilterInitialized is a free log retrieval operation binding the contract event 0xe9c9b456cb2994b80aeef036cf59d26e9617df80f816a6ee5a5b4166e07e2f5c. -// -// Solidity: event Initialized(uint32 version) -func (_MockEntitlementGated *MockEntitlementGatedFilterer) FilterInitialized(opts *bind.FilterOpts) (*MockEntitlementGatedInitializedIterator, error) { - - logs, sub, err := _MockEntitlementGated.contract.FilterLogs(opts, "Initialized") - if err != nil { - return nil, err - } - return &MockEntitlementGatedInitializedIterator{contract: _MockEntitlementGated.contract, event: "Initialized", logs: logs, sub: sub}, nil -} - -// WatchInitialized is a free log subscription operation binding the contract event 0xe9c9b456cb2994b80aeef036cf59d26e9617df80f816a6ee5a5b4166e07e2f5c. -// -// Solidity: event Initialized(uint32 version) -func (_MockEntitlementGated *MockEntitlementGatedFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *MockEntitlementGatedInitialized) (event.Subscription, error) { - - logs, sub, err := _MockEntitlementGated.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(MockEntitlementGatedInitialized) - if err := _MockEntitlementGated.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 0xe9c9b456cb2994b80aeef036cf59d26e9617df80f816a6ee5a5b4166e07e2f5c. -// -// Solidity: event Initialized(uint32 version) -func (_MockEntitlementGated *MockEntitlementGatedFilterer) ParseInitialized(log types.Log) (*MockEntitlementGatedInitialized, error) { - event := new(MockEntitlementGatedInitialized) - if err := _MockEntitlementGated.contract.UnpackLog(event, "Initialized", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// MockEntitlementGatedInterfaceAddedIterator is returned from FilterInterfaceAdded and is used to iterate over the raw logs and unpacked data for InterfaceAdded events raised by the MockEntitlementGated contract. -type MockEntitlementGatedInterfaceAddedIterator struct { - Event *MockEntitlementGatedInterfaceAdded // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *MockEntitlementGatedInterfaceAddedIterator) 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(MockEntitlementGatedInterfaceAdded) - 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(MockEntitlementGatedInterfaceAdded) - 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 *MockEntitlementGatedInterfaceAddedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *MockEntitlementGatedInterfaceAddedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// MockEntitlementGatedInterfaceAdded represents a InterfaceAdded event raised by the MockEntitlementGated contract. -type MockEntitlementGatedInterfaceAdded struct { - InterfaceId [4]byte - Raw types.Log // Blockchain specific contextual infos -} - -// FilterInterfaceAdded is a free log retrieval operation binding the contract event 0x78f84e5b1c5c05be2b5ad3800781dd404d6d6c6302bc755c0fe20f58a33a7f22. -// -// Solidity: event InterfaceAdded(bytes4 indexed interfaceId) -func (_MockEntitlementGated *MockEntitlementGatedFilterer) FilterInterfaceAdded(opts *bind.FilterOpts, interfaceId [][4]byte) (*MockEntitlementGatedInterfaceAddedIterator, error) { - - var interfaceIdRule []interface{} - for _, interfaceIdItem := range interfaceId { - interfaceIdRule = append(interfaceIdRule, interfaceIdItem) - } - - logs, sub, err := _MockEntitlementGated.contract.FilterLogs(opts, "InterfaceAdded", interfaceIdRule) - if err != nil { - return nil, err - } - return &MockEntitlementGatedInterfaceAddedIterator{contract: _MockEntitlementGated.contract, event: "InterfaceAdded", logs: logs, sub: sub}, nil -} - -// WatchInterfaceAdded is a free log subscription operation binding the contract event 0x78f84e5b1c5c05be2b5ad3800781dd404d6d6c6302bc755c0fe20f58a33a7f22. -// -// Solidity: event InterfaceAdded(bytes4 indexed interfaceId) -func (_MockEntitlementGated *MockEntitlementGatedFilterer) WatchInterfaceAdded(opts *bind.WatchOpts, sink chan<- *MockEntitlementGatedInterfaceAdded, interfaceId [][4]byte) (event.Subscription, error) { - - var interfaceIdRule []interface{} - for _, interfaceIdItem := range interfaceId { - interfaceIdRule = append(interfaceIdRule, interfaceIdItem) - } - - logs, sub, err := _MockEntitlementGated.contract.WatchLogs(opts, "InterfaceAdded", interfaceIdRule) - 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(MockEntitlementGatedInterfaceAdded) - if err := _MockEntitlementGated.contract.UnpackLog(event, "InterfaceAdded", 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 -} - -// ParseInterfaceAdded is a log parse operation binding the contract event 0x78f84e5b1c5c05be2b5ad3800781dd404d6d6c6302bc755c0fe20f58a33a7f22. -// -// Solidity: event InterfaceAdded(bytes4 indexed interfaceId) -func (_MockEntitlementGated *MockEntitlementGatedFilterer) ParseInterfaceAdded(log types.Log) (*MockEntitlementGatedInterfaceAdded, error) { - event := new(MockEntitlementGatedInterfaceAdded) - if err := _MockEntitlementGated.contract.UnpackLog(event, "InterfaceAdded", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// MockEntitlementGatedInterfaceRemovedIterator is returned from FilterInterfaceRemoved and is used to iterate over the raw logs and unpacked data for InterfaceRemoved events raised by the MockEntitlementGated contract. -type MockEntitlementGatedInterfaceRemovedIterator struct { - Event *MockEntitlementGatedInterfaceRemoved // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *MockEntitlementGatedInterfaceRemovedIterator) 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(MockEntitlementGatedInterfaceRemoved) - 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(MockEntitlementGatedInterfaceRemoved) - 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 *MockEntitlementGatedInterfaceRemovedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *MockEntitlementGatedInterfaceRemovedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// MockEntitlementGatedInterfaceRemoved represents a InterfaceRemoved event raised by the MockEntitlementGated contract. -type MockEntitlementGatedInterfaceRemoved struct { - InterfaceId [4]byte - Raw types.Log // Blockchain specific contextual infos -} - -// FilterInterfaceRemoved is a free log retrieval operation binding the contract event 0x8bd383568d0bc57b64b8e424138fc19ae827e694e05757faa8fea8f63fb87315. -// -// Solidity: event InterfaceRemoved(bytes4 indexed interfaceId) -func (_MockEntitlementGated *MockEntitlementGatedFilterer) FilterInterfaceRemoved(opts *bind.FilterOpts, interfaceId [][4]byte) (*MockEntitlementGatedInterfaceRemovedIterator, error) { - - var interfaceIdRule []interface{} - for _, interfaceIdItem := range interfaceId { - interfaceIdRule = append(interfaceIdRule, interfaceIdItem) - } - - logs, sub, err := _MockEntitlementGated.contract.FilterLogs(opts, "InterfaceRemoved", interfaceIdRule) - if err != nil { - return nil, err - } - return &MockEntitlementGatedInterfaceRemovedIterator{contract: _MockEntitlementGated.contract, event: "InterfaceRemoved", logs: logs, sub: sub}, nil -} - -// WatchInterfaceRemoved is a free log subscription operation binding the contract event 0x8bd383568d0bc57b64b8e424138fc19ae827e694e05757faa8fea8f63fb87315. -// -// Solidity: event InterfaceRemoved(bytes4 indexed interfaceId) -func (_MockEntitlementGated *MockEntitlementGatedFilterer) WatchInterfaceRemoved(opts *bind.WatchOpts, sink chan<- *MockEntitlementGatedInterfaceRemoved, interfaceId [][4]byte) (event.Subscription, error) { - - var interfaceIdRule []interface{} - for _, interfaceIdItem := range interfaceId { - interfaceIdRule = append(interfaceIdRule, interfaceIdItem) - } - - logs, sub, err := _MockEntitlementGated.contract.WatchLogs(opts, "InterfaceRemoved", interfaceIdRule) - 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(MockEntitlementGatedInterfaceRemoved) - if err := _MockEntitlementGated.contract.UnpackLog(event, "InterfaceRemoved", 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 -} - -// ParseInterfaceRemoved is a log parse operation binding the contract event 0x8bd383568d0bc57b64b8e424138fc19ae827e694e05757faa8fea8f63fb87315. -// -// Solidity: event InterfaceRemoved(bytes4 indexed interfaceId) -func (_MockEntitlementGated *MockEntitlementGatedFilterer) ParseInterfaceRemoved(log types.Log) (*MockEntitlementGatedInterfaceRemoved, error) { - event := new(MockEntitlementGatedInterfaceRemoved) - if err := _MockEntitlementGated.contract.UnpackLog(event, "InterfaceRemoved", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} diff --git a/core/xchain/contracts/v3/entitlement_checker.go b/core/xchain/contracts/v3/entitlement_checker.go deleted file mode 100644 index ef3815180..000000000 --- a/core/xchain/contracts/v3/entitlement_checker.go +++ /dev/null @@ -1,1290 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package v3 - -import ( - "errors" - "math/big" - "strings" - - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" -) - -// Reference imports to suppress errors if they are not otherwise used. -var ( - _ = errors.New - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription - _ = abi.ConvertType -) - -// EntitlementCheckerMetaData contains all meta data concerning the EntitlementChecker contract. -var EntitlementCheckerMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"function\",\"name\":\"__EntitlementChecker_init\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"getNodeAtIndex\",\"inputs\":[{\"name\":\"index\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getNodeCount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getNodesByOperator\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getRandomNodes\",\"inputs\":[{\"name\":\"count\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isValidNode\",\"inputs\":[{\"name\":\"node\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"registerNode\",\"inputs\":[{\"name\":\"node\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"requestEntitlementCheck\",\"inputs\":[{\"name\":\"callerAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"transactionId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"roleId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"nodes\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"unregisterNode\",\"inputs\":[{\"name\":\"node\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"EntitlementCheckRequested\",\"inputs\":[{\"name\":\"callerAddress\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"contractAddress\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"transactionId\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"roleId\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"selectedNodes\",\"type\":\"address[]\",\"indexed\":false,\"internalType\":\"address[]\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"InterfaceAdded\",\"inputs\":[{\"name\":\"interfaceId\",\"type\":\"bytes4\",\"indexed\":true,\"internalType\":\"bytes4\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"InterfaceRemoved\",\"inputs\":[{\"name\":\"interfaceId\",\"type\":\"bytes4\",\"indexed\":true,\"internalType\":\"bytes4\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"NodeRegistered\",\"inputs\":[{\"name\":\"nodeAddress\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"NodeUnregistered\",\"inputs\":[{\"name\":\"nodeAddress\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"EntitlementChecker_InsufficientNumberOfNodes\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EntitlementChecker_InvalidNodeOperator\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EntitlementChecker_InvalidOperator\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EntitlementChecker_NodeAlreadyRegistered\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EntitlementChecker_NodeNotRegistered\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EntitlementChecker_OperatorNotActive\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Initializable_InInitializingState\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Initializable_NotInInitializingState\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Introspection_AlreadySupported\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Introspection_NotSupported\",\"inputs\":[]}]", - Bin: "0x608060405234801561001057600080fd5b5061001961001e565b6100c4565b7f59b501c3653afc186af7d48dda36cf6732bd21629a6295693664240a6ef520008054640100000000900460ff161561006a576040516366008a2d60e01b815260040160405180910390fd5b805463ffffffff90811610156100c157805463ffffffff191663ffffffff90811782556040519081527fe9c9b456cb2994b80aeef036cf59d26e9617df80f816a6ee5a5b4166e07e2f5c9060200160405180910390a15b50565b610df3806100d36000396000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c80634f845445116100665780634f84544514610108578063541da4e51461011b578063672d7a0d1461012e5780639ebd11ef14610141578063c5e41cf61461016457600080fd5b806339bf397e1461009857806339dc5b3e146100b35780633c59f126146100bd57806343024ac9146100e8575b600080fd5b6100a0610177565b6040519081526020015b60405180910390f35b6100bb610197565b005b6100d06100cb366004610b29565b6101f3565b6040516001600160a01b0390911681526020016100aa565b6100fb6100f6366004610b5e565b610266565b6040516100aa9190610bbe565b6100fb610116366004610b29565b6103b3565b6100bb610129366004610be7565b6103c4565b6100bb61013c366004610b5e565b610409565b61015461014f366004610b5e565b61052e565b60405190151581526020016100aa565b6100bb610172366004610b5e565b610549565b6000600080516020610dd38339815191526101918161064c565b91505090565b7f59b501c3653afc186af7d48dda36cf6732bd21629a6295693664240a6ef5200054640100000000900460ff166101e157604051630ef4733760e31b815260040160405180910390fd5b6101f1636109052560e01b610656565b565b6000600080516020610dd383398151915261020d8161064c565b83106102555760405162461bcd60e51b8152602060048201526013602482015272496e646578206f7574206f6620626f756e647360681b604482015260640160405180910390fd5b61025f8184610734565b9392505050565b6060600080516020610dd383398151915260006102828261064c565b90506000805b828110156102dc57600061029c8583610734565b6001600160a01b0380821660009081526002880160205260409020549192508089169116036102d357826102cf81610ce6565b9350505b50600101610288565b5060008167ffffffffffffffff8111156102f8576102f8610bd1565b604051908082528060200260200182016040528015610321578160200160208202803683370190505b5090506000805b848110156103a757600061033c8783610734565b6001600160a01b03808216600090815260028a016020526040902054919250808b1691160361039e578084848151811061037857610378610cff565b6001600160a01b03909216602092830291909101909101528261039a81610ce6565b9350505b50600101610328565b50909695505050505050565b60606103be82610740565b92915050565b7f4675e3cc15801ffde520a3076d6ad75c0c6dbe8f23bdbea1dd45b676caffe4f384338585856040516103fb959493929190610d15565b60405180910390a150505050565b7f988e8266be98e92aff755bdd688f8f4a2421e26daa6089c7e2668053a3bf55006104348133610915565b6104515760405163c931a1fb60e01b815260040160405180910390fd5b600080516020610dd383398151915261046a8184610915565b156104885760405163d1922fc160e01b815260040160405180910390fd5b6104928184610937565b506001600160a01b038316600081815260028301602052604080822080546001600160a01b03191633179055517f564728e6a7c8edd446557d94e0339d5e6ca2e05f42188914efdbdc87bcbbabf69190a250600233600090815260028301602052604090205460ff16600381111561050c5761050c610d5a565b1461052a57604051637164de9160e01b815260040160405180910390fd5b5050565b6000600080516020610dd383398151915261025f8184610915565b6001600160a01b0380821660009081527f180c1d0b9e5eeea9f2f078bc2712cd77acc6afea03b37705abe96dda6f602602602052604090205482913391600080516020610dd3833981519152911682146105b65760405163fd2dc62f60e01b815260040160405180910390fd5b600080516020610dd38339815191526105cf8186610915565b6105ec576040516317e3e0b960e01b815260040160405180910390fd5b6105f6818661094c565b506001600160a01b038516600081815260028301602052604080822080546001600160a01b0319169055517fb1864577e4f285436a80ebc833984755393e2450d58622a65fb4fce87ea3573a9190a25050505050565b60006103be825490565b6001600160e01b0319811660009081527f81088bbc801e045ea3e7620779ab349988f58afbdfba10dff983df3f33522b00602052604090205460ff1615156001146106e3576001600160e01b0319811660009081527f81088bbc801e045ea3e7620779ab349988f58afbdfba10dff983df3f33522b0060205260409020805460ff191660011790556106fc565b604051637967f77d60e11b815260040160405180910390fd5b6040516001600160e01b03198216907f78f84e5b1c5c05be2b5ad3800781dd404d6d6c6302bc755c0fe20f58a33a7f2290600090a250565b600061025f8383610961565b6060600080516020610dd3833981519152600061075c8261064c565b90508084111561077f57604051631762997d60e01b815260040160405180910390fd5b60008467ffffffffffffffff81111561079a5761079a610bd1565b6040519080825280602002602001820160405280156107c3578160200160208202803683370190505b50905060008267ffffffffffffffff8111156107e1576107e1610bd1565b60405190808252806020026020018201604052801561080a578160200160208202803683370190505b50905060005b8381101561083e578082828151811061082b5761082b610cff565b6020908102919091010152600101610810565b508260005b87811015610909576000610857828461098b565b905061088884828151811061086e5761086e610cff565b60200260200101518860000161073490919063ffffffff16565b85838151811061089a5761089a610cff565b6001600160a01b0390921660209283029190910190910152836108be600185610d70565b815181106108ce576108ce610cff565b60200260200101518482815181106108e8576108e8610cff565b6020908102919091010152826108fd81610d83565b93505050600101610843565b50919695505050505050565b6001600160a01b0381166000908152600183016020526040812054151561025f565b600061025f836001600160a01b0384166109e7565b600061025f836001600160a01b038416610a36565b600082600001828154811061097857610978610cff565b9060005260206000200154905092915050565b604080514460208201524291810191909152606080820184905233901b6bffffffffffffffffffffffff1916608082015260009082906094016040516020818303038152906040528051906020012060001c61025f9190610d9a565b6000818152600183016020526040812054610a2e575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556103be565b5060006103be565b60008181526001830160205260408120548015610b1f576000610a5a600183610d70565b8554909150600090610a6e90600190610d70565b9050808214610ad3576000866000018281548110610a8e57610a8e610cff565b9060005260206000200154905080876000018481548110610ab157610ab1610cff565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080610ae457610ae4610dbc565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506103be565b60009150506103be565b600060208284031215610b3b57600080fd5b5035919050565b80356001600160a01b0381168114610b5957600080fd5b919050565b600060208284031215610b7057600080fd5b61025f82610b42565b60008151808452602080850194506020840160005b83811015610bb35781516001600160a01b031687529582019590820190600101610b8e565b509495945050505050565b60208152600061025f6020830184610b79565b634e487b7160e01b600052604160045260246000fd5b60008060008060808587031215610bfd57600080fd5b610c0685610b42565b9350602080860135935060408601359250606086013567ffffffffffffffff80821115610c3257600080fd5b818801915088601f830112610c4657600080fd5b813581811115610c5857610c58610bd1565b8060051b604051601f19603f83011681018181108582111715610c7d57610c7d610bd1565b60405291825284820192508381018501918b831115610c9b57600080fd5b938501935b82851015610cc057610cb185610b42565b84529385019392850192610ca0565b989b979a50959850505050505050565b634e487b7160e01b600052601160045260246000fd5b600060018201610cf857610cf8610cd0565b5060010190565b634e487b7160e01b600052603260045260246000fd5b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090610d4f90830184610b79565b979650505050505050565b634e487b7160e01b600052602160045260246000fd5b818103818111156103be576103be610cd0565b600081610d9257610d92610cd0565b506000190190565b600082610db757634e487b7160e01b600052601260045260246000fd5b500690565b634e487b7160e01b600052603160045260246000fdfe180c1d0b9e5eeea9f2f078bc2712cd77acc6afea03b37705abe96dda6f602600", -} - -// EntitlementCheckerABI is the input ABI used to generate the binding from. -// Deprecated: Use EntitlementCheckerMetaData.ABI instead. -var EntitlementCheckerABI = EntitlementCheckerMetaData.ABI - -// EntitlementCheckerBin is the compiled bytecode used for deploying new contracts. -// Deprecated: Use EntitlementCheckerMetaData.Bin instead. -var EntitlementCheckerBin = EntitlementCheckerMetaData.Bin - -// DeployEntitlementChecker deploys a new Ethereum contract, binding an instance of EntitlementChecker to it. -func DeployEntitlementChecker(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *EntitlementChecker, error) { - parsed, err := EntitlementCheckerMetaData.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(EntitlementCheckerBin), backend) - if err != nil { - return common.Address{}, nil, nil, err - } - return address, tx, &EntitlementChecker{EntitlementCheckerCaller: EntitlementCheckerCaller{contract: contract}, EntitlementCheckerTransactor: EntitlementCheckerTransactor{contract: contract}, EntitlementCheckerFilterer: EntitlementCheckerFilterer{contract: contract}}, nil -} - -// EntitlementChecker is an auto generated Go binding around an Ethereum contract. -type EntitlementChecker struct { - EntitlementCheckerCaller // Read-only binding to the contract - EntitlementCheckerTransactor // Write-only binding to the contract - EntitlementCheckerFilterer // Log filterer for contract events -} - -// EntitlementCheckerCaller is an auto generated read-only Go binding around an Ethereum contract. -type EntitlementCheckerCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// EntitlementCheckerTransactor is an auto generated write-only Go binding around an Ethereum contract. -type EntitlementCheckerTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// EntitlementCheckerFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type EntitlementCheckerFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// EntitlementCheckerSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type EntitlementCheckerSession struct { - Contract *EntitlementChecker // 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 -} - -// EntitlementCheckerCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type EntitlementCheckerCallerSession struct { - Contract *EntitlementCheckerCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// EntitlementCheckerTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type EntitlementCheckerTransactorSession struct { - Contract *EntitlementCheckerTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// EntitlementCheckerRaw is an auto generated low-level Go binding around an Ethereum contract. -type EntitlementCheckerRaw struct { - Contract *EntitlementChecker // Generic contract binding to access the raw methods on -} - -// EntitlementCheckerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type EntitlementCheckerCallerRaw struct { - Contract *EntitlementCheckerCaller // Generic read-only contract binding to access the raw methods on -} - -// EntitlementCheckerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type EntitlementCheckerTransactorRaw struct { - Contract *EntitlementCheckerTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewEntitlementChecker creates a new instance of EntitlementChecker, bound to a specific deployed contract. -func NewEntitlementChecker(address common.Address, backend bind.ContractBackend) (*EntitlementChecker, error) { - contract, err := bindEntitlementChecker(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &EntitlementChecker{EntitlementCheckerCaller: EntitlementCheckerCaller{contract: contract}, EntitlementCheckerTransactor: EntitlementCheckerTransactor{contract: contract}, EntitlementCheckerFilterer: EntitlementCheckerFilterer{contract: contract}}, nil -} - -// NewEntitlementCheckerCaller creates a new read-only instance of EntitlementChecker, bound to a specific deployed contract. -func NewEntitlementCheckerCaller(address common.Address, caller bind.ContractCaller) (*EntitlementCheckerCaller, error) { - contract, err := bindEntitlementChecker(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &EntitlementCheckerCaller{contract: contract}, nil -} - -// NewEntitlementCheckerTransactor creates a new write-only instance of EntitlementChecker, bound to a specific deployed contract. -func NewEntitlementCheckerTransactor(address common.Address, transactor bind.ContractTransactor) (*EntitlementCheckerTransactor, error) { - contract, err := bindEntitlementChecker(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &EntitlementCheckerTransactor{contract: contract}, nil -} - -// NewEntitlementCheckerFilterer creates a new log filterer instance of EntitlementChecker, bound to a specific deployed contract. -func NewEntitlementCheckerFilterer(address common.Address, filterer bind.ContractFilterer) (*EntitlementCheckerFilterer, error) { - contract, err := bindEntitlementChecker(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &EntitlementCheckerFilterer{contract: contract}, nil -} - -// bindEntitlementChecker binds a generic wrapper to an already deployed contract. -func bindEntitlementChecker(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := EntitlementCheckerMetaData.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 (_EntitlementChecker *EntitlementCheckerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _EntitlementChecker.Contract.EntitlementCheckerCaller.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 (_EntitlementChecker *EntitlementCheckerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _EntitlementChecker.Contract.EntitlementCheckerTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_EntitlementChecker *EntitlementCheckerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _EntitlementChecker.Contract.EntitlementCheckerTransactor.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 (_EntitlementChecker *EntitlementCheckerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _EntitlementChecker.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 (_EntitlementChecker *EntitlementCheckerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _EntitlementChecker.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_EntitlementChecker *EntitlementCheckerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _EntitlementChecker.Contract.contract.Transact(opts, method, params...) -} - -// GetNodeAtIndex is a free data retrieval call binding the contract method 0x3c59f126. -// -// Solidity: function getNodeAtIndex(uint256 index) view returns(address) -func (_EntitlementChecker *EntitlementCheckerCaller) GetNodeAtIndex(opts *bind.CallOpts, index *big.Int) (common.Address, error) { - var out []interface{} - err := _EntitlementChecker.contract.Call(opts, &out, "getNodeAtIndex", index) - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// GetNodeAtIndex is a free data retrieval call binding the contract method 0x3c59f126. -// -// Solidity: function getNodeAtIndex(uint256 index) view returns(address) -func (_EntitlementChecker *EntitlementCheckerSession) GetNodeAtIndex(index *big.Int) (common.Address, error) { - return _EntitlementChecker.Contract.GetNodeAtIndex(&_EntitlementChecker.CallOpts, index) -} - -// GetNodeAtIndex is a free data retrieval call binding the contract method 0x3c59f126. -// -// Solidity: function getNodeAtIndex(uint256 index) view returns(address) -func (_EntitlementChecker *EntitlementCheckerCallerSession) GetNodeAtIndex(index *big.Int) (common.Address, error) { - return _EntitlementChecker.Contract.GetNodeAtIndex(&_EntitlementChecker.CallOpts, index) -} - -// GetNodeCount is a free data retrieval call binding the contract method 0x39bf397e. -// -// Solidity: function getNodeCount() view returns(uint256) -func (_EntitlementChecker *EntitlementCheckerCaller) GetNodeCount(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _EntitlementChecker.contract.Call(opts, &out, "getNodeCount") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// GetNodeCount is a free data retrieval call binding the contract method 0x39bf397e. -// -// Solidity: function getNodeCount() view returns(uint256) -func (_EntitlementChecker *EntitlementCheckerSession) GetNodeCount() (*big.Int, error) { - return _EntitlementChecker.Contract.GetNodeCount(&_EntitlementChecker.CallOpts) -} - -// GetNodeCount is a free data retrieval call binding the contract method 0x39bf397e. -// -// Solidity: function getNodeCount() view returns(uint256) -func (_EntitlementChecker *EntitlementCheckerCallerSession) GetNodeCount() (*big.Int, error) { - return _EntitlementChecker.Contract.GetNodeCount(&_EntitlementChecker.CallOpts) -} - -// GetNodesByOperator is a free data retrieval call binding the contract method 0x43024ac9. -// -// Solidity: function getNodesByOperator(address operator) view returns(address[]) -func (_EntitlementChecker *EntitlementCheckerCaller) GetNodesByOperator(opts *bind.CallOpts, operator common.Address) ([]common.Address, error) { - var out []interface{} - err := _EntitlementChecker.contract.Call(opts, &out, "getNodesByOperator", operator) - - if err != nil { - return *new([]common.Address), err - } - - out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) - - return out0, err - -} - -// GetNodesByOperator is a free data retrieval call binding the contract method 0x43024ac9. -// -// Solidity: function getNodesByOperator(address operator) view returns(address[]) -func (_EntitlementChecker *EntitlementCheckerSession) GetNodesByOperator(operator common.Address) ([]common.Address, error) { - return _EntitlementChecker.Contract.GetNodesByOperator(&_EntitlementChecker.CallOpts, operator) -} - -// GetNodesByOperator is a free data retrieval call binding the contract method 0x43024ac9. -// -// Solidity: function getNodesByOperator(address operator) view returns(address[]) -func (_EntitlementChecker *EntitlementCheckerCallerSession) GetNodesByOperator(operator common.Address) ([]common.Address, error) { - return _EntitlementChecker.Contract.GetNodesByOperator(&_EntitlementChecker.CallOpts, operator) -} - -// GetRandomNodes is a free data retrieval call binding the contract method 0x4f845445. -// -// Solidity: function getRandomNodes(uint256 count) view returns(address[]) -func (_EntitlementChecker *EntitlementCheckerCaller) GetRandomNodes(opts *bind.CallOpts, count *big.Int) ([]common.Address, error) { - var out []interface{} - err := _EntitlementChecker.contract.Call(opts, &out, "getRandomNodes", count) - - if err != nil { - return *new([]common.Address), err - } - - out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) - - return out0, err - -} - -// GetRandomNodes is a free data retrieval call binding the contract method 0x4f845445. -// -// Solidity: function getRandomNodes(uint256 count) view returns(address[]) -func (_EntitlementChecker *EntitlementCheckerSession) GetRandomNodes(count *big.Int) ([]common.Address, error) { - return _EntitlementChecker.Contract.GetRandomNodes(&_EntitlementChecker.CallOpts, count) -} - -// GetRandomNodes is a free data retrieval call binding the contract method 0x4f845445. -// -// Solidity: function getRandomNodes(uint256 count) view returns(address[]) -func (_EntitlementChecker *EntitlementCheckerCallerSession) GetRandomNodes(count *big.Int) ([]common.Address, error) { - return _EntitlementChecker.Contract.GetRandomNodes(&_EntitlementChecker.CallOpts, count) -} - -// IsValidNode is a free data retrieval call binding the contract method 0x9ebd11ef. -// -// Solidity: function isValidNode(address node) view returns(bool) -func (_EntitlementChecker *EntitlementCheckerCaller) IsValidNode(opts *bind.CallOpts, node common.Address) (bool, error) { - var out []interface{} - err := _EntitlementChecker.contract.Call(opts, &out, "isValidNode", node) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// IsValidNode is a free data retrieval call binding the contract method 0x9ebd11ef. -// -// Solidity: function isValidNode(address node) view returns(bool) -func (_EntitlementChecker *EntitlementCheckerSession) IsValidNode(node common.Address) (bool, error) { - return _EntitlementChecker.Contract.IsValidNode(&_EntitlementChecker.CallOpts, node) -} - -// IsValidNode is a free data retrieval call binding the contract method 0x9ebd11ef. -// -// Solidity: function isValidNode(address node) view returns(bool) -func (_EntitlementChecker *EntitlementCheckerCallerSession) IsValidNode(node common.Address) (bool, error) { - return _EntitlementChecker.Contract.IsValidNode(&_EntitlementChecker.CallOpts, node) -} - -// EntitlementCheckerInit is a paid mutator transaction binding the contract method 0x39dc5b3e. -// -// Solidity: function __EntitlementChecker_init() returns() -func (_EntitlementChecker *EntitlementCheckerTransactor) EntitlementCheckerInit(opts *bind.TransactOpts) (*types.Transaction, error) { - return _EntitlementChecker.contract.Transact(opts, "__EntitlementChecker_init") -} - -// EntitlementCheckerInit is a paid mutator transaction binding the contract method 0x39dc5b3e. -// -// Solidity: function __EntitlementChecker_init() returns() -func (_EntitlementChecker *EntitlementCheckerSession) EntitlementCheckerInit() (*types.Transaction, error) { - return _EntitlementChecker.Contract.EntitlementCheckerInit(&_EntitlementChecker.TransactOpts) -} - -// EntitlementCheckerInit is a paid mutator transaction binding the contract method 0x39dc5b3e. -// -// Solidity: function __EntitlementChecker_init() returns() -func (_EntitlementChecker *EntitlementCheckerTransactorSession) EntitlementCheckerInit() (*types.Transaction, error) { - return _EntitlementChecker.Contract.EntitlementCheckerInit(&_EntitlementChecker.TransactOpts) -} - -// RegisterNode is a paid mutator transaction binding the contract method 0x672d7a0d. -// -// Solidity: function registerNode(address node) returns() -func (_EntitlementChecker *EntitlementCheckerTransactor) RegisterNode(opts *bind.TransactOpts, node common.Address) (*types.Transaction, error) { - return _EntitlementChecker.contract.Transact(opts, "registerNode", node) -} - -// RegisterNode is a paid mutator transaction binding the contract method 0x672d7a0d. -// -// Solidity: function registerNode(address node) returns() -func (_EntitlementChecker *EntitlementCheckerSession) RegisterNode(node common.Address) (*types.Transaction, error) { - return _EntitlementChecker.Contract.RegisterNode(&_EntitlementChecker.TransactOpts, node) -} - -// RegisterNode is a paid mutator transaction binding the contract method 0x672d7a0d. -// -// Solidity: function registerNode(address node) returns() -func (_EntitlementChecker *EntitlementCheckerTransactorSession) RegisterNode(node common.Address) (*types.Transaction, error) { - return _EntitlementChecker.Contract.RegisterNode(&_EntitlementChecker.TransactOpts, node) -} - -// RequestEntitlementCheck is a paid mutator transaction binding the contract method 0x541da4e5. -// -// Solidity: function requestEntitlementCheck(address callerAddress, bytes32 transactionId, uint256 roleId, address[] nodes) returns() -func (_EntitlementChecker *EntitlementCheckerTransactor) RequestEntitlementCheck(opts *bind.TransactOpts, callerAddress common.Address, transactionId [32]byte, roleId *big.Int, nodes []common.Address) (*types.Transaction, error) { - return _EntitlementChecker.contract.Transact(opts, "requestEntitlementCheck", callerAddress, transactionId, roleId, nodes) -} - -// RequestEntitlementCheck is a paid mutator transaction binding the contract method 0x541da4e5. -// -// Solidity: function requestEntitlementCheck(address callerAddress, bytes32 transactionId, uint256 roleId, address[] nodes) returns() -func (_EntitlementChecker *EntitlementCheckerSession) RequestEntitlementCheck(callerAddress common.Address, transactionId [32]byte, roleId *big.Int, nodes []common.Address) (*types.Transaction, error) { - return _EntitlementChecker.Contract.RequestEntitlementCheck(&_EntitlementChecker.TransactOpts, callerAddress, transactionId, roleId, nodes) -} - -// RequestEntitlementCheck is a paid mutator transaction binding the contract method 0x541da4e5. -// -// Solidity: function requestEntitlementCheck(address callerAddress, bytes32 transactionId, uint256 roleId, address[] nodes) returns() -func (_EntitlementChecker *EntitlementCheckerTransactorSession) RequestEntitlementCheck(callerAddress common.Address, transactionId [32]byte, roleId *big.Int, nodes []common.Address) (*types.Transaction, error) { - return _EntitlementChecker.Contract.RequestEntitlementCheck(&_EntitlementChecker.TransactOpts, callerAddress, transactionId, roleId, nodes) -} - -// UnregisterNode is a paid mutator transaction binding the contract method 0xc5e41cf6. -// -// Solidity: function unregisterNode(address node) returns() -func (_EntitlementChecker *EntitlementCheckerTransactor) UnregisterNode(opts *bind.TransactOpts, node common.Address) (*types.Transaction, error) { - return _EntitlementChecker.contract.Transact(opts, "unregisterNode", node) -} - -// UnregisterNode is a paid mutator transaction binding the contract method 0xc5e41cf6. -// -// Solidity: function unregisterNode(address node) returns() -func (_EntitlementChecker *EntitlementCheckerSession) UnregisterNode(node common.Address) (*types.Transaction, error) { - return _EntitlementChecker.Contract.UnregisterNode(&_EntitlementChecker.TransactOpts, node) -} - -// UnregisterNode is a paid mutator transaction binding the contract method 0xc5e41cf6. -// -// Solidity: function unregisterNode(address node) returns() -func (_EntitlementChecker *EntitlementCheckerTransactorSession) UnregisterNode(node common.Address) (*types.Transaction, error) { - return _EntitlementChecker.Contract.UnregisterNode(&_EntitlementChecker.TransactOpts, node) -} - -// EntitlementCheckerEntitlementCheckRequestedIterator is returned from FilterEntitlementCheckRequested and is used to iterate over the raw logs and unpacked data for EntitlementCheckRequested events raised by the EntitlementChecker contract. -type EntitlementCheckerEntitlementCheckRequestedIterator struct { - Event *EntitlementCheckerEntitlementCheckRequested // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *EntitlementCheckerEntitlementCheckRequestedIterator) 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(EntitlementCheckerEntitlementCheckRequested) - 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(EntitlementCheckerEntitlementCheckRequested) - 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 *EntitlementCheckerEntitlementCheckRequestedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *EntitlementCheckerEntitlementCheckRequestedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// EntitlementCheckerEntitlementCheckRequested represents a EntitlementCheckRequested event raised by the EntitlementChecker contract. -type EntitlementCheckerEntitlementCheckRequested struct { - CallerAddress common.Address - ContractAddress common.Address - TransactionId [32]byte - RoleId *big.Int - SelectedNodes []common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterEntitlementCheckRequested is a free log retrieval operation binding the contract event 0x4675e3cc15801ffde520a3076d6ad75c0c6dbe8f23bdbea1dd45b676caffe4f3. -// -// Solidity: event EntitlementCheckRequested(address callerAddress, address contractAddress, bytes32 transactionId, uint256 roleId, address[] selectedNodes) -func (_EntitlementChecker *EntitlementCheckerFilterer) FilterEntitlementCheckRequested(opts *bind.FilterOpts) (*EntitlementCheckerEntitlementCheckRequestedIterator, error) { - - logs, sub, err := _EntitlementChecker.contract.FilterLogs(opts, "EntitlementCheckRequested") - if err != nil { - return nil, err - } - return &EntitlementCheckerEntitlementCheckRequestedIterator{contract: _EntitlementChecker.contract, event: "EntitlementCheckRequested", logs: logs, sub: sub}, nil -} - -// WatchEntitlementCheckRequested is a free log subscription operation binding the contract event 0x4675e3cc15801ffde520a3076d6ad75c0c6dbe8f23bdbea1dd45b676caffe4f3. -// -// Solidity: event EntitlementCheckRequested(address callerAddress, address contractAddress, bytes32 transactionId, uint256 roleId, address[] selectedNodes) -func (_EntitlementChecker *EntitlementCheckerFilterer) WatchEntitlementCheckRequested(opts *bind.WatchOpts, sink chan<- *EntitlementCheckerEntitlementCheckRequested) (event.Subscription, error) { - - logs, sub, err := _EntitlementChecker.contract.WatchLogs(opts, "EntitlementCheckRequested") - 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(EntitlementCheckerEntitlementCheckRequested) - if err := _EntitlementChecker.contract.UnpackLog(event, "EntitlementCheckRequested", 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 -} - -// ParseEntitlementCheckRequested is a log parse operation binding the contract event 0x4675e3cc15801ffde520a3076d6ad75c0c6dbe8f23bdbea1dd45b676caffe4f3. -// -// Solidity: event EntitlementCheckRequested(address callerAddress, address contractAddress, bytes32 transactionId, uint256 roleId, address[] selectedNodes) -func (_EntitlementChecker *EntitlementCheckerFilterer) ParseEntitlementCheckRequested(log types.Log) (*EntitlementCheckerEntitlementCheckRequested, error) { - event := new(EntitlementCheckerEntitlementCheckRequested) - if err := _EntitlementChecker.contract.UnpackLog(event, "EntitlementCheckRequested", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// EntitlementCheckerInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the EntitlementChecker contract. -type EntitlementCheckerInitializedIterator struct { - Event *EntitlementCheckerInitialized // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *EntitlementCheckerInitializedIterator) 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(EntitlementCheckerInitialized) - 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(EntitlementCheckerInitialized) - 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 *EntitlementCheckerInitializedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *EntitlementCheckerInitializedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// EntitlementCheckerInitialized represents a Initialized event raised by the EntitlementChecker contract. -type EntitlementCheckerInitialized struct { - Version uint32 - Raw types.Log // Blockchain specific contextual infos -} - -// FilterInitialized is a free log retrieval operation binding the contract event 0xe9c9b456cb2994b80aeef036cf59d26e9617df80f816a6ee5a5b4166e07e2f5c. -// -// Solidity: event Initialized(uint32 version) -func (_EntitlementChecker *EntitlementCheckerFilterer) FilterInitialized(opts *bind.FilterOpts) (*EntitlementCheckerInitializedIterator, error) { - - logs, sub, err := _EntitlementChecker.contract.FilterLogs(opts, "Initialized") - if err != nil { - return nil, err - } - return &EntitlementCheckerInitializedIterator{contract: _EntitlementChecker.contract, event: "Initialized", logs: logs, sub: sub}, nil -} - -// WatchInitialized is a free log subscription operation binding the contract event 0xe9c9b456cb2994b80aeef036cf59d26e9617df80f816a6ee5a5b4166e07e2f5c. -// -// Solidity: event Initialized(uint32 version) -func (_EntitlementChecker *EntitlementCheckerFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *EntitlementCheckerInitialized) (event.Subscription, error) { - - logs, sub, err := _EntitlementChecker.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(EntitlementCheckerInitialized) - if err := _EntitlementChecker.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 0xe9c9b456cb2994b80aeef036cf59d26e9617df80f816a6ee5a5b4166e07e2f5c. -// -// Solidity: event Initialized(uint32 version) -func (_EntitlementChecker *EntitlementCheckerFilterer) ParseInitialized(log types.Log) (*EntitlementCheckerInitialized, error) { - event := new(EntitlementCheckerInitialized) - if err := _EntitlementChecker.contract.UnpackLog(event, "Initialized", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// EntitlementCheckerInterfaceAddedIterator is returned from FilterInterfaceAdded and is used to iterate over the raw logs and unpacked data for InterfaceAdded events raised by the EntitlementChecker contract. -type EntitlementCheckerInterfaceAddedIterator struct { - Event *EntitlementCheckerInterfaceAdded // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *EntitlementCheckerInterfaceAddedIterator) 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(EntitlementCheckerInterfaceAdded) - 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(EntitlementCheckerInterfaceAdded) - 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 *EntitlementCheckerInterfaceAddedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *EntitlementCheckerInterfaceAddedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// EntitlementCheckerInterfaceAdded represents a InterfaceAdded event raised by the EntitlementChecker contract. -type EntitlementCheckerInterfaceAdded struct { - InterfaceId [4]byte - Raw types.Log // Blockchain specific contextual infos -} - -// FilterInterfaceAdded is a free log retrieval operation binding the contract event 0x78f84e5b1c5c05be2b5ad3800781dd404d6d6c6302bc755c0fe20f58a33a7f22. -// -// Solidity: event InterfaceAdded(bytes4 indexed interfaceId) -func (_EntitlementChecker *EntitlementCheckerFilterer) FilterInterfaceAdded(opts *bind.FilterOpts, interfaceId [][4]byte) (*EntitlementCheckerInterfaceAddedIterator, error) { - - var interfaceIdRule []interface{} - for _, interfaceIdItem := range interfaceId { - interfaceIdRule = append(interfaceIdRule, interfaceIdItem) - } - - logs, sub, err := _EntitlementChecker.contract.FilterLogs(opts, "InterfaceAdded", interfaceIdRule) - if err != nil { - return nil, err - } - return &EntitlementCheckerInterfaceAddedIterator{contract: _EntitlementChecker.contract, event: "InterfaceAdded", logs: logs, sub: sub}, nil -} - -// WatchInterfaceAdded is a free log subscription operation binding the contract event 0x78f84e5b1c5c05be2b5ad3800781dd404d6d6c6302bc755c0fe20f58a33a7f22. -// -// Solidity: event InterfaceAdded(bytes4 indexed interfaceId) -func (_EntitlementChecker *EntitlementCheckerFilterer) WatchInterfaceAdded(opts *bind.WatchOpts, sink chan<- *EntitlementCheckerInterfaceAdded, interfaceId [][4]byte) (event.Subscription, error) { - - var interfaceIdRule []interface{} - for _, interfaceIdItem := range interfaceId { - interfaceIdRule = append(interfaceIdRule, interfaceIdItem) - } - - logs, sub, err := _EntitlementChecker.contract.WatchLogs(opts, "InterfaceAdded", interfaceIdRule) - 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(EntitlementCheckerInterfaceAdded) - if err := _EntitlementChecker.contract.UnpackLog(event, "InterfaceAdded", 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 -} - -// ParseInterfaceAdded is a log parse operation binding the contract event 0x78f84e5b1c5c05be2b5ad3800781dd404d6d6c6302bc755c0fe20f58a33a7f22. -// -// Solidity: event InterfaceAdded(bytes4 indexed interfaceId) -func (_EntitlementChecker *EntitlementCheckerFilterer) ParseInterfaceAdded(log types.Log) (*EntitlementCheckerInterfaceAdded, error) { - event := new(EntitlementCheckerInterfaceAdded) - if err := _EntitlementChecker.contract.UnpackLog(event, "InterfaceAdded", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// EntitlementCheckerInterfaceRemovedIterator is returned from FilterInterfaceRemoved and is used to iterate over the raw logs and unpacked data for InterfaceRemoved events raised by the EntitlementChecker contract. -type EntitlementCheckerInterfaceRemovedIterator struct { - Event *EntitlementCheckerInterfaceRemoved // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *EntitlementCheckerInterfaceRemovedIterator) 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(EntitlementCheckerInterfaceRemoved) - 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(EntitlementCheckerInterfaceRemoved) - 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 *EntitlementCheckerInterfaceRemovedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *EntitlementCheckerInterfaceRemovedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// EntitlementCheckerInterfaceRemoved represents a InterfaceRemoved event raised by the EntitlementChecker contract. -type EntitlementCheckerInterfaceRemoved struct { - InterfaceId [4]byte - Raw types.Log // Blockchain specific contextual infos -} - -// FilterInterfaceRemoved is a free log retrieval operation binding the contract event 0x8bd383568d0bc57b64b8e424138fc19ae827e694e05757faa8fea8f63fb87315. -// -// Solidity: event InterfaceRemoved(bytes4 indexed interfaceId) -func (_EntitlementChecker *EntitlementCheckerFilterer) FilterInterfaceRemoved(opts *bind.FilterOpts, interfaceId [][4]byte) (*EntitlementCheckerInterfaceRemovedIterator, error) { - - var interfaceIdRule []interface{} - for _, interfaceIdItem := range interfaceId { - interfaceIdRule = append(interfaceIdRule, interfaceIdItem) - } - - logs, sub, err := _EntitlementChecker.contract.FilterLogs(opts, "InterfaceRemoved", interfaceIdRule) - if err != nil { - return nil, err - } - return &EntitlementCheckerInterfaceRemovedIterator{contract: _EntitlementChecker.contract, event: "InterfaceRemoved", logs: logs, sub: sub}, nil -} - -// WatchInterfaceRemoved is a free log subscription operation binding the contract event 0x8bd383568d0bc57b64b8e424138fc19ae827e694e05757faa8fea8f63fb87315. -// -// Solidity: event InterfaceRemoved(bytes4 indexed interfaceId) -func (_EntitlementChecker *EntitlementCheckerFilterer) WatchInterfaceRemoved(opts *bind.WatchOpts, sink chan<- *EntitlementCheckerInterfaceRemoved, interfaceId [][4]byte) (event.Subscription, error) { - - var interfaceIdRule []interface{} - for _, interfaceIdItem := range interfaceId { - interfaceIdRule = append(interfaceIdRule, interfaceIdItem) - } - - logs, sub, err := _EntitlementChecker.contract.WatchLogs(opts, "InterfaceRemoved", interfaceIdRule) - 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(EntitlementCheckerInterfaceRemoved) - if err := _EntitlementChecker.contract.UnpackLog(event, "InterfaceRemoved", 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 -} - -// ParseInterfaceRemoved is a log parse operation binding the contract event 0x8bd383568d0bc57b64b8e424138fc19ae827e694e05757faa8fea8f63fb87315. -// -// Solidity: event InterfaceRemoved(bytes4 indexed interfaceId) -func (_EntitlementChecker *EntitlementCheckerFilterer) ParseInterfaceRemoved(log types.Log) (*EntitlementCheckerInterfaceRemoved, error) { - event := new(EntitlementCheckerInterfaceRemoved) - if err := _EntitlementChecker.contract.UnpackLog(event, "InterfaceRemoved", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// EntitlementCheckerNodeRegisteredIterator is returned from FilterNodeRegistered and is used to iterate over the raw logs and unpacked data for NodeRegistered events raised by the EntitlementChecker contract. -type EntitlementCheckerNodeRegisteredIterator struct { - Event *EntitlementCheckerNodeRegistered // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *EntitlementCheckerNodeRegisteredIterator) 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(EntitlementCheckerNodeRegistered) - 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(EntitlementCheckerNodeRegistered) - 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 *EntitlementCheckerNodeRegisteredIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *EntitlementCheckerNodeRegisteredIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// EntitlementCheckerNodeRegistered represents a NodeRegistered event raised by the EntitlementChecker contract. -type EntitlementCheckerNodeRegistered struct { - NodeAddress common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterNodeRegistered is a free log retrieval operation binding the contract event 0x564728e6a7c8edd446557d94e0339d5e6ca2e05f42188914efdbdc87bcbbabf6. -// -// Solidity: event NodeRegistered(address indexed nodeAddress) -func (_EntitlementChecker *EntitlementCheckerFilterer) FilterNodeRegistered(opts *bind.FilterOpts, nodeAddress []common.Address) (*EntitlementCheckerNodeRegisteredIterator, error) { - - var nodeAddressRule []interface{} - for _, nodeAddressItem := range nodeAddress { - nodeAddressRule = append(nodeAddressRule, nodeAddressItem) - } - - logs, sub, err := _EntitlementChecker.contract.FilterLogs(opts, "NodeRegistered", nodeAddressRule) - if err != nil { - return nil, err - } - return &EntitlementCheckerNodeRegisteredIterator{contract: _EntitlementChecker.contract, event: "NodeRegistered", logs: logs, sub: sub}, nil -} - -// WatchNodeRegistered is a free log subscription operation binding the contract event 0x564728e6a7c8edd446557d94e0339d5e6ca2e05f42188914efdbdc87bcbbabf6. -// -// Solidity: event NodeRegistered(address indexed nodeAddress) -func (_EntitlementChecker *EntitlementCheckerFilterer) WatchNodeRegistered(opts *bind.WatchOpts, sink chan<- *EntitlementCheckerNodeRegistered, nodeAddress []common.Address) (event.Subscription, error) { - - var nodeAddressRule []interface{} - for _, nodeAddressItem := range nodeAddress { - nodeAddressRule = append(nodeAddressRule, nodeAddressItem) - } - - logs, sub, err := _EntitlementChecker.contract.WatchLogs(opts, "NodeRegistered", nodeAddressRule) - 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(EntitlementCheckerNodeRegistered) - if err := _EntitlementChecker.contract.UnpackLog(event, "NodeRegistered", 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 -} - -// ParseNodeRegistered is a log parse operation binding the contract event 0x564728e6a7c8edd446557d94e0339d5e6ca2e05f42188914efdbdc87bcbbabf6. -// -// Solidity: event NodeRegistered(address indexed nodeAddress) -func (_EntitlementChecker *EntitlementCheckerFilterer) ParseNodeRegistered(log types.Log) (*EntitlementCheckerNodeRegistered, error) { - event := new(EntitlementCheckerNodeRegistered) - if err := _EntitlementChecker.contract.UnpackLog(event, "NodeRegistered", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// EntitlementCheckerNodeUnregisteredIterator is returned from FilterNodeUnregistered and is used to iterate over the raw logs and unpacked data for NodeUnregistered events raised by the EntitlementChecker contract. -type EntitlementCheckerNodeUnregisteredIterator struct { - Event *EntitlementCheckerNodeUnregistered // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *EntitlementCheckerNodeUnregisteredIterator) 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(EntitlementCheckerNodeUnregistered) - 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(EntitlementCheckerNodeUnregistered) - 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 *EntitlementCheckerNodeUnregisteredIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *EntitlementCheckerNodeUnregisteredIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// EntitlementCheckerNodeUnregistered represents a NodeUnregistered event raised by the EntitlementChecker contract. -type EntitlementCheckerNodeUnregistered struct { - NodeAddress common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterNodeUnregistered is a free log retrieval operation binding the contract event 0xb1864577e4f285436a80ebc833984755393e2450d58622a65fb4fce87ea3573a. -// -// Solidity: event NodeUnregistered(address indexed nodeAddress) -func (_EntitlementChecker *EntitlementCheckerFilterer) FilterNodeUnregistered(opts *bind.FilterOpts, nodeAddress []common.Address) (*EntitlementCheckerNodeUnregisteredIterator, error) { - - var nodeAddressRule []interface{} - for _, nodeAddressItem := range nodeAddress { - nodeAddressRule = append(nodeAddressRule, nodeAddressItem) - } - - logs, sub, err := _EntitlementChecker.contract.FilterLogs(opts, "NodeUnregistered", nodeAddressRule) - if err != nil { - return nil, err - } - return &EntitlementCheckerNodeUnregisteredIterator{contract: _EntitlementChecker.contract, event: "NodeUnregistered", logs: logs, sub: sub}, nil -} - -// WatchNodeUnregistered is a free log subscription operation binding the contract event 0xb1864577e4f285436a80ebc833984755393e2450d58622a65fb4fce87ea3573a. -// -// Solidity: event NodeUnregistered(address indexed nodeAddress) -func (_EntitlementChecker *EntitlementCheckerFilterer) WatchNodeUnregistered(opts *bind.WatchOpts, sink chan<- *EntitlementCheckerNodeUnregistered, nodeAddress []common.Address) (event.Subscription, error) { - - var nodeAddressRule []interface{} - for _, nodeAddressItem := range nodeAddress { - nodeAddressRule = append(nodeAddressRule, nodeAddressItem) - } - - logs, sub, err := _EntitlementChecker.contract.WatchLogs(opts, "NodeUnregistered", nodeAddressRule) - 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(EntitlementCheckerNodeUnregistered) - if err := _EntitlementChecker.contract.UnpackLog(event, "NodeUnregistered", 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 -} - -// ParseNodeUnregistered is a log parse operation binding the contract event 0xb1864577e4f285436a80ebc833984755393e2450d58622a65fb4fce87ea3573a. -// -// Solidity: event NodeUnregistered(address indexed nodeAddress) -func (_EntitlementChecker *EntitlementCheckerFilterer) ParseNodeUnregistered(log types.Log) (*EntitlementCheckerNodeUnregistered, error) { - event := new(EntitlementCheckerNodeUnregistered) - if err := _EntitlementChecker.contract.UnpackLog(event, "NodeUnregistered", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} diff --git a/core/xchain/contracts/v3/i_entitlement_checker.go b/core/xchain/contracts/v3/i_entitlement_checker.go deleted file mode 100644 index e89b6b591..000000000 --- a/core/xchain/contracts/v3/i_entitlement_checker.go +++ /dev/null @@ -1,825 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package v3 - -import ( - "errors" - "math/big" - "strings" - - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" -) - -// Reference imports to suppress errors if they are not otherwise used. -var ( - _ = errors.New - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription - _ = abi.ConvertType -) - -// IEntitlementCheckerMetaData contains all meta data concerning the IEntitlementChecker contract. -var IEntitlementCheckerMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"function\",\"name\":\"getNodeAtIndex\",\"inputs\":[{\"name\":\"index\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getNodeCount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getNodesByOperator\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getRandomNodes\",\"inputs\":[{\"name\":\"count\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isValidNode\",\"inputs\":[{\"name\":\"node\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"registerNode\",\"inputs\":[{\"name\":\"node\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"requestEntitlementCheck\",\"inputs\":[{\"name\":\"callerAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"transactionId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"roleId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"nodes\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"unregisterNode\",\"inputs\":[{\"name\":\"node\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"EntitlementCheckRequested\",\"inputs\":[{\"name\":\"callerAddress\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"contractAddress\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"transactionId\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"roleId\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"selectedNodes\",\"type\":\"address[]\",\"indexed\":false,\"internalType\":\"address[]\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"NodeRegistered\",\"inputs\":[{\"name\":\"nodeAddress\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"NodeUnregistered\",\"inputs\":[{\"name\":\"nodeAddress\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"EntitlementChecker_InsufficientNumberOfNodes\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EntitlementChecker_InvalidNodeOperator\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EntitlementChecker_InvalidOperator\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EntitlementChecker_NodeAlreadyRegistered\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EntitlementChecker_NodeNotRegistered\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EntitlementChecker_OperatorNotActive\",\"inputs\":[]}]", -} - -// IEntitlementCheckerABI is the input ABI used to generate the binding from. -// Deprecated: Use IEntitlementCheckerMetaData.ABI instead. -var IEntitlementCheckerABI = IEntitlementCheckerMetaData.ABI - -// IEntitlementChecker is an auto generated Go binding around an Ethereum contract. -type IEntitlementChecker struct { - IEntitlementCheckerCaller // Read-only binding to the contract - IEntitlementCheckerTransactor // Write-only binding to the contract - IEntitlementCheckerFilterer // Log filterer for contract events -} - -// IEntitlementCheckerCaller is an auto generated read-only Go binding around an Ethereum contract. -type IEntitlementCheckerCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// IEntitlementCheckerTransactor is an auto generated write-only Go binding around an Ethereum contract. -type IEntitlementCheckerTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// IEntitlementCheckerFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type IEntitlementCheckerFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// IEntitlementCheckerSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type IEntitlementCheckerSession struct { - Contract *IEntitlementChecker // 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 -} - -// IEntitlementCheckerCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type IEntitlementCheckerCallerSession struct { - Contract *IEntitlementCheckerCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// IEntitlementCheckerTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type IEntitlementCheckerTransactorSession struct { - Contract *IEntitlementCheckerTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// IEntitlementCheckerRaw is an auto generated low-level Go binding around an Ethereum contract. -type IEntitlementCheckerRaw struct { - Contract *IEntitlementChecker // Generic contract binding to access the raw methods on -} - -// IEntitlementCheckerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type IEntitlementCheckerCallerRaw struct { - Contract *IEntitlementCheckerCaller // Generic read-only contract binding to access the raw methods on -} - -// IEntitlementCheckerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type IEntitlementCheckerTransactorRaw struct { - Contract *IEntitlementCheckerTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewIEntitlementChecker creates a new instance of IEntitlementChecker, bound to a specific deployed contract. -func NewIEntitlementChecker(address common.Address, backend bind.ContractBackend) (*IEntitlementChecker, error) { - contract, err := bindIEntitlementChecker(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &IEntitlementChecker{IEntitlementCheckerCaller: IEntitlementCheckerCaller{contract: contract}, IEntitlementCheckerTransactor: IEntitlementCheckerTransactor{contract: contract}, IEntitlementCheckerFilterer: IEntitlementCheckerFilterer{contract: contract}}, nil -} - -// NewIEntitlementCheckerCaller creates a new read-only instance of IEntitlementChecker, bound to a specific deployed contract. -func NewIEntitlementCheckerCaller(address common.Address, caller bind.ContractCaller) (*IEntitlementCheckerCaller, error) { - contract, err := bindIEntitlementChecker(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &IEntitlementCheckerCaller{contract: contract}, nil -} - -// NewIEntitlementCheckerTransactor creates a new write-only instance of IEntitlementChecker, bound to a specific deployed contract. -func NewIEntitlementCheckerTransactor(address common.Address, transactor bind.ContractTransactor) (*IEntitlementCheckerTransactor, error) { - contract, err := bindIEntitlementChecker(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &IEntitlementCheckerTransactor{contract: contract}, nil -} - -// NewIEntitlementCheckerFilterer creates a new log filterer instance of IEntitlementChecker, bound to a specific deployed contract. -func NewIEntitlementCheckerFilterer(address common.Address, filterer bind.ContractFilterer) (*IEntitlementCheckerFilterer, error) { - contract, err := bindIEntitlementChecker(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &IEntitlementCheckerFilterer{contract: contract}, nil -} - -// bindIEntitlementChecker binds a generic wrapper to an already deployed contract. -func bindIEntitlementChecker(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := IEntitlementCheckerMetaData.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 (_IEntitlementChecker *IEntitlementCheckerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _IEntitlementChecker.Contract.IEntitlementCheckerCaller.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 (_IEntitlementChecker *IEntitlementCheckerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _IEntitlementChecker.Contract.IEntitlementCheckerTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_IEntitlementChecker *IEntitlementCheckerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _IEntitlementChecker.Contract.IEntitlementCheckerTransactor.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 (_IEntitlementChecker *IEntitlementCheckerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _IEntitlementChecker.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 (_IEntitlementChecker *IEntitlementCheckerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _IEntitlementChecker.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_IEntitlementChecker *IEntitlementCheckerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _IEntitlementChecker.Contract.contract.Transact(opts, method, params...) -} - -// GetNodeAtIndex is a free data retrieval call binding the contract method 0x3c59f126. -// -// Solidity: function getNodeAtIndex(uint256 index) view returns(address) -func (_IEntitlementChecker *IEntitlementCheckerCaller) GetNodeAtIndex(opts *bind.CallOpts, index *big.Int) (common.Address, error) { - var out []interface{} - err := _IEntitlementChecker.contract.Call(opts, &out, "getNodeAtIndex", index) - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// GetNodeAtIndex is a free data retrieval call binding the contract method 0x3c59f126. -// -// Solidity: function getNodeAtIndex(uint256 index) view returns(address) -func (_IEntitlementChecker *IEntitlementCheckerSession) GetNodeAtIndex(index *big.Int) (common.Address, error) { - return _IEntitlementChecker.Contract.GetNodeAtIndex(&_IEntitlementChecker.CallOpts, index) -} - -// GetNodeAtIndex is a free data retrieval call binding the contract method 0x3c59f126. -// -// Solidity: function getNodeAtIndex(uint256 index) view returns(address) -func (_IEntitlementChecker *IEntitlementCheckerCallerSession) GetNodeAtIndex(index *big.Int) (common.Address, error) { - return _IEntitlementChecker.Contract.GetNodeAtIndex(&_IEntitlementChecker.CallOpts, index) -} - -// GetNodeCount is a free data retrieval call binding the contract method 0x39bf397e. -// -// Solidity: function getNodeCount() view returns(uint256) -func (_IEntitlementChecker *IEntitlementCheckerCaller) GetNodeCount(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _IEntitlementChecker.contract.Call(opts, &out, "getNodeCount") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// GetNodeCount is a free data retrieval call binding the contract method 0x39bf397e. -// -// Solidity: function getNodeCount() view returns(uint256) -func (_IEntitlementChecker *IEntitlementCheckerSession) GetNodeCount() (*big.Int, error) { - return _IEntitlementChecker.Contract.GetNodeCount(&_IEntitlementChecker.CallOpts) -} - -// GetNodeCount is a free data retrieval call binding the contract method 0x39bf397e. -// -// Solidity: function getNodeCount() view returns(uint256) -func (_IEntitlementChecker *IEntitlementCheckerCallerSession) GetNodeCount() (*big.Int, error) { - return _IEntitlementChecker.Contract.GetNodeCount(&_IEntitlementChecker.CallOpts) -} - -// GetNodesByOperator is a free data retrieval call binding the contract method 0x43024ac9. -// -// Solidity: function getNodesByOperator(address operator) view returns(address[]) -func (_IEntitlementChecker *IEntitlementCheckerCaller) GetNodesByOperator(opts *bind.CallOpts, operator common.Address) ([]common.Address, error) { - var out []interface{} - err := _IEntitlementChecker.contract.Call(opts, &out, "getNodesByOperator", operator) - - if err != nil { - return *new([]common.Address), err - } - - out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) - - return out0, err - -} - -// GetNodesByOperator is a free data retrieval call binding the contract method 0x43024ac9. -// -// Solidity: function getNodesByOperator(address operator) view returns(address[]) -func (_IEntitlementChecker *IEntitlementCheckerSession) GetNodesByOperator(operator common.Address) ([]common.Address, error) { - return _IEntitlementChecker.Contract.GetNodesByOperator(&_IEntitlementChecker.CallOpts, operator) -} - -// GetNodesByOperator is a free data retrieval call binding the contract method 0x43024ac9. -// -// Solidity: function getNodesByOperator(address operator) view returns(address[]) -func (_IEntitlementChecker *IEntitlementCheckerCallerSession) GetNodesByOperator(operator common.Address) ([]common.Address, error) { - return _IEntitlementChecker.Contract.GetNodesByOperator(&_IEntitlementChecker.CallOpts, operator) -} - -// GetRandomNodes is a free data retrieval call binding the contract method 0x4f845445. -// -// Solidity: function getRandomNodes(uint256 count) view returns(address[]) -func (_IEntitlementChecker *IEntitlementCheckerCaller) GetRandomNodes(opts *bind.CallOpts, count *big.Int) ([]common.Address, error) { - var out []interface{} - err := _IEntitlementChecker.contract.Call(opts, &out, "getRandomNodes", count) - - if err != nil { - return *new([]common.Address), err - } - - out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) - - return out0, err - -} - -// GetRandomNodes is a free data retrieval call binding the contract method 0x4f845445. -// -// Solidity: function getRandomNodes(uint256 count) view returns(address[]) -func (_IEntitlementChecker *IEntitlementCheckerSession) GetRandomNodes(count *big.Int) ([]common.Address, error) { - return _IEntitlementChecker.Contract.GetRandomNodes(&_IEntitlementChecker.CallOpts, count) -} - -// GetRandomNodes is a free data retrieval call binding the contract method 0x4f845445. -// -// Solidity: function getRandomNodes(uint256 count) view returns(address[]) -func (_IEntitlementChecker *IEntitlementCheckerCallerSession) GetRandomNodes(count *big.Int) ([]common.Address, error) { - return _IEntitlementChecker.Contract.GetRandomNodes(&_IEntitlementChecker.CallOpts, count) -} - -// IsValidNode is a free data retrieval call binding the contract method 0x9ebd11ef. -// -// Solidity: function isValidNode(address node) view returns(bool) -func (_IEntitlementChecker *IEntitlementCheckerCaller) IsValidNode(opts *bind.CallOpts, node common.Address) (bool, error) { - var out []interface{} - err := _IEntitlementChecker.contract.Call(opts, &out, "isValidNode", node) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// IsValidNode is a free data retrieval call binding the contract method 0x9ebd11ef. -// -// Solidity: function isValidNode(address node) view returns(bool) -func (_IEntitlementChecker *IEntitlementCheckerSession) IsValidNode(node common.Address) (bool, error) { - return _IEntitlementChecker.Contract.IsValidNode(&_IEntitlementChecker.CallOpts, node) -} - -// IsValidNode is a free data retrieval call binding the contract method 0x9ebd11ef. -// -// Solidity: function isValidNode(address node) view returns(bool) -func (_IEntitlementChecker *IEntitlementCheckerCallerSession) IsValidNode(node common.Address) (bool, error) { - return _IEntitlementChecker.Contract.IsValidNode(&_IEntitlementChecker.CallOpts, node) -} - -// RegisterNode is a paid mutator transaction binding the contract method 0x672d7a0d. -// -// Solidity: function registerNode(address node) returns() -func (_IEntitlementChecker *IEntitlementCheckerTransactor) RegisterNode(opts *bind.TransactOpts, node common.Address) (*types.Transaction, error) { - return _IEntitlementChecker.contract.Transact(opts, "registerNode", node) -} - -// RegisterNode is a paid mutator transaction binding the contract method 0x672d7a0d. -// -// Solidity: function registerNode(address node) returns() -func (_IEntitlementChecker *IEntitlementCheckerSession) RegisterNode(node common.Address) (*types.Transaction, error) { - return _IEntitlementChecker.Contract.RegisterNode(&_IEntitlementChecker.TransactOpts, node) -} - -// RegisterNode is a paid mutator transaction binding the contract method 0x672d7a0d. -// -// Solidity: function registerNode(address node) returns() -func (_IEntitlementChecker *IEntitlementCheckerTransactorSession) RegisterNode(node common.Address) (*types.Transaction, error) { - return _IEntitlementChecker.Contract.RegisterNode(&_IEntitlementChecker.TransactOpts, node) -} - -// RequestEntitlementCheck is a paid mutator transaction binding the contract method 0x541da4e5. -// -// Solidity: function requestEntitlementCheck(address callerAddress, bytes32 transactionId, uint256 roleId, address[] nodes) returns() -func (_IEntitlementChecker *IEntitlementCheckerTransactor) RequestEntitlementCheck(opts *bind.TransactOpts, callerAddress common.Address, transactionId [32]byte, roleId *big.Int, nodes []common.Address) (*types.Transaction, error) { - return _IEntitlementChecker.contract.Transact(opts, "requestEntitlementCheck", callerAddress, transactionId, roleId, nodes) -} - -// RequestEntitlementCheck is a paid mutator transaction binding the contract method 0x541da4e5. -// -// Solidity: function requestEntitlementCheck(address callerAddress, bytes32 transactionId, uint256 roleId, address[] nodes) returns() -func (_IEntitlementChecker *IEntitlementCheckerSession) RequestEntitlementCheck(callerAddress common.Address, transactionId [32]byte, roleId *big.Int, nodes []common.Address) (*types.Transaction, error) { - return _IEntitlementChecker.Contract.RequestEntitlementCheck(&_IEntitlementChecker.TransactOpts, callerAddress, transactionId, roleId, nodes) -} - -// RequestEntitlementCheck is a paid mutator transaction binding the contract method 0x541da4e5. -// -// Solidity: function requestEntitlementCheck(address callerAddress, bytes32 transactionId, uint256 roleId, address[] nodes) returns() -func (_IEntitlementChecker *IEntitlementCheckerTransactorSession) RequestEntitlementCheck(callerAddress common.Address, transactionId [32]byte, roleId *big.Int, nodes []common.Address) (*types.Transaction, error) { - return _IEntitlementChecker.Contract.RequestEntitlementCheck(&_IEntitlementChecker.TransactOpts, callerAddress, transactionId, roleId, nodes) -} - -// UnregisterNode is a paid mutator transaction binding the contract method 0xc5e41cf6. -// -// Solidity: function unregisterNode(address node) returns() -func (_IEntitlementChecker *IEntitlementCheckerTransactor) UnregisterNode(opts *bind.TransactOpts, node common.Address) (*types.Transaction, error) { - return _IEntitlementChecker.contract.Transact(opts, "unregisterNode", node) -} - -// UnregisterNode is a paid mutator transaction binding the contract method 0xc5e41cf6. -// -// Solidity: function unregisterNode(address node) returns() -func (_IEntitlementChecker *IEntitlementCheckerSession) UnregisterNode(node common.Address) (*types.Transaction, error) { - return _IEntitlementChecker.Contract.UnregisterNode(&_IEntitlementChecker.TransactOpts, node) -} - -// UnregisterNode is a paid mutator transaction binding the contract method 0xc5e41cf6. -// -// Solidity: function unregisterNode(address node) returns() -func (_IEntitlementChecker *IEntitlementCheckerTransactorSession) UnregisterNode(node common.Address) (*types.Transaction, error) { - return _IEntitlementChecker.Contract.UnregisterNode(&_IEntitlementChecker.TransactOpts, node) -} - -// IEntitlementCheckerEntitlementCheckRequestedIterator is returned from FilterEntitlementCheckRequested and is used to iterate over the raw logs and unpacked data for EntitlementCheckRequested events raised by the IEntitlementChecker contract. -type IEntitlementCheckerEntitlementCheckRequestedIterator struct { - Event *IEntitlementCheckerEntitlementCheckRequested // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *IEntitlementCheckerEntitlementCheckRequestedIterator) 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(IEntitlementCheckerEntitlementCheckRequested) - 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(IEntitlementCheckerEntitlementCheckRequested) - 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 *IEntitlementCheckerEntitlementCheckRequestedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *IEntitlementCheckerEntitlementCheckRequestedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// IEntitlementCheckerEntitlementCheckRequested represents a EntitlementCheckRequested event raised by the IEntitlementChecker contract. -type IEntitlementCheckerEntitlementCheckRequested struct { - CallerAddress common.Address - ContractAddress common.Address - TransactionId [32]byte - RoleId *big.Int - SelectedNodes []common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterEntitlementCheckRequested is a free log retrieval operation binding the contract event 0x4675e3cc15801ffde520a3076d6ad75c0c6dbe8f23bdbea1dd45b676caffe4f3. -// -// Solidity: event EntitlementCheckRequested(address callerAddress, address contractAddress, bytes32 transactionId, uint256 roleId, address[] selectedNodes) -func (_IEntitlementChecker *IEntitlementCheckerFilterer) FilterEntitlementCheckRequested(opts *bind.FilterOpts) (*IEntitlementCheckerEntitlementCheckRequestedIterator, error) { - - logs, sub, err := _IEntitlementChecker.contract.FilterLogs(opts, "EntitlementCheckRequested") - if err != nil { - return nil, err - } - return &IEntitlementCheckerEntitlementCheckRequestedIterator{contract: _IEntitlementChecker.contract, event: "EntitlementCheckRequested", logs: logs, sub: sub}, nil -} - -// WatchEntitlementCheckRequested is a free log subscription operation binding the contract event 0x4675e3cc15801ffde520a3076d6ad75c0c6dbe8f23bdbea1dd45b676caffe4f3. -// -// Solidity: event EntitlementCheckRequested(address callerAddress, address contractAddress, bytes32 transactionId, uint256 roleId, address[] selectedNodes) -func (_IEntitlementChecker *IEntitlementCheckerFilterer) WatchEntitlementCheckRequested(opts *bind.WatchOpts, sink chan<- *IEntitlementCheckerEntitlementCheckRequested) (event.Subscription, error) { - - logs, sub, err := _IEntitlementChecker.contract.WatchLogs(opts, "EntitlementCheckRequested") - 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(IEntitlementCheckerEntitlementCheckRequested) - if err := _IEntitlementChecker.contract.UnpackLog(event, "EntitlementCheckRequested", 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 -} - -// ParseEntitlementCheckRequested is a log parse operation binding the contract event 0x4675e3cc15801ffde520a3076d6ad75c0c6dbe8f23bdbea1dd45b676caffe4f3. -// -// Solidity: event EntitlementCheckRequested(address callerAddress, address contractAddress, bytes32 transactionId, uint256 roleId, address[] selectedNodes) -func (_IEntitlementChecker *IEntitlementCheckerFilterer) ParseEntitlementCheckRequested(log types.Log) (*IEntitlementCheckerEntitlementCheckRequested, error) { - event := new(IEntitlementCheckerEntitlementCheckRequested) - if err := _IEntitlementChecker.contract.UnpackLog(event, "EntitlementCheckRequested", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// IEntitlementCheckerNodeRegisteredIterator is returned from FilterNodeRegistered and is used to iterate over the raw logs and unpacked data for NodeRegistered events raised by the IEntitlementChecker contract. -type IEntitlementCheckerNodeRegisteredIterator struct { - Event *IEntitlementCheckerNodeRegistered // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *IEntitlementCheckerNodeRegisteredIterator) 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(IEntitlementCheckerNodeRegistered) - 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(IEntitlementCheckerNodeRegistered) - 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 *IEntitlementCheckerNodeRegisteredIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *IEntitlementCheckerNodeRegisteredIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// IEntitlementCheckerNodeRegistered represents a NodeRegistered event raised by the IEntitlementChecker contract. -type IEntitlementCheckerNodeRegistered struct { - NodeAddress common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterNodeRegistered is a free log retrieval operation binding the contract event 0x564728e6a7c8edd446557d94e0339d5e6ca2e05f42188914efdbdc87bcbbabf6. -// -// Solidity: event NodeRegistered(address indexed nodeAddress) -func (_IEntitlementChecker *IEntitlementCheckerFilterer) FilterNodeRegistered(opts *bind.FilterOpts, nodeAddress []common.Address) (*IEntitlementCheckerNodeRegisteredIterator, error) { - - var nodeAddressRule []interface{} - for _, nodeAddressItem := range nodeAddress { - nodeAddressRule = append(nodeAddressRule, nodeAddressItem) - } - - logs, sub, err := _IEntitlementChecker.contract.FilterLogs(opts, "NodeRegistered", nodeAddressRule) - if err != nil { - return nil, err - } - return &IEntitlementCheckerNodeRegisteredIterator{contract: _IEntitlementChecker.contract, event: "NodeRegistered", logs: logs, sub: sub}, nil -} - -// WatchNodeRegistered is a free log subscription operation binding the contract event 0x564728e6a7c8edd446557d94e0339d5e6ca2e05f42188914efdbdc87bcbbabf6. -// -// Solidity: event NodeRegistered(address indexed nodeAddress) -func (_IEntitlementChecker *IEntitlementCheckerFilterer) WatchNodeRegistered(opts *bind.WatchOpts, sink chan<- *IEntitlementCheckerNodeRegistered, nodeAddress []common.Address) (event.Subscription, error) { - - var nodeAddressRule []interface{} - for _, nodeAddressItem := range nodeAddress { - nodeAddressRule = append(nodeAddressRule, nodeAddressItem) - } - - logs, sub, err := _IEntitlementChecker.contract.WatchLogs(opts, "NodeRegistered", nodeAddressRule) - 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(IEntitlementCheckerNodeRegistered) - if err := _IEntitlementChecker.contract.UnpackLog(event, "NodeRegistered", 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 -} - -// ParseNodeRegistered is a log parse operation binding the contract event 0x564728e6a7c8edd446557d94e0339d5e6ca2e05f42188914efdbdc87bcbbabf6. -// -// Solidity: event NodeRegistered(address indexed nodeAddress) -func (_IEntitlementChecker *IEntitlementCheckerFilterer) ParseNodeRegistered(log types.Log) (*IEntitlementCheckerNodeRegistered, error) { - event := new(IEntitlementCheckerNodeRegistered) - if err := _IEntitlementChecker.contract.UnpackLog(event, "NodeRegistered", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// IEntitlementCheckerNodeUnregisteredIterator is returned from FilterNodeUnregistered and is used to iterate over the raw logs and unpacked data for NodeUnregistered events raised by the IEntitlementChecker contract. -type IEntitlementCheckerNodeUnregisteredIterator struct { - Event *IEntitlementCheckerNodeUnregistered // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *IEntitlementCheckerNodeUnregisteredIterator) 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(IEntitlementCheckerNodeUnregistered) - 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(IEntitlementCheckerNodeUnregistered) - 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 *IEntitlementCheckerNodeUnregisteredIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *IEntitlementCheckerNodeUnregisteredIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// IEntitlementCheckerNodeUnregistered represents a NodeUnregistered event raised by the IEntitlementChecker contract. -type IEntitlementCheckerNodeUnregistered struct { - NodeAddress common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterNodeUnregistered is a free log retrieval operation binding the contract event 0xb1864577e4f285436a80ebc833984755393e2450d58622a65fb4fce87ea3573a. -// -// Solidity: event NodeUnregistered(address indexed nodeAddress) -func (_IEntitlementChecker *IEntitlementCheckerFilterer) FilterNodeUnregistered(opts *bind.FilterOpts, nodeAddress []common.Address) (*IEntitlementCheckerNodeUnregisteredIterator, error) { - - var nodeAddressRule []interface{} - for _, nodeAddressItem := range nodeAddress { - nodeAddressRule = append(nodeAddressRule, nodeAddressItem) - } - - logs, sub, err := _IEntitlementChecker.contract.FilterLogs(opts, "NodeUnregistered", nodeAddressRule) - if err != nil { - return nil, err - } - return &IEntitlementCheckerNodeUnregisteredIterator{contract: _IEntitlementChecker.contract, event: "NodeUnregistered", logs: logs, sub: sub}, nil -} - -// WatchNodeUnregistered is a free log subscription operation binding the contract event 0xb1864577e4f285436a80ebc833984755393e2450d58622a65fb4fce87ea3573a. -// -// Solidity: event NodeUnregistered(address indexed nodeAddress) -func (_IEntitlementChecker *IEntitlementCheckerFilterer) WatchNodeUnregistered(opts *bind.WatchOpts, sink chan<- *IEntitlementCheckerNodeUnregistered, nodeAddress []common.Address) (event.Subscription, error) { - - var nodeAddressRule []interface{} - for _, nodeAddressItem := range nodeAddress { - nodeAddressRule = append(nodeAddressRule, nodeAddressItem) - } - - logs, sub, err := _IEntitlementChecker.contract.WatchLogs(opts, "NodeUnregistered", nodeAddressRule) - 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(IEntitlementCheckerNodeUnregistered) - if err := _IEntitlementChecker.contract.UnpackLog(event, "NodeUnregistered", 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 -} - -// ParseNodeUnregistered is a log parse operation binding the contract event 0xb1864577e4f285436a80ebc833984755393e2450d58622a65fb4fce87ea3573a. -// -// Solidity: event NodeUnregistered(address indexed nodeAddress) -func (_IEntitlementChecker *IEntitlementCheckerFilterer) ParseNodeUnregistered(log types.Log) (*IEntitlementCheckerNodeUnregistered, error) { - event := new(IEntitlementCheckerNodeUnregistered) - if err := _IEntitlementChecker.contract.UnpackLog(event, "NodeUnregistered", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} diff --git a/core/xchain/contracts/v3/i_wallet_link.go b/core/xchain/contracts/v3/i_wallet_link.go deleted file mode 100644 index 5a916d36b..000000000 --- a/core/xchain/contracts/v3/i_wallet_link.go +++ /dev/null @@ -1,680 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package v3 - -import ( - "errors" - "math/big" - "strings" - - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" -) - -// Reference imports to suppress errors if they are not otherwise used. -var ( - _ = errors.New - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription - _ = abi.ConvertType -) - -// IWalletLinkBaseLinkedWallet is an auto generated low-level Go binding around an user-defined struct. -type IWalletLinkBaseLinkedWallet struct { - Addr common.Address - Signature []byte -} - -// IWalletLinkMetaData contains all meta data concerning the IWalletLink contract. -var IWalletLinkMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"function\",\"name\":\"checkIfLinked\",\"inputs\":[{\"name\":\"rootKey\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"wallet\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getLatestNonceForRootKey\",\"inputs\":[{\"name\":\"rootKey\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getRootKeyForWallet\",\"inputs\":[{\"name\":\"wallet\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"rootKey\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getWalletsByRootKey\",\"inputs\":[{\"name\":\"rootKey\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"wallets\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"linkCallerToRootKey\",\"inputs\":[{\"name\":\"rootWallet\",\"type\":\"tuple\",\"internalType\":\"structIWalletLinkBase.LinkedWallet\",\"components\":[{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"linkWalletToRootKey\",\"inputs\":[{\"name\":\"wallet\",\"type\":\"tuple\",\"internalType\":\"structIWalletLinkBase.LinkedWallet\",\"components\":[{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"rootWallet\",\"type\":\"tuple\",\"internalType\":\"structIWalletLinkBase.LinkedWallet\",\"components\":[{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"removeLink\",\"inputs\":[{\"name\":\"wallet\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"rootWallet\",\"type\":\"tuple\",\"internalType\":\"structIWalletLinkBase.LinkedWallet\",\"components\":[{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"LinkWalletToRootKey\",\"inputs\":[{\"name\":\"wallet\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"rootKey\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RemoveLink\",\"inputs\":[{\"name\":\"wallet\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"secondWallet\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"WalletLink__CannotLinkToRootWallet\",\"inputs\":[{\"name\":\"wallet\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"rootKey\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"WalletLink__CannotLinkToSelf\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"WalletLink__CannotRemoveRootWallet\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"WalletLink__InvalidAddress\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"WalletLink__InvalidSignature\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"WalletLink__LinkAlreadyExists\",\"inputs\":[{\"name\":\"wallet\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"rootKey\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"WalletLink__LinkedToAnotherRootKey\",\"inputs\":[{\"name\":\"wallet\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"rootKey\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"WalletLink__NotLinked\",\"inputs\":[{\"name\":\"wallet\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"rootKey\",\"type\":\"address\",\"internalType\":\"address\"}]}]", -} - -// IWalletLinkABI is the input ABI used to generate the binding from. -// Deprecated: Use IWalletLinkMetaData.ABI instead. -var IWalletLinkABI = IWalletLinkMetaData.ABI - -// IWalletLink is an auto generated Go binding around an Ethereum contract. -type IWalletLink struct { - IWalletLinkCaller // Read-only binding to the contract - IWalletLinkTransactor // Write-only binding to the contract - IWalletLinkFilterer // Log filterer for contract events -} - -// IWalletLinkCaller is an auto generated read-only Go binding around an Ethereum contract. -type IWalletLinkCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// IWalletLinkTransactor is an auto generated write-only Go binding around an Ethereum contract. -type IWalletLinkTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// IWalletLinkFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type IWalletLinkFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// IWalletLinkSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type IWalletLinkSession struct { - Contract *IWalletLink // 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 -} - -// IWalletLinkCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type IWalletLinkCallerSession struct { - Contract *IWalletLinkCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// IWalletLinkTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type IWalletLinkTransactorSession struct { - Contract *IWalletLinkTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// IWalletLinkRaw is an auto generated low-level Go binding around an Ethereum contract. -type IWalletLinkRaw struct { - Contract *IWalletLink // Generic contract binding to access the raw methods on -} - -// IWalletLinkCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type IWalletLinkCallerRaw struct { - Contract *IWalletLinkCaller // Generic read-only contract binding to access the raw methods on -} - -// IWalletLinkTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type IWalletLinkTransactorRaw struct { - Contract *IWalletLinkTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewIWalletLink creates a new instance of IWalletLink, bound to a specific deployed contract. -func NewIWalletLink(address common.Address, backend bind.ContractBackend) (*IWalletLink, error) { - contract, err := bindIWalletLink(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &IWalletLink{IWalletLinkCaller: IWalletLinkCaller{contract: contract}, IWalletLinkTransactor: IWalletLinkTransactor{contract: contract}, IWalletLinkFilterer: IWalletLinkFilterer{contract: contract}}, nil -} - -// NewIWalletLinkCaller creates a new read-only instance of IWalletLink, bound to a specific deployed contract. -func NewIWalletLinkCaller(address common.Address, caller bind.ContractCaller) (*IWalletLinkCaller, error) { - contract, err := bindIWalletLink(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &IWalletLinkCaller{contract: contract}, nil -} - -// NewIWalletLinkTransactor creates a new write-only instance of IWalletLink, bound to a specific deployed contract. -func NewIWalletLinkTransactor(address common.Address, transactor bind.ContractTransactor) (*IWalletLinkTransactor, error) { - contract, err := bindIWalletLink(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &IWalletLinkTransactor{contract: contract}, nil -} - -// NewIWalletLinkFilterer creates a new log filterer instance of IWalletLink, bound to a specific deployed contract. -func NewIWalletLinkFilterer(address common.Address, filterer bind.ContractFilterer) (*IWalletLinkFilterer, error) { - contract, err := bindIWalletLink(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &IWalletLinkFilterer{contract: contract}, nil -} - -// bindIWalletLink binds a generic wrapper to an already deployed contract. -func bindIWalletLink(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := IWalletLinkMetaData.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 (_IWalletLink *IWalletLinkRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _IWalletLink.Contract.IWalletLinkCaller.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 (_IWalletLink *IWalletLinkRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _IWalletLink.Contract.IWalletLinkTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_IWalletLink *IWalletLinkRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _IWalletLink.Contract.IWalletLinkTransactor.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 (_IWalletLink *IWalletLinkCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _IWalletLink.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 (_IWalletLink *IWalletLinkTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _IWalletLink.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_IWalletLink *IWalletLinkTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _IWalletLink.Contract.contract.Transact(opts, method, params...) -} - -// CheckIfLinked is a free data retrieval call binding the contract method 0x912b9758. -// -// Solidity: function checkIfLinked(address rootKey, address wallet) view returns(bool) -func (_IWalletLink *IWalletLinkCaller) CheckIfLinked(opts *bind.CallOpts, rootKey common.Address, wallet common.Address) (bool, error) { - var out []interface{} - err := _IWalletLink.contract.Call(opts, &out, "checkIfLinked", rootKey, wallet) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// CheckIfLinked is a free data retrieval call binding the contract method 0x912b9758. -// -// Solidity: function checkIfLinked(address rootKey, address wallet) view returns(bool) -func (_IWalletLink *IWalletLinkSession) CheckIfLinked(rootKey common.Address, wallet common.Address) (bool, error) { - return _IWalletLink.Contract.CheckIfLinked(&_IWalletLink.CallOpts, rootKey, wallet) -} - -// CheckIfLinked is a free data retrieval call binding the contract method 0x912b9758. -// -// Solidity: function checkIfLinked(address rootKey, address wallet) view returns(bool) -func (_IWalletLink *IWalletLinkCallerSession) CheckIfLinked(rootKey common.Address, wallet common.Address) (bool, error) { - return _IWalletLink.Contract.CheckIfLinked(&_IWalletLink.CallOpts, rootKey, wallet) -} - -// GetLatestNonceForRootKey is a free data retrieval call binding the contract method 0x20a00ac8. -// -// Solidity: function getLatestNonceForRootKey(address rootKey) view returns(uint256) -func (_IWalletLink *IWalletLinkCaller) GetLatestNonceForRootKey(opts *bind.CallOpts, rootKey common.Address) (*big.Int, error) { - var out []interface{} - err := _IWalletLink.contract.Call(opts, &out, "getLatestNonceForRootKey", rootKey) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// GetLatestNonceForRootKey is a free data retrieval call binding the contract method 0x20a00ac8. -// -// Solidity: function getLatestNonceForRootKey(address rootKey) view returns(uint256) -func (_IWalletLink *IWalletLinkSession) GetLatestNonceForRootKey(rootKey common.Address) (*big.Int, error) { - return _IWalletLink.Contract.GetLatestNonceForRootKey(&_IWalletLink.CallOpts, rootKey) -} - -// GetLatestNonceForRootKey is a free data retrieval call binding the contract method 0x20a00ac8. -// -// Solidity: function getLatestNonceForRootKey(address rootKey) view returns(uint256) -func (_IWalletLink *IWalletLinkCallerSession) GetLatestNonceForRootKey(rootKey common.Address) (*big.Int, error) { - return _IWalletLink.Contract.GetLatestNonceForRootKey(&_IWalletLink.CallOpts, rootKey) -} - -// GetRootKeyForWallet is a free data retrieval call binding the contract method 0xf8210398. -// -// Solidity: function getRootKeyForWallet(address wallet) view returns(address rootKey) -func (_IWalletLink *IWalletLinkCaller) GetRootKeyForWallet(opts *bind.CallOpts, wallet common.Address) (common.Address, error) { - var out []interface{} - err := _IWalletLink.contract.Call(opts, &out, "getRootKeyForWallet", wallet) - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// GetRootKeyForWallet is a free data retrieval call binding the contract method 0xf8210398. -// -// Solidity: function getRootKeyForWallet(address wallet) view returns(address rootKey) -func (_IWalletLink *IWalletLinkSession) GetRootKeyForWallet(wallet common.Address) (common.Address, error) { - return _IWalletLink.Contract.GetRootKeyForWallet(&_IWalletLink.CallOpts, wallet) -} - -// GetRootKeyForWallet is a free data retrieval call binding the contract method 0xf8210398. -// -// Solidity: function getRootKeyForWallet(address wallet) view returns(address rootKey) -func (_IWalletLink *IWalletLinkCallerSession) GetRootKeyForWallet(wallet common.Address) (common.Address, error) { - return _IWalletLink.Contract.GetRootKeyForWallet(&_IWalletLink.CallOpts, wallet) -} - -// GetWalletsByRootKey is a free data retrieval call binding the contract method 0x02345b98. -// -// Solidity: function getWalletsByRootKey(address rootKey) view returns(address[] wallets) -func (_IWalletLink *IWalletLinkCaller) GetWalletsByRootKey(opts *bind.CallOpts, rootKey common.Address) ([]common.Address, error) { - var out []interface{} - err := _IWalletLink.contract.Call(opts, &out, "getWalletsByRootKey", rootKey) - - if err != nil { - return *new([]common.Address), err - } - - out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) - - return out0, err - -} - -// GetWalletsByRootKey is a free data retrieval call binding the contract method 0x02345b98. -// -// Solidity: function getWalletsByRootKey(address rootKey) view returns(address[] wallets) -func (_IWalletLink *IWalletLinkSession) GetWalletsByRootKey(rootKey common.Address) ([]common.Address, error) { - return _IWalletLink.Contract.GetWalletsByRootKey(&_IWalletLink.CallOpts, rootKey) -} - -// GetWalletsByRootKey is a free data retrieval call binding the contract method 0x02345b98. -// -// Solidity: function getWalletsByRootKey(address rootKey) view returns(address[] wallets) -func (_IWalletLink *IWalletLinkCallerSession) GetWalletsByRootKey(rootKey common.Address) ([]common.Address, error) { - return _IWalletLink.Contract.GetWalletsByRootKey(&_IWalletLink.CallOpts, rootKey) -} - -// LinkCallerToRootKey is a paid mutator transaction binding the contract method 0xe65dfe9d. -// -// Solidity: function linkCallerToRootKey((address,bytes) rootWallet, uint256 nonce) returns() -func (_IWalletLink *IWalletLinkTransactor) LinkCallerToRootKey(opts *bind.TransactOpts, rootWallet IWalletLinkBaseLinkedWallet, nonce *big.Int) (*types.Transaction, error) { - return _IWalletLink.contract.Transact(opts, "linkCallerToRootKey", rootWallet, nonce) -} - -// LinkCallerToRootKey is a paid mutator transaction binding the contract method 0xe65dfe9d. -// -// Solidity: function linkCallerToRootKey((address,bytes) rootWallet, uint256 nonce) returns() -func (_IWalletLink *IWalletLinkSession) LinkCallerToRootKey(rootWallet IWalletLinkBaseLinkedWallet, nonce *big.Int) (*types.Transaction, error) { - return _IWalletLink.Contract.LinkCallerToRootKey(&_IWalletLink.TransactOpts, rootWallet, nonce) -} - -// LinkCallerToRootKey is a paid mutator transaction binding the contract method 0xe65dfe9d. -// -// Solidity: function linkCallerToRootKey((address,bytes) rootWallet, uint256 nonce) returns() -func (_IWalletLink *IWalletLinkTransactorSession) LinkCallerToRootKey(rootWallet IWalletLinkBaseLinkedWallet, nonce *big.Int) (*types.Transaction, error) { - return _IWalletLink.Contract.LinkCallerToRootKey(&_IWalletLink.TransactOpts, rootWallet, nonce) -} - -// LinkWalletToRootKey is a paid mutator transaction binding the contract method 0x1a31fc8d. -// -// Solidity: function linkWalletToRootKey((address,bytes) wallet, (address,bytes) rootWallet, uint256 nonce) returns() -func (_IWalletLink *IWalletLinkTransactor) LinkWalletToRootKey(opts *bind.TransactOpts, wallet IWalletLinkBaseLinkedWallet, rootWallet IWalletLinkBaseLinkedWallet, nonce *big.Int) (*types.Transaction, error) { - return _IWalletLink.contract.Transact(opts, "linkWalletToRootKey", wallet, rootWallet, nonce) -} - -// LinkWalletToRootKey is a paid mutator transaction binding the contract method 0x1a31fc8d. -// -// Solidity: function linkWalletToRootKey((address,bytes) wallet, (address,bytes) rootWallet, uint256 nonce) returns() -func (_IWalletLink *IWalletLinkSession) LinkWalletToRootKey(wallet IWalletLinkBaseLinkedWallet, rootWallet IWalletLinkBaseLinkedWallet, nonce *big.Int) (*types.Transaction, error) { - return _IWalletLink.Contract.LinkWalletToRootKey(&_IWalletLink.TransactOpts, wallet, rootWallet, nonce) -} - -// LinkWalletToRootKey is a paid mutator transaction binding the contract method 0x1a31fc8d. -// -// Solidity: function linkWalletToRootKey((address,bytes) wallet, (address,bytes) rootWallet, uint256 nonce) returns() -func (_IWalletLink *IWalletLinkTransactorSession) LinkWalletToRootKey(wallet IWalletLinkBaseLinkedWallet, rootWallet IWalletLinkBaseLinkedWallet, nonce *big.Int) (*types.Transaction, error) { - return _IWalletLink.Contract.LinkWalletToRootKey(&_IWalletLink.TransactOpts, wallet, rootWallet, nonce) -} - -// RemoveLink is a paid mutator transaction binding the contract method 0xd80bd3b9. -// -// Solidity: function removeLink(address wallet, (address,bytes) rootWallet, uint256 nonce) returns() -func (_IWalletLink *IWalletLinkTransactor) RemoveLink(opts *bind.TransactOpts, wallet common.Address, rootWallet IWalletLinkBaseLinkedWallet, nonce *big.Int) (*types.Transaction, error) { - return _IWalletLink.contract.Transact(opts, "removeLink", wallet, rootWallet, nonce) -} - -// RemoveLink is a paid mutator transaction binding the contract method 0xd80bd3b9. -// -// Solidity: function removeLink(address wallet, (address,bytes) rootWallet, uint256 nonce) returns() -func (_IWalletLink *IWalletLinkSession) RemoveLink(wallet common.Address, rootWallet IWalletLinkBaseLinkedWallet, nonce *big.Int) (*types.Transaction, error) { - return _IWalletLink.Contract.RemoveLink(&_IWalletLink.TransactOpts, wallet, rootWallet, nonce) -} - -// RemoveLink is a paid mutator transaction binding the contract method 0xd80bd3b9. -// -// Solidity: function removeLink(address wallet, (address,bytes) rootWallet, uint256 nonce) returns() -func (_IWalletLink *IWalletLinkTransactorSession) RemoveLink(wallet common.Address, rootWallet IWalletLinkBaseLinkedWallet, nonce *big.Int) (*types.Transaction, error) { - return _IWalletLink.Contract.RemoveLink(&_IWalletLink.TransactOpts, wallet, rootWallet, nonce) -} - -// IWalletLinkLinkWalletToRootKeyIterator is returned from FilterLinkWalletToRootKey and is used to iterate over the raw logs and unpacked data for LinkWalletToRootKey events raised by the IWalletLink contract. -type IWalletLinkLinkWalletToRootKeyIterator struct { - Event *IWalletLinkLinkWalletToRootKey // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *IWalletLinkLinkWalletToRootKeyIterator) 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(IWalletLinkLinkWalletToRootKey) - 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(IWalletLinkLinkWalletToRootKey) - 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 *IWalletLinkLinkWalletToRootKeyIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *IWalletLinkLinkWalletToRootKeyIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// IWalletLinkLinkWalletToRootKey represents a LinkWalletToRootKey event raised by the IWalletLink contract. -type IWalletLinkLinkWalletToRootKey struct { - Wallet common.Address - RootKey common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterLinkWalletToRootKey is a free log retrieval operation binding the contract event 0x64126824352170c4025060d1f6e215159635e4b08e649830695f26ef6d2b5721. -// -// Solidity: event LinkWalletToRootKey(address indexed wallet, address indexed rootKey) -func (_IWalletLink *IWalletLinkFilterer) FilterLinkWalletToRootKey(opts *bind.FilterOpts, wallet []common.Address, rootKey []common.Address) (*IWalletLinkLinkWalletToRootKeyIterator, error) { - - var walletRule []interface{} - for _, walletItem := range wallet { - walletRule = append(walletRule, walletItem) - } - var rootKeyRule []interface{} - for _, rootKeyItem := range rootKey { - rootKeyRule = append(rootKeyRule, rootKeyItem) - } - - logs, sub, err := _IWalletLink.contract.FilterLogs(opts, "LinkWalletToRootKey", walletRule, rootKeyRule) - if err != nil { - return nil, err - } - return &IWalletLinkLinkWalletToRootKeyIterator{contract: _IWalletLink.contract, event: "LinkWalletToRootKey", logs: logs, sub: sub}, nil -} - -// WatchLinkWalletToRootKey is a free log subscription operation binding the contract event 0x64126824352170c4025060d1f6e215159635e4b08e649830695f26ef6d2b5721. -// -// Solidity: event LinkWalletToRootKey(address indexed wallet, address indexed rootKey) -func (_IWalletLink *IWalletLinkFilterer) WatchLinkWalletToRootKey(opts *bind.WatchOpts, sink chan<- *IWalletLinkLinkWalletToRootKey, wallet []common.Address, rootKey []common.Address) (event.Subscription, error) { - - var walletRule []interface{} - for _, walletItem := range wallet { - walletRule = append(walletRule, walletItem) - } - var rootKeyRule []interface{} - for _, rootKeyItem := range rootKey { - rootKeyRule = append(rootKeyRule, rootKeyItem) - } - - logs, sub, err := _IWalletLink.contract.WatchLogs(opts, "LinkWalletToRootKey", walletRule, rootKeyRule) - 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(IWalletLinkLinkWalletToRootKey) - if err := _IWalletLink.contract.UnpackLog(event, "LinkWalletToRootKey", 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 -} - -// ParseLinkWalletToRootKey is a log parse operation binding the contract event 0x64126824352170c4025060d1f6e215159635e4b08e649830695f26ef6d2b5721. -// -// Solidity: event LinkWalletToRootKey(address indexed wallet, address indexed rootKey) -func (_IWalletLink *IWalletLinkFilterer) ParseLinkWalletToRootKey(log types.Log) (*IWalletLinkLinkWalletToRootKey, error) { - event := new(IWalletLinkLinkWalletToRootKey) - if err := _IWalletLink.contract.UnpackLog(event, "LinkWalletToRootKey", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// IWalletLinkRemoveLinkIterator is returned from FilterRemoveLink and is used to iterate over the raw logs and unpacked data for RemoveLink events raised by the IWalletLink contract. -type IWalletLinkRemoveLinkIterator struct { - Event *IWalletLinkRemoveLink // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *IWalletLinkRemoveLinkIterator) 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(IWalletLinkRemoveLink) - 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(IWalletLinkRemoveLink) - 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 *IWalletLinkRemoveLinkIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *IWalletLinkRemoveLinkIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// IWalletLinkRemoveLink represents a RemoveLink event raised by the IWalletLink contract. -type IWalletLinkRemoveLink struct { - Wallet common.Address - SecondWallet common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterRemoveLink is a free log retrieval operation binding the contract event 0x9a9d98629b39adf596077fc95a0712ba55c38f40a354e99d366a10f9c3e27da2. -// -// Solidity: event RemoveLink(address indexed wallet, address indexed secondWallet) -func (_IWalletLink *IWalletLinkFilterer) FilterRemoveLink(opts *bind.FilterOpts, wallet []common.Address, secondWallet []common.Address) (*IWalletLinkRemoveLinkIterator, error) { - - var walletRule []interface{} - for _, walletItem := range wallet { - walletRule = append(walletRule, walletItem) - } - var secondWalletRule []interface{} - for _, secondWalletItem := range secondWallet { - secondWalletRule = append(secondWalletRule, secondWalletItem) - } - - logs, sub, err := _IWalletLink.contract.FilterLogs(opts, "RemoveLink", walletRule, secondWalletRule) - if err != nil { - return nil, err - } - return &IWalletLinkRemoveLinkIterator{contract: _IWalletLink.contract, event: "RemoveLink", logs: logs, sub: sub}, nil -} - -// WatchRemoveLink is a free log subscription operation binding the contract event 0x9a9d98629b39adf596077fc95a0712ba55c38f40a354e99d366a10f9c3e27da2. -// -// Solidity: event RemoveLink(address indexed wallet, address indexed secondWallet) -func (_IWalletLink *IWalletLinkFilterer) WatchRemoveLink(opts *bind.WatchOpts, sink chan<- *IWalletLinkRemoveLink, wallet []common.Address, secondWallet []common.Address) (event.Subscription, error) { - - var walletRule []interface{} - for _, walletItem := range wallet { - walletRule = append(walletRule, walletItem) - } - var secondWalletRule []interface{} - for _, secondWalletItem := range secondWallet { - secondWalletRule = append(secondWalletRule, secondWalletItem) - } - - logs, sub, err := _IWalletLink.contract.WatchLogs(opts, "RemoveLink", walletRule, secondWalletRule) - 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(IWalletLinkRemoveLink) - if err := _IWalletLink.contract.UnpackLog(event, "RemoveLink", 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 -} - -// ParseRemoveLink is a log parse operation binding the contract event 0x9a9d98629b39adf596077fc95a0712ba55c38f40a354e99d366a10f9c3e27da2. -// -// Solidity: event RemoveLink(address indexed wallet, address indexed secondWallet) -func (_IWalletLink *IWalletLinkFilterer) ParseRemoveLink(log types.Log) (*IWalletLinkRemoveLink, error) { - event := new(IWalletLinkRemoveLink) - if err := _IWalletLink.contract.UnpackLog(event, "RemoveLink", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} diff --git a/core/xchain/contracts/v3/mock_custom_entitlement.go b/core/xchain/contracts/v3/mock_custom_entitlement.go deleted file mode 100644 index 0d07db1e2..000000000 --- a/core/xchain/contracts/v3/mock_custom_entitlement.go +++ /dev/null @@ -1,255 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package v3 - -import ( - "errors" - "math/big" - "strings" - - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" -) - -// Reference imports to suppress errors if they are not otherwise used. -var ( - _ = errors.New - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription - _ = abi.ConvertType -) - -// MockCustomEntitlementMetaData contains all meta data concerning the MockCustomEntitlement contract. -var MockCustomEntitlementMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"isEntitled\",\"inputs\":[{\"name\":\"user\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"setEntitled\",\"inputs\":[{\"name\":\"user\",\"type\":\"address[]\",\"internalType\":\"address[]\"},{\"name\":\"userIsEntitled\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"}]", - Bin: "0x608060405234801561001057600080fd5b506102c1806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80633f4c4d831461003b578063ddc6e68e14610050575b600080fd5b61004e6100493660046101e0565b610077565b005b61006361005e366004610237565b6100c4565b604051901515815260200160405180910390f35b806000808460405160200161008c9190610274565b60408051808303601f19018152918152815160209283012083529082019290925201600020805460ff19169115159190911790555050565b6000806000836040516020016100da9190610274565b60408051601f198184030181529181528151602092830120835290820192909252016000205460ff1692915050565b634e487b7160e01b600052604160045260246000fd5b80356001600160a01b038116811461013657600080fd5b919050565b600082601f83011261014c57600080fd5b8135602067ffffffffffffffff8083111561016957610169610109565b8260051b604051601f19603f8301168101818110848211171561018e5761018e610109565b60405293845260208187018101949081019250878511156101ae57600080fd5b6020870191505b848210156101d5576101c68261011f565b835291830191908301906101b5565b979650505050505050565b600080604083850312156101f357600080fd5b823567ffffffffffffffff81111561020a57600080fd5b6102168582860161013b565b9250506020830135801515811461022c57600080fd5b809150509250929050565b60006020828403121561024957600080fd5b813567ffffffffffffffff81111561026057600080fd5b61026c8482850161013b565b949350505050565b6020808252825182820181905260009190848201906040850190845b818110156102b55783516001600160a01b031683529284019291840191600101610290565b5090969550505050505056", -} - -// MockCustomEntitlementABI is the input ABI used to generate the binding from. -// Deprecated: Use MockCustomEntitlementMetaData.ABI instead. -var MockCustomEntitlementABI = MockCustomEntitlementMetaData.ABI - -// MockCustomEntitlementBin is the compiled bytecode used for deploying new contracts. -// Deprecated: Use MockCustomEntitlementMetaData.Bin instead. -var MockCustomEntitlementBin = MockCustomEntitlementMetaData.Bin - -// DeployMockCustomEntitlement deploys a new Ethereum contract, binding an instance of MockCustomEntitlement to it. -func DeployMockCustomEntitlement(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *MockCustomEntitlement, error) { - parsed, err := MockCustomEntitlementMetaData.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(MockCustomEntitlementBin), backend) - if err != nil { - return common.Address{}, nil, nil, err - } - return address, tx, &MockCustomEntitlement{MockCustomEntitlementCaller: MockCustomEntitlementCaller{contract: contract}, MockCustomEntitlementTransactor: MockCustomEntitlementTransactor{contract: contract}, MockCustomEntitlementFilterer: MockCustomEntitlementFilterer{contract: contract}}, nil -} - -// MockCustomEntitlement is an auto generated Go binding around an Ethereum contract. -type MockCustomEntitlement struct { - MockCustomEntitlementCaller // Read-only binding to the contract - MockCustomEntitlementTransactor // Write-only binding to the contract - MockCustomEntitlementFilterer // Log filterer for contract events -} - -// MockCustomEntitlementCaller is an auto generated read-only Go binding around an Ethereum contract. -type MockCustomEntitlementCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// MockCustomEntitlementTransactor is an auto generated write-only Go binding around an Ethereum contract. -type MockCustomEntitlementTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// MockCustomEntitlementFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type MockCustomEntitlementFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// MockCustomEntitlementSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type MockCustomEntitlementSession struct { - Contract *MockCustomEntitlement // 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 -} - -// MockCustomEntitlementCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type MockCustomEntitlementCallerSession struct { - Contract *MockCustomEntitlementCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// MockCustomEntitlementTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type MockCustomEntitlementTransactorSession struct { - Contract *MockCustomEntitlementTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// MockCustomEntitlementRaw is an auto generated low-level Go binding around an Ethereum contract. -type MockCustomEntitlementRaw struct { - Contract *MockCustomEntitlement // Generic contract binding to access the raw methods on -} - -// MockCustomEntitlementCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type MockCustomEntitlementCallerRaw struct { - Contract *MockCustomEntitlementCaller // Generic read-only contract binding to access the raw methods on -} - -// MockCustomEntitlementTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type MockCustomEntitlementTransactorRaw struct { - Contract *MockCustomEntitlementTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewMockCustomEntitlement creates a new instance of MockCustomEntitlement, bound to a specific deployed contract. -func NewMockCustomEntitlement(address common.Address, backend bind.ContractBackend) (*MockCustomEntitlement, error) { - contract, err := bindMockCustomEntitlement(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &MockCustomEntitlement{MockCustomEntitlementCaller: MockCustomEntitlementCaller{contract: contract}, MockCustomEntitlementTransactor: MockCustomEntitlementTransactor{contract: contract}, MockCustomEntitlementFilterer: MockCustomEntitlementFilterer{contract: contract}}, nil -} - -// NewMockCustomEntitlementCaller creates a new read-only instance of MockCustomEntitlement, bound to a specific deployed contract. -func NewMockCustomEntitlementCaller(address common.Address, caller bind.ContractCaller) (*MockCustomEntitlementCaller, error) { - contract, err := bindMockCustomEntitlement(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &MockCustomEntitlementCaller{contract: contract}, nil -} - -// NewMockCustomEntitlementTransactor creates a new write-only instance of MockCustomEntitlement, bound to a specific deployed contract. -func NewMockCustomEntitlementTransactor(address common.Address, transactor bind.ContractTransactor) (*MockCustomEntitlementTransactor, error) { - contract, err := bindMockCustomEntitlement(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &MockCustomEntitlementTransactor{contract: contract}, nil -} - -// NewMockCustomEntitlementFilterer creates a new log filterer instance of MockCustomEntitlement, bound to a specific deployed contract. -func NewMockCustomEntitlementFilterer(address common.Address, filterer bind.ContractFilterer) (*MockCustomEntitlementFilterer, error) { - contract, err := bindMockCustomEntitlement(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &MockCustomEntitlementFilterer{contract: contract}, nil -} - -// bindMockCustomEntitlement binds a generic wrapper to an already deployed contract. -func bindMockCustomEntitlement(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := MockCustomEntitlementMetaData.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 (_MockCustomEntitlement *MockCustomEntitlementRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _MockCustomEntitlement.Contract.MockCustomEntitlementCaller.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 (_MockCustomEntitlement *MockCustomEntitlementRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _MockCustomEntitlement.Contract.MockCustomEntitlementTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_MockCustomEntitlement *MockCustomEntitlementRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _MockCustomEntitlement.Contract.MockCustomEntitlementTransactor.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 (_MockCustomEntitlement *MockCustomEntitlementCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _MockCustomEntitlement.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 (_MockCustomEntitlement *MockCustomEntitlementTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _MockCustomEntitlement.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_MockCustomEntitlement *MockCustomEntitlementTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _MockCustomEntitlement.Contract.contract.Transact(opts, method, params...) -} - -// IsEntitled is a free data retrieval call binding the contract method 0xddc6e68e. -// -// Solidity: function isEntitled(address[] user) view returns(bool) -func (_MockCustomEntitlement *MockCustomEntitlementCaller) IsEntitled(opts *bind.CallOpts, user []common.Address) (bool, error) { - var out []interface{} - err := _MockCustomEntitlement.contract.Call(opts, &out, "isEntitled", user) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// IsEntitled is a free data retrieval call binding the contract method 0xddc6e68e. -// -// Solidity: function isEntitled(address[] user) view returns(bool) -func (_MockCustomEntitlement *MockCustomEntitlementSession) IsEntitled(user []common.Address) (bool, error) { - return _MockCustomEntitlement.Contract.IsEntitled(&_MockCustomEntitlement.CallOpts, user) -} - -// IsEntitled is a free data retrieval call binding the contract method 0xddc6e68e. -// -// Solidity: function isEntitled(address[] user) view returns(bool) -func (_MockCustomEntitlement *MockCustomEntitlementCallerSession) IsEntitled(user []common.Address) (bool, error) { - return _MockCustomEntitlement.Contract.IsEntitled(&_MockCustomEntitlement.CallOpts, user) -} - -// SetEntitled is a paid mutator transaction binding the contract method 0x3f4c4d83. -// -// Solidity: function setEntitled(address[] user, bool userIsEntitled) returns() -func (_MockCustomEntitlement *MockCustomEntitlementTransactor) SetEntitled(opts *bind.TransactOpts, user []common.Address, userIsEntitled bool) (*types.Transaction, error) { - return _MockCustomEntitlement.contract.Transact(opts, "setEntitled", user, userIsEntitled) -} - -// SetEntitled is a paid mutator transaction binding the contract method 0x3f4c4d83. -// -// Solidity: function setEntitled(address[] user, bool userIsEntitled) returns() -func (_MockCustomEntitlement *MockCustomEntitlementSession) SetEntitled(user []common.Address, userIsEntitled bool) (*types.Transaction, error) { - return _MockCustomEntitlement.Contract.SetEntitled(&_MockCustomEntitlement.TransactOpts, user, userIsEntitled) -} - -// SetEntitled is a paid mutator transaction binding the contract method 0x3f4c4d83. -// -// Solidity: function setEntitled(address[] user, bool userIsEntitled) returns() -func (_MockCustomEntitlement *MockCustomEntitlementTransactorSession) SetEntitled(user []common.Address, userIsEntitled bool) (*types.Transaction, error) { - return _MockCustomEntitlement.Contract.SetEntitled(&_MockCustomEntitlement.TransactOpts, user, userIsEntitled) -} diff --git a/core/xchain/contracts/v3/mock_entitlement_checker.go b/core/xchain/contracts/v3/mock_entitlement_checker.go deleted file mode 100644 index 89af97ba7..000000000 --- a/core/xchain/contracts/v3/mock_entitlement_checker.go +++ /dev/null @@ -1,2949 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package v3 - -import ( - "errors" - "math/big" - "strings" - - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" -) - -// Reference imports to suppress errors if they are not otherwise used. -var ( - _ = errors.New - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription - _ = abi.ConvertType -) - -// MockEntitlementCheckerMetaData contains all meta data concerning the MockEntitlementChecker contract. -var MockEntitlementCheckerMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"approvedOperators\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"__EntitlementChecker_init\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"__NodeOperator_init\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"getClaimAddressForOperator\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getCommissionRate\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getNodeAtIndex\",\"inputs\":[{\"name\":\"index\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getNodeCount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getNodesByOperator\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperatorStatus\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"enumNodeOperatorStatus\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperators\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getRandomNodes\",\"inputs\":[{\"name\":\"count\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isOperator\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isValidNode\",\"inputs\":[{\"name\":\"node\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"registerNode\",\"inputs\":[{\"name\":\"node\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"registerOperator\",\"inputs\":[{\"name\":\"claimer\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"requestEntitlementCheck\",\"inputs\":[{\"name\":\"callerAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"transactionId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"roleId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"nodes\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setClaimAddressForOperator\",\"inputs\":[{\"name\":\"claimer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setCommissionRate\",\"inputs\":[{\"name\":\"rateBps\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setOperatorStatus\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"newStatus\",\"type\":\"uint8\",\"internalType\":\"enumNodeOperatorStatus\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"unregisterNode\",\"inputs\":[{\"name\":\"node\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"Approval\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"approved\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"tokenId\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ApprovalForAll\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"approved\",\"type\":\"bool\",\"indexed\":false,\"internalType\":\"bool\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ConsecutiveTransfer\",\"inputs\":[{\"name\":\"fromTokenId\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"toTokenId\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"EntitlementCheckRequested\",\"inputs\":[{\"name\":\"callerAddress\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"contractAddress\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"transactionId\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"roleId\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"selectedNodes\",\"type\":\"address[]\",\"indexed\":false,\"internalType\":\"address[]\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"InterfaceAdded\",\"inputs\":[{\"name\":\"interfaceId\",\"type\":\"bytes4\",\"indexed\":true,\"internalType\":\"bytes4\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"InterfaceRemoved\",\"inputs\":[{\"name\":\"interfaceId\",\"type\":\"bytes4\",\"indexed\":true,\"internalType\":\"bytes4\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"NodeRegistered\",\"inputs\":[{\"name\":\"nodeAddress\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"NodeUnregistered\",\"inputs\":[{\"name\":\"nodeAddress\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorClaimAddressChanged\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"claimAddress\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorCommissionChanged\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"commission\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorRegistered\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorStatusChanged\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newStatus\",\"type\":\"uint8\",\"indexed\":true,\"internalType\":\"enumNodeOperatorStatus\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Transfer\",\"inputs\":[{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"tokenId\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"ApprovalCallerNotOwnerNorApproved\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ApprovalQueryForNonexistentToken\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"BalanceQueryForZeroAddress\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EntitlementChecker_InsufficientNumberOfNodes\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EntitlementChecker_InvalidNodeOperator\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EntitlementChecker_InvalidOperator\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EntitlementChecker_NodeAlreadyRegistered\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EntitlementChecker_NodeNotRegistered\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EntitlementChecker_OperatorNotActive\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Initializable_InInitializingState\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Initializable_NotInInitializingState\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Introspection_AlreadySupported\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Introspection_NotSupported\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"MintERC2309QuantityExceedsLimit\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"MintToZeroAddress\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"MintZeroQuantity\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NodeOperator__AlreadyDelegated\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"NodeOperator__AlreadyRegistered\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NodeOperator__ClaimAddressNotChanged\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NodeOperator__InvalidAddress\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NodeOperator__InvalidCommissionRate\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NodeOperator__InvalidOperator\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NodeOperator__InvalidSpace\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NodeOperator__InvalidStakeRequirement\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NodeOperator__InvalidStatusTransition\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NodeOperator__NotClaimer\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NodeOperator__NotEnoughStake\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NodeOperator__NotRegistered\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NodeOperator__NotTransferable\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NodeOperator__StatusNotChanged\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Ownable__NotOwner\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"Ownable__ZeroAddress\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OwnerQueryForNonexistentToken\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OwnershipNotInitializedForExtraData\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"TransferCallerNotOwnerNorApproved\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"TransferFromIncorrectOwner\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"TransferToNonERC721ReceiverImplementer\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"TransferToZeroAddress\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"URIQueryForNonexistentToken\",\"inputs\":[]}]", - Bin: "0x60806040523480156200001157600080fd5b50604051620021c6380380620021c6833981016040819052620000349162000687565b6200003e62000230565b6200004933620002d8565b6200005b63232cd89f60e21b620003a6565b6200006833600162000486565b7f988e8266be98e92aff755bdd688f8f4a2421e26daa6089c7e2668053a3bf550060005b82518110156200022757620000c2838281518110620000af57620000af62000759565b60209081029190910101518390620005e2565b506002826002016000858481518110620000e057620000e062000759565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191660018360038111156200012057620001206200076f565b02179055503382600401600085848151811062000141576200014162000759565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b03160217905550620001cb838281518110620001a657620001a662000759565b60209081029190910181015133600090815260058601909252604090912090620005e2565b50828181518110620001e157620001e162000759565b60200260200101516001600160a01b03167f4d0eb1f4bac8744fd2be119845e23b3befc88094b42bcda1204c65694a00f9e560405160405180910390a26001016200008c565b50505062000785565b7f59b501c3653afc186af7d48dda36cf6732bd21629a6295693664240a6ef520008054640100000000900460ff16156200027d576040516366008a2d60e01b815260040160405180910390fd5b805463ffffffff9081161015620002d557805463ffffffff191663ffffffff90811782556040519081527fe9c9b456cb2994b80aeef036cf59d26e9617df80f816a6ee5a5b4166e07e2f5c9060200160405180910390a15b50565b60006200030c7f4675fa8241f86f37157864d3d49b85ad4b164352c516da28e1678a90470ae300546001600160a01b031690565b90506001600160a01b0382166200033657604051634e3ef82560e01b815260040160405180910390fd5b817f4675fa8241f86f37157864d3d49b85ad4b164352c516da28e1678a90470ae30080546001600160a01b0319166001600160a01b03928316179055604051838216918316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160e01b0319811660009081527f81088bbc801e045ea3e7620779ab349988f58afbdfba10dff983df3f33522b00602052604090205460ff16151560011462000435576001600160e01b0319811660009081527f81088bbc801e045ea3e7620779ab349988f58afbdfba10dff983df3f33522b0060205260409020805460ff191660011790556200044e565b604051637967f77d60e11b815260040160405180910390fd5b6040516001600160e01b03198216907f78f84e5b1c5c05be2b5ad3800781dd404d6d6c6302bc755c0fe20f58a33a7f2290600090a250565b7f6569bde4a160c636ea8b8d11acb83a60d7fec0b8f2e09389306cba0e1340df00546000829003620004cb5760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b03831660008181527f6569bde4a160c636ea8b8d11acb83a60d7fec0b8f2e09389306cba0e1340df056020908152604080832080546801000000000000000188020190558483527f6569bde4a160c636ea8b8d11acb83a60d7fec0b8f2e09389306cba0e1340df0490915281206001851460e11b4260a01b17831790558284019083908390600080516020620021a68339815191528180a4600183015b818114620005985780836000600080516020620021a6833981519152600080a46001016200056f565b5081600003620005ba57604051622e076360e81b815260040160405180910390fd5b7f6569bde4a160c636ea8b8d11acb83a60d7fec0b8f2e09389306cba0e1340df005550505050565b6000620005f9836001600160a01b03841662000602565b90505b92915050565b60008181526001830160205260408120546200064b57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620005fc565b506000620005fc565b634e487b7160e01b600052604160045260246000fd5b80516001600160a01b03811681146200068257600080fd5b919050565b600060208083850312156200069b57600080fd5b82516001600160401b0380821115620006b357600080fd5b818501915085601f830112620006c857600080fd5b815181811115620006dd57620006dd62000654565b8060051b604051601f19603f8301168101818110858211171562000705576200070562000654565b6040529182528482019250838101850191888311156200072457600080fd5b938501935b828510156200074d576200073d856200066a565b8452938501939285019262000729565b98975050505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052602160045260246000fd5b611a1180620007956000396000f3fe608060405234801561001057600080fd5b50600436106101215760003560e01c8063541da4e5116100ad578063a33d1ccb11610071578063a33d1ccb1461025d578063c5e41cf614610265578063e0cc26a214610278578063e97cc6f6146102c0578063fd39105a1461030b57600080fd5b8063541da4e5146101ee57806359f12a2614610201578063672d7a0d146102145780636d70f7ae146102275780639ebd11ef1461024a57600080fd5b806339dc5b3e116100f457806339dc5b3e146101825780633c59f1261461018a57806343024ac9146101b55780634463ba8f146101c85780634f845445146101db57600080fd5b806319fac8fd1461012657806327a099d81461013b5780633682a4501461015957806339bf397e1461016c575b600080fd5b610139610134366004611691565b610363565b005b610143610460565b60405161015091906116ef565b60405180910390f35b61013961016736600461171e565b610480565b61017461057d565b604051908152602001610150565b610139610597565b61019d610198366004611691565b6105f3565b6040516001600160a01b039091168152602001610150565b6101436101c336600461171e565b610667565b6101396101d6366004611739565b6107b4565b6101436101e9366004611691565b610b1a565b6101396101fc36600461178a565b610b2b565b61013961020f366004611873565b610b70565b61013961022236600461171e565b610d2c565b61023a61023536600461171e565b610e3f565b6040519015158152602001610150565b61023a61025836600461171e565b610e5e565b610139610e75565b61013961027336600461171e565b610ecf565b61017461028636600461171e565b6001600160a01b031660009081527f988e8266be98e92aff755bdd688f8f4a2421e26daa6089c7e2668053a3bf5503602052604090205490565b61019d6102ce36600461171e565b6001600160a01b0390811660009081527f988e8266be98e92aff755bdd688f8f4a2421e26daa6089c7e2668053a3bf550460205260409020541690565b61035661031936600461171e565b6001600160a01b031660009081527f988e8266be98e92aff755bdd688f8f4a2421e26daa6089c7e2668053a3bf5502602052604090205460ff1690565b60405161015091906118bc565b6000805160206119f183398151915261037c8133610fd2565b610399576040516306e0839760e01b815260040160405180910390fd5b6127108211156103bc5760405163caf6558b60e01b815260040160405180910390fd5b336000908152600382016020526040902054821180156104025750600133600090815260028301602052604090205460ff1660038111156103ff576103ff6118a6565b14155b156104205760405163caf6558b60e01b815260040160405180910390fd5b336000818152600383016020526040808220859055518492917f3f8e6b052699b5c8512c54ad8f8c79ddbf0486d3263c519f20bdbb42cd4bd6da91a35050565b60606000805160206119f183398151915261047a81610ff3565b91505090565b6001600160a01b0381166104a7576040516330bdf2f160e21b815260040160405180910390fd5b6000805160206119f18339815191526104c08133610fd2565b156104de57604051632e86c00360e11b815260040160405180910390fd5b6104e9336001611000565b6104f3813361117a565b503360008181526002830160209081526040808320805460ff1916600117905560048501825280832080546001600160a01b0388166001600160a01b03199091168117909155835260058501909152902061054d9161117a565b5060405133907f4d0eb1f4bac8744fd2be119845e23b3befc88094b42bcda1204c65694a00f9e590600090a25050565b60006000805160206119d183398151915261047a8161118f565b7f59b501c3653afc186af7d48dda36cf6732bd21629a6295693664240a6ef5200054640100000000900460ff166105e157604051630ef4733760e31b815260040160405180910390fd5b6105f1636109052560e01b611199565b565b60006000805160206119d183398151915261060d8161118f565b83106106565760405162461bcd60e51b8152602060048201526013602482015272496e646578206f7574206f6620626f756e647360681b60448201526064015b60405180910390fd5b6106608184611277565b9392505050565b60606000805160206119d183398151915260006106838261118f565b90506000805b828110156106dd57600061069d8583611277565b6001600160a01b0380821660009081526002880160205260409020549192508089169116036106d457826106d0816118fa565b9350505b50600101610689565b5060008167ffffffffffffffff8111156106f9576106f9611774565b604051908082528060200260200182016040528015610722578160200160208202803683370190505b5090506000805b848110156107a857600061073d8783611277565b6001600160a01b03808216600090815260028a016020526040902054919250808b1691160361079f578084848151811061077957610779611913565b6001600160a01b03909216602092830291909101909101528261079b816118fa565b9350505b50600101610729565b50909695505050505050565b7f4675fa8241f86f37157864d3d49b85ad4b164352c516da28e1678a90470ae300546001600160a01b03163314610800576040516365f4906560e01b815233600482015260240161064d565b6001600160a01b038216610827576040516330bdf2f160e21b815260040160405180910390fd5b6000805160206119f18339815191526108408184610fd2565b61085d576040516306e0839760e01b815260040160405180910390fd5b6001600160a01b038316600090815260028201602052604090205460ff1682600381111561088d5761088d6118a6565b81600381111561089f5761089f6118a6565b036108bd576040516318324e6f60e01b815260040160405180910390fd5b60008160038111156108d1576108d16118a6565b1480156108f0575060018360038111156108ed576108ed6118a6565b14155b1561090e5760405163184186fd60e01b815260040160405180910390fd5b6001816003811115610922576109226118a6565b1480156109415750600283600381111561093e5761093e6118a6565b14155b1561095f5760405163184186fd60e01b815260040160405180910390fd5b6002816003811115610973576109736118a6565b1480156109af5750600083600381111561098f5761098f6118a6565b141580156109af575060038360038111156109ac576109ac6118a6565b14155b156109cd5760405163184186fd60e01b815260040160405180910390fd5b60038160038111156109e1576109e16118a6565b148015610a1d575060008360038111156109fd576109fd6118a6565b14158015610a1d57506002836003811115610a1a57610a1a6118a6565b14155b15610a3b5760405163184186fd60e01b815260040160405180910390fd5b6003836003811115610a4f57610a4f6118a6565b03610a76576001600160a01b03841660009081526006830160205260409020429055610a92565b6001600160a01b03841660009081526006830160205260408120555b6001600160a01b03841660009081526002830160205260409020805484919060ff19166001836003811115610ac957610ac96118a6565b0217905550826003811115610ae057610ae06118a6565b6040516001600160a01b038616907f7db2ae93d80cbf3cf719888318a0b92adff1855bcb01eda517607ed7b0f2183a90600090a350505050565b6060610b2582611283565b92915050565b7f4675e3cc15801ffde520a3076d6ad75c0c6dbe8f23bdbea1dd45b676caffe4f38433858585604051610b62959493929190611929565b60405180910390a150505050565b3360008181527f988e8266be98e92aff755bdd688f8f4a2421e26daa6089c7e2668053a3bf55056020526040902082906000805160206119f183398151915290610bba9083610fd2565b610bd757604051637dd0ec8560e01b815260040160405180910390fd5b6000805160206119f1833981519152610bf08186610fd2565b610c0d576040516306e0839760e01b815260040160405180910390fd5b6001600160a01b03808616600090815260048301602052604090205481169087168103610c4d576040516366c7dd8d60e11b815260040160405180910390fd5b6001600160a01b03811660009081526005830160205260409020610c719087610fd2565b15610c9c576001600160a01b03811660009081526005830160205260409020610c9a9087611458565b505b6001600160a01b038681166000908152600484016020908152604080832080546001600160a01b031916948c16948517905592825260058501905220610ce2908761117a565b50866001600160a01b0316866001600160a01b03167f9acff66817c6f3fac3752bef82306270971b2a3da032a5cb876e05676bb8328860405160405180910390a350505050505050565b6000805160206119f1833981519152610d458133610fd2565b610d625760405163c931a1fb60e01b815260040160405180910390fd5b6000805160206119d1833981519152610d7b8184610fd2565b15610d995760405163d1922fc160e01b815260040160405180910390fd5b610da3818461117a565b506001600160a01b038316600081815260028301602052604080822080546001600160a01b03191633179055517f564728e6a7c8edd446557d94e0339d5e6ca2e05f42188914efdbdc87bcbbabf69190a250600233600090815260028301602052604090205460ff166003811115610e1d57610e1d6118a6565b14610e3b57604051637164de9160e01b815260040160405180910390fd5b5050565b6000806000805160206119f18339815191525b90506106608184610fd2565b6000806000805160206119d1833981519152610e52565b7f59b501c3653afc186af7d48dda36cf6732bd21629a6295693664240a6ef5200054640100000000900460ff16610ebf57604051630ef4733760e31b815260040160405180910390fd5b6105f163232cd89f60e21b611199565b6001600160a01b0380821660009081527f180c1d0b9e5eeea9f2f078bc2712cd77acc6afea03b37705abe96dda6f6026026020526040902054829133916000805160206119d183398151915291168214610f3c5760405163fd2dc62f60e01b815260040160405180910390fd5b6000805160206119d1833981519152610f558186610fd2565b610f72576040516317e3e0b960e01b815260040160405180910390fd5b610f7c8186611458565b506001600160a01b038516600081815260028301602052604080822080546001600160a01b0319169055517fb1864577e4f285436a80ebc833984755393e2450d58622a65fb4fce87ea3573a9190a25050505050565b6001600160a01b031660009081526001919091016020526040902054151590565b606060006106608361146d565b7f6569bde4a160c636ea8b8d11acb83a60d7fec0b8f2e09389306cba0e1340df005460008290036110445760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b03831660008181527f6569bde4a160c636ea8b8d11acb83a60d7fec0b8f2e09389306cba0e1340df056020908152604080832080546801000000000000000188020190558483527f6569bde4a160c636ea8b8d11acb83a60d7fec0b8f2e09389306cba0e1340df0490915281206001851460e11b4260a01b178317905582840190839083907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4600183015b81811461113157808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a46001016110f9565b508160000361115257604051622e076360e81b815260040160405180910390fd5b7f6569bde4a160c636ea8b8d11acb83a60d7fec0b8f2e09389306cba0e1340df005550505050565b6000610660836001600160a01b0384166114c9565b6000610b25825490565b6001600160e01b0319811660009081527f81088bbc801e045ea3e7620779ab349988f58afbdfba10dff983df3f33522b00602052604090205460ff161515600114611226576001600160e01b0319811660009081527f81088bbc801e045ea3e7620779ab349988f58afbdfba10dff983df3f33522b0060205260409020805460ff1916600117905561123f565b604051637967f77d60e11b815260040160405180910390fd5b6040516001600160e01b03198216907f78f84e5b1c5c05be2b5ad3800781dd404d6d6c6302bc755c0fe20f58a33a7f2290600090a250565b60006106608383611518565b60606000805160206119d1833981519152600061129f8261118f565b9050808411156112c257604051631762997d60e01b815260040160405180910390fd5b60008467ffffffffffffffff8111156112dd576112dd611774565b604051908082528060200260200182016040528015611306578160200160208202803683370190505b50905060008267ffffffffffffffff81111561132457611324611774565b60405190808252806020026020018201604052801561134d578160200160208202803683370190505b50905060005b83811015611381578082828151811061136e5761136e611913565b6020908102919091010152600101611353565b508260005b8781101561144c57600061139a8284611542565b90506113cb8482815181106113b1576113b1611913565b60200260200101518860000161127790919063ffffffff16565b8583815181106113dd576113dd611913565b6001600160a01b03909216602092830291909101909101528361140160018561196e565b8151811061141157611411611913565b602002602001015184828151811061142b5761142b611913565b60209081029190910101528261144081611981565b93505050600101611386565b50919695505050505050565b6000610660836001600160a01b03841661159e565b6060816000018054806020026020016040519081016040528092919081815260200182805480156114bd57602002820191906000526020600020905b8154815260200190600101908083116114a9575b50505050509050919050565b600081815260018301602052604081205461151057508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610b25565b506000610b25565b600082600001828154811061152f5761152f611913565b9060005260206000200154905092915050565b604080514460208201524291810191909152606080820184905233901b6bffffffffffffffffffffffff1916608082015260009082906094016040516020818303038152906040528051906020012060001c6106609190611998565b600081815260018301602052604081205480156116875760006115c260018361196e565b85549091506000906115d69060019061196e565b905080821461163b5760008660000182815481106115f6576115f6611913565b906000526020600020015490508087600001848154811061161957611619611913565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061164c5761164c6119ba565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610b25565b6000915050610b25565b6000602082840312156116a357600080fd5b5035919050565b60008151808452602080850194506020840160005b838110156116e45781516001600160a01b0316875295820195908201906001016116bf565b509495945050505050565b60208152600061066060208301846116aa565b80356001600160a01b038116811461171957600080fd5b919050565b60006020828403121561173057600080fd5b61066082611702565b6000806040838503121561174c57600080fd5b61175583611702565b915060208301356004811061176957600080fd5b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600080600080608085870312156117a057600080fd5b6117a985611702565b9350602080860135935060408601359250606086013567ffffffffffffffff808211156117d557600080fd5b818801915088601f8301126117e957600080fd5b8135818111156117fb576117fb611774565b8060051b604051601f19603f8301168101818110858211171561182057611820611774565b60405291825284820192508381018501918b83111561183e57600080fd5b938501935b828510156118635761185485611702565b84529385019392850192611843565b989b979a50959850505050505050565b6000806040838503121561188657600080fd5b61188f83611702565b915061189d60208401611702565b90509250929050565b634e487b7160e01b600052602160045260246000fd5b60208101600483106118de57634e487b7160e01b600052602160045260246000fd5b91905290565b634e487b7160e01b600052601160045260246000fd5b60006001820161190c5761190c6118e4565b5060010190565b634e487b7160e01b600052603260045260246000fd5b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090611963908301846116aa565b979650505050505050565b81810381811115610b2557610b256118e4565b600081611990576119906118e4565b506000190190565b6000826119b557634e487b7160e01b600052601260045260246000fd5b500690565b634e487b7160e01b600052603160045260246000fdfe180c1d0b9e5eeea9f2f078bc2712cd77acc6afea03b37705abe96dda6f602600988e8266be98e92aff755bdd688f8f4a2421e26daa6089c7e2668053a3bf5500ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", -} - -// MockEntitlementCheckerABI is the input ABI used to generate the binding from. -// Deprecated: Use MockEntitlementCheckerMetaData.ABI instead. -var MockEntitlementCheckerABI = MockEntitlementCheckerMetaData.ABI - -// MockEntitlementCheckerBin is the compiled bytecode used for deploying new contracts. -// Deprecated: Use MockEntitlementCheckerMetaData.Bin instead. -var MockEntitlementCheckerBin = MockEntitlementCheckerMetaData.Bin - -// DeployMockEntitlementChecker deploys a new Ethereum contract, binding an instance of MockEntitlementChecker to it. -func DeployMockEntitlementChecker(auth *bind.TransactOpts, backend bind.ContractBackend, approvedOperators []common.Address) (common.Address, *types.Transaction, *MockEntitlementChecker, error) { - parsed, err := MockEntitlementCheckerMetaData.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(MockEntitlementCheckerBin), backend, approvedOperators) - if err != nil { - return common.Address{}, nil, nil, err - } - return address, tx, &MockEntitlementChecker{MockEntitlementCheckerCaller: MockEntitlementCheckerCaller{contract: contract}, MockEntitlementCheckerTransactor: MockEntitlementCheckerTransactor{contract: contract}, MockEntitlementCheckerFilterer: MockEntitlementCheckerFilterer{contract: contract}}, nil -} - -// MockEntitlementChecker is an auto generated Go binding around an Ethereum contract. -type MockEntitlementChecker struct { - MockEntitlementCheckerCaller // Read-only binding to the contract - MockEntitlementCheckerTransactor // Write-only binding to the contract - MockEntitlementCheckerFilterer // Log filterer for contract events -} - -// MockEntitlementCheckerCaller is an auto generated read-only Go binding around an Ethereum contract. -type MockEntitlementCheckerCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// MockEntitlementCheckerTransactor is an auto generated write-only Go binding around an Ethereum contract. -type MockEntitlementCheckerTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// MockEntitlementCheckerFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type MockEntitlementCheckerFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// MockEntitlementCheckerSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type MockEntitlementCheckerSession struct { - Contract *MockEntitlementChecker // 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 -} - -// MockEntitlementCheckerCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type MockEntitlementCheckerCallerSession struct { - Contract *MockEntitlementCheckerCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// MockEntitlementCheckerTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type MockEntitlementCheckerTransactorSession struct { - Contract *MockEntitlementCheckerTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// MockEntitlementCheckerRaw is an auto generated low-level Go binding around an Ethereum contract. -type MockEntitlementCheckerRaw struct { - Contract *MockEntitlementChecker // Generic contract binding to access the raw methods on -} - -// MockEntitlementCheckerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type MockEntitlementCheckerCallerRaw struct { - Contract *MockEntitlementCheckerCaller // Generic read-only contract binding to access the raw methods on -} - -// MockEntitlementCheckerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type MockEntitlementCheckerTransactorRaw struct { - Contract *MockEntitlementCheckerTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewMockEntitlementChecker creates a new instance of MockEntitlementChecker, bound to a specific deployed contract. -func NewMockEntitlementChecker(address common.Address, backend bind.ContractBackend) (*MockEntitlementChecker, error) { - contract, err := bindMockEntitlementChecker(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &MockEntitlementChecker{MockEntitlementCheckerCaller: MockEntitlementCheckerCaller{contract: contract}, MockEntitlementCheckerTransactor: MockEntitlementCheckerTransactor{contract: contract}, MockEntitlementCheckerFilterer: MockEntitlementCheckerFilterer{contract: contract}}, nil -} - -// NewMockEntitlementCheckerCaller creates a new read-only instance of MockEntitlementChecker, bound to a specific deployed contract. -func NewMockEntitlementCheckerCaller(address common.Address, caller bind.ContractCaller) (*MockEntitlementCheckerCaller, error) { - contract, err := bindMockEntitlementChecker(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &MockEntitlementCheckerCaller{contract: contract}, nil -} - -// NewMockEntitlementCheckerTransactor creates a new write-only instance of MockEntitlementChecker, bound to a specific deployed contract. -func NewMockEntitlementCheckerTransactor(address common.Address, transactor bind.ContractTransactor) (*MockEntitlementCheckerTransactor, error) { - contract, err := bindMockEntitlementChecker(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &MockEntitlementCheckerTransactor{contract: contract}, nil -} - -// NewMockEntitlementCheckerFilterer creates a new log filterer instance of MockEntitlementChecker, bound to a specific deployed contract. -func NewMockEntitlementCheckerFilterer(address common.Address, filterer bind.ContractFilterer) (*MockEntitlementCheckerFilterer, error) { - contract, err := bindMockEntitlementChecker(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &MockEntitlementCheckerFilterer{contract: contract}, nil -} - -// bindMockEntitlementChecker binds a generic wrapper to an already deployed contract. -func bindMockEntitlementChecker(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := MockEntitlementCheckerMetaData.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 (_MockEntitlementChecker *MockEntitlementCheckerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _MockEntitlementChecker.Contract.MockEntitlementCheckerCaller.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 (_MockEntitlementChecker *MockEntitlementCheckerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _MockEntitlementChecker.Contract.MockEntitlementCheckerTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_MockEntitlementChecker *MockEntitlementCheckerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _MockEntitlementChecker.Contract.MockEntitlementCheckerTransactor.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 (_MockEntitlementChecker *MockEntitlementCheckerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _MockEntitlementChecker.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 (_MockEntitlementChecker *MockEntitlementCheckerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _MockEntitlementChecker.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_MockEntitlementChecker *MockEntitlementCheckerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _MockEntitlementChecker.Contract.contract.Transact(opts, method, params...) -} - -// GetClaimAddressForOperator is a free data retrieval call binding the contract method 0xe97cc6f6. -// -// Solidity: function getClaimAddressForOperator(address operator) view returns(address) -func (_MockEntitlementChecker *MockEntitlementCheckerCaller) GetClaimAddressForOperator(opts *bind.CallOpts, operator common.Address) (common.Address, error) { - var out []interface{} - err := _MockEntitlementChecker.contract.Call(opts, &out, "getClaimAddressForOperator", operator) - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// GetClaimAddressForOperator is a free data retrieval call binding the contract method 0xe97cc6f6. -// -// Solidity: function getClaimAddressForOperator(address operator) view returns(address) -func (_MockEntitlementChecker *MockEntitlementCheckerSession) GetClaimAddressForOperator(operator common.Address) (common.Address, error) { - return _MockEntitlementChecker.Contract.GetClaimAddressForOperator(&_MockEntitlementChecker.CallOpts, operator) -} - -// GetClaimAddressForOperator is a free data retrieval call binding the contract method 0xe97cc6f6. -// -// Solidity: function getClaimAddressForOperator(address operator) view returns(address) -func (_MockEntitlementChecker *MockEntitlementCheckerCallerSession) GetClaimAddressForOperator(operator common.Address) (common.Address, error) { - return _MockEntitlementChecker.Contract.GetClaimAddressForOperator(&_MockEntitlementChecker.CallOpts, operator) -} - -// GetCommissionRate is a free data retrieval call binding the contract method 0xe0cc26a2. -// -// Solidity: function getCommissionRate(address operator) view returns(uint256) -func (_MockEntitlementChecker *MockEntitlementCheckerCaller) GetCommissionRate(opts *bind.CallOpts, operator common.Address) (*big.Int, error) { - var out []interface{} - err := _MockEntitlementChecker.contract.Call(opts, &out, "getCommissionRate", operator) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// GetCommissionRate is a free data retrieval call binding the contract method 0xe0cc26a2. -// -// Solidity: function getCommissionRate(address operator) view returns(uint256) -func (_MockEntitlementChecker *MockEntitlementCheckerSession) GetCommissionRate(operator common.Address) (*big.Int, error) { - return _MockEntitlementChecker.Contract.GetCommissionRate(&_MockEntitlementChecker.CallOpts, operator) -} - -// GetCommissionRate is a free data retrieval call binding the contract method 0xe0cc26a2. -// -// Solidity: function getCommissionRate(address operator) view returns(uint256) -func (_MockEntitlementChecker *MockEntitlementCheckerCallerSession) GetCommissionRate(operator common.Address) (*big.Int, error) { - return _MockEntitlementChecker.Contract.GetCommissionRate(&_MockEntitlementChecker.CallOpts, operator) -} - -// GetNodeAtIndex is a free data retrieval call binding the contract method 0x3c59f126. -// -// Solidity: function getNodeAtIndex(uint256 index) view returns(address) -func (_MockEntitlementChecker *MockEntitlementCheckerCaller) GetNodeAtIndex(opts *bind.CallOpts, index *big.Int) (common.Address, error) { - var out []interface{} - err := _MockEntitlementChecker.contract.Call(opts, &out, "getNodeAtIndex", index) - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// GetNodeAtIndex is a free data retrieval call binding the contract method 0x3c59f126. -// -// Solidity: function getNodeAtIndex(uint256 index) view returns(address) -func (_MockEntitlementChecker *MockEntitlementCheckerSession) GetNodeAtIndex(index *big.Int) (common.Address, error) { - return _MockEntitlementChecker.Contract.GetNodeAtIndex(&_MockEntitlementChecker.CallOpts, index) -} - -// GetNodeAtIndex is a free data retrieval call binding the contract method 0x3c59f126. -// -// Solidity: function getNodeAtIndex(uint256 index) view returns(address) -func (_MockEntitlementChecker *MockEntitlementCheckerCallerSession) GetNodeAtIndex(index *big.Int) (common.Address, error) { - return _MockEntitlementChecker.Contract.GetNodeAtIndex(&_MockEntitlementChecker.CallOpts, index) -} - -// GetNodeCount is a free data retrieval call binding the contract method 0x39bf397e. -// -// Solidity: function getNodeCount() view returns(uint256) -func (_MockEntitlementChecker *MockEntitlementCheckerCaller) GetNodeCount(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _MockEntitlementChecker.contract.Call(opts, &out, "getNodeCount") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// GetNodeCount is a free data retrieval call binding the contract method 0x39bf397e. -// -// Solidity: function getNodeCount() view returns(uint256) -func (_MockEntitlementChecker *MockEntitlementCheckerSession) GetNodeCount() (*big.Int, error) { - return _MockEntitlementChecker.Contract.GetNodeCount(&_MockEntitlementChecker.CallOpts) -} - -// GetNodeCount is a free data retrieval call binding the contract method 0x39bf397e. -// -// Solidity: function getNodeCount() view returns(uint256) -func (_MockEntitlementChecker *MockEntitlementCheckerCallerSession) GetNodeCount() (*big.Int, error) { - return _MockEntitlementChecker.Contract.GetNodeCount(&_MockEntitlementChecker.CallOpts) -} - -// GetNodesByOperator is a free data retrieval call binding the contract method 0x43024ac9. -// -// Solidity: function getNodesByOperator(address operator) view returns(address[]) -func (_MockEntitlementChecker *MockEntitlementCheckerCaller) GetNodesByOperator(opts *bind.CallOpts, operator common.Address) ([]common.Address, error) { - var out []interface{} - err := _MockEntitlementChecker.contract.Call(opts, &out, "getNodesByOperator", operator) - - if err != nil { - return *new([]common.Address), err - } - - out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) - - return out0, err - -} - -// GetNodesByOperator is a free data retrieval call binding the contract method 0x43024ac9. -// -// Solidity: function getNodesByOperator(address operator) view returns(address[]) -func (_MockEntitlementChecker *MockEntitlementCheckerSession) GetNodesByOperator(operator common.Address) ([]common.Address, error) { - return _MockEntitlementChecker.Contract.GetNodesByOperator(&_MockEntitlementChecker.CallOpts, operator) -} - -// GetNodesByOperator is a free data retrieval call binding the contract method 0x43024ac9. -// -// Solidity: function getNodesByOperator(address operator) view returns(address[]) -func (_MockEntitlementChecker *MockEntitlementCheckerCallerSession) GetNodesByOperator(operator common.Address) ([]common.Address, error) { - return _MockEntitlementChecker.Contract.GetNodesByOperator(&_MockEntitlementChecker.CallOpts, operator) -} - -// GetOperatorStatus is a free data retrieval call binding the contract method 0xfd39105a. -// -// Solidity: function getOperatorStatus(address operator) view returns(uint8) -func (_MockEntitlementChecker *MockEntitlementCheckerCaller) GetOperatorStatus(opts *bind.CallOpts, operator common.Address) (uint8, error) { - var out []interface{} - err := _MockEntitlementChecker.contract.Call(opts, &out, "getOperatorStatus", operator) - - if err != nil { - return *new(uint8), err - } - - out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) - - return out0, err - -} - -// GetOperatorStatus is a free data retrieval call binding the contract method 0xfd39105a. -// -// Solidity: function getOperatorStatus(address operator) view returns(uint8) -func (_MockEntitlementChecker *MockEntitlementCheckerSession) GetOperatorStatus(operator common.Address) (uint8, error) { - return _MockEntitlementChecker.Contract.GetOperatorStatus(&_MockEntitlementChecker.CallOpts, operator) -} - -// GetOperatorStatus is a free data retrieval call binding the contract method 0xfd39105a. -// -// Solidity: function getOperatorStatus(address operator) view returns(uint8) -func (_MockEntitlementChecker *MockEntitlementCheckerCallerSession) GetOperatorStatus(operator common.Address) (uint8, error) { - return _MockEntitlementChecker.Contract.GetOperatorStatus(&_MockEntitlementChecker.CallOpts, operator) -} - -// GetOperators is a free data retrieval call binding the contract method 0x27a099d8. -// -// Solidity: function getOperators() view returns(address[]) -func (_MockEntitlementChecker *MockEntitlementCheckerCaller) GetOperators(opts *bind.CallOpts) ([]common.Address, error) { - var out []interface{} - err := _MockEntitlementChecker.contract.Call(opts, &out, "getOperators") - - if err != nil { - return *new([]common.Address), err - } - - out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) - - return out0, err - -} - -// GetOperators is a free data retrieval call binding the contract method 0x27a099d8. -// -// Solidity: function getOperators() view returns(address[]) -func (_MockEntitlementChecker *MockEntitlementCheckerSession) GetOperators() ([]common.Address, error) { - return _MockEntitlementChecker.Contract.GetOperators(&_MockEntitlementChecker.CallOpts) -} - -// GetOperators is a free data retrieval call binding the contract method 0x27a099d8. -// -// Solidity: function getOperators() view returns(address[]) -func (_MockEntitlementChecker *MockEntitlementCheckerCallerSession) GetOperators() ([]common.Address, error) { - return _MockEntitlementChecker.Contract.GetOperators(&_MockEntitlementChecker.CallOpts) -} - -// GetRandomNodes is a free data retrieval call binding the contract method 0x4f845445. -// -// Solidity: function getRandomNodes(uint256 count) view returns(address[]) -func (_MockEntitlementChecker *MockEntitlementCheckerCaller) GetRandomNodes(opts *bind.CallOpts, count *big.Int) ([]common.Address, error) { - var out []interface{} - err := _MockEntitlementChecker.contract.Call(opts, &out, "getRandomNodes", count) - - if err != nil { - return *new([]common.Address), err - } - - out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) - - return out0, err - -} - -// GetRandomNodes is a free data retrieval call binding the contract method 0x4f845445. -// -// Solidity: function getRandomNodes(uint256 count) view returns(address[]) -func (_MockEntitlementChecker *MockEntitlementCheckerSession) GetRandomNodes(count *big.Int) ([]common.Address, error) { - return _MockEntitlementChecker.Contract.GetRandomNodes(&_MockEntitlementChecker.CallOpts, count) -} - -// GetRandomNodes is a free data retrieval call binding the contract method 0x4f845445. -// -// Solidity: function getRandomNodes(uint256 count) view returns(address[]) -func (_MockEntitlementChecker *MockEntitlementCheckerCallerSession) GetRandomNodes(count *big.Int) ([]common.Address, error) { - return _MockEntitlementChecker.Contract.GetRandomNodes(&_MockEntitlementChecker.CallOpts, count) -} - -// IsOperator is a free data retrieval call binding the contract method 0x6d70f7ae. -// -// Solidity: function isOperator(address operator) view returns(bool) -func (_MockEntitlementChecker *MockEntitlementCheckerCaller) IsOperator(opts *bind.CallOpts, operator common.Address) (bool, error) { - var out []interface{} - err := _MockEntitlementChecker.contract.Call(opts, &out, "isOperator", operator) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// IsOperator is a free data retrieval call binding the contract method 0x6d70f7ae. -// -// Solidity: function isOperator(address operator) view returns(bool) -func (_MockEntitlementChecker *MockEntitlementCheckerSession) IsOperator(operator common.Address) (bool, error) { - return _MockEntitlementChecker.Contract.IsOperator(&_MockEntitlementChecker.CallOpts, operator) -} - -// IsOperator is a free data retrieval call binding the contract method 0x6d70f7ae. -// -// Solidity: function isOperator(address operator) view returns(bool) -func (_MockEntitlementChecker *MockEntitlementCheckerCallerSession) IsOperator(operator common.Address) (bool, error) { - return _MockEntitlementChecker.Contract.IsOperator(&_MockEntitlementChecker.CallOpts, operator) -} - -// IsValidNode is a free data retrieval call binding the contract method 0x9ebd11ef. -// -// Solidity: function isValidNode(address node) view returns(bool) -func (_MockEntitlementChecker *MockEntitlementCheckerCaller) IsValidNode(opts *bind.CallOpts, node common.Address) (bool, error) { - var out []interface{} - err := _MockEntitlementChecker.contract.Call(opts, &out, "isValidNode", node) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// IsValidNode is a free data retrieval call binding the contract method 0x9ebd11ef. -// -// Solidity: function isValidNode(address node) view returns(bool) -func (_MockEntitlementChecker *MockEntitlementCheckerSession) IsValidNode(node common.Address) (bool, error) { - return _MockEntitlementChecker.Contract.IsValidNode(&_MockEntitlementChecker.CallOpts, node) -} - -// IsValidNode is a free data retrieval call binding the contract method 0x9ebd11ef. -// -// Solidity: function isValidNode(address node) view returns(bool) -func (_MockEntitlementChecker *MockEntitlementCheckerCallerSession) IsValidNode(node common.Address) (bool, error) { - return _MockEntitlementChecker.Contract.IsValidNode(&_MockEntitlementChecker.CallOpts, node) -} - -// EntitlementCheckerInit is a paid mutator transaction binding the contract method 0x39dc5b3e. -// -// Solidity: function __EntitlementChecker_init() returns() -func (_MockEntitlementChecker *MockEntitlementCheckerTransactor) EntitlementCheckerInit(opts *bind.TransactOpts) (*types.Transaction, error) { - return _MockEntitlementChecker.contract.Transact(opts, "__EntitlementChecker_init") -} - -// EntitlementCheckerInit is a paid mutator transaction binding the contract method 0x39dc5b3e. -// -// Solidity: function __EntitlementChecker_init() returns() -func (_MockEntitlementChecker *MockEntitlementCheckerSession) EntitlementCheckerInit() (*types.Transaction, error) { - return _MockEntitlementChecker.Contract.EntitlementCheckerInit(&_MockEntitlementChecker.TransactOpts) -} - -// EntitlementCheckerInit is a paid mutator transaction binding the contract method 0x39dc5b3e. -// -// Solidity: function __EntitlementChecker_init() returns() -func (_MockEntitlementChecker *MockEntitlementCheckerTransactorSession) EntitlementCheckerInit() (*types.Transaction, error) { - return _MockEntitlementChecker.Contract.EntitlementCheckerInit(&_MockEntitlementChecker.TransactOpts) -} - -// NodeOperatorInit is a paid mutator transaction binding the contract method 0xa33d1ccb. -// -// Solidity: function __NodeOperator_init() returns() -func (_MockEntitlementChecker *MockEntitlementCheckerTransactor) NodeOperatorInit(opts *bind.TransactOpts) (*types.Transaction, error) { - return _MockEntitlementChecker.contract.Transact(opts, "__NodeOperator_init") -} - -// NodeOperatorInit is a paid mutator transaction binding the contract method 0xa33d1ccb. -// -// Solidity: function __NodeOperator_init() returns() -func (_MockEntitlementChecker *MockEntitlementCheckerSession) NodeOperatorInit() (*types.Transaction, error) { - return _MockEntitlementChecker.Contract.NodeOperatorInit(&_MockEntitlementChecker.TransactOpts) -} - -// NodeOperatorInit is a paid mutator transaction binding the contract method 0xa33d1ccb. -// -// Solidity: function __NodeOperator_init() returns() -func (_MockEntitlementChecker *MockEntitlementCheckerTransactorSession) NodeOperatorInit() (*types.Transaction, error) { - return _MockEntitlementChecker.Contract.NodeOperatorInit(&_MockEntitlementChecker.TransactOpts) -} - -// RegisterNode is a paid mutator transaction binding the contract method 0x672d7a0d. -// -// Solidity: function registerNode(address node) returns() -func (_MockEntitlementChecker *MockEntitlementCheckerTransactor) RegisterNode(opts *bind.TransactOpts, node common.Address) (*types.Transaction, error) { - return _MockEntitlementChecker.contract.Transact(opts, "registerNode", node) -} - -// RegisterNode is a paid mutator transaction binding the contract method 0x672d7a0d. -// -// Solidity: function registerNode(address node) returns() -func (_MockEntitlementChecker *MockEntitlementCheckerSession) RegisterNode(node common.Address) (*types.Transaction, error) { - return _MockEntitlementChecker.Contract.RegisterNode(&_MockEntitlementChecker.TransactOpts, node) -} - -// RegisterNode is a paid mutator transaction binding the contract method 0x672d7a0d. -// -// Solidity: function registerNode(address node) returns() -func (_MockEntitlementChecker *MockEntitlementCheckerTransactorSession) RegisterNode(node common.Address) (*types.Transaction, error) { - return _MockEntitlementChecker.Contract.RegisterNode(&_MockEntitlementChecker.TransactOpts, node) -} - -// RegisterOperator is a paid mutator transaction binding the contract method 0x3682a450. -// -// Solidity: function registerOperator(address claimer) returns() -func (_MockEntitlementChecker *MockEntitlementCheckerTransactor) RegisterOperator(opts *bind.TransactOpts, claimer common.Address) (*types.Transaction, error) { - return _MockEntitlementChecker.contract.Transact(opts, "registerOperator", claimer) -} - -// RegisterOperator is a paid mutator transaction binding the contract method 0x3682a450. -// -// Solidity: function registerOperator(address claimer) returns() -func (_MockEntitlementChecker *MockEntitlementCheckerSession) RegisterOperator(claimer common.Address) (*types.Transaction, error) { - return _MockEntitlementChecker.Contract.RegisterOperator(&_MockEntitlementChecker.TransactOpts, claimer) -} - -// RegisterOperator is a paid mutator transaction binding the contract method 0x3682a450. -// -// Solidity: function registerOperator(address claimer) returns() -func (_MockEntitlementChecker *MockEntitlementCheckerTransactorSession) RegisterOperator(claimer common.Address) (*types.Transaction, error) { - return _MockEntitlementChecker.Contract.RegisterOperator(&_MockEntitlementChecker.TransactOpts, claimer) -} - -// RequestEntitlementCheck is a paid mutator transaction binding the contract method 0x541da4e5. -// -// Solidity: function requestEntitlementCheck(address callerAddress, bytes32 transactionId, uint256 roleId, address[] nodes) returns() -func (_MockEntitlementChecker *MockEntitlementCheckerTransactor) RequestEntitlementCheck(opts *bind.TransactOpts, callerAddress common.Address, transactionId [32]byte, roleId *big.Int, nodes []common.Address) (*types.Transaction, error) { - return _MockEntitlementChecker.contract.Transact(opts, "requestEntitlementCheck", callerAddress, transactionId, roleId, nodes) -} - -// RequestEntitlementCheck is a paid mutator transaction binding the contract method 0x541da4e5. -// -// Solidity: function requestEntitlementCheck(address callerAddress, bytes32 transactionId, uint256 roleId, address[] nodes) returns() -func (_MockEntitlementChecker *MockEntitlementCheckerSession) RequestEntitlementCheck(callerAddress common.Address, transactionId [32]byte, roleId *big.Int, nodes []common.Address) (*types.Transaction, error) { - return _MockEntitlementChecker.Contract.RequestEntitlementCheck(&_MockEntitlementChecker.TransactOpts, callerAddress, transactionId, roleId, nodes) -} - -// RequestEntitlementCheck is a paid mutator transaction binding the contract method 0x541da4e5. -// -// Solidity: function requestEntitlementCheck(address callerAddress, bytes32 transactionId, uint256 roleId, address[] nodes) returns() -func (_MockEntitlementChecker *MockEntitlementCheckerTransactorSession) RequestEntitlementCheck(callerAddress common.Address, transactionId [32]byte, roleId *big.Int, nodes []common.Address) (*types.Transaction, error) { - return _MockEntitlementChecker.Contract.RequestEntitlementCheck(&_MockEntitlementChecker.TransactOpts, callerAddress, transactionId, roleId, nodes) -} - -// SetClaimAddressForOperator is a paid mutator transaction binding the contract method 0x59f12a26. -// -// Solidity: function setClaimAddressForOperator(address claimer, address operator) returns() -func (_MockEntitlementChecker *MockEntitlementCheckerTransactor) SetClaimAddressForOperator(opts *bind.TransactOpts, claimer common.Address, operator common.Address) (*types.Transaction, error) { - return _MockEntitlementChecker.contract.Transact(opts, "setClaimAddressForOperator", claimer, operator) -} - -// SetClaimAddressForOperator is a paid mutator transaction binding the contract method 0x59f12a26. -// -// Solidity: function setClaimAddressForOperator(address claimer, address operator) returns() -func (_MockEntitlementChecker *MockEntitlementCheckerSession) SetClaimAddressForOperator(claimer common.Address, operator common.Address) (*types.Transaction, error) { - return _MockEntitlementChecker.Contract.SetClaimAddressForOperator(&_MockEntitlementChecker.TransactOpts, claimer, operator) -} - -// SetClaimAddressForOperator is a paid mutator transaction binding the contract method 0x59f12a26. -// -// Solidity: function setClaimAddressForOperator(address claimer, address operator) returns() -func (_MockEntitlementChecker *MockEntitlementCheckerTransactorSession) SetClaimAddressForOperator(claimer common.Address, operator common.Address) (*types.Transaction, error) { - return _MockEntitlementChecker.Contract.SetClaimAddressForOperator(&_MockEntitlementChecker.TransactOpts, claimer, operator) -} - -// SetCommissionRate is a paid mutator transaction binding the contract method 0x19fac8fd. -// -// Solidity: function setCommissionRate(uint256 rateBps) returns() -func (_MockEntitlementChecker *MockEntitlementCheckerTransactor) SetCommissionRate(opts *bind.TransactOpts, rateBps *big.Int) (*types.Transaction, error) { - return _MockEntitlementChecker.contract.Transact(opts, "setCommissionRate", rateBps) -} - -// SetCommissionRate is a paid mutator transaction binding the contract method 0x19fac8fd. -// -// Solidity: function setCommissionRate(uint256 rateBps) returns() -func (_MockEntitlementChecker *MockEntitlementCheckerSession) SetCommissionRate(rateBps *big.Int) (*types.Transaction, error) { - return _MockEntitlementChecker.Contract.SetCommissionRate(&_MockEntitlementChecker.TransactOpts, rateBps) -} - -// SetCommissionRate is a paid mutator transaction binding the contract method 0x19fac8fd. -// -// Solidity: function setCommissionRate(uint256 rateBps) returns() -func (_MockEntitlementChecker *MockEntitlementCheckerTransactorSession) SetCommissionRate(rateBps *big.Int) (*types.Transaction, error) { - return _MockEntitlementChecker.Contract.SetCommissionRate(&_MockEntitlementChecker.TransactOpts, rateBps) -} - -// SetOperatorStatus is a paid mutator transaction binding the contract method 0x4463ba8f. -// -// Solidity: function setOperatorStatus(address operator, uint8 newStatus) returns() -func (_MockEntitlementChecker *MockEntitlementCheckerTransactor) SetOperatorStatus(opts *bind.TransactOpts, operator common.Address, newStatus uint8) (*types.Transaction, error) { - return _MockEntitlementChecker.contract.Transact(opts, "setOperatorStatus", operator, newStatus) -} - -// SetOperatorStatus is a paid mutator transaction binding the contract method 0x4463ba8f. -// -// Solidity: function setOperatorStatus(address operator, uint8 newStatus) returns() -func (_MockEntitlementChecker *MockEntitlementCheckerSession) SetOperatorStatus(operator common.Address, newStatus uint8) (*types.Transaction, error) { - return _MockEntitlementChecker.Contract.SetOperatorStatus(&_MockEntitlementChecker.TransactOpts, operator, newStatus) -} - -// SetOperatorStatus is a paid mutator transaction binding the contract method 0x4463ba8f. -// -// Solidity: function setOperatorStatus(address operator, uint8 newStatus) returns() -func (_MockEntitlementChecker *MockEntitlementCheckerTransactorSession) SetOperatorStatus(operator common.Address, newStatus uint8) (*types.Transaction, error) { - return _MockEntitlementChecker.Contract.SetOperatorStatus(&_MockEntitlementChecker.TransactOpts, operator, newStatus) -} - -// UnregisterNode is a paid mutator transaction binding the contract method 0xc5e41cf6. -// -// Solidity: function unregisterNode(address node) returns() -func (_MockEntitlementChecker *MockEntitlementCheckerTransactor) UnregisterNode(opts *bind.TransactOpts, node common.Address) (*types.Transaction, error) { - return _MockEntitlementChecker.contract.Transact(opts, "unregisterNode", node) -} - -// UnregisterNode is a paid mutator transaction binding the contract method 0xc5e41cf6. -// -// Solidity: function unregisterNode(address node) returns() -func (_MockEntitlementChecker *MockEntitlementCheckerSession) UnregisterNode(node common.Address) (*types.Transaction, error) { - return _MockEntitlementChecker.Contract.UnregisterNode(&_MockEntitlementChecker.TransactOpts, node) -} - -// UnregisterNode is a paid mutator transaction binding the contract method 0xc5e41cf6. -// -// Solidity: function unregisterNode(address node) returns() -func (_MockEntitlementChecker *MockEntitlementCheckerTransactorSession) UnregisterNode(node common.Address) (*types.Transaction, error) { - return _MockEntitlementChecker.Contract.UnregisterNode(&_MockEntitlementChecker.TransactOpts, node) -} - -// MockEntitlementCheckerApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the MockEntitlementChecker contract. -type MockEntitlementCheckerApprovalIterator struct { - Event *MockEntitlementCheckerApproval // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *MockEntitlementCheckerApprovalIterator) 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(MockEntitlementCheckerApproval) - 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(MockEntitlementCheckerApproval) - 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 *MockEntitlementCheckerApprovalIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *MockEntitlementCheckerApprovalIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// MockEntitlementCheckerApproval represents a Approval event raised by the MockEntitlementChecker contract. -type MockEntitlementCheckerApproval struct { - Owner common.Address - Approved common.Address - TokenId *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. -// -// Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) -func (_MockEntitlementChecker *MockEntitlementCheckerFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, approved []common.Address, tokenId []*big.Int) (*MockEntitlementCheckerApprovalIterator, error) { - - var ownerRule []interface{} - for _, ownerItem := range owner { - ownerRule = append(ownerRule, ownerItem) - } - var approvedRule []interface{} - for _, approvedItem := range approved { - approvedRule = append(approvedRule, approvedItem) - } - var tokenIdRule []interface{} - for _, tokenIdItem := range tokenId { - tokenIdRule = append(tokenIdRule, tokenIdItem) - } - - logs, sub, err := _MockEntitlementChecker.contract.FilterLogs(opts, "Approval", ownerRule, approvedRule, tokenIdRule) - if err != nil { - return nil, err - } - return &MockEntitlementCheckerApprovalIterator{contract: _MockEntitlementChecker.contract, event: "Approval", logs: logs, sub: sub}, nil -} - -// WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. -// -// Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) -func (_MockEntitlementChecker *MockEntitlementCheckerFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *MockEntitlementCheckerApproval, owner []common.Address, approved []common.Address, tokenId []*big.Int) (event.Subscription, error) { - - var ownerRule []interface{} - for _, ownerItem := range owner { - ownerRule = append(ownerRule, ownerItem) - } - var approvedRule []interface{} - for _, approvedItem := range approved { - approvedRule = append(approvedRule, approvedItem) - } - var tokenIdRule []interface{} - for _, tokenIdItem := range tokenId { - tokenIdRule = append(tokenIdRule, tokenIdItem) - } - - logs, sub, err := _MockEntitlementChecker.contract.WatchLogs(opts, "Approval", ownerRule, approvedRule, tokenIdRule) - 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(MockEntitlementCheckerApproval) - if err := _MockEntitlementChecker.contract.UnpackLog(event, "Approval", 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 -} - -// ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. -// -// Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) -func (_MockEntitlementChecker *MockEntitlementCheckerFilterer) ParseApproval(log types.Log) (*MockEntitlementCheckerApproval, error) { - event := new(MockEntitlementCheckerApproval) - if err := _MockEntitlementChecker.contract.UnpackLog(event, "Approval", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// MockEntitlementCheckerApprovalForAllIterator is returned from FilterApprovalForAll and is used to iterate over the raw logs and unpacked data for ApprovalForAll events raised by the MockEntitlementChecker contract. -type MockEntitlementCheckerApprovalForAllIterator struct { - Event *MockEntitlementCheckerApprovalForAll // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *MockEntitlementCheckerApprovalForAllIterator) 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(MockEntitlementCheckerApprovalForAll) - 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(MockEntitlementCheckerApprovalForAll) - 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 *MockEntitlementCheckerApprovalForAllIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *MockEntitlementCheckerApprovalForAllIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// MockEntitlementCheckerApprovalForAll represents a ApprovalForAll event raised by the MockEntitlementChecker contract. -type MockEntitlementCheckerApprovalForAll struct { - Owner common.Address - Operator common.Address - Approved bool - Raw types.Log // Blockchain specific contextual infos -} - -// FilterApprovalForAll is a free log retrieval operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. -// -// Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) -func (_MockEntitlementChecker *MockEntitlementCheckerFilterer) FilterApprovalForAll(opts *bind.FilterOpts, owner []common.Address, operator []common.Address) (*MockEntitlementCheckerApprovalForAllIterator, error) { - - var ownerRule []interface{} - for _, ownerItem := range owner { - ownerRule = append(ownerRule, ownerItem) - } - var operatorRule []interface{} - for _, operatorItem := range operator { - operatorRule = append(operatorRule, operatorItem) - } - - logs, sub, err := _MockEntitlementChecker.contract.FilterLogs(opts, "ApprovalForAll", ownerRule, operatorRule) - if err != nil { - return nil, err - } - return &MockEntitlementCheckerApprovalForAllIterator{contract: _MockEntitlementChecker.contract, event: "ApprovalForAll", logs: logs, sub: sub}, nil -} - -// WatchApprovalForAll is a free log subscription operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. -// -// Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) -func (_MockEntitlementChecker *MockEntitlementCheckerFilterer) WatchApprovalForAll(opts *bind.WatchOpts, sink chan<- *MockEntitlementCheckerApprovalForAll, owner []common.Address, operator []common.Address) (event.Subscription, error) { - - var ownerRule []interface{} - for _, ownerItem := range owner { - ownerRule = append(ownerRule, ownerItem) - } - var operatorRule []interface{} - for _, operatorItem := range operator { - operatorRule = append(operatorRule, operatorItem) - } - - logs, sub, err := _MockEntitlementChecker.contract.WatchLogs(opts, "ApprovalForAll", ownerRule, operatorRule) - 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(MockEntitlementCheckerApprovalForAll) - if err := _MockEntitlementChecker.contract.UnpackLog(event, "ApprovalForAll", 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 -} - -// ParseApprovalForAll is a log parse operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. -// -// Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) -func (_MockEntitlementChecker *MockEntitlementCheckerFilterer) ParseApprovalForAll(log types.Log) (*MockEntitlementCheckerApprovalForAll, error) { - event := new(MockEntitlementCheckerApprovalForAll) - if err := _MockEntitlementChecker.contract.UnpackLog(event, "ApprovalForAll", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// MockEntitlementCheckerConsecutiveTransferIterator is returned from FilterConsecutiveTransfer and is used to iterate over the raw logs and unpacked data for ConsecutiveTransfer events raised by the MockEntitlementChecker contract. -type MockEntitlementCheckerConsecutiveTransferIterator struct { - Event *MockEntitlementCheckerConsecutiveTransfer // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *MockEntitlementCheckerConsecutiveTransferIterator) 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(MockEntitlementCheckerConsecutiveTransfer) - 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(MockEntitlementCheckerConsecutiveTransfer) - 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 *MockEntitlementCheckerConsecutiveTransferIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *MockEntitlementCheckerConsecutiveTransferIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// MockEntitlementCheckerConsecutiveTransfer represents a ConsecutiveTransfer event raised by the MockEntitlementChecker contract. -type MockEntitlementCheckerConsecutiveTransfer struct { - FromTokenId *big.Int - ToTokenId *big.Int - From common.Address - To common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterConsecutiveTransfer is a free log retrieval operation binding the contract event 0xdeaa91b6123d068f5821d0fb0678463d1a8a6079fe8af5de3ce5e896dcf9133d. -// -// Solidity: event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to) -func (_MockEntitlementChecker *MockEntitlementCheckerFilterer) FilterConsecutiveTransfer(opts *bind.FilterOpts, fromTokenId []*big.Int, from []common.Address, to []common.Address) (*MockEntitlementCheckerConsecutiveTransferIterator, error) { - - var fromTokenIdRule []interface{} - for _, fromTokenIdItem := range fromTokenId { - fromTokenIdRule = append(fromTokenIdRule, fromTokenIdItem) - } - - var fromRule []interface{} - for _, fromItem := range from { - fromRule = append(fromRule, fromItem) - } - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - - logs, sub, err := _MockEntitlementChecker.contract.FilterLogs(opts, "ConsecutiveTransfer", fromTokenIdRule, fromRule, toRule) - if err != nil { - return nil, err - } - return &MockEntitlementCheckerConsecutiveTransferIterator{contract: _MockEntitlementChecker.contract, event: "ConsecutiveTransfer", logs: logs, sub: sub}, nil -} - -// WatchConsecutiveTransfer is a free log subscription operation binding the contract event 0xdeaa91b6123d068f5821d0fb0678463d1a8a6079fe8af5de3ce5e896dcf9133d. -// -// Solidity: event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to) -func (_MockEntitlementChecker *MockEntitlementCheckerFilterer) WatchConsecutiveTransfer(opts *bind.WatchOpts, sink chan<- *MockEntitlementCheckerConsecutiveTransfer, fromTokenId []*big.Int, from []common.Address, to []common.Address) (event.Subscription, error) { - - var fromTokenIdRule []interface{} - for _, fromTokenIdItem := range fromTokenId { - fromTokenIdRule = append(fromTokenIdRule, fromTokenIdItem) - } - - var fromRule []interface{} - for _, fromItem := range from { - fromRule = append(fromRule, fromItem) - } - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - - logs, sub, err := _MockEntitlementChecker.contract.WatchLogs(opts, "ConsecutiveTransfer", fromTokenIdRule, fromRule, toRule) - 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(MockEntitlementCheckerConsecutiveTransfer) - if err := _MockEntitlementChecker.contract.UnpackLog(event, "ConsecutiveTransfer", 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 -} - -// ParseConsecutiveTransfer is a log parse operation binding the contract event 0xdeaa91b6123d068f5821d0fb0678463d1a8a6079fe8af5de3ce5e896dcf9133d. -// -// Solidity: event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to) -func (_MockEntitlementChecker *MockEntitlementCheckerFilterer) ParseConsecutiveTransfer(log types.Log) (*MockEntitlementCheckerConsecutiveTransfer, error) { - event := new(MockEntitlementCheckerConsecutiveTransfer) - if err := _MockEntitlementChecker.contract.UnpackLog(event, "ConsecutiveTransfer", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// MockEntitlementCheckerEntitlementCheckRequestedIterator is returned from FilterEntitlementCheckRequested and is used to iterate over the raw logs and unpacked data for EntitlementCheckRequested events raised by the MockEntitlementChecker contract. -type MockEntitlementCheckerEntitlementCheckRequestedIterator struct { - Event *MockEntitlementCheckerEntitlementCheckRequested // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *MockEntitlementCheckerEntitlementCheckRequestedIterator) 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(MockEntitlementCheckerEntitlementCheckRequested) - 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(MockEntitlementCheckerEntitlementCheckRequested) - 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 *MockEntitlementCheckerEntitlementCheckRequestedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *MockEntitlementCheckerEntitlementCheckRequestedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// MockEntitlementCheckerEntitlementCheckRequested represents a EntitlementCheckRequested event raised by the MockEntitlementChecker contract. -type MockEntitlementCheckerEntitlementCheckRequested struct { - CallerAddress common.Address - ContractAddress common.Address - TransactionId [32]byte - RoleId *big.Int - SelectedNodes []common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterEntitlementCheckRequested is a free log retrieval operation binding the contract event 0x4675e3cc15801ffde520a3076d6ad75c0c6dbe8f23bdbea1dd45b676caffe4f3. -// -// Solidity: event EntitlementCheckRequested(address callerAddress, address contractAddress, bytes32 transactionId, uint256 roleId, address[] selectedNodes) -func (_MockEntitlementChecker *MockEntitlementCheckerFilterer) FilterEntitlementCheckRequested(opts *bind.FilterOpts) (*MockEntitlementCheckerEntitlementCheckRequestedIterator, error) { - - logs, sub, err := _MockEntitlementChecker.contract.FilterLogs(opts, "EntitlementCheckRequested") - if err != nil { - return nil, err - } - return &MockEntitlementCheckerEntitlementCheckRequestedIterator{contract: _MockEntitlementChecker.contract, event: "EntitlementCheckRequested", logs: logs, sub: sub}, nil -} - -// WatchEntitlementCheckRequested is a free log subscription operation binding the contract event 0x4675e3cc15801ffde520a3076d6ad75c0c6dbe8f23bdbea1dd45b676caffe4f3. -// -// Solidity: event EntitlementCheckRequested(address callerAddress, address contractAddress, bytes32 transactionId, uint256 roleId, address[] selectedNodes) -func (_MockEntitlementChecker *MockEntitlementCheckerFilterer) WatchEntitlementCheckRequested(opts *bind.WatchOpts, sink chan<- *MockEntitlementCheckerEntitlementCheckRequested) (event.Subscription, error) { - - logs, sub, err := _MockEntitlementChecker.contract.WatchLogs(opts, "EntitlementCheckRequested") - 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(MockEntitlementCheckerEntitlementCheckRequested) - if err := _MockEntitlementChecker.contract.UnpackLog(event, "EntitlementCheckRequested", 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 -} - -// ParseEntitlementCheckRequested is a log parse operation binding the contract event 0x4675e3cc15801ffde520a3076d6ad75c0c6dbe8f23bdbea1dd45b676caffe4f3. -// -// Solidity: event EntitlementCheckRequested(address callerAddress, address contractAddress, bytes32 transactionId, uint256 roleId, address[] selectedNodes) -func (_MockEntitlementChecker *MockEntitlementCheckerFilterer) ParseEntitlementCheckRequested(log types.Log) (*MockEntitlementCheckerEntitlementCheckRequested, error) { - event := new(MockEntitlementCheckerEntitlementCheckRequested) - if err := _MockEntitlementChecker.contract.UnpackLog(event, "EntitlementCheckRequested", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// MockEntitlementCheckerInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the MockEntitlementChecker contract. -type MockEntitlementCheckerInitializedIterator struct { - Event *MockEntitlementCheckerInitialized // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *MockEntitlementCheckerInitializedIterator) 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(MockEntitlementCheckerInitialized) - 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(MockEntitlementCheckerInitialized) - 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 *MockEntitlementCheckerInitializedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *MockEntitlementCheckerInitializedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// MockEntitlementCheckerInitialized represents a Initialized event raised by the MockEntitlementChecker contract. -type MockEntitlementCheckerInitialized struct { - Version uint32 - Raw types.Log // Blockchain specific contextual infos -} - -// FilterInitialized is a free log retrieval operation binding the contract event 0xe9c9b456cb2994b80aeef036cf59d26e9617df80f816a6ee5a5b4166e07e2f5c. -// -// Solidity: event Initialized(uint32 version) -func (_MockEntitlementChecker *MockEntitlementCheckerFilterer) FilterInitialized(opts *bind.FilterOpts) (*MockEntitlementCheckerInitializedIterator, error) { - - logs, sub, err := _MockEntitlementChecker.contract.FilterLogs(opts, "Initialized") - if err != nil { - return nil, err - } - return &MockEntitlementCheckerInitializedIterator{contract: _MockEntitlementChecker.contract, event: "Initialized", logs: logs, sub: sub}, nil -} - -// WatchInitialized is a free log subscription operation binding the contract event 0xe9c9b456cb2994b80aeef036cf59d26e9617df80f816a6ee5a5b4166e07e2f5c. -// -// Solidity: event Initialized(uint32 version) -func (_MockEntitlementChecker *MockEntitlementCheckerFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *MockEntitlementCheckerInitialized) (event.Subscription, error) { - - logs, sub, err := _MockEntitlementChecker.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(MockEntitlementCheckerInitialized) - if err := _MockEntitlementChecker.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 0xe9c9b456cb2994b80aeef036cf59d26e9617df80f816a6ee5a5b4166e07e2f5c. -// -// Solidity: event Initialized(uint32 version) -func (_MockEntitlementChecker *MockEntitlementCheckerFilterer) ParseInitialized(log types.Log) (*MockEntitlementCheckerInitialized, error) { - event := new(MockEntitlementCheckerInitialized) - if err := _MockEntitlementChecker.contract.UnpackLog(event, "Initialized", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// MockEntitlementCheckerInterfaceAddedIterator is returned from FilterInterfaceAdded and is used to iterate over the raw logs and unpacked data for InterfaceAdded events raised by the MockEntitlementChecker contract. -type MockEntitlementCheckerInterfaceAddedIterator struct { - Event *MockEntitlementCheckerInterfaceAdded // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *MockEntitlementCheckerInterfaceAddedIterator) 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(MockEntitlementCheckerInterfaceAdded) - 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(MockEntitlementCheckerInterfaceAdded) - 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 *MockEntitlementCheckerInterfaceAddedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *MockEntitlementCheckerInterfaceAddedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// MockEntitlementCheckerInterfaceAdded represents a InterfaceAdded event raised by the MockEntitlementChecker contract. -type MockEntitlementCheckerInterfaceAdded struct { - InterfaceId [4]byte - Raw types.Log // Blockchain specific contextual infos -} - -// FilterInterfaceAdded is a free log retrieval operation binding the contract event 0x78f84e5b1c5c05be2b5ad3800781dd404d6d6c6302bc755c0fe20f58a33a7f22. -// -// Solidity: event InterfaceAdded(bytes4 indexed interfaceId) -func (_MockEntitlementChecker *MockEntitlementCheckerFilterer) FilterInterfaceAdded(opts *bind.FilterOpts, interfaceId [][4]byte) (*MockEntitlementCheckerInterfaceAddedIterator, error) { - - var interfaceIdRule []interface{} - for _, interfaceIdItem := range interfaceId { - interfaceIdRule = append(interfaceIdRule, interfaceIdItem) - } - - logs, sub, err := _MockEntitlementChecker.contract.FilterLogs(opts, "InterfaceAdded", interfaceIdRule) - if err != nil { - return nil, err - } - return &MockEntitlementCheckerInterfaceAddedIterator{contract: _MockEntitlementChecker.contract, event: "InterfaceAdded", logs: logs, sub: sub}, nil -} - -// WatchInterfaceAdded is a free log subscription operation binding the contract event 0x78f84e5b1c5c05be2b5ad3800781dd404d6d6c6302bc755c0fe20f58a33a7f22. -// -// Solidity: event InterfaceAdded(bytes4 indexed interfaceId) -func (_MockEntitlementChecker *MockEntitlementCheckerFilterer) WatchInterfaceAdded(opts *bind.WatchOpts, sink chan<- *MockEntitlementCheckerInterfaceAdded, interfaceId [][4]byte) (event.Subscription, error) { - - var interfaceIdRule []interface{} - for _, interfaceIdItem := range interfaceId { - interfaceIdRule = append(interfaceIdRule, interfaceIdItem) - } - - logs, sub, err := _MockEntitlementChecker.contract.WatchLogs(opts, "InterfaceAdded", interfaceIdRule) - 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(MockEntitlementCheckerInterfaceAdded) - if err := _MockEntitlementChecker.contract.UnpackLog(event, "InterfaceAdded", 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 -} - -// ParseInterfaceAdded is a log parse operation binding the contract event 0x78f84e5b1c5c05be2b5ad3800781dd404d6d6c6302bc755c0fe20f58a33a7f22. -// -// Solidity: event InterfaceAdded(bytes4 indexed interfaceId) -func (_MockEntitlementChecker *MockEntitlementCheckerFilterer) ParseInterfaceAdded(log types.Log) (*MockEntitlementCheckerInterfaceAdded, error) { - event := new(MockEntitlementCheckerInterfaceAdded) - if err := _MockEntitlementChecker.contract.UnpackLog(event, "InterfaceAdded", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// MockEntitlementCheckerInterfaceRemovedIterator is returned from FilterInterfaceRemoved and is used to iterate over the raw logs and unpacked data for InterfaceRemoved events raised by the MockEntitlementChecker contract. -type MockEntitlementCheckerInterfaceRemovedIterator struct { - Event *MockEntitlementCheckerInterfaceRemoved // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *MockEntitlementCheckerInterfaceRemovedIterator) 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(MockEntitlementCheckerInterfaceRemoved) - 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(MockEntitlementCheckerInterfaceRemoved) - 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 *MockEntitlementCheckerInterfaceRemovedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *MockEntitlementCheckerInterfaceRemovedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// MockEntitlementCheckerInterfaceRemoved represents a InterfaceRemoved event raised by the MockEntitlementChecker contract. -type MockEntitlementCheckerInterfaceRemoved struct { - InterfaceId [4]byte - Raw types.Log // Blockchain specific contextual infos -} - -// FilterInterfaceRemoved is a free log retrieval operation binding the contract event 0x8bd383568d0bc57b64b8e424138fc19ae827e694e05757faa8fea8f63fb87315. -// -// Solidity: event InterfaceRemoved(bytes4 indexed interfaceId) -func (_MockEntitlementChecker *MockEntitlementCheckerFilterer) FilterInterfaceRemoved(opts *bind.FilterOpts, interfaceId [][4]byte) (*MockEntitlementCheckerInterfaceRemovedIterator, error) { - - var interfaceIdRule []interface{} - for _, interfaceIdItem := range interfaceId { - interfaceIdRule = append(interfaceIdRule, interfaceIdItem) - } - - logs, sub, err := _MockEntitlementChecker.contract.FilterLogs(opts, "InterfaceRemoved", interfaceIdRule) - if err != nil { - return nil, err - } - return &MockEntitlementCheckerInterfaceRemovedIterator{contract: _MockEntitlementChecker.contract, event: "InterfaceRemoved", logs: logs, sub: sub}, nil -} - -// WatchInterfaceRemoved is a free log subscription operation binding the contract event 0x8bd383568d0bc57b64b8e424138fc19ae827e694e05757faa8fea8f63fb87315. -// -// Solidity: event InterfaceRemoved(bytes4 indexed interfaceId) -func (_MockEntitlementChecker *MockEntitlementCheckerFilterer) WatchInterfaceRemoved(opts *bind.WatchOpts, sink chan<- *MockEntitlementCheckerInterfaceRemoved, interfaceId [][4]byte) (event.Subscription, error) { - - var interfaceIdRule []interface{} - for _, interfaceIdItem := range interfaceId { - interfaceIdRule = append(interfaceIdRule, interfaceIdItem) - } - - logs, sub, err := _MockEntitlementChecker.contract.WatchLogs(opts, "InterfaceRemoved", interfaceIdRule) - 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(MockEntitlementCheckerInterfaceRemoved) - if err := _MockEntitlementChecker.contract.UnpackLog(event, "InterfaceRemoved", 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 -} - -// ParseInterfaceRemoved is a log parse operation binding the contract event 0x8bd383568d0bc57b64b8e424138fc19ae827e694e05757faa8fea8f63fb87315. -// -// Solidity: event InterfaceRemoved(bytes4 indexed interfaceId) -func (_MockEntitlementChecker *MockEntitlementCheckerFilterer) ParseInterfaceRemoved(log types.Log) (*MockEntitlementCheckerInterfaceRemoved, error) { - event := new(MockEntitlementCheckerInterfaceRemoved) - if err := _MockEntitlementChecker.contract.UnpackLog(event, "InterfaceRemoved", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// MockEntitlementCheckerNodeRegisteredIterator is returned from FilterNodeRegistered and is used to iterate over the raw logs and unpacked data for NodeRegistered events raised by the MockEntitlementChecker contract. -type MockEntitlementCheckerNodeRegisteredIterator struct { - Event *MockEntitlementCheckerNodeRegistered // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *MockEntitlementCheckerNodeRegisteredIterator) 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(MockEntitlementCheckerNodeRegistered) - 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(MockEntitlementCheckerNodeRegistered) - 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 *MockEntitlementCheckerNodeRegisteredIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *MockEntitlementCheckerNodeRegisteredIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// MockEntitlementCheckerNodeRegistered represents a NodeRegistered event raised by the MockEntitlementChecker contract. -type MockEntitlementCheckerNodeRegistered struct { - NodeAddress common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterNodeRegistered is a free log retrieval operation binding the contract event 0x564728e6a7c8edd446557d94e0339d5e6ca2e05f42188914efdbdc87bcbbabf6. -// -// Solidity: event NodeRegistered(address indexed nodeAddress) -func (_MockEntitlementChecker *MockEntitlementCheckerFilterer) FilterNodeRegistered(opts *bind.FilterOpts, nodeAddress []common.Address) (*MockEntitlementCheckerNodeRegisteredIterator, error) { - - var nodeAddressRule []interface{} - for _, nodeAddressItem := range nodeAddress { - nodeAddressRule = append(nodeAddressRule, nodeAddressItem) - } - - logs, sub, err := _MockEntitlementChecker.contract.FilterLogs(opts, "NodeRegistered", nodeAddressRule) - if err != nil { - return nil, err - } - return &MockEntitlementCheckerNodeRegisteredIterator{contract: _MockEntitlementChecker.contract, event: "NodeRegistered", logs: logs, sub: sub}, nil -} - -// WatchNodeRegistered is a free log subscription operation binding the contract event 0x564728e6a7c8edd446557d94e0339d5e6ca2e05f42188914efdbdc87bcbbabf6. -// -// Solidity: event NodeRegistered(address indexed nodeAddress) -func (_MockEntitlementChecker *MockEntitlementCheckerFilterer) WatchNodeRegistered(opts *bind.WatchOpts, sink chan<- *MockEntitlementCheckerNodeRegistered, nodeAddress []common.Address) (event.Subscription, error) { - - var nodeAddressRule []interface{} - for _, nodeAddressItem := range nodeAddress { - nodeAddressRule = append(nodeAddressRule, nodeAddressItem) - } - - logs, sub, err := _MockEntitlementChecker.contract.WatchLogs(opts, "NodeRegistered", nodeAddressRule) - 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(MockEntitlementCheckerNodeRegistered) - if err := _MockEntitlementChecker.contract.UnpackLog(event, "NodeRegistered", 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 -} - -// ParseNodeRegistered is a log parse operation binding the contract event 0x564728e6a7c8edd446557d94e0339d5e6ca2e05f42188914efdbdc87bcbbabf6. -// -// Solidity: event NodeRegistered(address indexed nodeAddress) -func (_MockEntitlementChecker *MockEntitlementCheckerFilterer) ParseNodeRegistered(log types.Log) (*MockEntitlementCheckerNodeRegistered, error) { - event := new(MockEntitlementCheckerNodeRegistered) - if err := _MockEntitlementChecker.contract.UnpackLog(event, "NodeRegistered", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// MockEntitlementCheckerNodeUnregisteredIterator is returned from FilterNodeUnregistered and is used to iterate over the raw logs and unpacked data for NodeUnregistered events raised by the MockEntitlementChecker contract. -type MockEntitlementCheckerNodeUnregisteredIterator struct { - Event *MockEntitlementCheckerNodeUnregistered // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *MockEntitlementCheckerNodeUnregisteredIterator) 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(MockEntitlementCheckerNodeUnregistered) - 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(MockEntitlementCheckerNodeUnregistered) - 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 *MockEntitlementCheckerNodeUnregisteredIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *MockEntitlementCheckerNodeUnregisteredIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// MockEntitlementCheckerNodeUnregistered represents a NodeUnregistered event raised by the MockEntitlementChecker contract. -type MockEntitlementCheckerNodeUnregistered struct { - NodeAddress common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterNodeUnregistered is a free log retrieval operation binding the contract event 0xb1864577e4f285436a80ebc833984755393e2450d58622a65fb4fce87ea3573a. -// -// Solidity: event NodeUnregistered(address indexed nodeAddress) -func (_MockEntitlementChecker *MockEntitlementCheckerFilterer) FilterNodeUnregistered(opts *bind.FilterOpts, nodeAddress []common.Address) (*MockEntitlementCheckerNodeUnregisteredIterator, error) { - - var nodeAddressRule []interface{} - for _, nodeAddressItem := range nodeAddress { - nodeAddressRule = append(nodeAddressRule, nodeAddressItem) - } - - logs, sub, err := _MockEntitlementChecker.contract.FilterLogs(opts, "NodeUnregistered", nodeAddressRule) - if err != nil { - return nil, err - } - return &MockEntitlementCheckerNodeUnregisteredIterator{contract: _MockEntitlementChecker.contract, event: "NodeUnregistered", logs: logs, sub: sub}, nil -} - -// WatchNodeUnregistered is a free log subscription operation binding the contract event 0xb1864577e4f285436a80ebc833984755393e2450d58622a65fb4fce87ea3573a. -// -// Solidity: event NodeUnregistered(address indexed nodeAddress) -func (_MockEntitlementChecker *MockEntitlementCheckerFilterer) WatchNodeUnregistered(opts *bind.WatchOpts, sink chan<- *MockEntitlementCheckerNodeUnregistered, nodeAddress []common.Address) (event.Subscription, error) { - - var nodeAddressRule []interface{} - for _, nodeAddressItem := range nodeAddress { - nodeAddressRule = append(nodeAddressRule, nodeAddressItem) - } - - logs, sub, err := _MockEntitlementChecker.contract.WatchLogs(opts, "NodeUnregistered", nodeAddressRule) - 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(MockEntitlementCheckerNodeUnregistered) - if err := _MockEntitlementChecker.contract.UnpackLog(event, "NodeUnregistered", 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 -} - -// ParseNodeUnregistered is a log parse operation binding the contract event 0xb1864577e4f285436a80ebc833984755393e2450d58622a65fb4fce87ea3573a. -// -// Solidity: event NodeUnregistered(address indexed nodeAddress) -func (_MockEntitlementChecker *MockEntitlementCheckerFilterer) ParseNodeUnregistered(log types.Log) (*MockEntitlementCheckerNodeUnregistered, error) { - event := new(MockEntitlementCheckerNodeUnregistered) - if err := _MockEntitlementChecker.contract.UnpackLog(event, "NodeUnregistered", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// MockEntitlementCheckerOperatorClaimAddressChangedIterator is returned from FilterOperatorClaimAddressChanged and is used to iterate over the raw logs and unpacked data for OperatorClaimAddressChanged events raised by the MockEntitlementChecker contract. -type MockEntitlementCheckerOperatorClaimAddressChangedIterator struct { - Event *MockEntitlementCheckerOperatorClaimAddressChanged // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *MockEntitlementCheckerOperatorClaimAddressChangedIterator) 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(MockEntitlementCheckerOperatorClaimAddressChanged) - 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(MockEntitlementCheckerOperatorClaimAddressChanged) - 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 *MockEntitlementCheckerOperatorClaimAddressChangedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *MockEntitlementCheckerOperatorClaimAddressChangedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// MockEntitlementCheckerOperatorClaimAddressChanged represents a OperatorClaimAddressChanged event raised by the MockEntitlementChecker contract. -type MockEntitlementCheckerOperatorClaimAddressChanged struct { - Operator common.Address - ClaimAddress common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterOperatorClaimAddressChanged is a free log retrieval operation binding the contract event 0x9acff66817c6f3fac3752bef82306270971b2a3da032a5cb876e05676bb83288. -// -// Solidity: event OperatorClaimAddressChanged(address indexed operator, address indexed claimAddress) -func (_MockEntitlementChecker *MockEntitlementCheckerFilterer) FilterOperatorClaimAddressChanged(opts *bind.FilterOpts, operator []common.Address, claimAddress []common.Address) (*MockEntitlementCheckerOperatorClaimAddressChangedIterator, error) { - - var operatorRule []interface{} - for _, operatorItem := range operator { - operatorRule = append(operatorRule, operatorItem) - } - var claimAddressRule []interface{} - for _, claimAddressItem := range claimAddress { - claimAddressRule = append(claimAddressRule, claimAddressItem) - } - - logs, sub, err := _MockEntitlementChecker.contract.FilterLogs(opts, "OperatorClaimAddressChanged", operatorRule, claimAddressRule) - if err != nil { - return nil, err - } - return &MockEntitlementCheckerOperatorClaimAddressChangedIterator{contract: _MockEntitlementChecker.contract, event: "OperatorClaimAddressChanged", logs: logs, sub: sub}, nil -} - -// WatchOperatorClaimAddressChanged is a free log subscription operation binding the contract event 0x9acff66817c6f3fac3752bef82306270971b2a3da032a5cb876e05676bb83288. -// -// Solidity: event OperatorClaimAddressChanged(address indexed operator, address indexed claimAddress) -func (_MockEntitlementChecker *MockEntitlementCheckerFilterer) WatchOperatorClaimAddressChanged(opts *bind.WatchOpts, sink chan<- *MockEntitlementCheckerOperatorClaimAddressChanged, operator []common.Address, claimAddress []common.Address) (event.Subscription, error) { - - var operatorRule []interface{} - for _, operatorItem := range operator { - operatorRule = append(operatorRule, operatorItem) - } - var claimAddressRule []interface{} - for _, claimAddressItem := range claimAddress { - claimAddressRule = append(claimAddressRule, claimAddressItem) - } - - logs, sub, err := _MockEntitlementChecker.contract.WatchLogs(opts, "OperatorClaimAddressChanged", operatorRule, claimAddressRule) - 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(MockEntitlementCheckerOperatorClaimAddressChanged) - if err := _MockEntitlementChecker.contract.UnpackLog(event, "OperatorClaimAddressChanged", 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 -} - -// ParseOperatorClaimAddressChanged is a log parse operation binding the contract event 0x9acff66817c6f3fac3752bef82306270971b2a3da032a5cb876e05676bb83288. -// -// Solidity: event OperatorClaimAddressChanged(address indexed operator, address indexed claimAddress) -func (_MockEntitlementChecker *MockEntitlementCheckerFilterer) ParseOperatorClaimAddressChanged(log types.Log) (*MockEntitlementCheckerOperatorClaimAddressChanged, error) { - event := new(MockEntitlementCheckerOperatorClaimAddressChanged) - if err := _MockEntitlementChecker.contract.UnpackLog(event, "OperatorClaimAddressChanged", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// MockEntitlementCheckerOperatorCommissionChangedIterator is returned from FilterOperatorCommissionChanged and is used to iterate over the raw logs and unpacked data for OperatorCommissionChanged events raised by the MockEntitlementChecker contract. -type MockEntitlementCheckerOperatorCommissionChangedIterator struct { - Event *MockEntitlementCheckerOperatorCommissionChanged // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *MockEntitlementCheckerOperatorCommissionChangedIterator) 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(MockEntitlementCheckerOperatorCommissionChanged) - 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(MockEntitlementCheckerOperatorCommissionChanged) - 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 *MockEntitlementCheckerOperatorCommissionChangedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *MockEntitlementCheckerOperatorCommissionChangedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// MockEntitlementCheckerOperatorCommissionChanged represents a OperatorCommissionChanged event raised by the MockEntitlementChecker contract. -type MockEntitlementCheckerOperatorCommissionChanged struct { - Operator common.Address - Commission *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterOperatorCommissionChanged is a free log retrieval operation binding the contract event 0x3f8e6b052699b5c8512c54ad8f8c79ddbf0486d3263c519f20bdbb42cd4bd6da. -// -// Solidity: event OperatorCommissionChanged(address indexed operator, uint256 indexed commission) -func (_MockEntitlementChecker *MockEntitlementCheckerFilterer) FilterOperatorCommissionChanged(opts *bind.FilterOpts, operator []common.Address, commission []*big.Int) (*MockEntitlementCheckerOperatorCommissionChangedIterator, error) { - - var operatorRule []interface{} - for _, operatorItem := range operator { - operatorRule = append(operatorRule, operatorItem) - } - var commissionRule []interface{} - for _, commissionItem := range commission { - commissionRule = append(commissionRule, commissionItem) - } - - logs, sub, err := _MockEntitlementChecker.contract.FilterLogs(opts, "OperatorCommissionChanged", operatorRule, commissionRule) - if err != nil { - return nil, err - } - return &MockEntitlementCheckerOperatorCommissionChangedIterator{contract: _MockEntitlementChecker.contract, event: "OperatorCommissionChanged", logs: logs, sub: sub}, nil -} - -// WatchOperatorCommissionChanged is a free log subscription operation binding the contract event 0x3f8e6b052699b5c8512c54ad8f8c79ddbf0486d3263c519f20bdbb42cd4bd6da. -// -// Solidity: event OperatorCommissionChanged(address indexed operator, uint256 indexed commission) -func (_MockEntitlementChecker *MockEntitlementCheckerFilterer) WatchOperatorCommissionChanged(opts *bind.WatchOpts, sink chan<- *MockEntitlementCheckerOperatorCommissionChanged, operator []common.Address, commission []*big.Int) (event.Subscription, error) { - - var operatorRule []interface{} - for _, operatorItem := range operator { - operatorRule = append(operatorRule, operatorItem) - } - var commissionRule []interface{} - for _, commissionItem := range commission { - commissionRule = append(commissionRule, commissionItem) - } - - logs, sub, err := _MockEntitlementChecker.contract.WatchLogs(opts, "OperatorCommissionChanged", operatorRule, commissionRule) - 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(MockEntitlementCheckerOperatorCommissionChanged) - if err := _MockEntitlementChecker.contract.UnpackLog(event, "OperatorCommissionChanged", 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 -} - -// ParseOperatorCommissionChanged is a log parse operation binding the contract event 0x3f8e6b052699b5c8512c54ad8f8c79ddbf0486d3263c519f20bdbb42cd4bd6da. -// -// Solidity: event OperatorCommissionChanged(address indexed operator, uint256 indexed commission) -func (_MockEntitlementChecker *MockEntitlementCheckerFilterer) ParseOperatorCommissionChanged(log types.Log) (*MockEntitlementCheckerOperatorCommissionChanged, error) { - event := new(MockEntitlementCheckerOperatorCommissionChanged) - if err := _MockEntitlementChecker.contract.UnpackLog(event, "OperatorCommissionChanged", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// MockEntitlementCheckerOperatorRegisteredIterator is returned from FilterOperatorRegistered and is used to iterate over the raw logs and unpacked data for OperatorRegistered events raised by the MockEntitlementChecker contract. -type MockEntitlementCheckerOperatorRegisteredIterator struct { - Event *MockEntitlementCheckerOperatorRegistered // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *MockEntitlementCheckerOperatorRegisteredIterator) 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(MockEntitlementCheckerOperatorRegistered) - 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(MockEntitlementCheckerOperatorRegistered) - 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 *MockEntitlementCheckerOperatorRegisteredIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *MockEntitlementCheckerOperatorRegisteredIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// MockEntitlementCheckerOperatorRegistered represents a OperatorRegistered event raised by the MockEntitlementChecker contract. -type MockEntitlementCheckerOperatorRegistered struct { - Operator common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterOperatorRegistered is a free log retrieval operation binding the contract event 0x4d0eb1f4bac8744fd2be119845e23b3befc88094b42bcda1204c65694a00f9e5. -// -// Solidity: event OperatorRegistered(address indexed operator) -func (_MockEntitlementChecker *MockEntitlementCheckerFilterer) FilterOperatorRegistered(opts *bind.FilterOpts, operator []common.Address) (*MockEntitlementCheckerOperatorRegisteredIterator, error) { - - var operatorRule []interface{} - for _, operatorItem := range operator { - operatorRule = append(operatorRule, operatorItem) - } - - logs, sub, err := _MockEntitlementChecker.contract.FilterLogs(opts, "OperatorRegistered", operatorRule) - if err != nil { - return nil, err - } - return &MockEntitlementCheckerOperatorRegisteredIterator{contract: _MockEntitlementChecker.contract, event: "OperatorRegistered", logs: logs, sub: sub}, nil -} - -// WatchOperatorRegistered is a free log subscription operation binding the contract event 0x4d0eb1f4bac8744fd2be119845e23b3befc88094b42bcda1204c65694a00f9e5. -// -// Solidity: event OperatorRegistered(address indexed operator) -func (_MockEntitlementChecker *MockEntitlementCheckerFilterer) WatchOperatorRegistered(opts *bind.WatchOpts, sink chan<- *MockEntitlementCheckerOperatorRegistered, operator []common.Address) (event.Subscription, error) { - - var operatorRule []interface{} - for _, operatorItem := range operator { - operatorRule = append(operatorRule, operatorItem) - } - - logs, sub, err := _MockEntitlementChecker.contract.WatchLogs(opts, "OperatorRegistered", operatorRule) - 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(MockEntitlementCheckerOperatorRegistered) - if err := _MockEntitlementChecker.contract.UnpackLog(event, "OperatorRegistered", 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 -} - -// ParseOperatorRegistered is a log parse operation binding the contract event 0x4d0eb1f4bac8744fd2be119845e23b3befc88094b42bcda1204c65694a00f9e5. -// -// Solidity: event OperatorRegistered(address indexed operator) -func (_MockEntitlementChecker *MockEntitlementCheckerFilterer) ParseOperatorRegistered(log types.Log) (*MockEntitlementCheckerOperatorRegistered, error) { - event := new(MockEntitlementCheckerOperatorRegistered) - if err := _MockEntitlementChecker.contract.UnpackLog(event, "OperatorRegistered", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// MockEntitlementCheckerOperatorStatusChangedIterator is returned from FilterOperatorStatusChanged and is used to iterate over the raw logs and unpacked data for OperatorStatusChanged events raised by the MockEntitlementChecker contract. -type MockEntitlementCheckerOperatorStatusChangedIterator struct { - Event *MockEntitlementCheckerOperatorStatusChanged // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *MockEntitlementCheckerOperatorStatusChangedIterator) 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(MockEntitlementCheckerOperatorStatusChanged) - 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(MockEntitlementCheckerOperatorStatusChanged) - 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 *MockEntitlementCheckerOperatorStatusChangedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *MockEntitlementCheckerOperatorStatusChangedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// MockEntitlementCheckerOperatorStatusChanged represents a OperatorStatusChanged event raised by the MockEntitlementChecker contract. -type MockEntitlementCheckerOperatorStatusChanged struct { - Operator common.Address - NewStatus uint8 - Raw types.Log // Blockchain specific contextual infos -} - -// FilterOperatorStatusChanged is a free log retrieval operation binding the contract event 0x7db2ae93d80cbf3cf719888318a0b92adff1855bcb01eda517607ed7b0f2183a. -// -// Solidity: event OperatorStatusChanged(address indexed operator, uint8 indexed newStatus) -func (_MockEntitlementChecker *MockEntitlementCheckerFilterer) FilterOperatorStatusChanged(opts *bind.FilterOpts, operator []common.Address, newStatus []uint8) (*MockEntitlementCheckerOperatorStatusChangedIterator, error) { - - var operatorRule []interface{} - for _, operatorItem := range operator { - operatorRule = append(operatorRule, operatorItem) - } - var newStatusRule []interface{} - for _, newStatusItem := range newStatus { - newStatusRule = append(newStatusRule, newStatusItem) - } - - logs, sub, err := _MockEntitlementChecker.contract.FilterLogs(opts, "OperatorStatusChanged", operatorRule, newStatusRule) - if err != nil { - return nil, err - } - return &MockEntitlementCheckerOperatorStatusChangedIterator{contract: _MockEntitlementChecker.contract, event: "OperatorStatusChanged", logs: logs, sub: sub}, nil -} - -// WatchOperatorStatusChanged is a free log subscription operation binding the contract event 0x7db2ae93d80cbf3cf719888318a0b92adff1855bcb01eda517607ed7b0f2183a. -// -// Solidity: event OperatorStatusChanged(address indexed operator, uint8 indexed newStatus) -func (_MockEntitlementChecker *MockEntitlementCheckerFilterer) WatchOperatorStatusChanged(opts *bind.WatchOpts, sink chan<- *MockEntitlementCheckerOperatorStatusChanged, operator []common.Address, newStatus []uint8) (event.Subscription, error) { - - var operatorRule []interface{} - for _, operatorItem := range operator { - operatorRule = append(operatorRule, operatorItem) - } - var newStatusRule []interface{} - for _, newStatusItem := range newStatus { - newStatusRule = append(newStatusRule, newStatusItem) - } - - logs, sub, err := _MockEntitlementChecker.contract.WatchLogs(opts, "OperatorStatusChanged", operatorRule, newStatusRule) - 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(MockEntitlementCheckerOperatorStatusChanged) - if err := _MockEntitlementChecker.contract.UnpackLog(event, "OperatorStatusChanged", 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 -} - -// ParseOperatorStatusChanged is a log parse operation binding the contract event 0x7db2ae93d80cbf3cf719888318a0b92adff1855bcb01eda517607ed7b0f2183a. -// -// Solidity: event OperatorStatusChanged(address indexed operator, uint8 indexed newStatus) -func (_MockEntitlementChecker *MockEntitlementCheckerFilterer) ParseOperatorStatusChanged(log types.Log) (*MockEntitlementCheckerOperatorStatusChanged, error) { - event := new(MockEntitlementCheckerOperatorStatusChanged) - if err := _MockEntitlementChecker.contract.UnpackLog(event, "OperatorStatusChanged", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// MockEntitlementCheckerOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the MockEntitlementChecker contract. -type MockEntitlementCheckerOwnershipTransferredIterator struct { - Event *MockEntitlementCheckerOwnershipTransferred // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *MockEntitlementCheckerOwnershipTransferredIterator) 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(MockEntitlementCheckerOwnershipTransferred) - 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(MockEntitlementCheckerOwnershipTransferred) - 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 *MockEntitlementCheckerOwnershipTransferredIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *MockEntitlementCheckerOwnershipTransferredIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// MockEntitlementCheckerOwnershipTransferred represents a OwnershipTransferred event raised by the MockEntitlementChecker contract. -type MockEntitlementCheckerOwnershipTransferred struct { - PreviousOwner common.Address - NewOwner common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_MockEntitlementChecker *MockEntitlementCheckerFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*MockEntitlementCheckerOwnershipTransferredIterator, error) { - - var previousOwnerRule []interface{} - for _, previousOwnerItem := range previousOwner { - previousOwnerRule = append(previousOwnerRule, previousOwnerItem) - } - var newOwnerRule []interface{} - for _, newOwnerItem := range newOwner { - newOwnerRule = append(newOwnerRule, newOwnerItem) - } - - logs, sub, err := _MockEntitlementChecker.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) - if err != nil { - return nil, err - } - return &MockEntitlementCheckerOwnershipTransferredIterator{contract: _MockEntitlementChecker.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil -} - -// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_MockEntitlementChecker *MockEntitlementCheckerFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *MockEntitlementCheckerOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { - - var previousOwnerRule []interface{} - for _, previousOwnerItem := range previousOwner { - previousOwnerRule = append(previousOwnerRule, previousOwnerItem) - } - var newOwnerRule []interface{} - for _, newOwnerItem := range newOwner { - newOwnerRule = append(newOwnerRule, newOwnerItem) - } - - logs, sub, err := _MockEntitlementChecker.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(MockEntitlementCheckerOwnershipTransferred) - if err := _MockEntitlementChecker.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_MockEntitlementChecker *MockEntitlementCheckerFilterer) ParseOwnershipTransferred(log types.Log) (*MockEntitlementCheckerOwnershipTransferred, error) { - event := new(MockEntitlementCheckerOwnershipTransferred) - if err := _MockEntitlementChecker.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// MockEntitlementCheckerTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the MockEntitlementChecker contract. -type MockEntitlementCheckerTransferIterator struct { - Event *MockEntitlementCheckerTransfer // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *MockEntitlementCheckerTransferIterator) 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(MockEntitlementCheckerTransfer) - 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(MockEntitlementCheckerTransfer) - 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 *MockEntitlementCheckerTransferIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *MockEntitlementCheckerTransferIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// MockEntitlementCheckerTransfer represents a Transfer event raised by the MockEntitlementChecker contract. -type MockEntitlementCheckerTransfer struct { - From common.Address - To common.Address - TokenId *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. -// -// Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) -func (_MockEntitlementChecker *MockEntitlementCheckerFilterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address, tokenId []*big.Int) (*MockEntitlementCheckerTransferIterator, error) { - - var fromRule []interface{} - for _, fromItem := range from { - fromRule = append(fromRule, fromItem) - } - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - var tokenIdRule []interface{} - for _, tokenIdItem := range tokenId { - tokenIdRule = append(tokenIdRule, tokenIdItem) - } - - logs, sub, err := _MockEntitlementChecker.contract.FilterLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) - if err != nil { - return nil, err - } - return &MockEntitlementCheckerTransferIterator{contract: _MockEntitlementChecker.contract, event: "Transfer", logs: logs, sub: sub}, nil -} - -// WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. -// -// Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) -func (_MockEntitlementChecker *MockEntitlementCheckerFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *MockEntitlementCheckerTransfer, from []common.Address, to []common.Address, tokenId []*big.Int) (event.Subscription, error) { - - var fromRule []interface{} - for _, fromItem := range from { - fromRule = append(fromRule, fromItem) - } - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - var tokenIdRule []interface{} - for _, tokenIdItem := range tokenId { - tokenIdRule = append(tokenIdRule, tokenIdItem) - } - - logs, sub, err := _MockEntitlementChecker.contract.WatchLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) - 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(MockEntitlementCheckerTransfer) - if err := _MockEntitlementChecker.contract.UnpackLog(event, "Transfer", 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 -} - -// ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. -// -// Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) -func (_MockEntitlementChecker *MockEntitlementCheckerFilterer) ParseTransfer(log types.Log) (*MockEntitlementCheckerTransfer, error) { - event := new(MockEntitlementCheckerTransfer) - if err := _MockEntitlementChecker.contract.UnpackLog(event, "Transfer", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} diff --git a/core/xchain/contracts/v3/wallet_link.go b/core/xchain/contracts/v3/wallet_link.go deleted file mode 100644 index 1cf2fc790..000000000 --- a/core/xchain/contracts/v3/wallet_link.go +++ /dev/null @@ -1,1139 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package v3 - -import ( - "errors" - "math/big" - "strings" - - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" -) - -// Reference imports to suppress errors if they are not otherwise used. -var ( - _ = errors.New - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription - _ = abi.ConvertType -) - -// WalletLinkMetaData contains all meta data concerning the WalletLink contract. -var WalletLinkMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"function\",\"name\":\"__WalletLink_init\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"checkIfLinked\",\"inputs\":[{\"name\":\"rootKey\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"wallet\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getLatestNonceForRootKey\",\"inputs\":[{\"name\":\"rootKey\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getRootKeyForWallet\",\"inputs\":[{\"name\":\"wallet\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"rootKey\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getWalletsByRootKey\",\"inputs\":[{\"name\":\"rootKey\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"wallets\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"linkCallerToRootKey\",\"inputs\":[{\"name\":\"rootWallet\",\"type\":\"tuple\",\"internalType\":\"structIWalletLinkBase.LinkedWallet\",\"components\":[{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"linkWalletToRootKey\",\"inputs\":[{\"name\":\"wallet\",\"type\":\"tuple\",\"internalType\":\"structIWalletLinkBase.LinkedWallet\",\"components\":[{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"rootWallet\",\"type\":\"tuple\",\"internalType\":\"structIWalletLinkBase.LinkedWallet\",\"components\":[{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"removeLink\",\"inputs\":[{\"name\":\"wallet\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"rootWallet\",\"type\":\"tuple\",\"internalType\":\"structIWalletLinkBase.LinkedWallet\",\"components\":[{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"InterfaceAdded\",\"inputs\":[{\"name\":\"interfaceId\",\"type\":\"bytes4\",\"indexed\":true,\"internalType\":\"bytes4\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"InterfaceRemoved\",\"inputs\":[{\"name\":\"interfaceId\",\"type\":\"bytes4\",\"indexed\":true,\"internalType\":\"bytes4\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"LinkWalletToRootKey\",\"inputs\":[{\"name\":\"wallet\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"rootKey\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RemoveLink\",\"inputs\":[{\"name\":\"wallet\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"secondWallet\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"ECDSAInvalidSignature\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ECDSAInvalidSignatureLength\",\"inputs\":[{\"name\":\"length\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"ECDSAInvalidSignatureS\",\"inputs\":[{\"name\":\"s\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"Initializable_InInitializingState\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Initializable_NotInInitializingState\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Introspection_AlreadySupported\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Introspection_NotSupported\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidAccountNonce\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"currentNonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"WalletLink__CannotLinkToRootWallet\",\"inputs\":[{\"name\":\"wallet\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"rootKey\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"WalletLink__CannotLinkToSelf\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"WalletLink__CannotRemoveRootWallet\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"WalletLink__InvalidAddress\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"WalletLink__InvalidSignature\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"WalletLink__LinkAlreadyExists\",\"inputs\":[{\"name\":\"wallet\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"rootKey\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"WalletLink__LinkedToAnotherRootKey\",\"inputs\":[{\"name\":\"wallet\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"rootKey\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"WalletLink__NotLinked\",\"inputs\":[{\"name\":\"wallet\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"rootKey\",\"type\":\"address\",\"internalType\":\"address\"}]}]", - Bin: "0x608060405234801561001057600080fd5b5061001961001e565b6100c4565b7f59b501c3653afc186af7d48dda36cf6732bd21629a6295693664240a6ef520008054640100000000900460ff161561006a576040516366008a2d60e01b815260040160405180910390fd5b805463ffffffff90811610156100c157805463ffffffff191663ffffffff90811782556040519081527fe9c9b456cb2994b80aeef036cf59d26e9617df80f816a6ee5a5b4166e07e2f5c9060200160405180910390a15b50565b6111ba806100d36000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c8063912b97581161005b578063912b9758146100f4578063d80bd3b914610117578063e65dfe9d1461012a578063f82103981461013d57600080fd5b806302345b981461008d5780631a31fc8d146100b657806320a00ac8146100cb578063260a409d146100ec575b600080fd5b6100a061009b366004610e84565b610168565b6040516100ad9190610e9f565b60405180910390f35b6100c96100c436600461100b565b610179565b005b6100de6100d9366004610e84565b610189565b6040519081526020016100ad565b6100c96101c6565b610107610102366004611078565b610222565b60405190151581526020016100ad565b6100c96101253660046110ab565b61026b565b6100c96101383660046110f1565b610276565b61015061014b366004610e84565b610284565b6040516001600160a01b0390911681526020016100ad565b6060610173826102c5565b92915050565b6101848383836102f6565b505050565b6001600160a01b03811660009081527fda5d6d87446d81938877f0ee239dac391146dd7466ea30567f72becf06773c006020526040812054610173565b7f59b501c3653afc186af7d48dda36cf6732bd21629a6295693664240a6ef5200054640100000000900460ff1661021057604051630ef4733760e31b815260040160405180910390fd5b610220636ff9143960e01b6104da565b565b6001600160a01b0381811660009081527f19511ce7944c192b1007be99b82019218d1decfc513f05239612743360a0dc01602052604081205490918481169116145b9392505050565b6101848383836105b8565b6102808282610780565b5050565b6001600160a01b0380821660009081527f19511ce7944c192b1007be99b82019218d1decfc513f05239612743360a0dc016020526040812054909116610173565b6001600160a01b038116600090815260008051602061119a83398151915260205260409020606090610173906108a7565b8251825160008051602061119a83398151915291610316918391906108b4565b8351604080516001600160a01b0390921660208301528101839052600090610385906060015b604051602081830303815290604052805190602001207f19457468657265756d205369676e6564204d6573736167653a0a3332000000006000908152601c91909152603c902090565b905083600001516001600160a01b03166103a3828660200151610a25565b6001600160a01b0316146103ca57604051632af0041d60e11b815260040160405180910390fd5b8351604080516001600160a01b03909216602083015281018490526000906103f49060600161033c565b905085600001516001600160a01b0316610412828860200151610a25565b6001600160a01b03161461043957604051632af0041d60e11b815260040160405180910390fd5b84516104459085610a4f565b855185516001600160a01b0316600090815260208590526040902061046991610ac1565b50845186516001600160a01b03908116600090815260018601602052604080822080546001600160a01b0319169484169490941790935587518951935190831693909216917f64126824352170c4025060d1f6e215159635e4b08e649830695f26ef6d2b57219190a3505050505050565b6001600160e01b0319811660009081527f81088bbc801e045ea3e7620779ab349988f58afbdfba10dff983df3f33522b00602052604090205460ff161515600114610567576001600160e01b0319811660009081527f81088bbc801e045ea3e7620779ab349988f58afbdfba10dff983df3f33522b0060205260409020805460ff19166001179055610580565b604051637967f77d60e11b815260040160405180910390fd5b6040516001600160e01b03198216907f78f84e5b1c5c05be2b5ad3800781dd404d6d6c6302bc755c0fe20f58a33a7f2290600090a250565b60008051602061119a8339815191526001600160a01b03841615806105e5575082516001600160a01b0316155b1561060357604051636df3f5c360e01b815260040160405180910390fd5b82600001516001600160a01b0316846001600160a01b031603610639576040516333976e3b60e11b815260040160405180910390fd5b82516001600160a01b0385811660009081526001840160205260409020548116911614610694578251604051635e300c8360e01b81526001600160a01b03808716600483015290911660248201526044015b60405180910390fd5b604080516001600160a01b03861660208201529081018390526000906106bc9060600161033c565b905083600001516001600160a01b03166106da828660200151610a25565b6001600160a01b03161461070157604051632af0041d60e11b815260040160405180910390fd5b6001600160a01b038086166000908152600184016020908152604080832080546001600160a01b031916905587519093168252849052206107429086610ad6565b5060405133906001600160a01b038716907f9a9d98629b39adf596077fc95a0712ba55c38f40a354e99d366a10f9c3e27da290600090a35050505050565b815160008051602061119a8339815191529033906107a190839083906108b4565b604080516001600160a01b03831660208201529081018490526000906107c99060600161033c565b905084600001516001600160a01b03166107e7828760200151610a25565b6001600160a01b03161461080e57604051632af0041d60e11b815260040160405180910390fd5b845161081a9085610a4f565b84516001600160a01b0316600090815260208490526040902061083d9083610ac1565b5084516001600160a01b03838116600081815260018701602052604080822080546001600160a01b0319169585169590951790945588519351939092169290917f64126824352170c4025060d1f6e215159635e4b08e649830695f26ef6d2b572191a35050505050565b6060600061026483610aeb565b6001600160a01b03821615806108d157506001600160a01b038116155b156108ef57604051636df3f5c360e01b815260040160405180910390fd5b806001600160a01b0316826001600160a01b0316036109215760405163848ba26d60e01b815260040160405180910390fd5b6001600160a01b038281166000908152600185016020526040902054161561096f576040516314790b7f60e01b81526001600160a01b0380841660048301528216602482015260440161068b565b6001600160a01b03818116600090815260018501602052604090205416156109d2576001600160a01b038181166000908152600185016020526040908190205490516347227b5d60e01b815284831660048201529116602482015260440161068b565b6001600160a01b03821660009081526020849052604081206109f390610b47565b111561018457604051637b815eed60e11b81526001600160a01b0380841660048301528216602482015260440161068b565b600080600080610a358686610b51565b925092509250610a458282610b9e565b5090949350505050565b6001600160a01b03821660009081527fda5d6d87446d81938877f0ee239dac391146dd7466ea30567f72becf06773c0060205260409020805460018101909155818114610184576040516301d4b62360e61b81526001600160a01b03841660048201526024810182905260440161068b565b6000610264836001600160a01b038416610c57565b6000610264836001600160a01b038416610ca6565b606081600001805480602002602001604051908101604052809291908181526020018280548015610b3b57602002820191906000526020600020905b815481526020019060010190808311610b27575b50505050509050919050565b6000610173825490565b60008060008351604103610b8b5760208401516040850151606086015160001a610b7d88828585610d99565b955095509550505050610b97565b50508151600091506002905b9250925092565b6000826003811115610bb257610bb2611136565b03610bbb575050565b6001826003811115610bcf57610bcf611136565b03610bed5760405163f645eedf60e01b815260040160405180910390fd5b6002826003811115610c0157610c01611136565b03610c225760405163fce698f760e01b81526004810182905260240161068b565b6003826003811115610c3657610c36611136565b03610280576040516335e2f38360e21b81526004810182905260240161068b565b6000818152600183016020526040812054610c9e57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610173565b506000610173565b60008181526001830160205260408120548015610d8f576000610cca60018361114c565b8554909150600090610cde9060019061114c565b9050808214610d43576000866000018281548110610cfe57610cfe61116d565b9060005260206000200154905080876000018481548110610d2157610d2161116d565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080610d5457610d54611183565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610173565b6000915050610173565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0841115610dd45750600091506003905082610e5e565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015610e28573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610e5457506000925060019150829050610e5e565b9250600091508190505b9450945094915050565b80356001600160a01b0381168114610e7f57600080fd5b919050565b600060208284031215610e9657600080fd5b61026482610e68565b6020808252825182820181905260009190848201906040850190845b81811015610ee05783516001600160a01b031683529284019291840191600101610ebb565b50909695505050505050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715610f2557610f25610eec565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610f5457610f54610eec565b604052919050565b600060408284031215610f6e57600080fd5b610f76610f02565b9050610f8182610e68565b815260208083013567ffffffffffffffff80821115610f9f57600080fd5b818501915085601f830112610fb357600080fd5b813581811115610fc557610fc5610eec565b610fd7601f8201601f19168501610f2b565b91508082528684828501011115610fed57600080fd5b80848401858401376000908201840152918301919091525092915050565b60008060006060848603121561102057600080fd5b833567ffffffffffffffff8082111561103857600080fd5b61104487838801610f5c565b9450602086013591508082111561105a57600080fd5b5061106786828701610f5c565b925050604084013590509250925092565b6000806040838503121561108b57600080fd5b61109483610e68565b91506110a260208401610e68565b90509250929050565b6000806000606084860312156110c057600080fd5b6110c984610e68565b9250602084013567ffffffffffffffff8111156110e557600080fd5b61106786828701610f5c565b6000806040838503121561110457600080fd5b823567ffffffffffffffff81111561111b57600080fd5b61112785828601610f5c565b95602094909401359450505050565b634e487b7160e01b600052602160045260246000fd5b8181038181111561017357634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fdfe19511ce7944c192b1007be99b82019218d1decfc513f05239612743360a0dc00", -} - -// WalletLinkABI is the input ABI used to generate the binding from. -// Deprecated: Use WalletLinkMetaData.ABI instead. -var WalletLinkABI = WalletLinkMetaData.ABI - -// WalletLinkBin is the compiled bytecode used for deploying new contracts. -// Deprecated: Use WalletLinkMetaData.Bin instead. -var WalletLinkBin = WalletLinkMetaData.Bin - -// DeployWalletLink deploys a new Ethereum contract, binding an instance of WalletLink to it. -func DeployWalletLink(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *WalletLink, error) { - parsed, err := WalletLinkMetaData.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(WalletLinkBin), backend) - if err != nil { - return common.Address{}, nil, nil, err - } - return address, tx, &WalletLink{WalletLinkCaller: WalletLinkCaller{contract: contract}, WalletLinkTransactor: WalletLinkTransactor{contract: contract}, WalletLinkFilterer: WalletLinkFilterer{contract: contract}}, nil -} - -// WalletLink is an auto generated Go binding around an Ethereum contract. -type WalletLink struct { - WalletLinkCaller // Read-only binding to the contract - WalletLinkTransactor // Write-only binding to the contract - WalletLinkFilterer // Log filterer for contract events -} - -// WalletLinkCaller is an auto generated read-only Go binding around an Ethereum contract. -type WalletLinkCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// WalletLinkTransactor is an auto generated write-only Go binding around an Ethereum contract. -type WalletLinkTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// WalletLinkFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type WalletLinkFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// WalletLinkSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type WalletLinkSession struct { - Contract *WalletLink // 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 -} - -// WalletLinkCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type WalletLinkCallerSession struct { - Contract *WalletLinkCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// WalletLinkTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type WalletLinkTransactorSession struct { - Contract *WalletLinkTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// WalletLinkRaw is an auto generated low-level Go binding around an Ethereum contract. -type WalletLinkRaw struct { - Contract *WalletLink // Generic contract binding to access the raw methods on -} - -// WalletLinkCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type WalletLinkCallerRaw struct { - Contract *WalletLinkCaller // Generic read-only contract binding to access the raw methods on -} - -// WalletLinkTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type WalletLinkTransactorRaw struct { - Contract *WalletLinkTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewWalletLink creates a new instance of WalletLink, bound to a specific deployed contract. -func NewWalletLink(address common.Address, backend bind.ContractBackend) (*WalletLink, error) { - contract, err := bindWalletLink(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &WalletLink{WalletLinkCaller: WalletLinkCaller{contract: contract}, WalletLinkTransactor: WalletLinkTransactor{contract: contract}, WalletLinkFilterer: WalletLinkFilterer{contract: contract}}, nil -} - -// NewWalletLinkCaller creates a new read-only instance of WalletLink, bound to a specific deployed contract. -func NewWalletLinkCaller(address common.Address, caller bind.ContractCaller) (*WalletLinkCaller, error) { - contract, err := bindWalletLink(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &WalletLinkCaller{contract: contract}, nil -} - -// NewWalletLinkTransactor creates a new write-only instance of WalletLink, bound to a specific deployed contract. -func NewWalletLinkTransactor(address common.Address, transactor bind.ContractTransactor) (*WalletLinkTransactor, error) { - contract, err := bindWalletLink(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &WalletLinkTransactor{contract: contract}, nil -} - -// NewWalletLinkFilterer creates a new log filterer instance of WalletLink, bound to a specific deployed contract. -func NewWalletLinkFilterer(address common.Address, filterer bind.ContractFilterer) (*WalletLinkFilterer, error) { - contract, err := bindWalletLink(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &WalletLinkFilterer{contract: contract}, nil -} - -// bindWalletLink binds a generic wrapper to an already deployed contract. -func bindWalletLink(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := WalletLinkMetaData.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 (_WalletLink *WalletLinkRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _WalletLink.Contract.WalletLinkCaller.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 (_WalletLink *WalletLinkRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _WalletLink.Contract.WalletLinkTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_WalletLink *WalletLinkRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _WalletLink.Contract.WalletLinkTransactor.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 (_WalletLink *WalletLinkCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _WalletLink.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 (_WalletLink *WalletLinkTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _WalletLink.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_WalletLink *WalletLinkTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _WalletLink.Contract.contract.Transact(opts, method, params...) -} - -// CheckIfLinked is a free data retrieval call binding the contract method 0x912b9758. -// -// Solidity: function checkIfLinked(address rootKey, address wallet) view returns(bool) -func (_WalletLink *WalletLinkCaller) CheckIfLinked(opts *bind.CallOpts, rootKey common.Address, wallet common.Address) (bool, error) { - var out []interface{} - err := _WalletLink.contract.Call(opts, &out, "checkIfLinked", rootKey, wallet) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// CheckIfLinked is a free data retrieval call binding the contract method 0x912b9758. -// -// Solidity: function checkIfLinked(address rootKey, address wallet) view returns(bool) -func (_WalletLink *WalletLinkSession) CheckIfLinked(rootKey common.Address, wallet common.Address) (bool, error) { - return _WalletLink.Contract.CheckIfLinked(&_WalletLink.CallOpts, rootKey, wallet) -} - -// CheckIfLinked is a free data retrieval call binding the contract method 0x912b9758. -// -// Solidity: function checkIfLinked(address rootKey, address wallet) view returns(bool) -func (_WalletLink *WalletLinkCallerSession) CheckIfLinked(rootKey common.Address, wallet common.Address) (bool, error) { - return _WalletLink.Contract.CheckIfLinked(&_WalletLink.CallOpts, rootKey, wallet) -} - -// GetLatestNonceForRootKey is a free data retrieval call binding the contract method 0x20a00ac8. -// -// Solidity: function getLatestNonceForRootKey(address rootKey) view returns(uint256) -func (_WalletLink *WalletLinkCaller) GetLatestNonceForRootKey(opts *bind.CallOpts, rootKey common.Address) (*big.Int, error) { - var out []interface{} - err := _WalletLink.contract.Call(opts, &out, "getLatestNonceForRootKey", rootKey) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// GetLatestNonceForRootKey is a free data retrieval call binding the contract method 0x20a00ac8. -// -// Solidity: function getLatestNonceForRootKey(address rootKey) view returns(uint256) -func (_WalletLink *WalletLinkSession) GetLatestNonceForRootKey(rootKey common.Address) (*big.Int, error) { - return _WalletLink.Contract.GetLatestNonceForRootKey(&_WalletLink.CallOpts, rootKey) -} - -// GetLatestNonceForRootKey is a free data retrieval call binding the contract method 0x20a00ac8. -// -// Solidity: function getLatestNonceForRootKey(address rootKey) view returns(uint256) -func (_WalletLink *WalletLinkCallerSession) GetLatestNonceForRootKey(rootKey common.Address) (*big.Int, error) { - return _WalletLink.Contract.GetLatestNonceForRootKey(&_WalletLink.CallOpts, rootKey) -} - -// GetRootKeyForWallet is a free data retrieval call binding the contract method 0xf8210398. -// -// Solidity: function getRootKeyForWallet(address wallet) view returns(address rootKey) -func (_WalletLink *WalletLinkCaller) GetRootKeyForWallet(opts *bind.CallOpts, wallet common.Address) (common.Address, error) { - var out []interface{} - err := _WalletLink.contract.Call(opts, &out, "getRootKeyForWallet", wallet) - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// GetRootKeyForWallet is a free data retrieval call binding the contract method 0xf8210398. -// -// Solidity: function getRootKeyForWallet(address wallet) view returns(address rootKey) -func (_WalletLink *WalletLinkSession) GetRootKeyForWallet(wallet common.Address) (common.Address, error) { - return _WalletLink.Contract.GetRootKeyForWallet(&_WalletLink.CallOpts, wallet) -} - -// GetRootKeyForWallet is a free data retrieval call binding the contract method 0xf8210398. -// -// Solidity: function getRootKeyForWallet(address wallet) view returns(address rootKey) -func (_WalletLink *WalletLinkCallerSession) GetRootKeyForWallet(wallet common.Address) (common.Address, error) { - return _WalletLink.Contract.GetRootKeyForWallet(&_WalletLink.CallOpts, wallet) -} - -// GetWalletsByRootKey is a free data retrieval call binding the contract method 0x02345b98. -// -// Solidity: function getWalletsByRootKey(address rootKey) view returns(address[] wallets) -func (_WalletLink *WalletLinkCaller) GetWalletsByRootKey(opts *bind.CallOpts, rootKey common.Address) ([]common.Address, error) { - var out []interface{} - err := _WalletLink.contract.Call(opts, &out, "getWalletsByRootKey", rootKey) - - if err != nil { - return *new([]common.Address), err - } - - out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) - - return out0, err - -} - -// GetWalletsByRootKey is a free data retrieval call binding the contract method 0x02345b98. -// -// Solidity: function getWalletsByRootKey(address rootKey) view returns(address[] wallets) -func (_WalletLink *WalletLinkSession) GetWalletsByRootKey(rootKey common.Address) ([]common.Address, error) { - return _WalletLink.Contract.GetWalletsByRootKey(&_WalletLink.CallOpts, rootKey) -} - -// GetWalletsByRootKey is a free data retrieval call binding the contract method 0x02345b98. -// -// Solidity: function getWalletsByRootKey(address rootKey) view returns(address[] wallets) -func (_WalletLink *WalletLinkCallerSession) GetWalletsByRootKey(rootKey common.Address) ([]common.Address, error) { - return _WalletLink.Contract.GetWalletsByRootKey(&_WalletLink.CallOpts, rootKey) -} - -// WalletLinkInit is a paid mutator transaction binding the contract method 0x260a409d. -// -// Solidity: function __WalletLink_init() returns() -func (_WalletLink *WalletLinkTransactor) WalletLinkInit(opts *bind.TransactOpts) (*types.Transaction, error) { - return _WalletLink.contract.Transact(opts, "__WalletLink_init") -} - -// WalletLinkInit is a paid mutator transaction binding the contract method 0x260a409d. -// -// Solidity: function __WalletLink_init() returns() -func (_WalletLink *WalletLinkSession) WalletLinkInit() (*types.Transaction, error) { - return _WalletLink.Contract.WalletLinkInit(&_WalletLink.TransactOpts) -} - -// WalletLinkInit is a paid mutator transaction binding the contract method 0x260a409d. -// -// Solidity: function __WalletLink_init() returns() -func (_WalletLink *WalletLinkTransactorSession) WalletLinkInit() (*types.Transaction, error) { - return _WalletLink.Contract.WalletLinkInit(&_WalletLink.TransactOpts) -} - -// LinkCallerToRootKey is a paid mutator transaction binding the contract method 0xe65dfe9d. -// -// Solidity: function linkCallerToRootKey((address,bytes) rootWallet, uint256 nonce) returns() -func (_WalletLink *WalletLinkTransactor) LinkCallerToRootKey(opts *bind.TransactOpts, rootWallet IWalletLinkBaseLinkedWallet, nonce *big.Int) (*types.Transaction, error) { - return _WalletLink.contract.Transact(opts, "linkCallerToRootKey", rootWallet, nonce) -} - -// LinkCallerToRootKey is a paid mutator transaction binding the contract method 0xe65dfe9d. -// -// Solidity: function linkCallerToRootKey((address,bytes) rootWallet, uint256 nonce) returns() -func (_WalletLink *WalletLinkSession) LinkCallerToRootKey(rootWallet IWalletLinkBaseLinkedWallet, nonce *big.Int) (*types.Transaction, error) { - return _WalletLink.Contract.LinkCallerToRootKey(&_WalletLink.TransactOpts, rootWallet, nonce) -} - -// LinkCallerToRootKey is a paid mutator transaction binding the contract method 0xe65dfe9d. -// -// Solidity: function linkCallerToRootKey((address,bytes) rootWallet, uint256 nonce) returns() -func (_WalletLink *WalletLinkTransactorSession) LinkCallerToRootKey(rootWallet IWalletLinkBaseLinkedWallet, nonce *big.Int) (*types.Transaction, error) { - return _WalletLink.Contract.LinkCallerToRootKey(&_WalletLink.TransactOpts, rootWallet, nonce) -} - -// LinkWalletToRootKey is a paid mutator transaction binding the contract method 0x1a31fc8d. -// -// Solidity: function linkWalletToRootKey((address,bytes) wallet, (address,bytes) rootWallet, uint256 nonce) returns() -func (_WalletLink *WalletLinkTransactor) LinkWalletToRootKey(opts *bind.TransactOpts, wallet IWalletLinkBaseLinkedWallet, rootWallet IWalletLinkBaseLinkedWallet, nonce *big.Int) (*types.Transaction, error) { - return _WalletLink.contract.Transact(opts, "linkWalletToRootKey", wallet, rootWallet, nonce) -} - -// LinkWalletToRootKey is a paid mutator transaction binding the contract method 0x1a31fc8d. -// -// Solidity: function linkWalletToRootKey((address,bytes) wallet, (address,bytes) rootWallet, uint256 nonce) returns() -func (_WalletLink *WalletLinkSession) LinkWalletToRootKey(wallet IWalletLinkBaseLinkedWallet, rootWallet IWalletLinkBaseLinkedWallet, nonce *big.Int) (*types.Transaction, error) { - return _WalletLink.Contract.LinkWalletToRootKey(&_WalletLink.TransactOpts, wallet, rootWallet, nonce) -} - -// LinkWalletToRootKey is a paid mutator transaction binding the contract method 0x1a31fc8d. -// -// Solidity: function linkWalletToRootKey((address,bytes) wallet, (address,bytes) rootWallet, uint256 nonce) returns() -func (_WalletLink *WalletLinkTransactorSession) LinkWalletToRootKey(wallet IWalletLinkBaseLinkedWallet, rootWallet IWalletLinkBaseLinkedWallet, nonce *big.Int) (*types.Transaction, error) { - return _WalletLink.Contract.LinkWalletToRootKey(&_WalletLink.TransactOpts, wallet, rootWallet, nonce) -} - -// RemoveLink is a paid mutator transaction binding the contract method 0xd80bd3b9. -// -// Solidity: function removeLink(address wallet, (address,bytes) rootWallet, uint256 nonce) returns() -func (_WalletLink *WalletLinkTransactor) RemoveLink(opts *bind.TransactOpts, wallet common.Address, rootWallet IWalletLinkBaseLinkedWallet, nonce *big.Int) (*types.Transaction, error) { - return _WalletLink.contract.Transact(opts, "removeLink", wallet, rootWallet, nonce) -} - -// RemoveLink is a paid mutator transaction binding the contract method 0xd80bd3b9. -// -// Solidity: function removeLink(address wallet, (address,bytes) rootWallet, uint256 nonce) returns() -func (_WalletLink *WalletLinkSession) RemoveLink(wallet common.Address, rootWallet IWalletLinkBaseLinkedWallet, nonce *big.Int) (*types.Transaction, error) { - return _WalletLink.Contract.RemoveLink(&_WalletLink.TransactOpts, wallet, rootWallet, nonce) -} - -// RemoveLink is a paid mutator transaction binding the contract method 0xd80bd3b9. -// -// Solidity: function removeLink(address wallet, (address,bytes) rootWallet, uint256 nonce) returns() -func (_WalletLink *WalletLinkTransactorSession) RemoveLink(wallet common.Address, rootWallet IWalletLinkBaseLinkedWallet, nonce *big.Int) (*types.Transaction, error) { - return _WalletLink.Contract.RemoveLink(&_WalletLink.TransactOpts, wallet, rootWallet, nonce) -} - -// WalletLinkInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the WalletLink contract. -type WalletLinkInitializedIterator struct { - Event *WalletLinkInitialized // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *WalletLinkInitializedIterator) 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(WalletLinkInitialized) - 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(WalletLinkInitialized) - 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 *WalletLinkInitializedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *WalletLinkInitializedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// WalletLinkInitialized represents a Initialized event raised by the WalletLink contract. -type WalletLinkInitialized struct { - Version uint32 - Raw types.Log // Blockchain specific contextual infos -} - -// FilterInitialized is a free log retrieval operation binding the contract event 0xe9c9b456cb2994b80aeef036cf59d26e9617df80f816a6ee5a5b4166e07e2f5c. -// -// Solidity: event Initialized(uint32 version) -func (_WalletLink *WalletLinkFilterer) FilterInitialized(opts *bind.FilterOpts) (*WalletLinkInitializedIterator, error) { - - logs, sub, err := _WalletLink.contract.FilterLogs(opts, "Initialized") - if err != nil { - return nil, err - } - return &WalletLinkInitializedIterator{contract: _WalletLink.contract, event: "Initialized", logs: logs, sub: sub}, nil -} - -// WatchInitialized is a free log subscription operation binding the contract event 0xe9c9b456cb2994b80aeef036cf59d26e9617df80f816a6ee5a5b4166e07e2f5c. -// -// Solidity: event Initialized(uint32 version) -func (_WalletLink *WalletLinkFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *WalletLinkInitialized) (event.Subscription, error) { - - logs, sub, err := _WalletLink.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(WalletLinkInitialized) - if err := _WalletLink.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 0xe9c9b456cb2994b80aeef036cf59d26e9617df80f816a6ee5a5b4166e07e2f5c. -// -// Solidity: event Initialized(uint32 version) -func (_WalletLink *WalletLinkFilterer) ParseInitialized(log types.Log) (*WalletLinkInitialized, error) { - event := new(WalletLinkInitialized) - if err := _WalletLink.contract.UnpackLog(event, "Initialized", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// WalletLinkInterfaceAddedIterator is returned from FilterInterfaceAdded and is used to iterate over the raw logs and unpacked data for InterfaceAdded events raised by the WalletLink contract. -type WalletLinkInterfaceAddedIterator struct { - Event *WalletLinkInterfaceAdded // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *WalletLinkInterfaceAddedIterator) 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(WalletLinkInterfaceAdded) - 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(WalletLinkInterfaceAdded) - 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 *WalletLinkInterfaceAddedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *WalletLinkInterfaceAddedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// WalletLinkInterfaceAdded represents a InterfaceAdded event raised by the WalletLink contract. -type WalletLinkInterfaceAdded struct { - InterfaceId [4]byte - Raw types.Log // Blockchain specific contextual infos -} - -// FilterInterfaceAdded is a free log retrieval operation binding the contract event 0x78f84e5b1c5c05be2b5ad3800781dd404d6d6c6302bc755c0fe20f58a33a7f22. -// -// Solidity: event InterfaceAdded(bytes4 indexed interfaceId) -func (_WalletLink *WalletLinkFilterer) FilterInterfaceAdded(opts *bind.FilterOpts, interfaceId [][4]byte) (*WalletLinkInterfaceAddedIterator, error) { - - var interfaceIdRule []interface{} - for _, interfaceIdItem := range interfaceId { - interfaceIdRule = append(interfaceIdRule, interfaceIdItem) - } - - logs, sub, err := _WalletLink.contract.FilterLogs(opts, "InterfaceAdded", interfaceIdRule) - if err != nil { - return nil, err - } - return &WalletLinkInterfaceAddedIterator{contract: _WalletLink.contract, event: "InterfaceAdded", logs: logs, sub: sub}, nil -} - -// WatchInterfaceAdded is a free log subscription operation binding the contract event 0x78f84e5b1c5c05be2b5ad3800781dd404d6d6c6302bc755c0fe20f58a33a7f22. -// -// Solidity: event InterfaceAdded(bytes4 indexed interfaceId) -func (_WalletLink *WalletLinkFilterer) WatchInterfaceAdded(opts *bind.WatchOpts, sink chan<- *WalletLinkInterfaceAdded, interfaceId [][4]byte) (event.Subscription, error) { - - var interfaceIdRule []interface{} - for _, interfaceIdItem := range interfaceId { - interfaceIdRule = append(interfaceIdRule, interfaceIdItem) - } - - logs, sub, err := _WalletLink.contract.WatchLogs(opts, "InterfaceAdded", interfaceIdRule) - 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(WalletLinkInterfaceAdded) - if err := _WalletLink.contract.UnpackLog(event, "InterfaceAdded", 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 -} - -// ParseInterfaceAdded is a log parse operation binding the contract event 0x78f84e5b1c5c05be2b5ad3800781dd404d6d6c6302bc755c0fe20f58a33a7f22. -// -// Solidity: event InterfaceAdded(bytes4 indexed interfaceId) -func (_WalletLink *WalletLinkFilterer) ParseInterfaceAdded(log types.Log) (*WalletLinkInterfaceAdded, error) { - event := new(WalletLinkInterfaceAdded) - if err := _WalletLink.contract.UnpackLog(event, "InterfaceAdded", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// WalletLinkInterfaceRemovedIterator is returned from FilterInterfaceRemoved and is used to iterate over the raw logs and unpacked data for InterfaceRemoved events raised by the WalletLink contract. -type WalletLinkInterfaceRemovedIterator struct { - Event *WalletLinkInterfaceRemoved // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *WalletLinkInterfaceRemovedIterator) 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(WalletLinkInterfaceRemoved) - 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(WalletLinkInterfaceRemoved) - 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 *WalletLinkInterfaceRemovedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *WalletLinkInterfaceRemovedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// WalletLinkInterfaceRemoved represents a InterfaceRemoved event raised by the WalletLink contract. -type WalletLinkInterfaceRemoved struct { - InterfaceId [4]byte - Raw types.Log // Blockchain specific contextual infos -} - -// FilterInterfaceRemoved is a free log retrieval operation binding the contract event 0x8bd383568d0bc57b64b8e424138fc19ae827e694e05757faa8fea8f63fb87315. -// -// Solidity: event InterfaceRemoved(bytes4 indexed interfaceId) -func (_WalletLink *WalletLinkFilterer) FilterInterfaceRemoved(opts *bind.FilterOpts, interfaceId [][4]byte) (*WalletLinkInterfaceRemovedIterator, error) { - - var interfaceIdRule []interface{} - for _, interfaceIdItem := range interfaceId { - interfaceIdRule = append(interfaceIdRule, interfaceIdItem) - } - - logs, sub, err := _WalletLink.contract.FilterLogs(opts, "InterfaceRemoved", interfaceIdRule) - if err != nil { - return nil, err - } - return &WalletLinkInterfaceRemovedIterator{contract: _WalletLink.contract, event: "InterfaceRemoved", logs: logs, sub: sub}, nil -} - -// WatchInterfaceRemoved is a free log subscription operation binding the contract event 0x8bd383568d0bc57b64b8e424138fc19ae827e694e05757faa8fea8f63fb87315. -// -// Solidity: event InterfaceRemoved(bytes4 indexed interfaceId) -func (_WalletLink *WalletLinkFilterer) WatchInterfaceRemoved(opts *bind.WatchOpts, sink chan<- *WalletLinkInterfaceRemoved, interfaceId [][4]byte) (event.Subscription, error) { - - var interfaceIdRule []interface{} - for _, interfaceIdItem := range interfaceId { - interfaceIdRule = append(interfaceIdRule, interfaceIdItem) - } - - logs, sub, err := _WalletLink.contract.WatchLogs(opts, "InterfaceRemoved", interfaceIdRule) - 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(WalletLinkInterfaceRemoved) - if err := _WalletLink.contract.UnpackLog(event, "InterfaceRemoved", 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 -} - -// ParseInterfaceRemoved is a log parse operation binding the contract event 0x8bd383568d0bc57b64b8e424138fc19ae827e694e05757faa8fea8f63fb87315. -// -// Solidity: event InterfaceRemoved(bytes4 indexed interfaceId) -func (_WalletLink *WalletLinkFilterer) ParseInterfaceRemoved(log types.Log) (*WalletLinkInterfaceRemoved, error) { - event := new(WalletLinkInterfaceRemoved) - if err := _WalletLink.contract.UnpackLog(event, "InterfaceRemoved", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// WalletLinkLinkWalletToRootKeyIterator is returned from FilterLinkWalletToRootKey and is used to iterate over the raw logs and unpacked data for LinkWalletToRootKey events raised by the WalletLink contract. -type WalletLinkLinkWalletToRootKeyIterator struct { - Event *WalletLinkLinkWalletToRootKey // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *WalletLinkLinkWalletToRootKeyIterator) 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(WalletLinkLinkWalletToRootKey) - 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(WalletLinkLinkWalletToRootKey) - 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 *WalletLinkLinkWalletToRootKeyIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *WalletLinkLinkWalletToRootKeyIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// WalletLinkLinkWalletToRootKey represents a LinkWalletToRootKey event raised by the WalletLink contract. -type WalletLinkLinkWalletToRootKey struct { - Wallet common.Address - RootKey common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterLinkWalletToRootKey is a free log retrieval operation binding the contract event 0x64126824352170c4025060d1f6e215159635e4b08e649830695f26ef6d2b5721. -// -// Solidity: event LinkWalletToRootKey(address indexed wallet, address indexed rootKey) -func (_WalletLink *WalletLinkFilterer) FilterLinkWalletToRootKey(opts *bind.FilterOpts, wallet []common.Address, rootKey []common.Address) (*WalletLinkLinkWalletToRootKeyIterator, error) { - - var walletRule []interface{} - for _, walletItem := range wallet { - walletRule = append(walletRule, walletItem) - } - var rootKeyRule []interface{} - for _, rootKeyItem := range rootKey { - rootKeyRule = append(rootKeyRule, rootKeyItem) - } - - logs, sub, err := _WalletLink.contract.FilterLogs(opts, "LinkWalletToRootKey", walletRule, rootKeyRule) - if err != nil { - return nil, err - } - return &WalletLinkLinkWalletToRootKeyIterator{contract: _WalletLink.contract, event: "LinkWalletToRootKey", logs: logs, sub: sub}, nil -} - -// WatchLinkWalletToRootKey is a free log subscription operation binding the contract event 0x64126824352170c4025060d1f6e215159635e4b08e649830695f26ef6d2b5721. -// -// Solidity: event LinkWalletToRootKey(address indexed wallet, address indexed rootKey) -func (_WalletLink *WalletLinkFilterer) WatchLinkWalletToRootKey(opts *bind.WatchOpts, sink chan<- *WalletLinkLinkWalletToRootKey, wallet []common.Address, rootKey []common.Address) (event.Subscription, error) { - - var walletRule []interface{} - for _, walletItem := range wallet { - walletRule = append(walletRule, walletItem) - } - var rootKeyRule []interface{} - for _, rootKeyItem := range rootKey { - rootKeyRule = append(rootKeyRule, rootKeyItem) - } - - logs, sub, err := _WalletLink.contract.WatchLogs(opts, "LinkWalletToRootKey", walletRule, rootKeyRule) - 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(WalletLinkLinkWalletToRootKey) - if err := _WalletLink.contract.UnpackLog(event, "LinkWalletToRootKey", 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 -} - -// ParseLinkWalletToRootKey is a log parse operation binding the contract event 0x64126824352170c4025060d1f6e215159635e4b08e649830695f26ef6d2b5721. -// -// Solidity: event LinkWalletToRootKey(address indexed wallet, address indexed rootKey) -func (_WalletLink *WalletLinkFilterer) ParseLinkWalletToRootKey(log types.Log) (*WalletLinkLinkWalletToRootKey, error) { - event := new(WalletLinkLinkWalletToRootKey) - if err := _WalletLink.contract.UnpackLog(event, "LinkWalletToRootKey", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// WalletLinkRemoveLinkIterator is returned from FilterRemoveLink and is used to iterate over the raw logs and unpacked data for RemoveLink events raised by the WalletLink contract. -type WalletLinkRemoveLinkIterator struct { - Event *WalletLinkRemoveLink // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *WalletLinkRemoveLinkIterator) 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(WalletLinkRemoveLink) - 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(WalletLinkRemoveLink) - 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 *WalletLinkRemoveLinkIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *WalletLinkRemoveLinkIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// WalletLinkRemoveLink represents a RemoveLink event raised by the WalletLink contract. -type WalletLinkRemoveLink struct { - Wallet common.Address - SecondWallet common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterRemoveLink is a free log retrieval operation binding the contract event 0x9a9d98629b39adf596077fc95a0712ba55c38f40a354e99d366a10f9c3e27da2. -// -// Solidity: event RemoveLink(address indexed wallet, address indexed secondWallet) -func (_WalletLink *WalletLinkFilterer) FilterRemoveLink(opts *bind.FilterOpts, wallet []common.Address, secondWallet []common.Address) (*WalletLinkRemoveLinkIterator, error) { - - var walletRule []interface{} - for _, walletItem := range wallet { - walletRule = append(walletRule, walletItem) - } - var secondWalletRule []interface{} - for _, secondWalletItem := range secondWallet { - secondWalletRule = append(secondWalletRule, secondWalletItem) - } - - logs, sub, err := _WalletLink.contract.FilterLogs(opts, "RemoveLink", walletRule, secondWalletRule) - if err != nil { - return nil, err - } - return &WalletLinkRemoveLinkIterator{contract: _WalletLink.contract, event: "RemoveLink", logs: logs, sub: sub}, nil -} - -// WatchRemoveLink is a free log subscription operation binding the contract event 0x9a9d98629b39adf596077fc95a0712ba55c38f40a354e99d366a10f9c3e27da2. -// -// Solidity: event RemoveLink(address indexed wallet, address indexed secondWallet) -func (_WalletLink *WalletLinkFilterer) WatchRemoveLink(opts *bind.WatchOpts, sink chan<- *WalletLinkRemoveLink, wallet []common.Address, secondWallet []common.Address) (event.Subscription, error) { - - var walletRule []interface{} - for _, walletItem := range wallet { - walletRule = append(walletRule, walletItem) - } - var secondWalletRule []interface{} - for _, secondWalletItem := range secondWallet { - secondWalletRule = append(secondWalletRule, secondWalletItem) - } - - logs, sub, err := _WalletLink.contract.WatchLogs(opts, "RemoveLink", walletRule, secondWalletRule) - 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(WalletLinkRemoveLink) - if err := _WalletLink.contract.UnpackLog(event, "RemoveLink", 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 -} - -// ParseRemoveLink is a log parse operation binding the contract event 0x9a9d98629b39adf596077fc95a0712ba55c38f40a354e99d366a10f9c3e27da2. -// -// Solidity: event RemoveLink(address indexed wallet, address indexed secondWallet) -func (_WalletLink *WalletLinkFilterer) ParseRemoveLink(log types.Log) (*WalletLinkRemoveLink, error) { - event := new(WalletLinkRemoveLink) - if err := _WalletLink.contract.UnpackLog(event, "RemoveLink", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} diff --git a/core/xchain/entitlement/check_operation.go b/core/xchain/entitlement/check_operation.go index 9e4702d67..fc8f971b1 100644 --- a/core/xchain/entitlement/check_operation.go +++ b/core/xchain/entitlement/check_operation.go @@ -6,14 +6,14 @@ import ( "math/big" "time" - "github.com/prometheus/client_golang/prometheus" - "github.com/river-build/river/core/xchain/bindings/erc20" - "github.com/river-build/river/core/xchain/bindings/erc721" - "github.com/river-build/river/core/xchain/contracts" - "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" + "github.com/prometheus/client_golang/prometheus" + + "github.com/river-build/river/core/contracts/base" "github.com/river-build/river/core/node/dlog" + "github.com/river-build/river/core/xchain/bindings/erc20" + "github.com/river-build/river/core/xchain/bindings/erc721" ) func (e *Evaluator) evaluateCheckOperation( @@ -88,10 +88,9 @@ func (e *Evaluator) evaluateIsEntitledOperation( return false, fmt.Errorf("evaluateIsEntitledOperation: Chain ID %v not found", op.ChainID) } - customEntitlementChecker, err := contracts.NewICustomEntitlement( + customEntitlementChecker, err := base.NewICustomEntitlement( op.ContractAddress, client, - e.contractVersion, ) if err != nil { log.Error("Failed to instantiate a CustomEntitlement contract from supplied contract address", diff --git a/core/xchain/entitlement/entitlement.go b/core/xchain/entitlement/entitlement.go index 442ce3e23..7a2b33f2c 100644 --- a/core/xchain/entitlement/entitlement.go +++ b/core/xchain/entitlement/entitlement.go @@ -7,16 +7,15 @@ import ( "math/big" "sync" - er "github.com/river-build/river/core/xchain/contracts" - "github.com/ethereum/go-ethereum/common" + "github.com/river-build/river/core/contracts/base" "github.com/river-build/river/core/node/dlog" ) func (e *Evaluator) EvaluateRuleData( ctx context.Context, linkedWallets []common.Address, - ruleData *er.IRuleData, + ruleData *base.IRuleEntitlementRuleData, ) (bool, error) { log := dlog.FromCtx(ctx) log.Info("Evaluating rule data", "ruleData", ruleData) @@ -169,7 +168,7 @@ func (a *AndOperation) SetRightOperation(right Operation) { } func getOperationTree(ctx context.Context, - ruleData *er.IRuleData, + ruleData *base.IRuleEntitlementRuleData, ) (Operation, error) { log := dlog.FromCtx(ctx) decodedOperations := []Operation{} diff --git a/core/xchain/entitlement/evaluator.go b/core/xchain/entitlement/evaluator.go index 39d0bd7af..59e6d5624 100644 --- a/core/xchain/entitlement/evaluator.go +++ b/core/xchain/entitlement/evaluator.go @@ -9,9 +9,8 @@ import ( ) type Evaluator struct { - clients BlockchainClientPool - contractVersion config.ContractVersion - evalHistrogram *prometheus.HistogramVec + clients BlockchainClientPool + evalHistrogram *prometheus.HistogramVec } func NewEvaluatorFromConfig(ctx context.Context, cfg *config.Config, metrics infra.MetricsFactory) (*Evaluator, error) { @@ -20,8 +19,7 @@ func NewEvaluatorFromConfig(ctx context.Context, cfg *config.Config, metrics inf return nil, err } return &Evaluator{ - clients: clients, - contractVersion: cfg.GetContractVersion(), + clients: clients, evalHistrogram: metrics.NewHistogramVecEx( "entitlement_op_duration_seconds", "Duration of entitlement evaluation", diff --git a/core/xchain/entitlement/linkedwallets.go b/core/xchain/entitlement/linkedwallets.go index bd58567c1..644e407a8 100644 --- a/core/xchain/entitlement/linkedwallets.go +++ b/core/xchain/entitlement/linkedwallets.go @@ -6,9 +6,9 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/prometheus/client_golang/prometheus" + "github.com/river-build/river/core/contracts/base" "github.com/river-build/river/core/node/dlog" "github.com/river-build/river/core/node/infra" - "github.com/river-build/river/core/xchain/contracts" ) type WrappedWalletLink interface { @@ -17,7 +17,7 @@ type WrappedWalletLink interface { } type wrappedWalletLink struct { - contract *contracts.IWalletLink + contract *base.WalletLink } func (w *wrappedWalletLink) GetRootKeyForWallet(ctx context.Context, wallet common.Address) (common.Address, error) { @@ -28,7 +28,7 @@ func (w *wrappedWalletLink) GetWalletsByRootKey(ctx context.Context, rootKey com return w.contract.GetWalletsByRootKey(&bind.CallOpts{Context: ctx}, rootKey) } -func NewWrappedWalletLink(contract *contracts.IWalletLink) WrappedWalletLink { +func NewWrappedWalletLink(contract *base.WalletLink) WrappedWalletLink { return &wrappedWalletLink{ contract: contract, } diff --git a/core/xchain/server/server.go b/core/xchain/server/server.go index 5a6cf13b7..057346961 100644 --- a/core/xchain/server/server.go +++ b/core/xchain/server/server.go @@ -8,6 +8,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/river-build/river/core/config" + "github.com/river-build/river/core/contracts/base" . "github.com/river-build/river/core/node/protocol" "github.com/river-build/river/core/xchain/contracts" "github.com/river-build/river/core/xchain/entitlement" @@ -28,7 +29,7 @@ type ( // xchain reads entitlement requests from base chain and writes the result after processing back to base. xchain struct { workerID int - checker *contracts.IEntitlementChecker + checker *base.IEntitlementChecker checkerABI *abi.ABI checkerContract *bind.BoundContract baseChain *crypto.Blockchain @@ -53,7 +54,7 @@ type ( TransactionID common.Hash RoleId *big.Int Outcome bool - Event contracts.IEntitlementCheckRequestEvent + Event base.IEntitlementCheckerEntitlementCheckRequested } // pending task to write the entitlement check outcome to base @@ -93,7 +94,12 @@ func New( return nil, err } - checker, err := contracts.NewIEntitlementChecker(cfg.GetEntitlementContractAddress(), nil, cfg.GetContractVersion()) + checker, err := base.NewIEntitlementChecker(cfg.GetEntitlementContractAddress(), nil) + if err != nil { + return nil, err + } + + checkerABI, err := base.IEntitlementCheckerMetaData.GetAbi() if err != nil { return nil, err } @@ -102,15 +108,13 @@ func New( log = dlog.FromCtx(ctx). With("worker_id", workerID). With("application", "xchain") - checkerABI = checker.GetAbi() checkerContract = bind.NewBoundContract( cfg.GetEntitlementContractAddress(), - *checker.GetAbi(), + *checkerABI, nil, nil, nil, ) - entitlementGatedMetaData = contracts.NewEntitlementGatedMetaData(cfg.GetContractVersion()) ) log.Info("Starting xchain node", "cfg", cfg) @@ -150,19 +154,10 @@ func New( ) } - walletLink, err := contracts.NewIWalletLink( - cfg.GetWalletLinkContractAddress(), - baseChain.Client, - cfg.GetContractVersion(), - ) - if err != nil { - return nil, err - } - decoder, err := crypto.NewEVMErrorDecoder( - checker.GetMetadata(), - entitlementGatedMetaData.GetMetadata(), - walletLink.GetMetadata(), + base.IEntitlementCheckerMetaData, + base.IEntitlementGatedMetaData, + base.WalletLinkMetaData, ) if err != nil { return nil, err @@ -235,8 +230,8 @@ func (x *xchain) Log(ctx context.Context) *slog.Logger { // isRegistered returns an indication if this instance is registered by its operator as a xchain node. // if not this instance isn't allowed to submit entitlement check results. func (x *xchain) isRegistered(ctx context.Context) (bool, error) { - checker, err := contracts.NewIEntitlementChecker( - x.config.GetEntitlementContractAddress(), x.baseChain.Client, x.config.GetContractVersion()) + checker, err := base.NewIEntitlementChecker( + x.config.GetEntitlementContractAddress(), x.baseChain.Client) if err != nil { return false, AsRiverError(err, Err_CANNOT_CALL_CONTRACT) } @@ -291,24 +286,24 @@ func (x *xchain) onEntitlementCheckRequested( ) { var ( log = x.Log(ctx) - entitlementCheckRequest = x.checker.EntitlementCheckRequestEvent() + entitlementCheckRequest = base.IEntitlementCheckerEntitlementCheckRequested{} ) // try to decode the EntitlementCheckRequested event - if err := x.checkerContract.UnpackLog(entitlementCheckRequest.Raw(), "EntitlementCheckRequested", event); err != nil { + if err := x.checkerContract.UnpackLog(&entitlementCheckRequest, "EntitlementCheckRequested", event); err != nil { x.entitlementCheckRequested.IncFail() log.Error("Unable to decode EntitlementCheckRequested event", "err", err) return } - log.Info("Received EntitlementCheckRequested", "xchain.req.txid", entitlementCheckRequest.TransactionID().Hex()) + log.Info("Received EntitlementCheckRequested", "xchain.req.txid", entitlementCheckRequest.TransactionId) // process the entitlement request and post the result to entitlementCheckResults outcome, err := x.handleEntitlementCheckRequest(ctx, entitlementCheckRequest) if err != nil { x.entitlementCheckRequested.IncFail() log.Error("Entitlement check failed to process", - "err", err, "xchain.req.txid", entitlementCheckRequest.TransactionID().Hex()) + "err", err, "xchain.req.txid", entitlementCheckRequest.TransactionId) return } if outcome != nil { // request was not intended for this xchain instance. @@ -328,23 +323,23 @@ func (x *xchain) onEntitlementCheckRequested( // It can return nil, nil in case the request wasn't targeted for the current xchain instance. func (x *xchain) handleEntitlementCheckRequest( ctx context.Context, - request contracts.IEntitlementCheckRequestEvent, + request base.IEntitlementCheckerEntitlementCheckRequested, ) (*entitlementCheckReceipt, error) { log := x.Log(ctx). With("function", "handleEntitlementCheckRequest"). - With("req.txid", request.TransactionID().Hex()). - With("roleId", request.RoleId().String()) + With("req.txid", request.TransactionId). + With("roleId", request.RoleId.String()) - for _, selectedNodeAddress := range request.SelectedNodes() { + for _, selectedNodeAddress := range request.SelectedNodes { if selectedNodeAddress == x.baseChain.Wallet.Address { log.Info("Processing EntitlementCheckRequested") - outcome, err := x.process(ctx, request, x.baseChain.Client, request.CallerAddress()) + outcome, err := x.process(ctx, request, x.baseChain.Client, request.CallerAddress) if err != nil { return nil, err } return &entitlementCheckReceipt{ - TransactionID: request.TransactionID(), - RoleId: request.RoleId(), + TransactionID: request.TransactionId, + RoleId: request.RoleId, Outcome: outcome, Event: request, }, nil @@ -352,7 +347,7 @@ func (x *xchain) handleEntitlementCheckRequest( } log.Debug( "EntitlementCheckRequested not for this xchain instance", - "selectedNodes", request.SelectedNodes(), + "selectedNodes", request.SelectedNodes, "nodeAddress", x.baseChain.Wallet.Address.Hex(), ) return nil, nil // request not for this xchain instance @@ -381,10 +376,9 @@ func (x *xchain) writeEntitlementCheckResults(ctx context.Context, checkResults } createPostResultTx := func(opts *bind.TransactOpts) (*types.Transaction, error) { - gated, err := contracts.NewIEntitlementGated( - receipt.Event.ContractAddress(), + gated, err := base.NewIEntitlementGated( + receipt.Event.ContractAddress, x.baseChain.Client, - x.config.GetContractVersion(), ) if err != nil { return nil, err @@ -447,7 +441,7 @@ func (x *xchain) writeEntitlementCheckResults(ctx context.Context, checkResults "tx.success", receipt.Status == crypto.TransactionResultSuccess, "xchain.req.txid", task.outcome.TransactionID, "xchain.req.outcome", task.outcome.Outcome, - "gatedContract", task.outcome.Event.ContractAddress()) + "gatedContract", task.outcome.Event.ContractAddress) x.entitlementCheckProcessed.IncFail() } else { log.Info("entitlement check response posted", @@ -457,7 +451,7 @@ func (x *xchain) writeEntitlementCheckResults(ctx context.Context, checkResults "tx.success", receipt.Status == crypto.TransactionResultSuccess, "xchain.req.txid", task.outcome.TransactionID, "xchain.req.outcome", task.outcome.Outcome, - "gatedContract", task.outcome.Event.ContractAddress()) + "gatedContract", task.outcome.Event.ContractAddress) x.entitlementCheckProcessed.IncPass() } } @@ -482,10 +476,9 @@ func (x *xchain) handleContractError(log *slog.Logger, err error, msg string) er func (x *xchain) getLinkedWallets(ctx context.Context, wallet common.Address) ([]common.Address, error) { log := x.Log(ctx) log.Debug("GetLinkedWallets", "wallet", wallet.Hex(), "walletLinkContract", x.config.GetWalletLinkContractAddress()) - iWalletLink, err := contracts.NewIWalletLink( + iWalletLink, err := base.NewWalletLink( x.config.GetWalletLinkContractAddress(), x.baseChain.Client, - x.config.GetContractVersion(), ) if err != nil { return nil, x.handleContractError(log, err, "Failed to create IWalletLink") @@ -521,9 +514,9 @@ func (x *xchain) getRuleData( roleId *big.Int, contractAddress common.Address, client crypto.BlockchainClient, -) (*contracts.IRuleData, error) { +) (*base.IRuleEntitlementRuleData, error) { log := x.Log(ctx).With("function", "getRuleData", "req.txid", transactionId) - gater, err := contracts.NewIEntitlementGated(contractAddress, client, x.config.GetContractVersion()) + gater, err := base.NewIEntitlementGated(contractAddress, client) if err != nil { return nil, x.handleContractError(log, err, "Failed to create NewEntitlementGated") } @@ -536,21 +529,21 @@ func (x *xchain) getRuleData( return nil, x.handleContractError(log, err, "Failed to GetEncodedRuleData") } x.getRuleDataCalls.IncPass() - return ruleData, nil + return &ruleData, nil } // process the given entitlement request. // It returns an indication of the request passes checks. func (x *xchain) process( ctx context.Context, - request contracts.IEntitlementCheckRequestEvent, + request base.IEntitlementCheckerEntitlementCheckRequested, client crypto.BlockchainClient, callerAddress common.Address, ) (result bool, err error) { log := x.Log(ctx). With("caller_address", callerAddress.Hex()) - log = log.With("function", "process", "req.txid", request.TransactionID().Hex()) + log = log.With("function", "process", "req.txid", request.TransactionId) log.Info("Process EntitlementCheckRequested") wallets, err := x.getLinkedWallets(ctx, callerAddress) @@ -558,7 +551,7 @@ func (x *xchain) process( return false, err } - ruleData, err := x.getRuleData(ctx, request.TransactionID(), request.RoleId(), request.ContractAddress(), client) + ruleData, err := x.getRuleData(ctx, request.TransactionId, request.RoleId, request.ContractAddress, client) if err != nil { return false, err } diff --git a/core/xchain/server/server_test.go b/core/xchain/server/server_test.go index 331e4120b..a06911097 100644 --- a/core/xchain/server/server_test.go +++ b/core/xchain/server/server_test.go @@ -13,10 +13,11 @@ import ( "time" "github.com/river-build/river/core/config" + "github.com/river-build/river/core/contracts/base" + "github.com/river-build/river/core/contracts/base/deploy" + test_contracts "github.com/river-build/river/core/contracts/base/deploy" "github.com/river-build/river/core/xchain/client_simulator" xc_common "github.com/river-build/river/core/xchain/common" - "github.com/river-build/river/core/xchain/contracts" - test_contracts "github.com/river-build/river/core/xchain/contracts/test" "github.com/river-build/river/core/xchain/entitlement" "github.com/river-build/river/core/xchain/server" @@ -56,8 +57,8 @@ type serviceTester struct { walletLinkingAddress common.Address // Contracts - entitlementChecker *contracts.IEntitlementChecker - walletLink *contracts.IWalletLink + entitlementChecker *base.IEntitlementChecker + walletLink *base.WalletLink decoder *node_crypto.EvmErrorDecoder } @@ -118,39 +119,37 @@ func (st *serviceTester) deployXchainTestContracts() { st.require.NoError(err) // Deploy the mock entitlement checker - addr, _, _, err := contracts.DeployMockEntitlementChecker( + addr, _, _, err := test_contracts.DeployMockEntitlementChecker( auth, client, approvedNodeOperators, - st.Config().GetContractVersion(), ) st.require.NoError(err) st.entitlementCheckerAddress = addr - iChecker, err := contracts.NewIEntitlementChecker(addr, client, st.Config().GetContractVersion()) + iChecker, err := base.NewIEntitlementChecker(addr, client) st.require.NoError(err) st.entitlementChecker = iChecker // Deploy the mock entitlement gated contract - addr, _, _, err = contracts.DeployMockEntitlementGated( + addr, _, _, err = test_contracts.DeployMockEntitlementGated( auth, client, st.entitlementCheckerAddress, - st.Config().GetContractVersion(), ) st.require.NoError(err) st.mockEntitlementGatedAddress = addr // Deploy the mock custom entitlement contract - addr, _, _, err = contracts.DeployMockCustomEntitlement(auth, client, st.Config().GetContractVersion()) + addr, _, _, err = test_contracts.DeployMockCustomEntitlement(auth, client) st.require.NoError(err) st.mockCustomEntitlementAddress = addr // Deploy the wallet linking contract - addr, _, _, err = contracts.DeployWalletLink(auth, client, st.Config().GetContractVersion()) + addr, _, _, err = test_contracts.DeployWalletLink(auth, client) st.require.NoError(err) st.walletLinkingAddress = addr - walletLink, err := contracts.NewIWalletLink(addr, client, st.Config().GetContractVersion()) + walletLink, err := base.NewWalletLink(addr, client) st.require.NoError(err) st.walletLink = walletLink @@ -170,7 +169,7 @@ func (st *serviceTester) deployXchainTestContracts() { st.walletLinkingAddress.Hex(), ) - decoder, err := node_crypto.NewEVMErrorDecoder(iChecker.GetMetadata(), walletLink.GetMetadata()) + decoder, err := node_crypto.NewEVMErrorDecoder(base.IEntitlementCheckerMetaData, base.WalletLinkMetaData) st.decoder = decoder } @@ -315,7 +314,7 @@ func (st *serviceTester) linkWalletToRootWallet( rootKeySignature, err := rootWallet.SignHash(node_crypto.ToEthMessageHash(hash)) rootKeySignature[64] += 27 // Transform V from 0/1 to 27/28 - rootKeyWallet := contracts.IWalletLinkBaseLinkedWallet{ + rootKeyWallet := base.IWalletLinkBaseLinkedWallet{ Addr: rootWallet.Address, Signature: rootKeySignature, } @@ -325,7 +324,7 @@ func (st *serviceTester) linkWalletToRootWallet( st.require.NoError(err) nodeWalletSignature, err := wallet.SignHash(node_crypto.ToEthMessageHash(hash)) nodeWalletSignature[64] += 27 // Transform V from 0/1 to 27/28 - nodeWallet := contracts.IWalletLinkBaseLinkedWallet{ + nodeWallet := base.IWalletLinkBaseLinkedWallet{ Addr: wallet.Address, Signature: nodeWalletSignature, } @@ -343,15 +342,15 @@ func (st *serviceTester) linkWalletToRootWallet( st.require.Equal(uint64(1), receipt.Status) } -func erc721Check(chainId uint64, contractAddress common.Address, threshold uint64) contracts.IRuleData { - return contracts.IRuleData{ - Operations: []contracts.IRuleEntitlementOperation{ +func erc721Check(chainId uint64, contractAddress common.Address, threshold uint64) base.IRuleEntitlementRuleData { + return base.IRuleEntitlementRuleData{ + Operations: []base.IRuleEntitlementOperation{ { OpType: uint8(entitlement.CHECK), Index: 0, }, }, - CheckOperations: []contracts.IRuleEntitlementCheckOperation{ + CheckOperations: []base.IRuleEntitlementCheckOperation{ { OpType: uint8(entitlement.ERC721), ChainId: new(big.Int).SetUint64(chainId), @@ -362,15 +361,15 @@ func erc721Check(chainId uint64, contractAddress common.Address, threshold uint6 } } -func erc20Check(chainId uint64, contractAddress common.Address, threshold uint64) contracts.IRuleData { - return contracts.IRuleData{ - Operations: []contracts.IRuleEntitlementOperation{ +func erc20Check(chainId uint64, contractAddress common.Address, threshold uint64) base.IRuleEntitlementRuleData { + return base.IRuleEntitlementRuleData{ + Operations: []base.IRuleEntitlementOperation{ { OpType: uint8(entitlement.CHECK), Index: 0, }, }, - CheckOperations: []contracts.IRuleEntitlementCheckOperation{ + CheckOperations: []base.IRuleEntitlementCheckOperation{ { OpType: uint8(entitlement.ERC20), ChainId: new(big.Int).SetUint64(chainId), @@ -382,15 +381,15 @@ func erc20Check(chainId uint64, contractAddress common.Address, threshold uint64 } } -func customEntitlementCheck(chainId uint64, contractAddress common.Address) contracts.IRuleData { - return contracts.IRuleData{ - Operations: []contracts.IRuleEntitlementOperation{ +func customEntitlementCheck(chainId uint64, contractAddress common.Address) base.IRuleEntitlementRuleData { + return base.IRuleEntitlementRuleData{ + Operations: []base.IRuleEntitlementOperation{ { OpType: uint8(entitlement.CHECK), Index: 0, }, }, - CheckOperations: []contracts.IRuleEntitlementCheckOperation{ + CheckOperations: []base.IRuleEntitlementCheckOperation{ { OpType: uint8(entitlement.ISENTITLED), ChainId: new(big.Int).SetUint64(chainId), @@ -438,7 +437,7 @@ func TestNodeIsRegistered(t *testing.T) { defer st.Close() st.Start(t) - count, err := st.entitlementChecker.NodeCount(nil) + count, err := st.entitlementChecker.GetNodeCount(nil) require.NoError(err) require.Equal(5, int(count.Int64())) @@ -470,7 +469,7 @@ func expectEntitlementCheckResult( cs client_simulator.ClientSimulator, ctx context.Context, cfg *config.Config, - data contracts.IRuleData, + data base.IRuleEntitlementRuleData, expected bool, ) { result, err := cs.EvaluateRuleData(ctx, cfg, data) @@ -683,7 +682,7 @@ func TestErc20Entitlements(t *testing.T) { func toggleEntitlement( require *require.Assertions, auth *bind.TransactOpts, - customEntitlement *contracts.MockCustomEntitlement, + customEntitlement *deploy.MockCustomEntitlement, wallet *node_crypto.Wallet, response bool, ) { @@ -702,7 +701,7 @@ func toggleEntitlement( func deployMockCustomEntitlement( require *require.Assertions, st *serviceTester, -) (*bind.TransactOpts, common.Address, *contracts.MockCustomEntitlement) { +) (*bind.TransactOpts, common.Address, *deploy.MockCustomEntitlement) { // Deploy mock custom entitlement contract to anvil chain nonce, err := anvilClient.PendingNonceAt(context.Background(), anvilWallet.Address) require.NoError(err) @@ -712,10 +711,9 @@ func deployMockCustomEntitlement( auth.Value = big.NewInt(0) // in wei auth.GasLimit = uint64(30_000_000) // in units - contractAddress, txn, customEntitlement, err := contracts.DeployMockCustomEntitlement( + contractAddress, txn, customEntitlement, err := deploy.DeployMockCustomEntitlement( auth, anvilClient, - st.Config().GetContractVersion(), ) require.NoError(err) require.NotNil( diff --git a/scripts/build-contract-types.sh b/scripts/build-contract-types.sh index bb930646c..90e0538db 100755 --- a/scripts/build-contract-types.sh +++ b/scripts/build-contract-types.sh @@ -27,7 +27,6 @@ for file in $ABI_DIR/*.abi.json; do done ./scripts/gen-river-node-bindings.sh -./scripts/gen-xchain-bindings.sh $VERSION DIFF_GLOB="$ABI_DIR/*.ts" diff --git a/scripts/gen-river-node-bindings.sh b/scripts/gen-river-node-bindings.sh index 96d091078..e63f12ced 100755 --- a/scripts/gen-river-node-bindings.sh +++ b/scripts/gen-river-node-bindings.sh @@ -23,6 +23,7 @@ generate_go() { --out "${OUT_DIR}/${GO_NAME}.go" } +# Base (and other) contracts interfaces generate_go base base IArchitect architect generate_go base base Channels channels generate_go base base IEntitlementsManager entitlements_manager @@ -32,10 +33,27 @@ generate_go base base IPausable pausable generate_go base base IBanning banning generate_go base base IWalletLink wallet_link generate_go base base IRuleEntitlement rule_entitlement +generate_go base base IEntitlementChecker i_entitlement_checker +generate_go base base IEntitlementGated i_entitlement_gated +generate_go base base IEntitlement i_entitlement +generate_go base base ICustomEntitlement i_custom_entitlement + +# Full Base (and other) contracts for deployment from tests +generate_go base/deploy deploy MockCustomEntitlement mock_custom_entitlement +generate_go base/deploy deploy MockEntitlementGated mock_entitlement_gated +generate_go base/deploy deploy MockEntitlementChecker mock_entitlement_checker +generate_go base/deploy deploy EntitlementChecker entitlement_checker +generate_go base/deploy deploy WalletLink wallet_link +generate_go base/deploy deploy MockERC20 mock_erc20 +generate_go base/deploy deploy MockERC721 mock_erc721 + +# River contracts interfaces generate_go river river INodeRegistry node_registry_v1 generate_go river river IStreamRegistry stream_registry_v1 generate_go river river IOperatorRegistry operator_registry_v1 generate_go river river IRiverConfig river_config_v1 + +# Full River contracts for deployment from tests generate_go river/deploy deploy MockRiverRegistry mock_river_registry # The follwing structs get included twice in the generated code, this utility removes them from a file @@ -49,3 +67,5 @@ mkdir -p bin go build -o bin/gen-bindings-remove-struct scripts/gen-bindings-remove-struct.go ./bin/gen-bindings-remove-struct core/contracts/base/architect.go IRuleEntitlementCheckOperation,IRuleEntitlementLogicalOperation,IRuleEntitlementOperation,IRuleEntitlementRuleData ./bin/gen-bindings-remove-struct core/contracts/base/entitlements_manager.go IRuleEntitlementCheckOperation,IRuleEntitlementLogicalOperation,IRuleEntitlementOperation,IRuleEntitlementRuleData +./bin/gen-bindings-remove-struct core/contracts/base/rule_entitlement.go IRuleEntitlementCheckOperation,IRuleEntitlementLogicalOperation,IRuleEntitlementOperation,IRuleEntitlementRuleData + diff --git a/scripts/gen-xchain-bindings.sh b/scripts/gen-xchain-bindings.sh deleted file mode 100755 index eb6725687..000000000 --- a/scripts/gen-xchain-bindings.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/bash -set -ueo pipefail -cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" -cd .. - -VERSION="${1:-localhost}" -if [ "$VERSION" = "localhost" ]; then - VERSION="dev" -elif [ "$VERSION" = "base_sepolia" ]; then - VERSION="v3" -fi - -if [ -z ${ABIGEN_VERSION+x} ]; then - ABIGEN_VERSION="v1.13.10" -fi - -XCHAIN_DIR="core/xchain/contracts" -BINDING_DIR="core/xchain/bindings" - -mkdir -p "${XCHAIN_DIR}/${VERSION}" - -generate_go() { - local CONTRACT=$1 - local GO_NAME=$2 - - go run github.com/ethereum/go-ethereum/cmd/abigen@${ABIGEN_VERSION} \ - --abi contracts/out/${CONTRACT}.sol/${CONTRACT}.abi.json \ - --bin contracts/out/${CONTRACT}.sol/${CONTRACT}.bin \ - --pkg "${VERSION}" \ - --type "${GO_NAME}" \ - --out "${XCHAIN_DIR}/${VERSION}/${GO_NAME}.go" -} - -generate_test_binding() { - local CONTRACT=$1 - local GO_NAME=$2 - - go run github.com/ethereum/go-ethereum/cmd/abigen@${ABIGEN_VERSION} \ - --abi contracts/out/${CONTRACT}.sol/${CONTRACT}.abi.json \ - --bin contracts/out/${CONTRACT}.sol/${CONTRACT}.bin \ - --pkg "dev" \ - --type "${GO_NAME}" \ - --out "${XCHAIN_DIR}/test/${GO_NAME}.go" -} - -generate_go_deploy() { - local CONTRACT=$1 - local GO_NAME=$2 - - local OUT_DIR="core/node/contracts/deploy" - mkdir -p "${OUT_DIR}" - - go run github.com/ethereum/go-ethereum/cmd/abigen@${ABIGEN_VERSION} \ - --abi contracts/out/${CONTRACT}.sol/${CONTRACT}.abi.json \ - --bin contracts/out/${CONTRACT}.sol/${CONTRACT}.bin \ - --pkg "deploy" \ - --type "${GO_NAME}" \ - --out "${OUT_DIR}/${GO_NAME}.go" -} - - -# Interfaces -generate_go IEntitlementChecker i_entitlement_checker -generate_go IEntitlementGated i_entitlement_gated -generate_go IEntitlement i_entitlement -generate_go ICustomEntitlement i_custom_entitlement -generate_go IWalletLink i_wallet_link - -# Contracts -generate_go MockCustomEntitlement mock_custom_entitlement -generate_go MockEntitlementGated mock_entitlement_gated -generate_go MockEntitlementChecker mock_entitlement_checker -generate_go EntitlementChecker entitlement_checker -generate_go WalletLink wallet_link - -# Unversion contracts -generate_test_binding MockERC20 mock_erc20 -generate_test_binding MockERC721 mock_erc721 - -mkdir -p bin -go build -o bin/gen-bindings-remove-struct scripts/gen-bindings-remove-struct.go -./bin/gen-bindings-remove-struct core/xchain/contracts/${VERSION}/mock_entitlement_gated.go IRuleEntitlementCheckOperation,IRuleEntitlementLogicalOperation,IRuleEntitlementOperation,IRuleEntitlementRuleData -./bin/gen-bindings-remove-struct core/xchain/contracts/${VERSION}/wallet_link.go IWalletLinkBaseLinkedWallet