From fef4e6a0c019a7e3b56cbf8bd1d6990fb64ea674 Mon Sep 17 00:00:00 2001 From: Bruno Calza Date: Wed, 15 Mar 2023 11:24:11 -0300 Subject: [PATCH 1/2] fix: gas limit [testnetdeploy] Signed-off-by: Bruno Calza --- Makefile | 8 +- cmd/toolkit/smart_contract.go | 128 +++------- pkg/tables/impl/ethereum/abi.json | 97 +++++-- pkg/tables/impl/ethereum/bytecode.bin | 2 +- pkg/tables/impl/ethereum/client.go | 45 +++- pkg/tables/impl/ethereum/contract.go | 241 +++++++++++++++--- .../ethereum/test/controller/controller.go | 5 +- .../test/erc721Enumerable/erc721Enumerable.go | 5 +- .../test/erc721aQueryable/erc721aQueryable.go | 5 +- 9 files changed, 371 insertions(+), 165 deletions(-) diff --git a/Makefile b/Makefile index 698f7333..b3bf1277 100644 --- a/Makefile +++ b/Makefile @@ -15,19 +15,19 @@ GOVVV_FLAGS=$(shell $(GOVVV) -flags -version $(BIN_VERSION) -pkg $(shell go list # Code generation ethereum: ethereum-testcontroller ethereum-testerc721 ethereum-testerc721a - go run github.com/ethereum/go-ethereum/cmd/abigen@v1.10.20 --abi ./pkg/tables/impl/ethereum/abi.json --pkg ethereum --type Contract --out pkg/tables/impl/ethereum/contract.go --bin pkg/tables/impl/ethereum/bytecode.bin + go run github.com/ethereum/go-ethereum/cmd/abigen@v1.11.4 --abi ./pkg/tables/impl/ethereum/abi.json --pkg ethereum --type Contract --out pkg/tables/impl/ethereum/contract.go --bin pkg/tables/impl/ethereum/bytecode.bin .PHONY: ethereum ethereum-testcontroller: - go run github.com/ethereum/go-ethereum/cmd/abigen@v1.10.20 --abi ./pkg/tables/impl/ethereum/test/controller/abi.json --pkg controller --type Contract --out pkg/tables/impl/ethereum/test/controller/controller.go --bin pkg/tables/impl/ethereum/test/controller/bytecode.bin + go run github.com/ethereum/go-ethereum/cmd/abigen@v1.11.4 --abi ./pkg/tables/impl/ethereum/test/controller/abi.json --pkg controller --type Contract --out pkg/tables/impl/ethereum/test/controller/controller.go --bin pkg/tables/impl/ethereum/test/controller/bytecode.bin .PHONY: ethereum-testcontroller ethereum-testerc721: - go run github.com/ethereum/go-ethereum/cmd/abigen@v1.10.20 --abi ./pkg/tables/impl/ethereum/test/erc721Enumerable/abi.json --pkg erc721Enumerable --type Contract --out pkg/tables/impl/ethereum/test/erc721Enumerable/erc721Enumerable.go --bin pkg/tables/impl/ethereum/test/erc721Enumerable/bytecode.bin + go run github.com/ethereum/go-ethereum/cmd/abigen@v1.11.4 --abi ./pkg/tables/impl/ethereum/test/erc721Enumerable/abi.json --pkg erc721Enumerable --type Contract --out pkg/tables/impl/ethereum/test/erc721Enumerable/erc721Enumerable.go --bin pkg/tables/impl/ethereum/test/erc721Enumerable/bytecode.bin .PHONY: ethereum-testerc721 ethereum-testerc721a: - go run github.com/ethereum/go-ethereum/cmd/abigen@v1.10.20 --abi ./pkg/tables/impl/ethereum/test/erc721aQueryable/abi.json --pkg erc721aQueryable --type Contract --out pkg/tables/impl/ethereum/test/erc721aQueryable/erc721aQueryable.go --bin pkg/tables/impl/ethereum/test/erc721aQueryable/bytecode.bin + go run github.com/ethereum/go-ethereum/cmd/abigen@v1.11.4 --abi ./pkg/tables/impl/ethereum/test/erc721aQueryable/abi.json --pkg erc721aQueryable --type Contract --out pkg/tables/impl/ethereum/test/erc721aQueryable/erc721aQueryable.go --bin pkg/tables/impl/ethereum/test/erc721aQueryable/bytecode.bin .PHONY: ethereum-testerc721a system-sql-assets: diff --git a/cmd/toolkit/smart_contract.go b/cmd/toolkit/smart_contract.go index 536c43f5..bb874d9a 100644 --- a/cmd/toolkit/smart_contract.go +++ b/cmd/toolkit/smart_contract.go @@ -6,13 +6,14 @@ import ( "fmt" "math/big" - "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/ethclient" "github.com/spf13/cobra" systemimpl "github.com/textileio/go-tableland/internal/system/impl" "github.com/textileio/go-tableland/internal/tableland" + "github.com/textileio/go-tableland/pkg/nonce/impl" parserimpl "github.com/textileio/go-tableland/pkg/parsing/impl" + "github.com/textileio/go-tableland/pkg/tables" "github.com/textileio/go-tableland/pkg/tables/impl/ethereum" "github.com/textileio/go-tableland/pkg/wallet" ) @@ -55,38 +56,11 @@ var runSQLCmd = &cobra.Command{ return fmt.Errorf("dial: %s", err) } - gasPrice, err := conn.SuggestGasPrice(ctx) - if err != nil { - return fmt.Errorf("suggest gas price: %s", err) - } - wallet, err := wallet.NewWallet(privateKey) if err != nil { return fmt.Errorf("new wallet: %s", err) } - auth, err := bind.NewKeyedTransactorWithChainID(wallet.PrivateKey(), big.NewInt(int64(chainID))) - if err != nil { - return fmt.Errorf("new keyed transactor with chain id: %s", err) - } - - nonce, err := conn.PendingNonceAt(ctx, wallet.Address()) - if err != nil { - return fmt.Errorf("pending nonce at: %s", err) - } - opts := &bind.TransactOpts{ - Context: ctx, - Signer: auth.Signer, - From: auth.From, - Nonce: big.NewInt(0).SetUint64(nonce), - GasPrice: gasPrice, - } - - contract, err := ethereum.NewContract(common.HexToAddress(contractAddress), conn) - if err != nil { - return fmt.Errorf("new contract: %s", err) - } - parser, err := parserimpl.New([]string{ "sqlite_", systemimpl.SystemTablesPrefix, @@ -102,9 +76,20 @@ var runSQLCmd = &cobra.Command{ return fmt.Errorf("validating mutating query: %s", err) } - tx, err := contract.RunSQL(opts, + client, err := ethereum.NewClient( + conn, + tableland.ChainID(chainID), + common.HexToAddress(contractAddress), + wallet, + impl.NewSimpleTracker(wallet, conn), + ) + if err != nil { + return fmt.Errorf("creating ethereum client: %s", err) + } + + tx, err := client.RunSQL(ctx, wallet.Address(), - stmts[0].GetTableID().ToBigInt(), + stmts[0].GetTableID(), query) if err != nil { return fmt.Errorf("run sql: %s", err) @@ -146,38 +131,11 @@ var createTableCmd = &cobra.Command{ return fmt.Errorf("dial: %s", err) } - gasPrice, err := conn.SuggestGasPrice(ctx) - if err != nil { - return fmt.Errorf("suggest gas price: %s", err) - } - wallet, err := wallet.NewWallet(privateKey) if err != nil { return fmt.Errorf("new wallet: %s", err) } - auth, err := bind.NewKeyedTransactorWithChainID(wallet.PrivateKey(), big.NewInt(int64(chainID))) - if err != nil { - return fmt.Errorf("new keyed transactor with chain id: %s", err) - } - - nonce, err := conn.PendingNonceAt(ctx, wallet.Address()) - if err != nil { - return fmt.Errorf("pending nonce at: %s", err) - } - opts := &bind.TransactOpts{ - Context: ctx, - Signer: auth.Signer, - From: auth.From, - Nonce: big.NewInt(0).SetUint64(nonce), - GasPrice: gasPrice, - } - - contract, err := ethereum.NewContract(common.HexToAddress(contractAddress), conn) - if err != nil { - return fmt.Errorf("new contract: %s", err) - } - parser, err := parserimpl.New([]string{ "sqlite_", systemimpl.SystemTablesPrefix, @@ -192,7 +150,18 @@ var createTableCmd = &cobra.Command{ return fmt.Errorf("validate create table: %s", err) } - tx, err := contract.CreateTable(opts, wallet.Address(), stmt) + client, err := ethereum.NewClient( + conn, + tableland.ChainID(chainID), + common.HexToAddress(contractAddress), + wallet, + impl.NewSimpleTracker(wallet, conn), + ) + if err != nil { + return fmt.Errorf("creating ethereum client: %s", err) + } + + tx, err := client.CreateTable(ctx, wallet.Address(), stmt) if err != nil { return fmt.Errorf("create table: %s", err) } @@ -234,38 +203,11 @@ var setControllerCmd = &cobra.Command{ return fmt.Errorf("dial: %s", err) } - gasPrice, err := conn.SuggestGasPrice(ctx) - if err != nil { - return fmt.Errorf("suggest gas price: %s", err) - } - wallet, err := wallet.NewWallet(privateKey) if err != nil { return fmt.Errorf("new wallet: %s", err) } - auth, err := bind.NewKeyedTransactorWithChainID(wallet.PrivateKey(), big.NewInt(int64(chainID))) - if err != nil { - return fmt.Errorf("new keyed transactor with chain id: %s", err) - } - - nonce, err := conn.PendingNonceAt(ctx, wallet.Address()) - if err != nil { - return fmt.Errorf("pending nonce at: %s", err) - } - opts := &bind.TransactOpts{ - Context: ctx, - Signer: auth.Signer, - From: auth.From, - Nonce: big.NewInt(0).SetUint64(nonce), - GasPrice: gasPrice, - } - - contract, err := ethereum.NewContract(common.HexToAddress(contractAddress), conn) - if err != nil { - return fmt.Errorf("new contract: %s", err) - } - tableIDStr := args[0] controller := args[1] @@ -275,9 +217,21 @@ var setControllerCmd = &cobra.Command{ return fmt.Errorf("set string: %s", err) } - tx, err := contract.SetController(opts, + client, err := ethereum.NewClient( + conn, + tableland.ChainID(chainID), + common.HexToAddress(contractAddress), + wallet, + impl.NewSimpleTracker(wallet, conn), + ) + if err != nil { + return fmt.Errorf("creating ethereum client: %s", err) + } + + tx, err := client.SetController( + ctx, wallet.Address(), - tableID, + tables.TableID(*tableID), common.HexToAddress(controller), ) if err != nil { diff --git a/pkg/tables/impl/ethereum/abi.json b/pkg/tables/impl/ethereum/abi.json index c5f953d8..878d01d5 100644 --- a/pkg/tables/impl/ethereum/abi.json +++ b/pkg/tables/impl/ethereum/abi.json @@ -9,11 +9,6 @@ "name": "ApprovalQueryForNonexistentToken", "type": "error" }, - { - "inputs": [], - "name": "ApprovalToCurrentOwner", - "type": "error" - }, { "inputs": [], "name": "ApproveToCaller", @@ -45,6 +40,11 @@ "name": "MaxQuerySizeExceeded", "type": "error" }, + { + "inputs": [], + "name": "MintERC2309QuantityExceedsLimit", + "type": "error" + }, { "inputs": [], "name": "MintToZeroAddress", @@ -60,6 +60,11 @@ "name": "OwnerQueryForNonexistentToken", "type": "error" }, + { + "inputs": [], + "name": "OwnershipNotInitializedForExtraData", + "type": "error" + }, { "inputs": [], "name": "TransferCallerNotOwnerNorApproved", @@ -172,6 +177,37 @@ "name": "BeaconUpgraded", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "fromTokenId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "toTokenId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "ConsecutiveTransfer", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -443,19 +479,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "burn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -470,7 +493,13 @@ } ], "name": "createTable", - "outputs": [], + "outputs": [ + { + "internalType": "uint256", + "name": "tableId", + "type": "uint256" + } + ], "stateMutability": "payable", "type": "function" }, @@ -500,6 +529,11 @@ "internalType": "bool", "name": "burned", "type": "bool" + }, + { + "internalType": "uint24", + "name": "extraData", + "type": "uint24" } ], "internalType": "struct IERC721AUpgradeable.TokenOwnership", @@ -536,6 +570,11 @@ "internalType": "bool", "name": "burned", "type": "bool" + }, + { + "internalType": "uint24", + "name": "extraData", + "type": "uint24" } ], "internalType": "struct IERC721AUpgradeable.TokenOwnership[]", @@ -621,6 +660,24 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tableId", + "type": "uint256" + } + ], + "name": "lockController", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [], "name": "name", @@ -726,7 +783,7 @@ ], "name": "runSQL", "outputs": [], - "stateMutability": "nonpayable", + "stateMutability": "payable", "type": "function" }, { diff --git a/pkg/tables/impl/ethereum/bytecode.bin b/pkg/tables/impl/ethereum/bytecode.bin index 472ce722..1b6f6dc9 100644 --- a/pkg/tables/impl/ethereum/bytecode.bin +++ b/pkg/tables/impl/ethereum/bytecode.bin @@ -1 +1 @@ -0x60a06040523060601b60805234801561001757600080fd5b5060805160601c613684610052600039600081816108aa015281816108f301528181610a6701528181610aa70152610b3a01526136846000f3fe6080604052600436106101f95760003560e01c80636352211e1161010d57806399a2557a116100a0578063c87b56dd1161006f578063c87b56dd146105b4578063e985e9c5146105d4578063eaf5d04e146105f4578063f2fde38b14610614578063f62d18881461063457600080fd5b806399a2557a14610527578063a22cb46514610547578063b88d4fde14610567578063c23dc68f1461058757600080fd5b80638462151c116100dc5780638462151c146104a75780638bb0ab97146104d45780638da5cb5b146104f457806395d89b411461051257600080fd5b80636352211e1461043d57806370a082311461045d578063715018a61461047d5780638456cb591461049257600080fd5b80633f4ba83a1161019057806352d1902d1161015f57806352d1902d1461038d57806355f804b3146103a257806358edaa9c146103c25780635bbb2177146103f85780635c975abb1461042557600080fd5b80633f4ba83a1461032557806342842e0e1461033a57806342966c681461035a5780634f1ef2861461037a57600080fd5b806318160ddd116101cc57806318160ddd146102af57806323b872dd146102d25780633659cfe6146102f25780633a9151b01461031257600080fd5b806301ffc9a7146101fe57806306fdde0314610233578063081812fc14610255578063095ea7b31461028d575b600080fd5b34801561020a57600080fd5b5061021e610219366004612e87565b610654565b60405190151581526020015b60405180910390f35b34801561023f57600080fd5b506102486106a6565b60405161022a9190613258565b34801561026157600080fd5b50610275610270366004612fd2565b610741565b6040516001600160a01b03909116815260200161022a565b34801561029957600080fd5b506102ad6102a8366004612cf3565b61078e565b005b3480156102bb57600080fd5b506102c461086f565b60405190815260200161022a565b3480156102de57600080fd5b506102ad6102ed366004612bd2565b61088f565b3480156102fe57600080fd5b506102ad61030d366004612b86565b61089f565b6102ad610320366004612ca8565b610988565b34801561033157600080fd5b506102ad610a02565b34801561034657600080fd5b506102ad610355366004612bd2565b610a36565b34801561036657600080fd5b506102ad610375366004612fd2565b610a51565b6102ad610388366004612ca8565b610a5c565b34801561039957600080fd5b506102c4610b2d565b3480156103ae57600080fd5b506102ad6103bd366004612ebf565b610be0565b3480156103ce57600080fd5b506102756103dd366004612fd2565b600090815260fc60205260409020546001600160a01b031690565b34801561040457600080fd5b50610418610413366004612ddd565b610c1d565b60405161022a91906131b6565b34801561043157600080fd5b5060655460ff1661021e565b34801561044957600080fd5b50610275610458366004612fd2565b610d0d565b34801561046957600080fd5b506102c4610478366004612b86565b610d18565b34801561048957600080fd5b506102ad610d77565b34801561049e57600080fd5b506102ad610dab565b3480156104b357600080fd5b506104c76104c2366004612b86565b610ddd565b60405161022a9190613220565b3480156104e057600080fd5b506102ad6104ef366004612d1c565b610f01565b34801561050057600080fd5b506033546001600160a01b0316610275565b34801561051e57600080fd5b50610248610fe3565b34801561053357600080fd5b506104c7610542366004612dab565b610ffb565b34801561055357600080fd5b506102ad610562366004612c72565b6111a1565b34801561057357600080fd5b506102ad610582366004612c0d565b611248565b34801561059357600080fd5b506105a76105a2366004612fd2565b611292565b60405161022a919061344f565b3480156105c057600080fd5b506102486105cf366004612fd2565b61130c565b3480156105e057600080fd5b5061021e6105ef366004612ba0565b611390565b34801561060057600080fd5b506102ad61060f366004612d57565b6113cd565b34801561062057600080fd5b506102ad61062f366004612b86565b6114da565b34801561064057600080fd5b506102ad61064f366004612ebf565b611572565b60006301ffc9a760e01b6001600160e01b03198316148061068557506380ac58cd60e01b6001600160e01b03198316145b806106a05750635b5e139f60e01b6001600160e01b03198316145b92915050565b60606106b0611771565b60020180546106be90613552565b80601f01602080910402602001604051908101604052809291908181526020018280546106ea90613552565b80156107375780601f1061070c57610100808354040283529160200191610737565b820191906000526020600020905b81548152906001019060200180831161071a57829003601f168201915b5050505050905090565b600061074c82611795565b610769576040516333d1c03960e21b815260040160405180910390fd5b610771611771565b60009283526006016020525060409020546001600160a01b031690565b6000610799826117de565b9050806001600160a01b0316836001600160a01b031614156107ce5760405163250fdee360e21b815260040160405180910390fd5b336001600160a01b03821614610805576107e88133611390565b610805576040516367d9dca160e11b815260040160405180910390fd5b8261080e611771565b6000848152600691909101602052604080822080546001600160a01b0319166001600160a01b0394851617905551849286811692908516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a4505050565b6000600161087b611771565b60010154610887611771565b540303919050565b61089a83838361186d565b505050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156108f15760405162461bcd60e51b81526004016108e8906132bf565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661093a6000805160206135c8833981519152546001600160a01b031690565b6001600160a01b0316146109605760405162461bcd60e51b81526004016108e89061330b565b61096981611a87565b6040805160008082526020820190925261098591839190611ab1565b50565b60655460ff16156109ab5760405162461bcd60e51b81526004016108e890613357565b60006109b5611c2b565b90506109c2836001611c3b565b7ffe0c067afc4fe17adcf4cfa139aabad6dc30dd86dfe39fb2b858961637156cdd8382846040516109f59392919061318f565b60405180910390a1505050565b6033546001600160a01b03163314610a2c5760405162461bcd60e51b81526004016108e8906133cf565b610a34611c55565b565b61089a83838360405180602001604052806000815250611248565b610985816001611ce8565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415610aa55760405162461bcd60e51b81526004016108e8906132bf565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610aee6000805160206135c8833981519152546001600160a01b031690565b6001600160a01b031614610b145760405162461bcd60e51b81526004016108e89061330b565b610b1d82611a87565b610b2982826001611ab1565b5050565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610bcd5760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016108e8565b506000805160206135c883398151915290565b6033546001600160a01b03163314610c0a5760405162461bcd60e51b81526004016108e8906133cf565b8051610b299060fb9060208401906129ab565b80516060906000816001600160401b03811115610c4a57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610c9557816020015b6040805160608101825260008082526020808301829052928201528252600019909201910181610c685790505b50905060005b828114610d0557610cd2858281518110610cc557634e487b7160e01b600052603260045260246000fd5b6020026020010151611292565b828281518110610cf257634e487b7160e01b600052603260045260246000fd5b6020908102919091010152600101610c9b565b509392505050565b60006106a0826117de565b600081610d38576040516323d3ad8160e21b815260040160405180910390fd5b6001600160401b03610d48611771565b6005016000846001600160a01b03166001600160a01b0316815260200190815260200160002054169050919050565b6033546001600160a01b03163314610da15760405162461bcd60e51b81526004016108e8906133cf565b610a346000611ec0565b6033546001600160a01b03163314610dd55760405162461bcd60e51b81526004016108e8906133cf565b610a34611f12565b60606000806000610ded85610d18565b90506000816001600160401b03811115610e1757634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610e40578160200160208202803683370190505b509050610e66604080516060810182526000808252602082018190529181019190915290565b60015b838614610ef557610e7981611f6a565b9150816040015115610e8a57610eed565b81516001600160a01b031615610e9f57815194505b876001600160a01b0316856001600160a01b03161415610eed5780838780600101985081518110610ee057634e487b7160e01b600052603260045260246000fd5b6020026020010181815250505b600101610e69565b50909695505050505050565b60655460ff1615610f245760405162461bcd60e51b81526004016108e890613357565b610f2d82611795565b1580610f6757506001600160a01b03831633148015610f655750610f5082610d0d565b6001600160a01b0316836001600160a01b0316145b155b15610f84576040516282b42960e81b815260040160405180910390fd5b600082815260fc602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f64d442926514e7c17643406b529155919979582e13eee1dfe07cbd088ef2033e91016109f5565b6060610fed611771565b60030180546106be90613552565b606081831061101d57604051631960ccad60e11b815260040160405180910390fd5b600080611028611c2b565b9050600185101561103857600194505b80841115611044578093505b600061104f87610d18565b90508486101561106e5785850381811015611068578091505b50611072565b5060005b6000816001600160401b0381111561109a57634e487b7160e01b600052604160045260246000fd5b6040519080825280602002602001820160405280156110c3578160200160208202803683370190505b509050816110d657935061119a92505050565b60006110e188611292565b9050600081604001516110f2575080515b885b8881141580156111045750848714155b1561118e5761111281611f6a565b925082604001511561112357611186565b82516001600160a01b03161561113857825191505b8a6001600160a01b0316826001600160a01b03161415611186578084888060010199508151811061117957634e487b7160e01b600052603260045260246000fd5b6020026020010181815250505b6001016110f4565b50505092835250909150505b9392505050565b6001600160a01b0382163314156111cb5760405163b06307db60e01b815260040160405180910390fd5b806111d4611771565b336000818152600792909201602090815260408084206001600160a01b03881680865290835293819020805460ff19169515159590951790945592518415158152919290917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b61125384848461186d565b6001600160a01b0383163b1561128c5761126f84848484611faa565b61128c576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b604080516060808201835260008083526020808401829052838501829052845192830185528183528201819052928101929092529060018310806112dd57506112d9611c2b565b8310155b156112e85792915050565b6112f183611f6a565b90508060400151156113035792915050565b61119a836120a2565b606061131782611795565b61133457604051630a14c4b560e41b815260040160405180910390fd5b600061133e6120d0565b905080516000141561135f576040518060200160405280600081525061119a565b80611369846120df565b60405160200161137a929190613032565b6040516020818303038152906040529392505050565b600061139a611771565b6001600160a01b039384166000908152600791909101602090815260408083209490951682529290925250205460ff1690565b60655460ff16156113f05760405162461bcd60e51b81526004016108e890613357565b6113f982611795565b158061142357506001600160a01b03831633148061142157506033546001600160a01b031633145b155b15611440576040516282b42960e81b815260040160405180910390fd5b80516188b88111156114705760405163287d905760e01b8152600481018290526188b860248201526044016108e8565b7f6de956d2cb2e161f8c91c6ae7b286358c7458d5ad5e26ea2d55330fbe282839c84856001600160a01b03166114a586610d0d565b6001600160a01b03161485856114bb898961212e565b6040516114cc95949392919061309e565b60405180910390a150505050565b6033546001600160a01b031633146115045760405162461bcd60e51b81526004016108e8906133cf565b6001600160a01b0381166115695760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016108e8565b61098581611ec0565b60008051602061362f83398151915254610100900460ff166115a75760008051602061362f8339815191525460ff16156115ab565b303b155b61161d5760405162461bcd60e51b815260206004820152603760248201527f455243373231415f5f496e697469616c697a61626c653a20636f6e747261637460448201527f20697320616c726561647920696e697469616c697a656400000000000000000060648201526084016108e8565b60008051602061362f83398151915254610100900460ff161580156116595760008051602061362f833981519152805461ffff19166101011790555b600061166560016122bf565b9050801561167d576000805461ff0019166101001790555b6116cc6040518060400160405280601081526020016f5461626c656c616e64205461626c657360801b815250604051806040016040528060058152602001645441424c4560d81b81525061234c565b6116d461238a565b6116dc61238a565b6116e46123c6565b6116ec6123f5565b6116f4612424565b82516117079060fb9060208601906129ab565b50801561174e576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b508015610b2957505060008051602061362f833981519152805461ff0019169055565b7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4090565b6000816001111580156117af57506117ab611771565b5482105b80156106a05750600160e01b6117c3611771565b60008481526004919091016020526040902054161592915050565b60008180600111611854576117f1611771565b54811015611854576000611803611771565b600083815260049190910160205260409020549050600160e01b8116611852575b8061119a57611831611771565b60001990920160008181526004939093016020526040909220549050611824565b505b604051636f96cda160e11b815260040160405180910390fd5b6000611878826117de565b9050836001600160a01b0316816001600160a01b0316146118ab5760405162a1148160e81b815260040160405180910390fd5b60006118b5611771565b600084815260069190910160205260408120546001600160a01b03908116925086163314806118e957506118e98633611390565b806118fc57506001600160a01b03821633145b90508061191c57604051632ce44b5f60e11b815260040160405180910390fd5b8461193a57604051633a954ecd60e21b815260040160405180910390fd5b811561196957611948611771565b60008581526006919091016020526040902080546001600160a01b03191690555b611971611771565b6001600160a01b038716600090815260059190910160205260409020805460001901905561199d611771565b6001600160a01b03861660009081526005919091016020526040902080546001019055600160e11b4260a01b8617176119d4611771565b60008681526004919091016020526040902055600160e11b8316611a4357600184016119fe611771565b60008281526004919091016020526040902054611a4157611a1d611771565b548114611a415783611a2d611771565b600083815260049190910160205260409020555b505b83856001600160a01b0316876001600160a01b031660008051602061360f83398151915260405160405180910390a4611a7f868686600161244b565b505050505050565b6033546001600160a01b031633146109855760405162461bcd60e51b81526004016108e8906133cf565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615611ae45761089a836124a2565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b158015611b1d57600080fd5b505afa925050508015611b4d575060408051601f3d908101601f19168201909252611b4a91810190612e6f565b60015b611bb05760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016108e8565b6000805160206135c88339815191528114611c1f5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016108e8565b5061089a83838361253e565b6000611c35611771565b54919050565b610b29828260405180602001604052806000815250612563565b60655460ff16611c9e5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016108e8565b6065805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6000611cf3836117de565b9050806000611d00611771565b600086815260069190910160205260409020546001600160a01b031690508315611d77576000336001600160a01b0384161480611d425750611d428333611390565b80611d5557506001600160a01b03821633145b905080611d7557604051632ce44b5f60e11b815260040160405180910390fd5b505b8015611da657611d85611771565b60008681526006919091016020526040902080546001600160a01b03191690555b6fffffffffffffffffffffffffffffffff611dbf611771565b6001600160a01b03841660009081526005919091016020526040902080549091019055600160e11b600160e01b4260a01b611df78590565b171717611e02611771565b60008781526004919091016020526040902055600160e11b8316611e715760018501611e2c611771565b60008281526004919091016020526040902054611e6f57611e4b611771565b548114611e6f5783611e5b611771565b600083815260049190910160205260409020555b505b60405185906000906001600160a01b0385169060008051602061360f833981519152908390a4611ea582600087600161244b565b611ead611771565b6001908101805490910190555050505050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60655460ff1615611f355760405162461bcd60e51b81526004016108e890613357565b6065805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611ccb3390565b60408051606081018252600080825260208201819052918101919091526106a0611f92611771565b600084815260049190910160205260409020546126ea565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290611fdf903390899088908890600401613061565b602060405180830381600087803b158015611ff957600080fd5b505af1925050508015612029575060408051601f3d908101601f1916820190925261202691810190612ea3565b60015b612084573d808015612057576040519150601f19603f3d011682016040523d82523d6000602084013e61205c565b606091505b50805161207c576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b60408051606081018252600080825260208201819052918101919091526106a06120cb836117de565b6126ea565b606060fb80546106be90613552565b604080516080810191829052607f0190826030600a8206018353600a90045b801561211c57600183039250600a81066030018353600a90046120fe565b50819003601f19909101908152919050565b6040805160c0810182526000808252602082018190529181019190915260608082018190526080820181905260a0820152600082815260fc60205260409020546001600160a01b0316803b1561220357604051631bc8ee3560e11b81526001600160a01b038581166004830152821690633791dc6a9060240160006040518083038186803b1580156121bf57600080fd5b505afa1580156121d3573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526121fb9190810190612ef1565b9150506106a0565b6001600160a01b038116158061222a5750836001600160a01b0316816001600160a01b0316145b612246576040516282b42960e81b815260040160405180910390fd5b6040805160c081018252600180825260208083018290528284019190915282518082018452600080825260608401919091528351808301855281815260808401528351818152918201909352909160a0830191906122b4565b606081526020019060019003908161229f5790505b509052949350505050565b60008054610100900460ff1615612306578160ff1660011480156122e25750303b155b6122fe5760405162461bcd60e51b81526004016108e890613381565b506000919050565b60005460ff80841691161061232d5760405162461bcd60e51b81526004016108e890613381565b506000805460ff191660ff92909216919091179055600190565b919050565b60008051602061362f83398151915254610100900460ff166123805760405162461bcd60e51b81526004016108e89061326b565b610b298282612724565b60008051602061362f83398151915254610100900460ff166123be5760405162461bcd60e51b81526004016108e89061326b565b610a346127a7565b600054610100900460ff166123ed5760405162461bcd60e51b81526004016108e890613404565b610a346127db565b600054610100900460ff1661241c5760405162461bcd60e51b81526004016108e890613404565b610a3461280b565b600054610100900460ff16610a345760405162461bcd60e51b81526004016108e890613404565b6001600160a01b0384161561128c57604080516001600160a01b038087168252851660208201529081018390527f16d5b5d582da969cea3131e89ffbd67ee6b1ebbe2576c7a97e9b852fce946a7f906060016114cc565b6001600160a01b0381163b61250f5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016108e8565b6000805160206135c883398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6125478361283e565b6000825111806125545750805b1561089a5761128c838361287e565b600061256d611771565b5490508361258d57604051622e076360e81b815260040160405180910390fd5b826125ab5760405163b562e8dd60e01b815260040160405180910390fd5b6801000000000000000183026125bf611771565b6001600160a01b0386166000908152600591909101602052604090208054909101905560e16125ee6001851490565b901b4260a01b8517176125ff611771565b60008381526004919091016020526040902055808381016001600160a01b0386163b1561269d575b60405182906001600160a01b0388169060009060008051602061360f833981519152908290a46126606000878480600101955087611faa565b61267d576040516368d2bf6b60e11b815260040160405180910390fd5b808210612627578261268d611771565b541461269857600080fd5b6126d0565b5b6040516001830192906001600160a01b0388169060009060008051602061360f833981519152908290a480821061269e575b816126d9611771565b555061128c9050600085838661244b565b604080516060810182526001600160a01b038316815260a083901c6001600160401b03166020820152600160e01b90921615159082015290565b60008051602061362f83398151915254610100900460ff166127585760405162461bcd60e51b81526004016108e89061326b565b81612761611771565b60020190805190602001906127779291906129ab565b5080612781611771565b60030190805190602001906127979291906129ab565b5060016127a2611771565b555050565b60008051602061362f83398151915254610100900460ff16610a345760405162461bcd60e51b81526004016108e89061326b565b600054610100900460ff166128025760405162461bcd60e51b81526004016108e890613404565b610a3433611ec0565b600054610100900460ff166128325760405162461bcd60e51b81526004016108e890613404565b6065805460ff19169055565b612847816124a2565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b6128e65760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016108e8565b600080846001600160a01b0316846040516129019190613016565b600060405180830381855af49150503d806000811461293c576040519150601f19603f3d011682016040523d82523d6000602084013e612941565b606091505b509150915061296982826040518060600160405280602781526020016135e860279139612972565b95945050505050565b6060831561298157508161119a565b8251156129915782518084602001fd5b8160405162461bcd60e51b81526004016108e89190613258565b8280546129b790613552565b90600052602060002090601f0160209004810192826129d95760008555612a1f565b82601f106129f257805160ff1916838001178555612a1f565b82800160010185558215612a1f579182015b82811115612a1f578251825591602001919060010190612a04565b50612a2b929150612a2f565b5090565b5b80821115612a2b5760008155600101612a30565b80356001600160a01b038116811461234757600080fd5b600082601f830112612a6b578081fd5b81516020612a80612a7b836134dc565b6134ac565b80838252828201915082860187848660051b8901011115612a9f578586fd5b855b85811015612adf5781516001600160401b03811115612abe578788fd5b612acc8a87838c0101612b43565b8552509284019290840190600101612aa1565b5090979650505050505050565b8051612347816135a3565b600082601f830112612b07578081fd5b8135612b15612a7b826134ff565b818152846020838601011115612b29578283fd5b816020850160208301379081016020019190915292915050565b600082601f830112612b53578081fd5b8151612b61612a7b826134ff565b818152846020838601011115612b75578283fd5b61209a826020830160208701613526565b600060208284031215612b97578081fd5b61119a82612a44565b60008060408385031215612bb2578081fd5b612bbb83612a44565b9150612bc960208401612a44565b90509250929050565b600080600060608486031215612be6578081fd5b612bef84612a44565b9250612bfd60208501612a44565b9150604084013590509250925092565b60008060008060808587031215612c22578081fd5b612c2b85612a44565b9350612c3960208601612a44565b92506040850135915060608501356001600160401b03811115612c5a578182fd5b612c6687828801612af7565b91505092959194509250565b60008060408385031215612c84578182fd5b612c8d83612a44565b91506020830135612c9d816135a3565b809150509250929050565b60008060408385031215612cba578182fd5b612cc383612a44565b915060208301356001600160401b03811115612cdd578182fd5b612ce985828601612af7565b9150509250929050565b60008060408385031215612d05578182fd5b612d0e83612a44565b946020939093013593505050565b600080600060608486031215612d30578081fd5b612d3984612a44565b925060208401359150612d4e60408501612a44565b90509250925092565b600080600060608486031215612d6b578081fd5b612d7484612a44565b92506020840135915060408401356001600160401b03811115612d95578182fd5b612da186828701612af7565b9150509250925092565b600080600060608486031215612dbf578081fd5b612dc884612a44565b95602085013595506040909401359392505050565b60006020808385031215612def578182fd5b82356001600160401b03811115612e04578283fd5b8301601f81018513612e14578283fd5b8035612e22612a7b826134dc565b80828252848201915084840188868560051b8701011115612e41578687fd5b8694505b83851015612e63578035835260019490940193918501918501612e45565b50979650505050505050565b600060208284031215612e80578081fd5b5051919050565b600060208284031215612e98578081fd5b813561119a816135b1565b600060208284031215612eb4578081fd5b815161119a816135b1565b600060208284031215612ed0578081fd5b81356001600160401b03811115612ee5578182fd5b61209a84828501612af7565b600060208284031215612f02578081fd5b81516001600160401b0380821115612f18578283fd5b9083019060c08286031215612f2b578283fd5b612f33613484565b612f3c83612aec565b8152612f4a60208401612aec565b6020820152612f5b60408401612aec565b6040820152606083015182811115612f71578485fd5b612f7d87828601612b43565b606083015250608083015182811115612f94578485fd5b612fa087828601612b43565b60808301525060a083015182811115612fb7578485fd5b612fc387828601612a5b565b60a08301525095945050505050565b600060208284031215612fe3578081fd5b5035919050565b60008151808452613002816020860160208601613526565b601f01601f19169290920160200192915050565b60008251613028818460208701613526565b9190910192915050565b60008351613044818460208801613526565b835190830190613058818360208801613526565b01949350505050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061309490830184612fea565b9695505050505050565b60018060a01b0386168152600060208615158184015285604084015260a060608401526130ce60a0840186612fea565b838103608085015284511515815281850151151582820152604085015115156040820152606085015160c0606083015261310b60c0830182612fea565b9050608086015182820360808401526131248282612fea565b91505060a086015182820360a084015281925080518083528483019350848160051b8401018583019250865b8281101561317e57601f1985830301865261316c828551612fea565b95870195938701939150600101613150565b509c9b505050505050505050505050565b60018060a01b03841681528260208201526060604082015260006129696060830184612fea565b6020808252825182820181905260009190848201906040850190845b81811015610ef55761320d83855180516001600160a01b031682526020808201516001600160401b0316908301526040908101511515910152565b92840192606092909201916001016131d2565b6020808252825182820181905260009190848201906040850190845b81811015610ef55783518352928401929184019160010161323c565b60208152600061119a6020830184612fea565b60208082526034908201527f455243373231415f5f496e697469616c697a61626c653a20636f6e7472616374604082015273206973206e6f7420696e697469616c697a696e6760601b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b81516001600160a01b031681526020808301516001600160401b031690820152604080830151151590820152606081016106a0565b60405160c081016001600160401b03811182821017156134a6576134a661358d565b60405290565b604051601f8201601f191681016001600160401b03811182821017156134d4576134d461358d565b604052919050565b60006001600160401b038211156134f5576134f561358d565b5060051b60200190565b60006001600160401b038211156135185761351861358d565b50601f01601f191660200190565b60005b83811015613541578181015183820152602001613529565b8381111561128c5750506000910152565b600181811c9082168061356657607f821691505b6020821081141561358757634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b801515811461098557600080fd5b6001600160e01b03198116811461098557600080fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85fa2646970667358221220be0e9f10bd78bb28f14b63f64059ad2d62f5e764eae9031b1a17017b61300f3b64736f6c63430008040033 +0x60a06040523060601b60805234801561001757600080fd5b5060805160601c61358561005260003960008181610b4701528181610b9001528181610cc201528181610d020152610d9501526135856000f3fe6080604052600436106101f95760003560e01c80636352211e1161010d57806399a2557a116100a0578063c87b56dd1161006f578063c87b56dd146105b5578063e985e9c5146105d5578063eaf5d04e146105f5578063f2fde38b14610608578063f62d18881461062857600080fd5b806399a2557a14610528578063a22cb46514610548578063b88d4fde14610568578063c23dc68f1461058857600080fd5b80638462151c116100dc5780638462151c146104a85780638bb0ab97146104d55780638da5cb5b146104f557806395d89b411461051357600080fd5b80636352211e1461043e57806370a082311461045e578063715018a61461047e5780638456cb591461049357600080fd5b80633a9151b01161019057806352d1902d1161015f57806352d1902d1461038d57806355f804b3146103a257806358edaa9c146103c25780635bbb2177146103f95780635c975abb1461042657600080fd5b80633a9151b0146103325780633f4ba83a1461034557806342842e0e1461035a5780634f1ef2861461037a57600080fd5b8063095ea7b3116101cc578063095ea7b3146102af57806318160ddd146102cf57806323b872dd146102f25780633659cfe61461031257600080fd5b806301ffc9a7146101fe578063052956811461023357806306fdde0314610255578063081812fc14610277575b600080fd5b34801561020a57600080fd5b5061021e610219366004612e68565b610648565b60405190151581526020015b60405180910390f35b34801561023f57600080fd5b5061025361024e366004612cd4565b61069a565b005b34801561026157600080fd5b5061026a61078a565b60405161022a919061324d565b34801561028357600080fd5b50610297610292366004612fb3565b610825565b6040516001600160a01b03909116815260200161022a565b3480156102bb57600080fd5b506102536102ca366004612cd4565b610872565b3480156102db57600080fd5b506102e4610920565b60405190815260200161022a565b3480156102fe57600080fd5b5061025361030d366004612bb3565b610940565b34801561031e57600080fd5b5061025361032d366004612b67565b610b3c565b6102e4610340366004612c89565b610c25565b34801561035157600080fd5b50610253610c85565b34801561036657600080fd5b50610253610375366004612bb3565b610c97565b610253610388366004612c89565b610cb7565b34801561039957600080fd5b506102e4610d88565b3480156103ae57600080fd5b506102536103bd366004612ea0565b610e3b565b3480156103ce57600080fd5b506102976103dd366004612fb3565b600090815261012e60205260409020546001600160a01b031690565b34801561040557600080fd5b50610419610414366004612dbe565b610e57565b60405161022a91906131d3565b34801561043257600080fd5b5060655460ff1661021e565b34801561044a57600080fd5b50610297610459366004612fb3565b610f4e565b34801561046a57600080fd5b506102e4610479366004612b67565b610f59565b34801561048a57600080fd5b50610253610fc1565b34801561049f57600080fd5b50610253610fd3565b3480156104b457600080fd5b506104c86104c3366004612b67565b610fe3565b60405161022a9190613215565b3480156104e157600080fd5b506102536104f0366004612cfd565b61110e565b34801561050157600080fd5b506033546001600160a01b0316610297565b34801561051f57600080fd5b5061026a611249565b34801561053457600080fd5b506104c8610543366004612d8c565b611261565b34801561055457600080fd5b50610253610563366004612c53565b611407565b34801561057457600080fd5b50610253610583366004612bee565b6114ae565b34801561059457600080fd5b506105a86105a3366004612fb3565b6114f8565b60405161022a9190613397565b3480156105c157600080fd5b5061026a6105d0366004612fb3565b611585565b3480156105e157600080fd5b5061021e6105f0366004612b81565b611609565b610253610603366004612d38565b611646565b34801561061457600080fd5b50610253610623366004612b67565b611795565b34801561063457600080fd5b50610253610643366004612ea0565b61180b565b60006301ffc9a760e01b6001600160e01b03198316148061067957506380ac58cd60e01b6001600160e01b03198316145b806106945750635b5e139f60e01b6001600160e01b03198316145b92915050565b6106a2611aa7565b6106ab81611aed565b6106c7576040516282b42960e81b815260040160405180910390fd5b6001600160a01b0382163314806106e857506033546001600160a01b031633145b610704576040516282b42960e81b815260040160405180910390fd5b61070d81610f4e565b6001600160a01b0316826001600160a01b03161461073d576040516282b42960e81b815260040160405180910390fd5b600081815261012f602052604090205460ff161561076d576040516282b42960e81b815260040160405180910390fd5b600090815261012f60205260409020805460ff1916600117905550565b6060610794611b36565b60020180546107a290613473565b80601f01602080910402602001604051908101604052809291908181526020018280546107ce90613473565b801561081b5780601f106107f05761010080835404028352916020019161081b565b820191906000526020600020905b8154815290600101906020018083116107fe57829003601f168201915b5050505050905090565b600061083082611aed565b61084d576040516333d1c03960e21b815260040160405180910390fd5b610855611b36565b60009283526006016020525060409020546001600160a01b031690565b600061087d82610f4e565b9050336001600160a01b038216146108b6576108998133611609565b6108b6576040516367d9dca160e11b815260040160405180910390fd5b826108bf611b36565b6000848152600691909101602052604080822080546001600160a01b0319166001600160a01b0394851617905551849286811692908516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a4505050565b6000600161092c611b36565b60010154610938611b36565b540303919050565b600061094b82611b5a565b9050836001600160a01b0316816001600160a01b03161461097e5760405162a1148160e81b815260040160405180910390fd5b60008061098a84611be9565b915091506109af818761099a3390565b6001600160a01b039081169116811491141790565b6109da576109bd8633611609565b6109da57604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b038516610a0157604051633a954ecd60e21b815260040160405180910390fd5b8015610a0c57600082555b610a14611b36565b6001600160a01b0387166000908152600591909101602052604090208054600019019055610a40611b36565b6001600160a01b03861660008181526005929092016020526040909120805460010190554260a01b17600160e11b17610a77611b36565b60008681526004919091016020526040902055600160e11b8316610ae65760018401610aa1611b36565b60008281526004919091016020526040902054610ae457610ac0611b36565b548114610ae45783610ad0611b36565b600083815260049190910160205260409020555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4610b348686866001611c11565b505050505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415610b8e5760405162461bcd60e51b8152600401610b85906132b4565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610bd76000805160206134e9833981519152546001600160a01b031690565b6001600160a01b031614610bfd5760405162461bcd60e51b8152600401610b8590613300565b610c0681611c71565b60408051600080825260208201909252610c2291839190611c79565b50565b6000610c2f611aa7565b610c37611df3565b9050610c44836001611e03565b7ffe0c067afc4fe17adcf4cfa139aabad6dc30dd86dfe39fb2b858961637156cdd838284604051610c77939291906131ac565b60405180910390a192915050565b610c8d611e1d565b610c95611e77565b565b610cb2838383604051806020016040528060008152506114ae565b505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415610d005760405162461bcd60e51b8152600401610b85906132b4565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610d496000805160206134e9833981519152546001600160a01b031690565b6001600160a01b031614610d6f5760405162461bcd60e51b8152600401610b8590613300565b610d7882611c71565b610d8482826001611c79565b5050565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610e285760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610b85565b506000805160206134e983398151915290565b610e43611e1d565b8051610d849061012d906020840190612987565b80516060906000816001600160401b03811115610e8457634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610ed657816020015b604080516080810182526000808252602080830182905292820181905260608201528252600019909201910181610ea25790505b50905060005b828114610f4657610f13858281518110610f0657634e487b7160e01b600052603260045260246000fd5b60200260200101516114f8565b828281518110610f3357634e487b7160e01b600052603260045260246000fd5b6020908102919091010152600101610edc565b509392505050565b600061069482611b5a565b60006001600160a01b038216610f82576040516323d3ad8160e21b815260040160405180910390fd5b6001600160401b03610f92611b36565b6005016000846001600160a01b03166001600160a01b0316815260200190815260200160002054169050919050565b610fc9611e1d565b610c956000611ec9565b610fdb611e1d565b610c95611f1b565b60606000806000610ff385610f59565b90506000816001600160401b0381111561101d57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015611046578160200160208202803683370190505b50905061107360408051608081018252600080825260208201819052918101829052606081019190915290565b60015b8386146111025761108681611f58565b9150816040015115611097576110fa565b81516001600160a01b0316156110ac57815194505b876001600160a01b0316856001600160a01b031614156110fa57808387806001019850815181106110ed57634e487b7160e01b600052603260045260246000fd5b6020026020010181815250505b600101611076565b50909695505050505050565b611116611aa7565b61111f82611aed565b61113b576040516282b42960e81b815260040160405180910390fd5b6001600160a01b03831633148061115c57506033546001600160a01b031633145b611178576040516282b42960e81b815260040160405180910390fd5b61118182610f4e565b6001600160a01b0316836001600160a01b0316146111b1576040516282b42960e81b815260040160405180910390fd5b600082815261012f602052604090205460ff16156111e1576040516282b42960e81b815260040160405180910390fd5b600082815261012e602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f64d442926514e7c17643406b529155919979582e13eee1dfe07cbd088ef2033e910160405180910390a1505050565b6060611253611b36565b60030180546107a290613473565b606081831061128357604051631960ccad60e11b815260040160405180910390fd5b60008061128e611df3565b9050600185101561129e57600194505b808411156112aa578093505b60006112b587610f59565b9050848610156112d457858503818110156112ce578091505b506112d8565b5060005b6000816001600160401b0381111561130057634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015611329578160200160208202803683370190505b5090508161133c57935061140092505050565b6000611347886114f8565b905060008160400151611358575080515b885b88811415801561136a5750848714155b156113f45761137881611f58565b9250826040015115611389576113ec565b82516001600160a01b03161561139e57825191505b8a6001600160a01b0316826001600160a01b031614156113ec57808488806001019950815181106113df57634e487b7160e01b600052603260045260246000fd5b6020026020010181815250505b60010161135a565b50505092835250909150505b9392505050565b6001600160a01b0382163314156114315760405163b06307db60e01b815260040160405180910390fd5b8061143a611b36565b336000818152600792909201602090815260408084206001600160a01b03881680865290835293819020805460ff19169515159590951790945592518415158152919290917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6114b9848484610940565b6001600160a01b0383163b156114f2576114d584848484611f9f565b6114f2576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b60408051608081018252600080825260208201819052918101829052606081019190915260408051608081018252600080825260208201819052918101829052606081019190915260018310806115565750611552611df3565b8310155b156115615792915050565b61156a83611f58565b905080604001511561157c5792915050565b61140083612097565b606061159082611aed565b6115ad57604051630a14c4b560e41b815260040160405180910390fd5b60006115b76120cc565b90508051600014156115d85760405180602001604052806000815250611400565b806115e2846120dc565b6040516020016115f392919061304f565b6040516020818303038152906040529392505050565b6000611613611b36565b6001600160a01b039384166000908152600791909101602090815260408083209490951682529290925250205460ff1690565b61164e611aa7565b600260975414156116a15760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b85565b60026097556116af82611aed565b15806116d957506001600160a01b0383163314806116d757506033546001600160a01b031633145b155b156116f6576040516282b42960e81b815260040160405180910390fd5b80516188b88111156117265760405163287d905760e01b8152600481018290526188b86024820152604401610b85565b7f6de956d2cb2e161f8c91c6ae7b286358c7458d5ad5e26ea2d55330fbe282839c84856001600160a01b031661175b86610f4e565b6001600160a01b0316148585611771898961212b565b6040516117829594939291906130bb565b60405180910390a1505060016097555050565b61179d611e1d565b6001600160a01b0381166118025760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610b85565b610c2281611ec9565b60008051602061353083398151915254610100900460ff16611840576000805160206135308339815191525460ff1615611844565b303b155b6118b65760405162461bcd60e51b815260206004820152603760248201527f455243373231415f5f496e697469616c697a61626c653a20636f6e747261637460448201527f20697320616c726561647920696e697469616c697a65640000000000000000006064820152608401610b85565b60008051602061353083398151915254610100900460ff161580156118f257600080516020613530833981519152805461ffff19166101011790555b600054610100900460ff16158080156119125750600054600160ff909116105b8061192c5750303b15801561192c575060005460ff166001145b61198f5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610b85565b6000805460ff1916600117905580156119b2576000805461ff0019166101001790555b611a016040518060400160405280601081526020016f5461626c656c616e64205461626c657360801b815250604051806040016040528060058152602001645441424c4560d81b8152506122c1565b611a096122ff565b611a1161233b565b611a1961236a565b611a21612399565b611a296123c8565b8251611a3d9061012d906020860190612987565b508015611a84576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b508015610d84575050600080516020613530833981519152805461ff0019169055565b60655460ff1615610c955760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610b85565b600081600111158015611b075750611b03611b36565b5482105b80156106945750600160e01b611b1b611b36565b60008481526004919091016020526040902054161592915050565b7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4090565b60008180600111611bd057611b6d611b36565b54811015611bd0576000611b7f611b36565b600083815260049190910160205260409020549050600160e01b8116611bce575b8061140057611bad611b36565b60001990920160008181526004939093016020526040909220549050611ba0565b505b604051636f96cda160e11b815260040160405180910390fd5b6000806000611bf6611b36565b60009485526006016020525050604090912080549092909150565b6001600160a01b038416156114f257604080516001600160a01b038087168252851660208201529081018390527f16d5b5d582da969cea3131e89ffbd67ee6b1ebbe2576c7a97e9b852fce946a7f9060600160405180910390a150505050565b610c22611e1d565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615611cac57610cb2836123ef565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b158015611ce557600080fd5b505afa925050508015611d15575060408051601f3d908101601f19168201909252611d1291810190612e50565b60015b611d785760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610b85565b6000805160206134e98339815191528114611de75760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610b85565b50610cb283838361248b565b6000611dfd611b36565b54919050565b610d848282604051806020016040528060008152506124b0565b6033546001600160a01b03163314610c955760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b85565b611e7f61252d565b6065805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b611f23611aa7565b6065805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611eac3390565b604080516080810182526000808252602082018190529181018290526060810191909152610694611f87611b36565b60008481526004919091016020526040902054612576565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290611fd490339089908890889060040161307e565b602060405180830381600087803b158015611fee57600080fd5b505af192505050801561201e575060408051601f3d908101601f1916820190925261201b91810190612e84565b60015b612079573d80801561204c576040519150601f19603f3d011682016040523d82523d6000602084013e612051565b606091505b508051612071576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b6040805160808101825260008082526020820181905291810182905260608101919091526106946120c783611b5a565b612576565b606061012d80546107a290613473565b604080516080810191829052607f0190826030600a8206018353600a90045b801561211957600183039250600a81066030018353600a90046120fb565b50819003601f19909101908152919050565b6040805160c0810182526000808252602082018190529181019190915260608082018190526080820181905260a0820152600082815261012e60205260409020546001600160a01b0316803b1561220557604051631bc8ee3560e11b81526001600160a01b038581166004830152821690633791dc6a9034906024016000604051808303818588803b1580156121c057600080fd5b505af11580156121d4573d6000803e3d6000fd5b50505050506040513d6000823e601f3d908101601f191682016040526121fd9190810190612ed2565b915050610694565b6001600160a01b038116158061222c5750836001600160a01b0316816001600160a01b0316145b612248576040516282b42960e81b815260040160405180910390fd5b6040805160c081018252600180825260208083018290528284019190915282518082018452600080825260608401919091528351808301855281815260808401528351818152918201909352909160a0830191906122b6565b60608152602001906001900390816122a15790505b509052949350505050565b60008051602061353083398151915254610100900460ff166122f55760405162461bcd60e51b8152600401610b8590613260565b610d8482826125bd565b60008051602061353083398151915254610100900460ff166123335760405162461bcd60e51b8152600401610b8590613260565b610c95612640565b600054610100900460ff166123625760405162461bcd60e51b8152600401610b859061334c565b610c95612674565b600054610100900460ff166123915760405162461bcd60e51b8152600401610b859061334c565b610c956126a4565b600054610100900460ff166123c05760405162461bcd60e51b8152600401610b859061334c565b610c956126d7565b600054610100900460ff16610c955760405162461bcd60e51b8152600401610b859061334c565b6001600160a01b0381163b61245c5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610b85565b6000805160206134e983398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b61249483612705565b6000825111806124a15750805b15610cb2576114f28383612745565b6124ba8383612839565b6001600160a01b0383163b15610cb25760006124d4611b36565b5490508281035b6124ee6000868380600101945086611f9f565b61250b576040516368d2bf6b60e11b815260040160405180910390fd5b8181106124db578161251b611b36565b541461252657600080fd5b5050505050565b60655460ff16610c955760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610b85565b604080516080810182526001600160a01b038316815260a083901c6001600160401b03166020820152600160e01b831615159181019190915260e89190911c606082015290565b60008051602061353083398151915254610100900460ff166125f15760405162461bcd60e51b8152600401610b8590613260565b816125fa611b36565b6002019080519060200190612610929190612987565b508061261a611b36565b6003019080519060200190612630929190612987565b50600161263b611b36565b555050565b60008051602061353083398151915254610100900460ff16610c955760405162461bcd60e51b8152600401610b8590613260565b600054610100900460ff1661269b5760405162461bcd60e51b8152600401610b859061334c565b610c9533611ec9565b600054610100900460ff166126cb5760405162461bcd60e51b8152600401610b859061334c565b6065805460ff19169055565b600054610100900460ff166126fe5760405162461bcd60e51b8152600401610b859061334c565b6001609755565b61270e816123ef565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b6127ad5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610b85565b600080846001600160a01b0316846040516127c89190613033565b600060405180830381855af49150503d8060008114612803576040519150601f19603f3d011682016040523d82523d6000602084013e612808565b606091505b509150915061283082826040518060600160405280602781526020016135096027913961294e565b95945050505050565b6000612843611b36565b5490506001600160a01b03831661286c57604051622e076360e81b815260040160405180910390fd5b8161288a5760405163b562e8dd60e01b815260040160405180910390fd5b68010000000000000001820261289e611b36565b6001600160a01b038516600081815260059290920160205260409091208054929092019091554260a01b6001841460e11b17176128d9611b36565b60008381526004919091016020526040902055808281015b6040516001830192906001600160a01b038716906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a48082106128f1578061293d611b36565b5550610cb290506000848385611c11565b6060831561295d575081611400565b82511561296d5782518084602001fd5b8160405162461bcd60e51b8152600401610b85919061324d565b82805461299390613473565b90600052602060002090601f0160209004810192826129b557600085556129fb565b82601f106129ce57805160ff19168380011785556129fb565b828001600101855582156129fb579182015b828111156129fb5782518255916020019190600101906129e0565b50612a07929150612a0b565b5090565b5b80821115612a075760008155600101612a0c565b80356001600160a01b0381168114612a3757600080fd5b919050565b600082601f830112612a4c578081fd5b81516020612a61612a5c836133fd565b6133cd565b80838252828201915082860187848660051b8901011115612a80578586fd5b855b85811015612ac05781516001600160401b03811115612a9f578788fd5b612aad8a87838c0101612b24565b8552509284019290840190600101612a82565b5090979650505050505050565b8051612a37816134c4565b600082601f830112612ae8578081fd5b8135612af6612a5c82613420565b818152846020838601011115612b0a578283fd5b816020850160208301379081016020019190915292915050565b600082601f830112612b34578081fd5b8151612b42612a5c82613420565b818152846020838601011115612b56578283fd5b61208f826020830160208701613447565b600060208284031215612b78578081fd5b61140082612a20565b60008060408385031215612b93578081fd5b612b9c83612a20565b9150612baa60208401612a20565b90509250929050565b600080600060608486031215612bc7578081fd5b612bd084612a20565b9250612bde60208501612a20565b9150604084013590509250925092565b60008060008060808587031215612c03578081fd5b612c0c85612a20565b9350612c1a60208601612a20565b92506040850135915060608501356001600160401b03811115612c3b578182fd5b612c4787828801612ad8565b91505092959194509250565b60008060408385031215612c65578182fd5b612c6e83612a20565b91506020830135612c7e816134c4565b809150509250929050565b60008060408385031215612c9b578182fd5b612ca483612a20565b915060208301356001600160401b03811115612cbe578182fd5b612cca85828601612ad8565b9150509250929050565b60008060408385031215612ce6578182fd5b612cef83612a20565b946020939093013593505050565b600080600060608486031215612d11578081fd5b612d1a84612a20565b925060208401359150612d2f60408501612a20565b90509250925092565b600080600060608486031215612d4c578081fd5b612d5584612a20565b92506020840135915060408401356001600160401b03811115612d76578182fd5b612d8286828701612ad8565b9150509250925092565b600080600060608486031215612da0578081fd5b612da984612a20565b95602085013595506040909401359392505050565b60006020808385031215612dd0578182fd5b82356001600160401b03811115612de5578283fd5b8301601f81018513612df5578283fd5b8035612e03612a5c826133fd565b80828252848201915084840188868560051b8701011115612e22578687fd5b8694505b83851015612e44578035835260019490940193918501918501612e26565b50979650505050505050565b600060208284031215612e61578081fd5b5051919050565b600060208284031215612e79578081fd5b8135611400816134d2565b600060208284031215612e95578081fd5b8151611400816134d2565b600060208284031215612eb1578081fd5b81356001600160401b03811115612ec6578182fd5b61208f84828501612ad8565b600060208284031215612ee3578081fd5b81516001600160401b0380821115612ef9578283fd5b9083019060c08286031215612f0c578283fd5b612f146133a5565b612f1d83612acd565b8152612f2b60208401612acd565b6020820152612f3c60408401612acd565b6040820152606083015182811115612f52578485fd5b612f5e87828601612b24565b606083015250608083015182811115612f75578485fd5b612f8187828601612b24565b60808301525060a083015182811115612f98578485fd5b612fa487828601612a3c565b60a08301525095945050505050565b600060208284031215612fc4578081fd5b5035919050565b60008151808452612fe3816020860160208601613447565b601f01601f19169290920160200192915050565b80516001600160a01b031682526020808201516001600160401b03169083015260408082015115159083015260609081015162ffffff16910152565b60008251613045818460208701613447565b9190910192915050565b60008351613061818460208801613447565b835190830190613075818360208801613447565b01949350505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906130b190830184612fcb565b9695505050505050565b60018060a01b0386168152600060208615158184015285604084015260a060608401526130eb60a0840186612fcb565b838103608085015284511515815281850151151582820152604085015115156040820152606085015160c0606083015261312860c0830182612fcb565b9050608086015182820360808401526131418282612fcb565b91505060a086015182820360a084015281925080518083528483019350848160051b8401018583019250865b8281101561319b57601f19858303018652613189828551612fcb565b9587019593870193915060010161316d565b509c9b505050505050505050505050565b60018060a01b03841681528260208201526060604082015260006128306060830184612fcb565b6020808252825182820181905260009190848201906040850190845b8181101561110257613202838551612ff7565b92840192608092909201916001016131ef565b6020808252825182820181905260009190848201906040850190845b8181101561110257835183529284019291840191600101613231565b6020815260006114006020830184612fcb565b60208082526034908201527f455243373231415f5f496e697469616c697a61626c653a20636f6e7472616374604082015273206973206e6f7420696e697469616c697a696e6760601b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b608081016106948284612ff7565b60405160c081016001600160401b03811182821017156133c7576133c76134ae565b60405290565b604051601f8201601f191681016001600160401b03811182821017156133f5576133f56134ae565b604052919050565b60006001600160401b03821115613416576134166134ae565b5060051b60200190565b60006001600160401b03821115613439576134396134ae565b50601f01601f191660200190565b60005b8381101561346257818101518382015260200161344a565b838111156114f25750506000910152565b600181811c9082168061348757607f821691505b602082108114156134a857634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b8015158114610c2257600080fd5b6001600160e01b031981168114610c2257600080fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564ee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85fa264697066735822122076afa17cd116544d73fbe96d9048692032c64d290be16837c948d92c4bfdeb3f64736f6c63430008040033 diff --git a/pkg/tables/impl/ethereum/client.go b/pkg/tables/impl/ethereum/client.go index 9b2abeb4..4d051fa9 100644 --- a/pkg/tables/impl/ethereum/client.go +++ b/pkg/tables/impl/ethereum/client.go @@ -4,9 +4,12 @@ import ( "bytes" "context" "fmt" + "math" "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" @@ -19,11 +22,12 @@ import ( // Client is the Ethereum implementation of the registry client. type Client struct { - contract *Contract - backend bind.ContractBackend - wallet *wallet.Wallet - chainID tableland.ChainID - tracker nonce.NonceTracker + contract *Contract + contractAddr common.Address + backend bind.ContractBackend + wallet *wallet.Wallet + chainID tableland.ChainID + tracker nonce.NonceTracker } // NewClient creates a new Client. @@ -39,11 +43,12 @@ func NewClient( return nil, fmt.Errorf("creating contract: %v", err) } return &Client{ - contract: contract, - backend: backend, - wallet: wallet, - chainID: chainID, - tracker: tracker, + contract: contract, + contractAddr: contractAddr, + backend: backend, + wallet: wallet, + chainID: chainID, + tracker: tracker, }, nil } @@ -127,6 +132,25 @@ func (c *Client) RunSQL( return nil, fmt.Errorf("creating keyed transactor: %s", err) } + tablesABI, err := abi.JSON(strings.NewReader(ContractABI)) + if err != nil { + return nil, fmt.Errorf("parsing abi: %s", err) + } + + data, err := tablesABI.Pack("runSQL", []interface{}{addr, table.ToBigInt(), statement}...) + if err != nil { + return nil, fmt.Errorf("abi packing: %s", err) + } + + gas, err := c.backend.EstimateGas(ctx, ethereum.CallMsg{ + From: addr, + To: &c.contractAddr, + Data: data, + }) + if err != nil { + return nil, fmt.Errorf("gas estimate: %s", err) + } + tx, err := c.callWithRetry(ctx, func() (*types.Transaction, error) { registerPendingTx, unlock, nonce := c.tracker.GetNonce(ctx) defer unlock() @@ -137,6 +161,7 @@ func (c *Client) RunSQL( From: auth.From, Nonce: big.NewInt(0).SetInt64(nonce), GasTipCap: gasTipCap, + GasLimit: uint64(math.Ceil(float64(gas) * 1.1)), } tx, err := c.contract.RunSQL(opts, addr, table.ToBigInt(), statement) diff --git a/pkg/tables/impl/ethereum/contract.go b/pkg/tables/impl/ethereum/contract.go index b02d5905..4a79ee4d 100644 --- a/pkg/tables/impl/ethereum/contract.go +++ b/pkg/tables/impl/ethereum/contract.go @@ -26,6 +26,7 @@ var ( _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription + _ = abi.ConvertType ) // IERC721AUpgradeableTokenOwnership is an auto generated low-level Go binding around an user-defined struct. @@ -33,6 +34,7 @@ type IERC721AUpgradeableTokenOwnership struct { Addr common.Address StartTimestamp uint64 Burned bool + ExtraData *big.Int } // ITablelandControllerPolicy is an auto generated low-level Go binding around an user-defined struct. @@ -47,8 +49,8 @@ type ITablelandControllerPolicy struct { // ContractMetaData contains all meta data concerning the Contract contract. var ContractMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[],\"name\":\"ApprovalCallerNotOwnerNorApproved\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ApprovalQueryForNonexistentToken\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ApprovalToCurrentOwner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ApproveToCaller\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BalanceQueryForZeroAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidQueryRange\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"querySize\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxQuerySize\",\"type\":\"uint256\"}],\"name\":\"MaxQuerySizeExceeded\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MintToZeroAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MintZeroQuantity\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OwnerQueryForNonexistentToken\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TransferCallerNotOwnerNorApproved\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TransferFromIncorrectOwner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TransferToNonERC721ReceiverImplementer\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TransferToZeroAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"URIQueryForNonexistentToken\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"approved\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tableId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"statement\",\"type\":\"string\"}],\"name\":\"CreateTable\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"isOwner\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tableId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"statement\",\"type\":\"string\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"allowInsert\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"allowUpdate\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"allowDelete\",\"type\":\"bool\"},{\"internalType\":\"string\",\"name\":\"whereClause\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"withCheck\",\"type\":\"string\"},{\"internalType\":\"string[]\",\"name\":\"updatableColumns\",\"type\":\"string[]\"}],\"indexed\":false,\"internalType\":\"structITablelandController.Policy\",\"name\":\"policy\",\"type\":\"tuple\"}],\"name\":\"RunSQL\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tableId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"controller\",\"type\":\"address\"}],\"name\":\"SetController\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tableId\",\"type\":\"uint256\"}],\"name\":\"TransferTable\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"statement\",\"type\":\"string\"}],\"name\":\"createTable\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"explicitOwnershipOf\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"startTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"burned\",\"type\":\"bool\"}],\"internalType\":\"structIERC721AUpgradeable.TokenOwnership\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"tokenIds\",\"type\":\"uint256[]\"}],\"name\":\"explicitOwnershipsOf\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"startTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"burned\",\"type\":\"bool\"}],\"internalType\":\"structIERC721AUpgradeable.TokenOwnership[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"getApproved\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tableId\",\"type\":\"uint256\"}],\"name\":\"getController\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"baseURI\",\"type\":\"string\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"ownerOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tableId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"statement\",\"type\":\"string\"}],\"name\":\"runSQL\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"baseURI\",\"type\":\"string\"}],\"name\":\"setBaseURI\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tableId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"controller\",\"type\":\"address\"}],\"name\":\"setController\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"tokenURI\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"tokensOfOwner\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"start\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"stop\",\"type\":\"uint256\"}],\"name\":\"tokensOfOwnerIn\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}]", - Bin: "0x60a06040523060601b60805234801561001757600080fd5b5060805160601c613684610052600039600081816108aa015281816108f301528181610a6701528181610aa70152610b3a01526136846000f3fe6080604052600436106101f95760003560e01c80636352211e1161010d57806399a2557a116100a0578063c87b56dd1161006f578063c87b56dd146105b4578063e985e9c5146105d4578063eaf5d04e146105f4578063f2fde38b14610614578063f62d18881461063457600080fd5b806399a2557a14610527578063a22cb46514610547578063b88d4fde14610567578063c23dc68f1461058757600080fd5b80638462151c116100dc5780638462151c146104a75780638bb0ab97146104d45780638da5cb5b146104f457806395d89b411461051257600080fd5b80636352211e1461043d57806370a082311461045d578063715018a61461047d5780638456cb591461049257600080fd5b80633f4ba83a1161019057806352d1902d1161015f57806352d1902d1461038d57806355f804b3146103a257806358edaa9c146103c25780635bbb2177146103f85780635c975abb1461042557600080fd5b80633f4ba83a1461032557806342842e0e1461033a57806342966c681461035a5780634f1ef2861461037a57600080fd5b806318160ddd116101cc57806318160ddd146102af57806323b872dd146102d25780633659cfe6146102f25780633a9151b01461031257600080fd5b806301ffc9a7146101fe57806306fdde0314610233578063081812fc14610255578063095ea7b31461028d575b600080fd5b34801561020a57600080fd5b5061021e610219366004612e87565b610654565b60405190151581526020015b60405180910390f35b34801561023f57600080fd5b506102486106a6565b60405161022a9190613258565b34801561026157600080fd5b50610275610270366004612fd2565b610741565b6040516001600160a01b03909116815260200161022a565b34801561029957600080fd5b506102ad6102a8366004612cf3565b61078e565b005b3480156102bb57600080fd5b506102c461086f565b60405190815260200161022a565b3480156102de57600080fd5b506102ad6102ed366004612bd2565b61088f565b3480156102fe57600080fd5b506102ad61030d366004612b86565b61089f565b6102ad610320366004612ca8565b610988565b34801561033157600080fd5b506102ad610a02565b34801561034657600080fd5b506102ad610355366004612bd2565b610a36565b34801561036657600080fd5b506102ad610375366004612fd2565b610a51565b6102ad610388366004612ca8565b610a5c565b34801561039957600080fd5b506102c4610b2d565b3480156103ae57600080fd5b506102ad6103bd366004612ebf565b610be0565b3480156103ce57600080fd5b506102756103dd366004612fd2565b600090815260fc60205260409020546001600160a01b031690565b34801561040457600080fd5b50610418610413366004612ddd565b610c1d565b60405161022a91906131b6565b34801561043157600080fd5b5060655460ff1661021e565b34801561044957600080fd5b50610275610458366004612fd2565b610d0d565b34801561046957600080fd5b506102c4610478366004612b86565b610d18565b34801561048957600080fd5b506102ad610d77565b34801561049e57600080fd5b506102ad610dab565b3480156104b357600080fd5b506104c76104c2366004612b86565b610ddd565b60405161022a9190613220565b3480156104e057600080fd5b506102ad6104ef366004612d1c565b610f01565b34801561050057600080fd5b506033546001600160a01b0316610275565b34801561051e57600080fd5b50610248610fe3565b34801561053357600080fd5b506104c7610542366004612dab565b610ffb565b34801561055357600080fd5b506102ad610562366004612c72565b6111a1565b34801561057357600080fd5b506102ad610582366004612c0d565b611248565b34801561059357600080fd5b506105a76105a2366004612fd2565b611292565b60405161022a919061344f565b3480156105c057600080fd5b506102486105cf366004612fd2565b61130c565b3480156105e057600080fd5b5061021e6105ef366004612ba0565b611390565b34801561060057600080fd5b506102ad61060f366004612d57565b6113cd565b34801561062057600080fd5b506102ad61062f366004612b86565b6114da565b34801561064057600080fd5b506102ad61064f366004612ebf565b611572565b60006301ffc9a760e01b6001600160e01b03198316148061068557506380ac58cd60e01b6001600160e01b03198316145b806106a05750635b5e139f60e01b6001600160e01b03198316145b92915050565b60606106b0611771565b60020180546106be90613552565b80601f01602080910402602001604051908101604052809291908181526020018280546106ea90613552565b80156107375780601f1061070c57610100808354040283529160200191610737565b820191906000526020600020905b81548152906001019060200180831161071a57829003601f168201915b5050505050905090565b600061074c82611795565b610769576040516333d1c03960e21b815260040160405180910390fd5b610771611771565b60009283526006016020525060409020546001600160a01b031690565b6000610799826117de565b9050806001600160a01b0316836001600160a01b031614156107ce5760405163250fdee360e21b815260040160405180910390fd5b336001600160a01b03821614610805576107e88133611390565b610805576040516367d9dca160e11b815260040160405180910390fd5b8261080e611771565b6000848152600691909101602052604080822080546001600160a01b0319166001600160a01b0394851617905551849286811692908516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a4505050565b6000600161087b611771565b60010154610887611771565b540303919050565b61089a83838361186d565b505050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156108f15760405162461bcd60e51b81526004016108e8906132bf565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661093a6000805160206135c8833981519152546001600160a01b031690565b6001600160a01b0316146109605760405162461bcd60e51b81526004016108e89061330b565b61096981611a87565b6040805160008082526020820190925261098591839190611ab1565b50565b60655460ff16156109ab5760405162461bcd60e51b81526004016108e890613357565b60006109b5611c2b565b90506109c2836001611c3b565b7ffe0c067afc4fe17adcf4cfa139aabad6dc30dd86dfe39fb2b858961637156cdd8382846040516109f59392919061318f565b60405180910390a1505050565b6033546001600160a01b03163314610a2c5760405162461bcd60e51b81526004016108e8906133cf565b610a34611c55565b565b61089a83838360405180602001604052806000815250611248565b610985816001611ce8565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415610aa55760405162461bcd60e51b81526004016108e8906132bf565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610aee6000805160206135c8833981519152546001600160a01b031690565b6001600160a01b031614610b145760405162461bcd60e51b81526004016108e89061330b565b610b1d82611a87565b610b2982826001611ab1565b5050565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610bcd5760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016108e8565b506000805160206135c883398151915290565b6033546001600160a01b03163314610c0a5760405162461bcd60e51b81526004016108e8906133cf565b8051610b299060fb9060208401906129ab565b80516060906000816001600160401b03811115610c4a57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610c9557816020015b6040805160608101825260008082526020808301829052928201528252600019909201910181610c685790505b50905060005b828114610d0557610cd2858281518110610cc557634e487b7160e01b600052603260045260246000fd5b6020026020010151611292565b828281518110610cf257634e487b7160e01b600052603260045260246000fd5b6020908102919091010152600101610c9b565b509392505050565b60006106a0826117de565b600081610d38576040516323d3ad8160e21b815260040160405180910390fd5b6001600160401b03610d48611771565b6005016000846001600160a01b03166001600160a01b0316815260200190815260200160002054169050919050565b6033546001600160a01b03163314610da15760405162461bcd60e51b81526004016108e8906133cf565b610a346000611ec0565b6033546001600160a01b03163314610dd55760405162461bcd60e51b81526004016108e8906133cf565b610a34611f12565b60606000806000610ded85610d18565b90506000816001600160401b03811115610e1757634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610e40578160200160208202803683370190505b509050610e66604080516060810182526000808252602082018190529181019190915290565b60015b838614610ef557610e7981611f6a565b9150816040015115610e8a57610eed565b81516001600160a01b031615610e9f57815194505b876001600160a01b0316856001600160a01b03161415610eed5780838780600101985081518110610ee057634e487b7160e01b600052603260045260246000fd5b6020026020010181815250505b600101610e69565b50909695505050505050565b60655460ff1615610f245760405162461bcd60e51b81526004016108e890613357565b610f2d82611795565b1580610f6757506001600160a01b03831633148015610f655750610f5082610d0d565b6001600160a01b0316836001600160a01b0316145b155b15610f84576040516282b42960e81b815260040160405180910390fd5b600082815260fc602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f64d442926514e7c17643406b529155919979582e13eee1dfe07cbd088ef2033e91016109f5565b6060610fed611771565b60030180546106be90613552565b606081831061101d57604051631960ccad60e11b815260040160405180910390fd5b600080611028611c2b565b9050600185101561103857600194505b80841115611044578093505b600061104f87610d18565b90508486101561106e5785850381811015611068578091505b50611072565b5060005b6000816001600160401b0381111561109a57634e487b7160e01b600052604160045260246000fd5b6040519080825280602002602001820160405280156110c3578160200160208202803683370190505b509050816110d657935061119a92505050565b60006110e188611292565b9050600081604001516110f2575080515b885b8881141580156111045750848714155b1561118e5761111281611f6a565b925082604001511561112357611186565b82516001600160a01b03161561113857825191505b8a6001600160a01b0316826001600160a01b03161415611186578084888060010199508151811061117957634e487b7160e01b600052603260045260246000fd5b6020026020010181815250505b6001016110f4565b50505092835250909150505b9392505050565b6001600160a01b0382163314156111cb5760405163b06307db60e01b815260040160405180910390fd5b806111d4611771565b336000818152600792909201602090815260408084206001600160a01b03881680865290835293819020805460ff19169515159590951790945592518415158152919290917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b61125384848461186d565b6001600160a01b0383163b1561128c5761126f84848484611faa565b61128c576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b604080516060808201835260008083526020808401829052838501829052845192830185528183528201819052928101929092529060018310806112dd57506112d9611c2b565b8310155b156112e85792915050565b6112f183611f6a565b90508060400151156113035792915050565b61119a836120a2565b606061131782611795565b61133457604051630a14c4b560e41b815260040160405180910390fd5b600061133e6120d0565b905080516000141561135f576040518060200160405280600081525061119a565b80611369846120df565b60405160200161137a929190613032565b6040516020818303038152906040529392505050565b600061139a611771565b6001600160a01b039384166000908152600791909101602090815260408083209490951682529290925250205460ff1690565b60655460ff16156113f05760405162461bcd60e51b81526004016108e890613357565b6113f982611795565b158061142357506001600160a01b03831633148061142157506033546001600160a01b031633145b155b15611440576040516282b42960e81b815260040160405180910390fd5b80516188b88111156114705760405163287d905760e01b8152600481018290526188b860248201526044016108e8565b7f6de956d2cb2e161f8c91c6ae7b286358c7458d5ad5e26ea2d55330fbe282839c84856001600160a01b03166114a586610d0d565b6001600160a01b03161485856114bb898961212e565b6040516114cc95949392919061309e565b60405180910390a150505050565b6033546001600160a01b031633146115045760405162461bcd60e51b81526004016108e8906133cf565b6001600160a01b0381166115695760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016108e8565b61098581611ec0565b60008051602061362f83398151915254610100900460ff166115a75760008051602061362f8339815191525460ff16156115ab565b303b155b61161d5760405162461bcd60e51b815260206004820152603760248201527f455243373231415f5f496e697469616c697a61626c653a20636f6e747261637460448201527f20697320616c726561647920696e697469616c697a656400000000000000000060648201526084016108e8565b60008051602061362f83398151915254610100900460ff161580156116595760008051602061362f833981519152805461ffff19166101011790555b600061166560016122bf565b9050801561167d576000805461ff0019166101001790555b6116cc6040518060400160405280601081526020016f5461626c656c616e64205461626c657360801b815250604051806040016040528060058152602001645441424c4560d81b81525061234c565b6116d461238a565b6116dc61238a565b6116e46123c6565b6116ec6123f5565b6116f4612424565b82516117079060fb9060208601906129ab565b50801561174e576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b508015610b2957505060008051602061362f833981519152805461ff0019169055565b7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4090565b6000816001111580156117af57506117ab611771565b5482105b80156106a05750600160e01b6117c3611771565b60008481526004919091016020526040902054161592915050565b60008180600111611854576117f1611771565b54811015611854576000611803611771565b600083815260049190910160205260409020549050600160e01b8116611852575b8061119a57611831611771565b60001990920160008181526004939093016020526040909220549050611824565b505b604051636f96cda160e11b815260040160405180910390fd5b6000611878826117de565b9050836001600160a01b0316816001600160a01b0316146118ab5760405162a1148160e81b815260040160405180910390fd5b60006118b5611771565b600084815260069190910160205260408120546001600160a01b03908116925086163314806118e957506118e98633611390565b806118fc57506001600160a01b03821633145b90508061191c57604051632ce44b5f60e11b815260040160405180910390fd5b8461193a57604051633a954ecd60e21b815260040160405180910390fd5b811561196957611948611771565b60008581526006919091016020526040902080546001600160a01b03191690555b611971611771565b6001600160a01b038716600090815260059190910160205260409020805460001901905561199d611771565b6001600160a01b03861660009081526005919091016020526040902080546001019055600160e11b4260a01b8617176119d4611771565b60008681526004919091016020526040902055600160e11b8316611a4357600184016119fe611771565b60008281526004919091016020526040902054611a4157611a1d611771565b548114611a415783611a2d611771565b600083815260049190910160205260409020555b505b83856001600160a01b0316876001600160a01b031660008051602061360f83398151915260405160405180910390a4611a7f868686600161244b565b505050505050565b6033546001600160a01b031633146109855760405162461bcd60e51b81526004016108e8906133cf565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615611ae45761089a836124a2565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b158015611b1d57600080fd5b505afa925050508015611b4d575060408051601f3d908101601f19168201909252611b4a91810190612e6f565b60015b611bb05760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016108e8565b6000805160206135c88339815191528114611c1f5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016108e8565b5061089a83838361253e565b6000611c35611771565b54919050565b610b29828260405180602001604052806000815250612563565b60655460ff16611c9e5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016108e8565b6065805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6000611cf3836117de565b9050806000611d00611771565b600086815260069190910160205260409020546001600160a01b031690508315611d77576000336001600160a01b0384161480611d425750611d428333611390565b80611d5557506001600160a01b03821633145b905080611d7557604051632ce44b5f60e11b815260040160405180910390fd5b505b8015611da657611d85611771565b60008681526006919091016020526040902080546001600160a01b03191690555b6fffffffffffffffffffffffffffffffff611dbf611771565b6001600160a01b03841660009081526005919091016020526040902080549091019055600160e11b600160e01b4260a01b611df78590565b171717611e02611771565b60008781526004919091016020526040902055600160e11b8316611e715760018501611e2c611771565b60008281526004919091016020526040902054611e6f57611e4b611771565b548114611e6f5783611e5b611771565b600083815260049190910160205260409020555b505b60405185906000906001600160a01b0385169060008051602061360f833981519152908390a4611ea582600087600161244b565b611ead611771565b6001908101805490910190555050505050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60655460ff1615611f355760405162461bcd60e51b81526004016108e890613357565b6065805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611ccb3390565b60408051606081018252600080825260208201819052918101919091526106a0611f92611771565b600084815260049190910160205260409020546126ea565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290611fdf903390899088908890600401613061565b602060405180830381600087803b158015611ff957600080fd5b505af1925050508015612029575060408051601f3d908101601f1916820190925261202691810190612ea3565b60015b612084573d808015612057576040519150601f19603f3d011682016040523d82523d6000602084013e61205c565b606091505b50805161207c576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b60408051606081018252600080825260208201819052918101919091526106a06120cb836117de565b6126ea565b606060fb80546106be90613552565b604080516080810191829052607f0190826030600a8206018353600a90045b801561211c57600183039250600a81066030018353600a90046120fe565b50819003601f19909101908152919050565b6040805160c0810182526000808252602082018190529181019190915260608082018190526080820181905260a0820152600082815260fc60205260409020546001600160a01b0316803b1561220357604051631bc8ee3560e11b81526001600160a01b038581166004830152821690633791dc6a9060240160006040518083038186803b1580156121bf57600080fd5b505afa1580156121d3573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526121fb9190810190612ef1565b9150506106a0565b6001600160a01b038116158061222a5750836001600160a01b0316816001600160a01b0316145b612246576040516282b42960e81b815260040160405180910390fd5b6040805160c081018252600180825260208083018290528284019190915282518082018452600080825260608401919091528351808301855281815260808401528351818152918201909352909160a0830191906122b4565b606081526020019060019003908161229f5790505b509052949350505050565b60008054610100900460ff1615612306578160ff1660011480156122e25750303b155b6122fe5760405162461bcd60e51b81526004016108e890613381565b506000919050565b60005460ff80841691161061232d5760405162461bcd60e51b81526004016108e890613381565b506000805460ff191660ff92909216919091179055600190565b919050565b60008051602061362f83398151915254610100900460ff166123805760405162461bcd60e51b81526004016108e89061326b565b610b298282612724565b60008051602061362f83398151915254610100900460ff166123be5760405162461bcd60e51b81526004016108e89061326b565b610a346127a7565b600054610100900460ff166123ed5760405162461bcd60e51b81526004016108e890613404565b610a346127db565b600054610100900460ff1661241c5760405162461bcd60e51b81526004016108e890613404565b610a3461280b565b600054610100900460ff16610a345760405162461bcd60e51b81526004016108e890613404565b6001600160a01b0384161561128c57604080516001600160a01b038087168252851660208201529081018390527f16d5b5d582da969cea3131e89ffbd67ee6b1ebbe2576c7a97e9b852fce946a7f906060016114cc565b6001600160a01b0381163b61250f5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016108e8565b6000805160206135c883398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6125478361283e565b6000825111806125545750805b1561089a5761128c838361287e565b600061256d611771565b5490508361258d57604051622e076360e81b815260040160405180910390fd5b826125ab5760405163b562e8dd60e01b815260040160405180910390fd5b6801000000000000000183026125bf611771565b6001600160a01b0386166000908152600591909101602052604090208054909101905560e16125ee6001851490565b901b4260a01b8517176125ff611771565b60008381526004919091016020526040902055808381016001600160a01b0386163b1561269d575b60405182906001600160a01b0388169060009060008051602061360f833981519152908290a46126606000878480600101955087611faa565b61267d576040516368d2bf6b60e11b815260040160405180910390fd5b808210612627578261268d611771565b541461269857600080fd5b6126d0565b5b6040516001830192906001600160a01b0388169060009060008051602061360f833981519152908290a480821061269e575b816126d9611771565b555061128c9050600085838661244b565b604080516060810182526001600160a01b038316815260a083901c6001600160401b03166020820152600160e01b90921615159082015290565b60008051602061362f83398151915254610100900460ff166127585760405162461bcd60e51b81526004016108e89061326b565b81612761611771565b60020190805190602001906127779291906129ab565b5080612781611771565b60030190805190602001906127979291906129ab565b5060016127a2611771565b555050565b60008051602061362f83398151915254610100900460ff16610a345760405162461bcd60e51b81526004016108e89061326b565b600054610100900460ff166128025760405162461bcd60e51b81526004016108e890613404565b610a3433611ec0565b600054610100900460ff166128325760405162461bcd60e51b81526004016108e890613404565b6065805460ff19169055565b612847816124a2565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b6128e65760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016108e8565b600080846001600160a01b0316846040516129019190613016565b600060405180830381855af49150503d806000811461293c576040519150601f19603f3d011682016040523d82523d6000602084013e612941565b606091505b509150915061296982826040518060600160405280602781526020016135e860279139612972565b95945050505050565b6060831561298157508161119a565b8251156129915782518084602001fd5b8160405162461bcd60e51b81526004016108e89190613258565b8280546129b790613552565b90600052602060002090601f0160209004810192826129d95760008555612a1f565b82601f106129f257805160ff1916838001178555612a1f565b82800160010185558215612a1f579182015b82811115612a1f578251825591602001919060010190612a04565b50612a2b929150612a2f565b5090565b5b80821115612a2b5760008155600101612a30565b80356001600160a01b038116811461234757600080fd5b600082601f830112612a6b578081fd5b81516020612a80612a7b836134dc565b6134ac565b80838252828201915082860187848660051b8901011115612a9f578586fd5b855b85811015612adf5781516001600160401b03811115612abe578788fd5b612acc8a87838c0101612b43565b8552509284019290840190600101612aa1565b5090979650505050505050565b8051612347816135a3565b600082601f830112612b07578081fd5b8135612b15612a7b826134ff565b818152846020838601011115612b29578283fd5b816020850160208301379081016020019190915292915050565b600082601f830112612b53578081fd5b8151612b61612a7b826134ff565b818152846020838601011115612b75578283fd5b61209a826020830160208701613526565b600060208284031215612b97578081fd5b61119a82612a44565b60008060408385031215612bb2578081fd5b612bbb83612a44565b9150612bc960208401612a44565b90509250929050565b600080600060608486031215612be6578081fd5b612bef84612a44565b9250612bfd60208501612a44565b9150604084013590509250925092565b60008060008060808587031215612c22578081fd5b612c2b85612a44565b9350612c3960208601612a44565b92506040850135915060608501356001600160401b03811115612c5a578182fd5b612c6687828801612af7565b91505092959194509250565b60008060408385031215612c84578182fd5b612c8d83612a44565b91506020830135612c9d816135a3565b809150509250929050565b60008060408385031215612cba578182fd5b612cc383612a44565b915060208301356001600160401b03811115612cdd578182fd5b612ce985828601612af7565b9150509250929050565b60008060408385031215612d05578182fd5b612d0e83612a44565b946020939093013593505050565b600080600060608486031215612d30578081fd5b612d3984612a44565b925060208401359150612d4e60408501612a44565b90509250925092565b600080600060608486031215612d6b578081fd5b612d7484612a44565b92506020840135915060408401356001600160401b03811115612d95578182fd5b612da186828701612af7565b9150509250925092565b600080600060608486031215612dbf578081fd5b612dc884612a44565b95602085013595506040909401359392505050565b60006020808385031215612def578182fd5b82356001600160401b03811115612e04578283fd5b8301601f81018513612e14578283fd5b8035612e22612a7b826134dc565b80828252848201915084840188868560051b8701011115612e41578687fd5b8694505b83851015612e63578035835260019490940193918501918501612e45565b50979650505050505050565b600060208284031215612e80578081fd5b5051919050565b600060208284031215612e98578081fd5b813561119a816135b1565b600060208284031215612eb4578081fd5b815161119a816135b1565b600060208284031215612ed0578081fd5b81356001600160401b03811115612ee5578182fd5b61209a84828501612af7565b600060208284031215612f02578081fd5b81516001600160401b0380821115612f18578283fd5b9083019060c08286031215612f2b578283fd5b612f33613484565b612f3c83612aec565b8152612f4a60208401612aec565b6020820152612f5b60408401612aec565b6040820152606083015182811115612f71578485fd5b612f7d87828601612b43565b606083015250608083015182811115612f94578485fd5b612fa087828601612b43565b60808301525060a083015182811115612fb7578485fd5b612fc387828601612a5b565b60a08301525095945050505050565b600060208284031215612fe3578081fd5b5035919050565b60008151808452613002816020860160208601613526565b601f01601f19169290920160200192915050565b60008251613028818460208701613526565b9190910192915050565b60008351613044818460208801613526565b835190830190613058818360208801613526565b01949350505050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061309490830184612fea565b9695505050505050565b60018060a01b0386168152600060208615158184015285604084015260a060608401526130ce60a0840186612fea565b838103608085015284511515815281850151151582820152604085015115156040820152606085015160c0606083015261310b60c0830182612fea565b9050608086015182820360808401526131248282612fea565b91505060a086015182820360a084015281925080518083528483019350848160051b8401018583019250865b8281101561317e57601f1985830301865261316c828551612fea565b95870195938701939150600101613150565b509c9b505050505050505050505050565b60018060a01b03841681528260208201526060604082015260006129696060830184612fea565b6020808252825182820181905260009190848201906040850190845b81811015610ef55761320d83855180516001600160a01b031682526020808201516001600160401b0316908301526040908101511515910152565b92840192606092909201916001016131d2565b6020808252825182820181905260009190848201906040850190845b81811015610ef55783518352928401929184019160010161323c565b60208152600061119a6020830184612fea565b60208082526034908201527f455243373231415f5f496e697469616c697a61626c653a20636f6e7472616374604082015273206973206e6f7420696e697469616c697a696e6760601b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b81516001600160a01b031681526020808301516001600160401b031690820152604080830151151590820152606081016106a0565b60405160c081016001600160401b03811182821017156134a6576134a661358d565b60405290565b604051601f8201601f191681016001600160401b03811182821017156134d4576134d461358d565b604052919050565b60006001600160401b038211156134f5576134f561358d565b5060051b60200190565b60006001600160401b038211156135185761351861358d565b50601f01601f191660200190565b60005b83811015613541578181015183820152602001613529565b8381111561128c5750506000910152565b600181811c9082168061356657607f821691505b6020821081141561358757634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b801515811461098557600080fd5b6001600160e01b03198116811461098557600080fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85fa2646970667358221220be0e9f10bd78bb28f14b63f64059ad2d62f5e764eae9031b1a17017b61300f3b64736f6c63430008040033", + ABI: "[{\"inputs\":[],\"name\":\"ApprovalCallerNotOwnerNorApproved\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ApprovalQueryForNonexistentToken\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ApproveToCaller\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BalanceQueryForZeroAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidQueryRange\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"querySize\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxQuerySize\",\"type\":\"uint256\"}],\"name\":\"MaxQuerySizeExceeded\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MintERC2309QuantityExceedsLimit\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MintToZeroAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MintZeroQuantity\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OwnerQueryForNonexistentToken\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OwnershipNotInitializedForExtraData\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TransferCallerNotOwnerNorApproved\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TransferFromIncorrectOwner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TransferToNonERC721ReceiverImplementer\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TransferToZeroAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"URIQueryForNonexistentToken\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"approved\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"fromTokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"toTokenId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"ConsecutiveTransfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tableId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"statement\",\"type\":\"string\"}],\"name\":\"CreateTable\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"isOwner\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tableId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"statement\",\"type\":\"string\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"allowInsert\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"allowUpdate\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"allowDelete\",\"type\":\"bool\"},{\"internalType\":\"string\",\"name\":\"whereClause\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"withCheck\",\"type\":\"string\"},{\"internalType\":\"string[]\",\"name\":\"updatableColumns\",\"type\":\"string[]\"}],\"indexed\":false,\"internalType\":\"structITablelandController.Policy\",\"name\":\"policy\",\"type\":\"tuple\"}],\"name\":\"RunSQL\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tableId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"controller\",\"type\":\"address\"}],\"name\":\"SetController\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tableId\",\"type\":\"uint256\"}],\"name\":\"TransferTable\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"statement\",\"type\":\"string\"}],\"name\":\"createTable\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"tableId\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"explicitOwnershipOf\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"startTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"burned\",\"type\":\"bool\"},{\"internalType\":\"uint24\",\"name\":\"extraData\",\"type\":\"uint24\"}],\"internalType\":\"structIERC721AUpgradeable.TokenOwnership\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"tokenIds\",\"type\":\"uint256[]\"}],\"name\":\"explicitOwnershipsOf\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"startTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"burned\",\"type\":\"bool\"},{\"internalType\":\"uint24\",\"name\":\"extraData\",\"type\":\"uint24\"}],\"internalType\":\"structIERC721AUpgradeable.TokenOwnership[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"getApproved\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tableId\",\"type\":\"uint256\"}],\"name\":\"getController\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"baseURI\",\"type\":\"string\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tableId\",\"type\":\"uint256\"}],\"name\":\"lockController\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"ownerOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tableId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"statement\",\"type\":\"string\"}],\"name\":\"runSQL\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"baseURI\",\"type\":\"string\"}],\"name\":\"setBaseURI\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tableId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"controller\",\"type\":\"address\"}],\"name\":\"setController\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"tokenURI\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"tokensOfOwner\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"start\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"stop\",\"type\":\"uint256\"}],\"name\":\"tokensOfOwnerIn\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}]", + Bin: "0x60a06040523060601b60805234801561001757600080fd5b5060805160601c61358561005260003960008181610b4701528181610b9001528181610cc201528181610d020152610d9501526135856000f3fe6080604052600436106101f95760003560e01c80636352211e1161010d57806399a2557a116100a0578063c87b56dd1161006f578063c87b56dd146105b5578063e985e9c5146105d5578063eaf5d04e146105f5578063f2fde38b14610608578063f62d18881461062857600080fd5b806399a2557a14610528578063a22cb46514610548578063b88d4fde14610568578063c23dc68f1461058857600080fd5b80638462151c116100dc5780638462151c146104a85780638bb0ab97146104d55780638da5cb5b146104f557806395d89b411461051357600080fd5b80636352211e1461043e57806370a082311461045e578063715018a61461047e5780638456cb591461049357600080fd5b80633a9151b01161019057806352d1902d1161015f57806352d1902d1461038d57806355f804b3146103a257806358edaa9c146103c25780635bbb2177146103f95780635c975abb1461042657600080fd5b80633a9151b0146103325780633f4ba83a1461034557806342842e0e1461035a5780634f1ef2861461037a57600080fd5b8063095ea7b3116101cc578063095ea7b3146102af57806318160ddd146102cf57806323b872dd146102f25780633659cfe61461031257600080fd5b806301ffc9a7146101fe578063052956811461023357806306fdde0314610255578063081812fc14610277575b600080fd5b34801561020a57600080fd5b5061021e610219366004612e68565b610648565b60405190151581526020015b60405180910390f35b34801561023f57600080fd5b5061025361024e366004612cd4565b61069a565b005b34801561026157600080fd5b5061026a61078a565b60405161022a919061324d565b34801561028357600080fd5b50610297610292366004612fb3565b610825565b6040516001600160a01b03909116815260200161022a565b3480156102bb57600080fd5b506102536102ca366004612cd4565b610872565b3480156102db57600080fd5b506102e4610920565b60405190815260200161022a565b3480156102fe57600080fd5b5061025361030d366004612bb3565b610940565b34801561031e57600080fd5b5061025361032d366004612b67565b610b3c565b6102e4610340366004612c89565b610c25565b34801561035157600080fd5b50610253610c85565b34801561036657600080fd5b50610253610375366004612bb3565b610c97565b610253610388366004612c89565b610cb7565b34801561039957600080fd5b506102e4610d88565b3480156103ae57600080fd5b506102536103bd366004612ea0565b610e3b565b3480156103ce57600080fd5b506102976103dd366004612fb3565b600090815261012e60205260409020546001600160a01b031690565b34801561040557600080fd5b50610419610414366004612dbe565b610e57565b60405161022a91906131d3565b34801561043257600080fd5b5060655460ff1661021e565b34801561044a57600080fd5b50610297610459366004612fb3565b610f4e565b34801561046a57600080fd5b506102e4610479366004612b67565b610f59565b34801561048a57600080fd5b50610253610fc1565b34801561049f57600080fd5b50610253610fd3565b3480156104b457600080fd5b506104c86104c3366004612b67565b610fe3565b60405161022a9190613215565b3480156104e157600080fd5b506102536104f0366004612cfd565b61110e565b34801561050157600080fd5b506033546001600160a01b0316610297565b34801561051f57600080fd5b5061026a611249565b34801561053457600080fd5b506104c8610543366004612d8c565b611261565b34801561055457600080fd5b50610253610563366004612c53565b611407565b34801561057457600080fd5b50610253610583366004612bee565b6114ae565b34801561059457600080fd5b506105a86105a3366004612fb3565b6114f8565b60405161022a9190613397565b3480156105c157600080fd5b5061026a6105d0366004612fb3565b611585565b3480156105e157600080fd5b5061021e6105f0366004612b81565b611609565b610253610603366004612d38565b611646565b34801561061457600080fd5b50610253610623366004612b67565b611795565b34801561063457600080fd5b50610253610643366004612ea0565b61180b565b60006301ffc9a760e01b6001600160e01b03198316148061067957506380ac58cd60e01b6001600160e01b03198316145b806106945750635b5e139f60e01b6001600160e01b03198316145b92915050565b6106a2611aa7565b6106ab81611aed565b6106c7576040516282b42960e81b815260040160405180910390fd5b6001600160a01b0382163314806106e857506033546001600160a01b031633145b610704576040516282b42960e81b815260040160405180910390fd5b61070d81610f4e565b6001600160a01b0316826001600160a01b03161461073d576040516282b42960e81b815260040160405180910390fd5b600081815261012f602052604090205460ff161561076d576040516282b42960e81b815260040160405180910390fd5b600090815261012f60205260409020805460ff1916600117905550565b6060610794611b36565b60020180546107a290613473565b80601f01602080910402602001604051908101604052809291908181526020018280546107ce90613473565b801561081b5780601f106107f05761010080835404028352916020019161081b565b820191906000526020600020905b8154815290600101906020018083116107fe57829003601f168201915b5050505050905090565b600061083082611aed565b61084d576040516333d1c03960e21b815260040160405180910390fd5b610855611b36565b60009283526006016020525060409020546001600160a01b031690565b600061087d82610f4e565b9050336001600160a01b038216146108b6576108998133611609565b6108b6576040516367d9dca160e11b815260040160405180910390fd5b826108bf611b36565b6000848152600691909101602052604080822080546001600160a01b0319166001600160a01b0394851617905551849286811692908516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a4505050565b6000600161092c611b36565b60010154610938611b36565b540303919050565b600061094b82611b5a565b9050836001600160a01b0316816001600160a01b03161461097e5760405162a1148160e81b815260040160405180910390fd5b60008061098a84611be9565b915091506109af818761099a3390565b6001600160a01b039081169116811491141790565b6109da576109bd8633611609565b6109da57604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b038516610a0157604051633a954ecd60e21b815260040160405180910390fd5b8015610a0c57600082555b610a14611b36565b6001600160a01b0387166000908152600591909101602052604090208054600019019055610a40611b36565b6001600160a01b03861660008181526005929092016020526040909120805460010190554260a01b17600160e11b17610a77611b36565b60008681526004919091016020526040902055600160e11b8316610ae65760018401610aa1611b36565b60008281526004919091016020526040902054610ae457610ac0611b36565b548114610ae45783610ad0611b36565b600083815260049190910160205260409020555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4610b348686866001611c11565b505050505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415610b8e5760405162461bcd60e51b8152600401610b85906132b4565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610bd76000805160206134e9833981519152546001600160a01b031690565b6001600160a01b031614610bfd5760405162461bcd60e51b8152600401610b8590613300565b610c0681611c71565b60408051600080825260208201909252610c2291839190611c79565b50565b6000610c2f611aa7565b610c37611df3565b9050610c44836001611e03565b7ffe0c067afc4fe17adcf4cfa139aabad6dc30dd86dfe39fb2b858961637156cdd838284604051610c77939291906131ac565b60405180910390a192915050565b610c8d611e1d565b610c95611e77565b565b610cb2838383604051806020016040528060008152506114ae565b505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415610d005760405162461bcd60e51b8152600401610b85906132b4565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610d496000805160206134e9833981519152546001600160a01b031690565b6001600160a01b031614610d6f5760405162461bcd60e51b8152600401610b8590613300565b610d7882611c71565b610d8482826001611c79565b5050565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610e285760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610b85565b506000805160206134e983398151915290565b610e43611e1d565b8051610d849061012d906020840190612987565b80516060906000816001600160401b03811115610e8457634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610ed657816020015b604080516080810182526000808252602080830182905292820181905260608201528252600019909201910181610ea25790505b50905060005b828114610f4657610f13858281518110610f0657634e487b7160e01b600052603260045260246000fd5b60200260200101516114f8565b828281518110610f3357634e487b7160e01b600052603260045260246000fd5b6020908102919091010152600101610edc565b509392505050565b600061069482611b5a565b60006001600160a01b038216610f82576040516323d3ad8160e21b815260040160405180910390fd5b6001600160401b03610f92611b36565b6005016000846001600160a01b03166001600160a01b0316815260200190815260200160002054169050919050565b610fc9611e1d565b610c956000611ec9565b610fdb611e1d565b610c95611f1b565b60606000806000610ff385610f59565b90506000816001600160401b0381111561101d57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015611046578160200160208202803683370190505b50905061107360408051608081018252600080825260208201819052918101829052606081019190915290565b60015b8386146111025761108681611f58565b9150816040015115611097576110fa565b81516001600160a01b0316156110ac57815194505b876001600160a01b0316856001600160a01b031614156110fa57808387806001019850815181106110ed57634e487b7160e01b600052603260045260246000fd5b6020026020010181815250505b600101611076565b50909695505050505050565b611116611aa7565b61111f82611aed565b61113b576040516282b42960e81b815260040160405180910390fd5b6001600160a01b03831633148061115c57506033546001600160a01b031633145b611178576040516282b42960e81b815260040160405180910390fd5b61118182610f4e565b6001600160a01b0316836001600160a01b0316146111b1576040516282b42960e81b815260040160405180910390fd5b600082815261012f602052604090205460ff16156111e1576040516282b42960e81b815260040160405180910390fd5b600082815261012e602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f64d442926514e7c17643406b529155919979582e13eee1dfe07cbd088ef2033e910160405180910390a1505050565b6060611253611b36565b60030180546107a290613473565b606081831061128357604051631960ccad60e11b815260040160405180910390fd5b60008061128e611df3565b9050600185101561129e57600194505b808411156112aa578093505b60006112b587610f59565b9050848610156112d457858503818110156112ce578091505b506112d8565b5060005b6000816001600160401b0381111561130057634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015611329578160200160208202803683370190505b5090508161133c57935061140092505050565b6000611347886114f8565b905060008160400151611358575080515b885b88811415801561136a5750848714155b156113f45761137881611f58565b9250826040015115611389576113ec565b82516001600160a01b03161561139e57825191505b8a6001600160a01b0316826001600160a01b031614156113ec57808488806001019950815181106113df57634e487b7160e01b600052603260045260246000fd5b6020026020010181815250505b60010161135a565b50505092835250909150505b9392505050565b6001600160a01b0382163314156114315760405163b06307db60e01b815260040160405180910390fd5b8061143a611b36565b336000818152600792909201602090815260408084206001600160a01b03881680865290835293819020805460ff19169515159590951790945592518415158152919290917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6114b9848484610940565b6001600160a01b0383163b156114f2576114d584848484611f9f565b6114f2576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b60408051608081018252600080825260208201819052918101829052606081019190915260408051608081018252600080825260208201819052918101829052606081019190915260018310806115565750611552611df3565b8310155b156115615792915050565b61156a83611f58565b905080604001511561157c5792915050565b61140083612097565b606061159082611aed565b6115ad57604051630a14c4b560e41b815260040160405180910390fd5b60006115b76120cc565b90508051600014156115d85760405180602001604052806000815250611400565b806115e2846120dc565b6040516020016115f392919061304f565b6040516020818303038152906040529392505050565b6000611613611b36565b6001600160a01b039384166000908152600791909101602090815260408083209490951682529290925250205460ff1690565b61164e611aa7565b600260975414156116a15760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b85565b60026097556116af82611aed565b15806116d957506001600160a01b0383163314806116d757506033546001600160a01b031633145b155b156116f6576040516282b42960e81b815260040160405180910390fd5b80516188b88111156117265760405163287d905760e01b8152600481018290526188b86024820152604401610b85565b7f6de956d2cb2e161f8c91c6ae7b286358c7458d5ad5e26ea2d55330fbe282839c84856001600160a01b031661175b86610f4e565b6001600160a01b0316148585611771898961212b565b6040516117829594939291906130bb565b60405180910390a1505060016097555050565b61179d611e1d565b6001600160a01b0381166118025760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610b85565b610c2281611ec9565b60008051602061353083398151915254610100900460ff16611840576000805160206135308339815191525460ff1615611844565b303b155b6118b65760405162461bcd60e51b815260206004820152603760248201527f455243373231415f5f496e697469616c697a61626c653a20636f6e747261637460448201527f20697320616c726561647920696e697469616c697a65640000000000000000006064820152608401610b85565b60008051602061353083398151915254610100900460ff161580156118f257600080516020613530833981519152805461ffff19166101011790555b600054610100900460ff16158080156119125750600054600160ff909116105b8061192c5750303b15801561192c575060005460ff166001145b61198f5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610b85565b6000805460ff1916600117905580156119b2576000805461ff0019166101001790555b611a016040518060400160405280601081526020016f5461626c656c616e64205461626c657360801b815250604051806040016040528060058152602001645441424c4560d81b8152506122c1565b611a096122ff565b611a1161233b565b611a1961236a565b611a21612399565b611a296123c8565b8251611a3d9061012d906020860190612987565b508015611a84576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b508015610d84575050600080516020613530833981519152805461ff0019169055565b60655460ff1615610c955760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610b85565b600081600111158015611b075750611b03611b36565b5482105b80156106945750600160e01b611b1b611b36565b60008481526004919091016020526040902054161592915050565b7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4090565b60008180600111611bd057611b6d611b36565b54811015611bd0576000611b7f611b36565b600083815260049190910160205260409020549050600160e01b8116611bce575b8061140057611bad611b36565b60001990920160008181526004939093016020526040909220549050611ba0565b505b604051636f96cda160e11b815260040160405180910390fd5b6000806000611bf6611b36565b60009485526006016020525050604090912080549092909150565b6001600160a01b038416156114f257604080516001600160a01b038087168252851660208201529081018390527f16d5b5d582da969cea3131e89ffbd67ee6b1ebbe2576c7a97e9b852fce946a7f9060600160405180910390a150505050565b610c22611e1d565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615611cac57610cb2836123ef565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b158015611ce557600080fd5b505afa925050508015611d15575060408051601f3d908101601f19168201909252611d1291810190612e50565b60015b611d785760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610b85565b6000805160206134e98339815191528114611de75760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610b85565b50610cb283838361248b565b6000611dfd611b36565b54919050565b610d848282604051806020016040528060008152506124b0565b6033546001600160a01b03163314610c955760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b85565b611e7f61252d565b6065805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b611f23611aa7565b6065805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611eac3390565b604080516080810182526000808252602082018190529181018290526060810191909152610694611f87611b36565b60008481526004919091016020526040902054612576565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290611fd490339089908890889060040161307e565b602060405180830381600087803b158015611fee57600080fd5b505af192505050801561201e575060408051601f3d908101601f1916820190925261201b91810190612e84565b60015b612079573d80801561204c576040519150601f19603f3d011682016040523d82523d6000602084013e612051565b606091505b508051612071576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b6040805160808101825260008082526020820181905291810182905260608101919091526106946120c783611b5a565b612576565b606061012d80546107a290613473565b604080516080810191829052607f0190826030600a8206018353600a90045b801561211957600183039250600a81066030018353600a90046120fb565b50819003601f19909101908152919050565b6040805160c0810182526000808252602082018190529181019190915260608082018190526080820181905260a0820152600082815261012e60205260409020546001600160a01b0316803b1561220557604051631bc8ee3560e11b81526001600160a01b038581166004830152821690633791dc6a9034906024016000604051808303818588803b1580156121c057600080fd5b505af11580156121d4573d6000803e3d6000fd5b50505050506040513d6000823e601f3d908101601f191682016040526121fd9190810190612ed2565b915050610694565b6001600160a01b038116158061222c5750836001600160a01b0316816001600160a01b0316145b612248576040516282b42960e81b815260040160405180910390fd5b6040805160c081018252600180825260208083018290528284019190915282518082018452600080825260608401919091528351808301855281815260808401528351818152918201909352909160a0830191906122b6565b60608152602001906001900390816122a15790505b509052949350505050565b60008051602061353083398151915254610100900460ff166122f55760405162461bcd60e51b8152600401610b8590613260565b610d8482826125bd565b60008051602061353083398151915254610100900460ff166123335760405162461bcd60e51b8152600401610b8590613260565b610c95612640565b600054610100900460ff166123625760405162461bcd60e51b8152600401610b859061334c565b610c95612674565b600054610100900460ff166123915760405162461bcd60e51b8152600401610b859061334c565b610c956126a4565b600054610100900460ff166123c05760405162461bcd60e51b8152600401610b859061334c565b610c956126d7565b600054610100900460ff16610c955760405162461bcd60e51b8152600401610b859061334c565b6001600160a01b0381163b61245c5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610b85565b6000805160206134e983398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b61249483612705565b6000825111806124a15750805b15610cb2576114f28383612745565b6124ba8383612839565b6001600160a01b0383163b15610cb25760006124d4611b36565b5490508281035b6124ee6000868380600101945086611f9f565b61250b576040516368d2bf6b60e11b815260040160405180910390fd5b8181106124db578161251b611b36565b541461252657600080fd5b5050505050565b60655460ff16610c955760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610b85565b604080516080810182526001600160a01b038316815260a083901c6001600160401b03166020820152600160e01b831615159181019190915260e89190911c606082015290565b60008051602061353083398151915254610100900460ff166125f15760405162461bcd60e51b8152600401610b8590613260565b816125fa611b36565b6002019080519060200190612610929190612987565b508061261a611b36565b6003019080519060200190612630929190612987565b50600161263b611b36565b555050565b60008051602061353083398151915254610100900460ff16610c955760405162461bcd60e51b8152600401610b8590613260565b600054610100900460ff1661269b5760405162461bcd60e51b8152600401610b859061334c565b610c9533611ec9565b600054610100900460ff166126cb5760405162461bcd60e51b8152600401610b859061334c565b6065805460ff19169055565b600054610100900460ff166126fe5760405162461bcd60e51b8152600401610b859061334c565b6001609755565b61270e816123ef565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b6127ad5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610b85565b600080846001600160a01b0316846040516127c89190613033565b600060405180830381855af49150503d8060008114612803576040519150601f19603f3d011682016040523d82523d6000602084013e612808565b606091505b509150915061283082826040518060600160405280602781526020016135096027913961294e565b95945050505050565b6000612843611b36565b5490506001600160a01b03831661286c57604051622e076360e81b815260040160405180910390fd5b8161288a5760405163b562e8dd60e01b815260040160405180910390fd5b68010000000000000001820261289e611b36565b6001600160a01b038516600081815260059290920160205260409091208054929092019091554260a01b6001841460e11b17176128d9611b36565b60008381526004919091016020526040902055808281015b6040516001830192906001600160a01b038716906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a48082106128f1578061293d611b36565b5550610cb290506000848385611c11565b6060831561295d575081611400565b82511561296d5782518084602001fd5b8160405162461bcd60e51b8152600401610b85919061324d565b82805461299390613473565b90600052602060002090601f0160209004810192826129b557600085556129fb565b82601f106129ce57805160ff19168380011785556129fb565b828001600101855582156129fb579182015b828111156129fb5782518255916020019190600101906129e0565b50612a07929150612a0b565b5090565b5b80821115612a075760008155600101612a0c565b80356001600160a01b0381168114612a3757600080fd5b919050565b600082601f830112612a4c578081fd5b81516020612a61612a5c836133fd565b6133cd565b80838252828201915082860187848660051b8901011115612a80578586fd5b855b85811015612ac05781516001600160401b03811115612a9f578788fd5b612aad8a87838c0101612b24565b8552509284019290840190600101612a82565b5090979650505050505050565b8051612a37816134c4565b600082601f830112612ae8578081fd5b8135612af6612a5c82613420565b818152846020838601011115612b0a578283fd5b816020850160208301379081016020019190915292915050565b600082601f830112612b34578081fd5b8151612b42612a5c82613420565b818152846020838601011115612b56578283fd5b61208f826020830160208701613447565b600060208284031215612b78578081fd5b61140082612a20565b60008060408385031215612b93578081fd5b612b9c83612a20565b9150612baa60208401612a20565b90509250929050565b600080600060608486031215612bc7578081fd5b612bd084612a20565b9250612bde60208501612a20565b9150604084013590509250925092565b60008060008060808587031215612c03578081fd5b612c0c85612a20565b9350612c1a60208601612a20565b92506040850135915060608501356001600160401b03811115612c3b578182fd5b612c4787828801612ad8565b91505092959194509250565b60008060408385031215612c65578182fd5b612c6e83612a20565b91506020830135612c7e816134c4565b809150509250929050565b60008060408385031215612c9b578182fd5b612ca483612a20565b915060208301356001600160401b03811115612cbe578182fd5b612cca85828601612ad8565b9150509250929050565b60008060408385031215612ce6578182fd5b612cef83612a20565b946020939093013593505050565b600080600060608486031215612d11578081fd5b612d1a84612a20565b925060208401359150612d2f60408501612a20565b90509250925092565b600080600060608486031215612d4c578081fd5b612d5584612a20565b92506020840135915060408401356001600160401b03811115612d76578182fd5b612d8286828701612ad8565b9150509250925092565b600080600060608486031215612da0578081fd5b612da984612a20565b95602085013595506040909401359392505050565b60006020808385031215612dd0578182fd5b82356001600160401b03811115612de5578283fd5b8301601f81018513612df5578283fd5b8035612e03612a5c826133fd565b80828252848201915084840188868560051b8701011115612e22578687fd5b8694505b83851015612e44578035835260019490940193918501918501612e26565b50979650505050505050565b600060208284031215612e61578081fd5b5051919050565b600060208284031215612e79578081fd5b8135611400816134d2565b600060208284031215612e95578081fd5b8151611400816134d2565b600060208284031215612eb1578081fd5b81356001600160401b03811115612ec6578182fd5b61208f84828501612ad8565b600060208284031215612ee3578081fd5b81516001600160401b0380821115612ef9578283fd5b9083019060c08286031215612f0c578283fd5b612f146133a5565b612f1d83612acd565b8152612f2b60208401612acd565b6020820152612f3c60408401612acd565b6040820152606083015182811115612f52578485fd5b612f5e87828601612b24565b606083015250608083015182811115612f75578485fd5b612f8187828601612b24565b60808301525060a083015182811115612f98578485fd5b612fa487828601612a3c565b60a08301525095945050505050565b600060208284031215612fc4578081fd5b5035919050565b60008151808452612fe3816020860160208601613447565b601f01601f19169290920160200192915050565b80516001600160a01b031682526020808201516001600160401b03169083015260408082015115159083015260609081015162ffffff16910152565b60008251613045818460208701613447565b9190910192915050565b60008351613061818460208801613447565b835190830190613075818360208801613447565b01949350505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906130b190830184612fcb565b9695505050505050565b60018060a01b0386168152600060208615158184015285604084015260a060608401526130eb60a0840186612fcb565b838103608085015284511515815281850151151582820152604085015115156040820152606085015160c0606083015261312860c0830182612fcb565b9050608086015182820360808401526131418282612fcb565b91505060a086015182820360a084015281925080518083528483019350848160051b8401018583019250865b8281101561319b57601f19858303018652613189828551612fcb565b9587019593870193915060010161316d565b509c9b505050505050505050505050565b60018060a01b03841681528260208201526060604082015260006128306060830184612fcb565b6020808252825182820181905260009190848201906040850190845b8181101561110257613202838551612ff7565b92840192608092909201916001016131ef565b6020808252825182820181905260009190848201906040850190845b8181101561110257835183529284019291840191600101613231565b6020815260006114006020830184612fcb565b60208082526034908201527f455243373231415f5f496e697469616c697a61626c653a20636f6e7472616374604082015273206973206e6f7420696e697469616c697a696e6760601b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b608081016106948284612ff7565b60405160c081016001600160401b03811182821017156133c7576133c76134ae565b60405290565b604051601f8201601f191681016001600160401b03811182821017156133f5576133f56134ae565b604052919050565b60006001600160401b03821115613416576134166134ae565b5060051b60200190565b60006001600160401b03821115613439576134396134ae565b50601f01601f191660200190565b60005b8381101561346257818101518382015260200161344a565b838111156114f25750506000910152565b600181811c9082168061348757607f821691505b602082108114156134a857634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b8015158114610c2257600080fd5b6001600160e01b031981168114610c2257600080fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564ee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85fa264697066735822122076afa17cd116544d73fbe96d9048692032c64d290be16837c948d92c4bfdeb3f64736f6c63430008040033", } // ContractABI is the input ABI used to generate the binding from. @@ -173,11 +175,11 @@ func NewContractFilterer(address common.Address, filterer bind.ContractFilterer) // bindContract binds a generic wrapper to an already deployed contract. func bindContract(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := abi.JSON(strings.NewReader(ContractABI)) + parsed, err := ContractMetaData.GetAbi() if err != nil { return nil, err } - return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and @@ -251,7 +253,7 @@ func (_Contract *ContractCallerSession) BalanceOf(owner common.Address) (*big.In // ExplicitOwnershipOf is a free data retrieval call binding the contract method 0xc23dc68f. // -// Solidity: function explicitOwnershipOf(uint256 tokenId) view returns((address,uint64,bool)) +// Solidity: function explicitOwnershipOf(uint256 tokenId) view returns((address,uint64,bool,uint24)) func (_Contract *ContractCaller) ExplicitOwnershipOf(opts *bind.CallOpts, tokenId *big.Int) (IERC721AUpgradeableTokenOwnership, error) { var out []interface{} err := _Contract.contract.Call(opts, &out, "explicitOwnershipOf", tokenId) @@ -268,21 +270,21 @@ func (_Contract *ContractCaller) ExplicitOwnershipOf(opts *bind.CallOpts, tokenI // ExplicitOwnershipOf is a free data retrieval call binding the contract method 0xc23dc68f. // -// Solidity: function explicitOwnershipOf(uint256 tokenId) view returns((address,uint64,bool)) +// Solidity: function explicitOwnershipOf(uint256 tokenId) view returns((address,uint64,bool,uint24)) func (_Contract *ContractSession) ExplicitOwnershipOf(tokenId *big.Int) (IERC721AUpgradeableTokenOwnership, error) { return _Contract.Contract.ExplicitOwnershipOf(&_Contract.CallOpts, tokenId) } // ExplicitOwnershipOf is a free data retrieval call binding the contract method 0xc23dc68f. // -// Solidity: function explicitOwnershipOf(uint256 tokenId) view returns((address,uint64,bool)) +// Solidity: function explicitOwnershipOf(uint256 tokenId) view returns((address,uint64,bool,uint24)) func (_Contract *ContractCallerSession) ExplicitOwnershipOf(tokenId *big.Int) (IERC721AUpgradeableTokenOwnership, error) { return _Contract.Contract.ExplicitOwnershipOf(&_Contract.CallOpts, tokenId) } // ExplicitOwnershipsOf is a free data retrieval call binding the contract method 0x5bbb2177. // -// Solidity: function explicitOwnershipsOf(uint256[] tokenIds) view returns((address,uint64,bool)[]) +// Solidity: function explicitOwnershipsOf(uint256[] tokenIds) view returns((address,uint64,bool,uint24)[]) func (_Contract *ContractCaller) ExplicitOwnershipsOf(opts *bind.CallOpts, tokenIds []*big.Int) ([]IERC721AUpgradeableTokenOwnership, error) { var out []interface{} err := _Contract.contract.Call(opts, &out, "explicitOwnershipsOf", tokenIds) @@ -299,14 +301,14 @@ func (_Contract *ContractCaller) ExplicitOwnershipsOf(opts *bind.CallOpts, token // ExplicitOwnershipsOf is a free data retrieval call binding the contract method 0x5bbb2177. // -// Solidity: function explicitOwnershipsOf(uint256[] tokenIds) view returns((address,uint64,bool)[]) +// Solidity: function explicitOwnershipsOf(uint256[] tokenIds) view returns((address,uint64,bool,uint24)[]) func (_Contract *ContractSession) ExplicitOwnershipsOf(tokenIds []*big.Int) ([]IERC721AUpgradeableTokenOwnership, error) { return _Contract.Contract.ExplicitOwnershipsOf(&_Contract.CallOpts, tokenIds) } // ExplicitOwnershipsOf is a free data retrieval call binding the contract method 0x5bbb2177. // -// Solidity: function explicitOwnershipsOf(uint256[] tokenIds) view returns((address,uint64,bool)[]) +// Solidity: function explicitOwnershipsOf(uint256[] tokenIds) view returns((address,uint64,bool,uint24)[]) func (_Contract *ContractCallerSession) ExplicitOwnershipsOf(tokenIds []*big.Int) ([]IERC721AUpgradeableTokenOwnership, error) { return _Contract.Contract.ExplicitOwnershipsOf(&_Contract.CallOpts, tokenIds) } @@ -766,44 +768,23 @@ func (_Contract *ContractTransactorSession) Approve(to common.Address, tokenId * return _Contract.Contract.Approve(&_Contract.TransactOpts, to, tokenId) } -// Burn is a paid mutator transaction binding the contract method 0x42966c68. -// -// Solidity: function burn(uint256 tokenId) returns() -func (_Contract *ContractTransactor) Burn(opts *bind.TransactOpts, tokenId *big.Int) (*types.Transaction, error) { - return _Contract.contract.Transact(opts, "burn", tokenId) -} - -// Burn is a paid mutator transaction binding the contract method 0x42966c68. -// -// Solidity: function burn(uint256 tokenId) returns() -func (_Contract *ContractSession) Burn(tokenId *big.Int) (*types.Transaction, error) { - return _Contract.Contract.Burn(&_Contract.TransactOpts, tokenId) -} - -// Burn is a paid mutator transaction binding the contract method 0x42966c68. -// -// Solidity: function burn(uint256 tokenId) returns() -func (_Contract *ContractTransactorSession) Burn(tokenId *big.Int) (*types.Transaction, error) { - return _Contract.Contract.Burn(&_Contract.TransactOpts, tokenId) -} - // CreateTable is a paid mutator transaction binding the contract method 0x3a9151b0. // -// Solidity: function createTable(address owner, string statement) payable returns() +// Solidity: function createTable(address owner, string statement) payable returns(uint256 tableId) func (_Contract *ContractTransactor) CreateTable(opts *bind.TransactOpts, owner common.Address, statement string) (*types.Transaction, error) { return _Contract.contract.Transact(opts, "createTable", owner, statement) } // CreateTable is a paid mutator transaction binding the contract method 0x3a9151b0. // -// Solidity: function createTable(address owner, string statement) payable returns() +// Solidity: function createTable(address owner, string statement) payable returns(uint256 tableId) func (_Contract *ContractSession) CreateTable(owner common.Address, statement string) (*types.Transaction, error) { return _Contract.Contract.CreateTable(&_Contract.TransactOpts, owner, statement) } // CreateTable is a paid mutator transaction binding the contract method 0x3a9151b0. // -// Solidity: function createTable(address owner, string statement) payable returns() +// Solidity: function createTable(address owner, string statement) payable returns(uint256 tableId) func (_Contract *ContractTransactorSession) CreateTable(owner common.Address, statement string) (*types.Transaction, error) { return _Contract.Contract.CreateTable(&_Contract.TransactOpts, owner, statement) } @@ -829,6 +810,27 @@ func (_Contract *ContractTransactorSession) Initialize(baseURI string) (*types.T return _Contract.Contract.Initialize(&_Contract.TransactOpts, baseURI) } +// LockController is a paid mutator transaction binding the contract method 0x05295681. +// +// Solidity: function lockController(address caller, uint256 tableId) returns() +func (_Contract *ContractTransactor) LockController(opts *bind.TransactOpts, caller common.Address, tableId *big.Int) (*types.Transaction, error) { + return _Contract.contract.Transact(opts, "lockController", caller, tableId) +} + +// LockController is a paid mutator transaction binding the contract method 0x05295681. +// +// Solidity: function lockController(address caller, uint256 tableId) returns() +func (_Contract *ContractSession) LockController(caller common.Address, tableId *big.Int) (*types.Transaction, error) { + return _Contract.Contract.LockController(&_Contract.TransactOpts, caller, tableId) +} + +// LockController is a paid mutator transaction binding the contract method 0x05295681. +// +// Solidity: function lockController(address caller, uint256 tableId) returns() +func (_Contract *ContractTransactorSession) LockController(caller common.Address, tableId *big.Int) (*types.Transaction, error) { + return _Contract.Contract.LockController(&_Contract.TransactOpts, caller, tableId) +} + // Pause is a paid mutator transaction binding the contract method 0x8456cb59. // // Solidity: function pause() returns() @@ -873,21 +875,21 @@ func (_Contract *ContractTransactorSession) RenounceOwnership() (*types.Transact // RunSQL is a paid mutator transaction binding the contract method 0xeaf5d04e. // -// Solidity: function runSQL(address caller, uint256 tableId, string statement) returns() +// Solidity: function runSQL(address caller, uint256 tableId, string statement) payable returns() func (_Contract *ContractTransactor) RunSQL(opts *bind.TransactOpts, caller common.Address, tableId *big.Int, statement string) (*types.Transaction, error) { return _Contract.contract.Transact(opts, "runSQL", caller, tableId, statement) } // RunSQL is a paid mutator transaction binding the contract method 0xeaf5d04e. // -// Solidity: function runSQL(address caller, uint256 tableId, string statement) returns() +// Solidity: function runSQL(address caller, uint256 tableId, string statement) payable returns() func (_Contract *ContractSession) RunSQL(caller common.Address, tableId *big.Int, statement string) (*types.Transaction, error) { return _Contract.Contract.RunSQL(&_Contract.TransactOpts, caller, tableId, statement) } // RunSQL is a paid mutator transaction binding the contract method 0xeaf5d04e. // -// Solidity: function runSQL(address caller, uint256 tableId, string statement) returns() +// Solidity: function runSQL(address caller, uint256 tableId, string statement) payable returns() func (_Contract *ContractTransactorSession) RunSQL(caller common.Address, tableId *big.Int, statement string) (*types.Transaction, error) { return _Contract.Contract.RunSQL(&_Contract.TransactOpts, caller, tableId, statement) } @@ -1697,6 +1699,171 @@ func (_Contract *ContractFilterer) ParseBeaconUpgraded(log types.Log) (*Contract return event, nil } +// ContractConsecutiveTransferIterator is returned from FilterConsecutiveTransfer and is used to iterate over the raw logs and unpacked data for ConsecutiveTransfer events raised by the Contract contract. +type ContractConsecutiveTransferIterator struct { + Event *ContractConsecutiveTransfer // 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 *ContractConsecutiveTransferIterator) 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(ContractConsecutiveTransfer) + 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(ContractConsecutiveTransfer) + 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 *ContractConsecutiveTransferIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ContractConsecutiveTransferIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ContractConsecutiveTransfer represents a ConsecutiveTransfer event raised by the Contract contract. +type ContractConsecutiveTransfer 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 (_Contract *ContractFilterer) FilterConsecutiveTransfer(opts *bind.FilterOpts, fromTokenId []*big.Int, from []common.Address, to []common.Address) (*ContractConsecutiveTransferIterator, 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 := _Contract.contract.FilterLogs(opts, "ConsecutiveTransfer", fromTokenIdRule, fromRule, toRule) + if err != nil { + return nil, err + } + return &ContractConsecutiveTransferIterator{contract: _Contract.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 (_Contract *ContractFilterer) WatchConsecutiveTransfer(opts *bind.WatchOpts, sink chan<- *ContractConsecutiveTransfer, 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 := _Contract.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(ContractConsecutiveTransfer) + if err := _Contract.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 (_Contract *ContractFilterer) ParseConsecutiveTransfer(log types.Log) (*ContractConsecutiveTransfer, error) { + event := new(ContractConsecutiveTransfer) + if err := _Contract.contract.UnpackLog(event, "ConsecutiveTransfer", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + // ContractCreateTableIterator is returned from FilterCreateTable and is used to iterate over the raw logs and unpacked data for CreateTable events raised by the Contract contract. type ContractCreateTableIterator struct { Event *ContractCreateTable // Event containing the contract specifics and raw log diff --git a/pkg/tables/impl/ethereum/test/controller/controller.go b/pkg/tables/impl/ethereum/test/controller/controller.go index 1967be59..fd9bd9ba 100644 --- a/pkg/tables/impl/ethereum/test/controller/controller.go +++ b/pkg/tables/impl/ethereum/test/controller/controller.go @@ -26,6 +26,7 @@ var ( _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription + _ = abi.ConvertType ) // ITablelandControllerPolicy is an auto generated low-level Go binding around an user-defined struct. @@ -166,11 +167,11 @@ func NewContractFilterer(address common.Address, filterer bind.ContractFilterer) // bindContract binds a generic wrapper to an already deployed contract. func bindContract(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := abi.JSON(strings.NewReader(ContractABI)) + parsed, err := ContractMetaData.GetAbi() if err != nil { return nil, err } - return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and diff --git a/pkg/tables/impl/ethereum/test/erc721Enumerable/erc721Enumerable.go b/pkg/tables/impl/ethereum/test/erc721Enumerable/erc721Enumerable.go index d6144f7a..5721e985 100644 --- a/pkg/tables/impl/ethereum/test/erc721Enumerable/erc721Enumerable.go +++ b/pkg/tables/impl/ethereum/test/erc721Enumerable/erc721Enumerable.go @@ -26,6 +26,7 @@ var ( _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription + _ = abi.ConvertType ) // ContractMetaData contains all meta data concerning the Contract contract. @@ -156,11 +157,11 @@ func NewContractFilterer(address common.Address, filterer bind.ContractFilterer) // bindContract binds a generic wrapper to an already deployed contract. func bindContract(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := abi.JSON(strings.NewReader(ContractABI)) + parsed, err := ContractMetaData.GetAbi() if err != nil { return nil, err } - return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and diff --git a/pkg/tables/impl/ethereum/test/erc721aQueryable/erc721aQueryable.go b/pkg/tables/impl/ethereum/test/erc721aQueryable/erc721aQueryable.go index d8b4655a..d545fcb8 100644 --- a/pkg/tables/impl/ethereum/test/erc721aQueryable/erc721aQueryable.go +++ b/pkg/tables/impl/ethereum/test/erc721aQueryable/erc721aQueryable.go @@ -26,6 +26,7 @@ var ( _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription + _ = abi.ConvertType ) // IERC721ATokenOwnership is an auto generated low-level Go binding around an user-defined struct. @@ -163,11 +164,11 @@ func NewContractFilterer(address common.Address, filterer bind.ContractFilterer) // bindContract binds a generic wrapper to an already deployed contract. func bindContract(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := abi.JSON(strings.NewReader(ContractABI)) + parsed, err := ContractMetaData.GetAbi() if err != nil { return nil, err } - return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and From abb7260b641b6ccd74b1da42d536f8ec3722f5d6 Mon Sep 17 00:00:00 2001 From: Bruno Calza Date: Wed, 15 Mar 2023 17:11:42 -0300 Subject: [PATCH 2/2] creates gas limit multiplier config [testnetdeploy] Signed-off-by: Bruno Calza --- Makefile | 9 +++++---- cmd/healthbot/config.go | 1 + cmd/healthbot/counterprobe/counterprobe.go | 6 +++++- .../counterprobe/counterprobe_test.go | 2 +- cmd/healthbot/main.go | 6 ++++++ docker/deployed/testnet/healthbot/config.json | 3 ++- pkg/client/v1/writequery.go | 18 +++++++++++++++++- pkg/tables/impl/ethereum/client.go | 2 +- pkg/tables/tables.go | 15 +++++++++++++++ 9 files changed, 53 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index b3bf1277..3b9ec4f3 100644 --- a/Makefile +++ b/Makefile @@ -10,24 +10,25 @@ HTTP_PORT ?= 8080 GO_BINDATA=go run github.com/go-bindata/go-bindata/v3/go-bindata@v3.1.3 SQLC=go run github.com/kyleconroy/sqlc/cmd/sqlc@v1.15.0 GOVVV=go run github.com/ahmetb/govvv@v0.3.0 +ABIGEN=go run github.com/ethereum/go-ethereum/cmd/abigen@v1.11.4 GOVVV_FLAGS=$(shell $(GOVVV) -flags -version $(BIN_VERSION) -pkg $(shell go list ./buildinfo)) # Code generation ethereum: ethereum-testcontroller ethereum-testerc721 ethereum-testerc721a - go run github.com/ethereum/go-ethereum/cmd/abigen@v1.11.4 --abi ./pkg/tables/impl/ethereum/abi.json --pkg ethereum --type Contract --out pkg/tables/impl/ethereum/contract.go --bin pkg/tables/impl/ethereum/bytecode.bin + $(ABIGEN) --abi ./pkg/tables/impl/ethereum/abi.json --pkg ethereum --type Contract --out pkg/tables/impl/ethereum/contract.go --bin pkg/tables/impl/ethereum/bytecode.bin .PHONY: ethereum ethereum-testcontroller: - go run github.com/ethereum/go-ethereum/cmd/abigen@v1.11.4 --abi ./pkg/tables/impl/ethereum/test/controller/abi.json --pkg controller --type Contract --out pkg/tables/impl/ethereum/test/controller/controller.go --bin pkg/tables/impl/ethereum/test/controller/bytecode.bin + $(ABIGEN) --abi ./pkg/tables/impl/ethereum/test/controller/abi.json --pkg controller --type Contract --out pkg/tables/impl/ethereum/test/controller/controller.go --bin pkg/tables/impl/ethereum/test/controller/bytecode.bin .PHONY: ethereum-testcontroller ethereum-testerc721: - go run github.com/ethereum/go-ethereum/cmd/abigen@v1.11.4 --abi ./pkg/tables/impl/ethereum/test/erc721Enumerable/abi.json --pkg erc721Enumerable --type Contract --out pkg/tables/impl/ethereum/test/erc721Enumerable/erc721Enumerable.go --bin pkg/tables/impl/ethereum/test/erc721Enumerable/bytecode.bin + $(ABIGEN) --abi ./pkg/tables/impl/ethereum/test/erc721Enumerable/abi.json --pkg erc721Enumerable --type Contract --out pkg/tables/impl/ethereum/test/erc721Enumerable/erc721Enumerable.go --bin pkg/tables/impl/ethereum/test/erc721Enumerable/bytecode.bin .PHONY: ethereum-testerc721 ethereum-testerc721a: - go run github.com/ethereum/go-ethereum/cmd/abigen@v1.11.4 --abi ./pkg/tables/impl/ethereum/test/erc721aQueryable/abi.json --pkg erc721aQueryable --type Contract --out pkg/tables/impl/ethereum/test/erc721aQueryable/erc721aQueryable.go --bin pkg/tables/impl/ethereum/test/erc721aQueryable/bytecode.bin + $(ABIGEN) --abi ./pkg/tables/impl/ethereum/test/erc721aQueryable/abi.json --pkg erc721aQueryable --type Contract --out pkg/tables/impl/ethereum/test/erc721aQueryable/erc721aQueryable.go --bin pkg/tables/impl/ethereum/test/erc721aQueryable/bytecode.bin .PHONY: ethereum-testerc721a system-sql-assets: diff --git a/cmd/healthbot/config.go b/cmd/healthbot/config.go index ad13ea73..8e84f2ea 100644 --- a/cmd/healthbot/config.go +++ b/cmd/healthbot/config.go @@ -39,6 +39,7 @@ type ChainConfig struct { GatewayEndpoint string ContractAddr string SuggestedGasPriceMultiplier float64 + EstimatedGasLimitMultiplier float64 } } diff --git a/cmd/healthbot/counterprobe/counterprobe.go b/cmd/healthbot/counterprobe/counterprobe.go index 10c058ba..8f58680a 100644 --- a/cmd/healthbot/counterprobe/counterprobe.go +++ b/cmd/healthbot/counterprobe/counterprobe.go @@ -28,6 +28,7 @@ type CounterProbe struct { receiptTimeout time.Duration tableName string suggGasPriceMultiplier float64 + estGasLimitMultiplier float64 lock sync.RWMutex mLastCounterValue int64 @@ -45,6 +46,7 @@ func New( checkInterval time.Duration, receiptTimeout time.Duration, suggGasPriceMultiplier float64, + estGasLimitMultiplier float64, ) (*CounterProbe, error) { log := logger.With(). Str("component", "healthbot"). @@ -65,6 +67,7 @@ func New( tableName: tableName, receiptTimeout: receiptTimeout, suggGasPriceMultiplier: suggGasPriceMultiplier, + estGasLimitMultiplier: estGasLimitMultiplier, } if err := cp.initMetrics(chainName); err != nil { return nil, fmt.Errorf("initializing metrics: %s", err) @@ -142,7 +145,8 @@ func (cp *CounterProbe) increaseCounterValue(ctx context.Context) error { txnHash, err := cp.client.Write( ctx, fmt.Sprintf("update %s set counter=counter+1", cp.tableName), - clientV1.WithSuggestedPriceMultiplier(cp.suggGasPriceMultiplier)) + clientV1.WithSuggestedPriceMultiplier(cp.suggGasPriceMultiplier), + clientV1.WithEstimatedGasLimitMultiplier(cp.estGasLimitMultiplier)) if err != nil { return fmt.Errorf("calling client Write: %s", err) } diff --git a/cmd/healthbot/counterprobe/counterprobe_test.go b/cmd/healthbot/counterprobe/counterprobe_test.go index 98d7ac55..58df5391 100644 --- a/cmd/healthbot/counterprobe/counterprobe_test.go +++ b/cmd/healthbot/counterprobe/counterprobe_test.go @@ -22,7 +22,7 @@ func TestProduction(t *testing.T) { client, err := clientV1.NewClient(ctx, wallet, clientV1.NewClientChain(chain)) require.NoError(t, err) - cp, err := New("optimism-mainnet", client, "Runbook_24", time.Second, time.Second*10, 1) + cp, err := New("optimism-mainnet", client, "Runbook_24", time.Second, time.Second*10, 1, 1) require.NoError(t, err) value, err := cp.healthCheck(context.Background()) diff --git a/cmd/healthbot/main.go b/cmd/healthbot/main.go index 7ae7a5c0..f5a0beb0 100644 --- a/cmd/healthbot/main.go +++ b/cmd/healthbot/main.go @@ -71,6 +71,11 @@ func main() { if chainCfg.OverrideClient.SuggestedGasPriceMultiplier > 0 { suggestedGasPriceMultiplier = chainCfg.OverrideClient.SuggestedGasPriceMultiplier } + estimatedGasLimitMultiplier := 1.0 + if chainCfg.OverrideClient.EstimatedGasLimitMultiplier > 0 { + estimatedGasLimitMultiplier = chainCfg.OverrideClient.EstimatedGasLimitMultiplier + } + cp, err := counterprobe.New( chain.Name, client, @@ -78,6 +83,7 @@ func main() { checkInterval, receiptTimeout, suggestedGasPriceMultiplier, + estimatedGasLimitMultiplier, ) if err != nil { log.Fatal().Err(err).Msg("initializing counter-probe") diff --git a/docker/deployed/testnet/healthbot/config.json b/docker/deployed/testnet/healthbot/config.json index a0d2347b..df90379c 100644 --- a/docker/deployed/testnet/healthbot/config.json +++ b/docker/deployed/testnet/healthbot/config.json @@ -27,7 +27,8 @@ "Tablename": "${HEALTHBOT_ETHEREUM_GOERLI_TABLE}" }, "OverrideClient": { - "SuggestedGasPriceMultiplier": 1.2 + "SuggestedGasPriceMultiplier": 1.2, + "EstimatedGasLimitMultiplier": 1.1 } }, { diff --git a/pkg/client/v1/writequery.go b/pkg/client/v1/writequery.go index 1df0d534..d8defa32 100644 --- a/pkg/client/v1/writequery.go +++ b/pkg/client/v1/writequery.go @@ -87,7 +87,8 @@ func (c *Client) Write(ctx context.Context, query string, opts ...WriteOption) ( c.wallet.Address(), tables.TableID(tableID), query, - tables.WithSuggestedPriceMultiplier(config.suggestedGasPriceMultiplier)) + tables.WithSuggestedPriceMultiplier(config.suggestedGasPriceMultiplier), + tables.WithEstimatedGasLimitMultiplier(config.estimatedGasLimitMultiplier)) if err != nil { return "", fmt.Errorf("calling RunSQL: %v", err) } @@ -100,10 +101,12 @@ type WriteOption func(*WriteConfig) error // WriteConfig contains configuration attributes to call Write. type WriteConfig struct { suggestedGasPriceMultiplier float64 + estimatedGasLimitMultiplier float64 } var defaultWriteConfig = WriteConfig{ suggestedGasPriceMultiplier: 1.0, + estimatedGasLimitMultiplier: 1.0, } // WithSuggestedPriceMultiplier allows to modify the gas priced to be used with respect with the suggested gas price. @@ -118,3 +121,16 @@ func WithSuggestedPriceMultiplier(m float64) WriteOption { return nil } } + +// WithEstimatedGasLimitMultiplier allows to modify the gas limit to be used with respect with the estimated gas. +// For example, if `m=1.2` then the gas limit to be used will be `estimatedGas * 1.2`. +func WithEstimatedGasLimitMultiplier(m float64) WriteOption { + return func(wc *WriteConfig) error { + if m <= 0 { + return fmt.Errorf("multiplier should be positive") + } + wc.estimatedGasLimitMultiplier = m + + return nil + } +} diff --git a/pkg/tables/impl/ethereum/client.go b/pkg/tables/impl/ethereum/client.go index 4d051fa9..a38c9e9e 100644 --- a/pkg/tables/impl/ethereum/client.go +++ b/pkg/tables/impl/ethereum/client.go @@ -161,7 +161,7 @@ func (c *Client) RunSQL( From: auth.From, Nonce: big.NewInt(0).SetInt64(nonce), GasTipCap: gasTipCap, - GasLimit: uint64(math.Ceil(float64(gas) * 1.1)), + GasLimit: uint64(math.Ceil(float64(gas) * conf.EstimatedGasLimitMultiplier)), } tx, err := c.contract.RunSQL(opts, addr, table.ToBigInt(), statement) diff --git a/pkg/tables/tables.go b/pkg/tables/tables.go index da8d8c0f..6518e193 100644 --- a/pkg/tables/tables.go +++ b/pkg/tables/tables.go @@ -70,11 +70,13 @@ type RunSQLOption func(*RunSQLConfig) error // RunSQLConfig contains configuration attributes to call Write. type RunSQLConfig struct { SuggestedGasPriceMultiplier float64 + EstimatedGasLimitMultiplier float64 } // DefaultRunSQLConfig is the default configuration for RunSQL if no options are passed. var DefaultRunSQLConfig = RunSQLConfig{ SuggestedGasPriceMultiplier: 1.0, + EstimatedGasLimitMultiplier: 1.0, } // WithSuggestedPriceMultiplier allows to modify the gas priced to be used with respect with the suggested gas price. @@ -89,3 +91,16 @@ func WithSuggestedPriceMultiplier(m float64) RunSQLOption { return nil } } + +// WithEstimatedGasLimitMultiplier allows to modify the gas limit to be used with respect with the estimated gas. +// For example, if `m=1.2` then the gas limit to be used will be `estimatedGas * 1.2`. +func WithEstimatedGasLimitMultiplier(m float64) RunSQLOption { + return func(wc *RunSQLConfig) error { + if m <= 0 { + return fmt.Errorf("multiplier should be positive") + } + wc.EstimatedGasLimitMultiplier = m + + return nil + } +}