From 8298821e57e391c096c438e78517ea11ec3ea48f Mon Sep 17 00:00:00 2001 From: Jonathan Oppenheimer Date: Mon, 3 Nov 2025 15:45:29 -0500 Subject: [PATCH 01/11] Create Go Test Utilities --- contracts/bindings/allowlist.go | 2 +- contracts/bindings/erc20nativeminter.go | 2 +- contracts/bindings/exampledeployerlist.go | 2 +- contracts/bindings/examplefeemanager.go | 2 +- contracts/bindings/examplerewardmanager.go | 2 +- contracts/bindings/exampletxallowlist.go | 2 +- contracts/bindings/examplewarp.go | 2 +- contracts/bindings/iallowlist.go | 459 ++++++++ contracts/bindings/ifeemanager.go | 744 ++++++++++++ contracts/bindings/inativeminter.go | 634 ++++++++++ contracts/bindings/irewardmanager.go | 1034 +++++++++++++++++ contracts/bindings/iwarpmessenger.go | 490 ++++++++ contracts/contracts/compile.go | 10 +- go.mod | 7 +- go.sum | 21 +- scripts/run_ginkgo_precompile.sh | 10 +- .../contract_deployer_allow_list_test.go | 328 ++++++ tests/precompile/contracttest/example_test.go | 56 + tests/precompile/contracttest/helpers.go | 142 +++ tests/precompile/contracttest/roles.go | 99 ++ tests/precompile/contracttest/tmpnet.go | 228 ++++ tests/precompile/solidity/suites.go | 7 +- 22 files changed, 4262 insertions(+), 21 deletions(-) create mode 100644 contracts/bindings/iallowlist.go create mode 100644 contracts/bindings/ifeemanager.go create mode 100644 contracts/bindings/inativeminter.go create mode 100644 contracts/bindings/irewardmanager.go create mode 100644 contracts/bindings/iwarpmessenger.go create mode 100644 tests/precompile/contract_deployer_allow_list_test.go create mode 100644 tests/precompile/contracttest/example_test.go create mode 100644 tests/precompile/contracttest/helpers.go create mode 100644 tests/precompile/contracttest/roles.go create mode 100644 tests/precompile/contracttest/tmpnet.go diff --git a/contracts/bindings/allowlist.go b/contracts/bindings/allowlist.go index 3353c67e2b..675cc32f78 100644 --- a/contracts/bindings/allowlist.go +++ b/contracts/bindings/allowlist.go @@ -32,7 +32,7 @@ var ( // AllowListMetaData contains all meta data concerning the AllowList contract. var AllowListMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"precompileAddr\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"OwnableInvalidOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"OwnableUnauthorizedAccount\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"isAdmin\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"isEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"isManager\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"revoke\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setEnabled\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x608060405234801561000f575f5ffd5b50604051610d39380380610d3983398181016040528101906100319190610217565b335f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036100a2575f6040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016100999190610251565b60405180910390fd5b6100b1816100f860201b60201c565b508060015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505061026a565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f5ffd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6101e6826101bd565b9050919050565b6101f6816101dc565b8114610200575f5ffd5b50565b5f81519050610211816101ed565b92915050565b5f6020828403121561022c5761022b6101b9565b5b5f61023984828501610203565b91505092915050565b61024b816101dc565b82525050565b5f6020820190506102645f830184610242565b92915050565b610ac2806102775f395ff3fe608060405234801561000f575f5ffd5b506004361061009c575f3560e01c80638da5cb5b116100645780638da5cb5b1461012e5780639015d3711461014c578063d0ebdbe71461017c578063f2fde38b14610198578063f3ae2415146101b45761009c565b80630aaf7043146100a057806324d7806c146100bc578063704b6c02146100ec578063715018a61461010857806374a8f10314610112575b5f5ffd5b6100ba60048036038101906100b59190610930565b6101e4565b005b6100d660048036038101906100d19190610930565b6101f8565b6040516100e39190610975565b60405180910390f35b61010660048036038101906101019190610930565b6102a1565b005b6101106102b5565b005b61012c60048036038101906101279190610930565b6102c8565b005b6101366102dc565b604051610143919061099d565b60405180910390f35b61016660048036038101906101619190610930565b610303565b6040516101739190610975565b60405180910390f35b61019660048036038101906101919190610930565b6103ac565b005b6101b260048036038101906101ad9190610930565b6103c0565b005b6101ce60048036038101906101c99190610930565b610444565b6040516101db9190610975565b60405180910390f35b6101ec6104ed565b6101f581610574565b50565b5f5f60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b8152600401610254919061099d565b602060405180830381865afa15801561026f573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061029391906109e9565b905060028114915050919050565b6102a96104ed565b6102b2816105fe565b50565b6102bd6104ed565b6102c65f610688565b565b6102d06104ed565b6102d981610749565b50565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b5f5f60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b815260040161035f919061099d565b602060405180830381865afa15801561037a573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061039e91906109e9565b90505f811415915050919050565b6103b46104ed565b6103bd81610841565b50565b6103c86104ed565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610438575f6040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260040161042f919061099d565b60405180910390fd5b61044181610688565b50565b5f5f60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b81526004016104a0919061099d565b602060405180830381865afa1580156104bb573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104df91906109e9565b905060038114915050919050565b6104f56108cb565b73ffffffffffffffffffffffffffffffffffffffff166105136102dc565b73ffffffffffffffffffffffffffffffffffffffff1614610572576105366108cb565b6040517f118cdaa7000000000000000000000000000000000000000000000000000000008152600401610569919061099d565b60405180910390fd5b565b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630aaf7043826040518263ffffffff1660e01b81526004016105ce919061099d565b5f604051808303815f87803b1580156105e5575f5ffd5b505af11580156105f7573d5f5f3e3d5ffd5b5050505050565b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663704b6c02826040518263ffffffff1660e01b8152600401610658919061099d565b5f604051808303815f87803b15801561066f575f5ffd5b505af1158015610681573d5f5f3e3d5ffd5b5050505050565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b8073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16036107b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107ae90610a6e565b60405180910390fd5b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638c6bfb3b826040518263ffffffff1660e01b8152600401610811919061099d565b5f604051808303815f87803b158015610828575f5ffd5b505af115801561083a573d5f5f3e3d5ffd5b5050505050565b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0ebdbe7826040518263ffffffff1660e01b815260040161089b919061099d565b5f604051808303815f87803b1580156108b2575f5ffd5b505af11580156108c4573d5f5f3e3d5ffd5b5050505050565b5f33905090565b5f5ffd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6108ff826108d6565b9050919050565b61090f816108f5565b8114610919575f5ffd5b50565b5f8135905061092a81610906565b92915050565b5f60208284031215610945576109446108d2565b5b5f6109528482850161091c565b91505092915050565b5f8115159050919050565b61096f8161095b565b82525050565b5f6020820190506109885f830184610966565b92915050565b610997816108f5565b82525050565b5f6020820190506109b05f83018461098e565b92915050565b5f819050919050565b6109c8816109b6565b81146109d2575f5ffd5b50565b5f815190506109e3816109bf565b92915050565b5f602082840312156109fe576109fd6108d2565b5b5f610a0b848285016109d5565b91505092915050565b5f82825260208201905092915050565b7f63616e6e6f74207265766f6b65206f776e20726f6c65000000000000000000005f82015250565b5f610a58601683610a14565b9150610a6382610a24565b602082019050919050565b5f6020820190508181035f830152610a8581610a4c565b905091905056fea2646970667358221220ca1811ed5ea5c612a035f49f4669d3792a4e99edce0d414764416eada03edce764736f6c634300081e0033", + Bin: "0x608060405234801561001057600080fd5b50604051610d92380380610d9283398181016040528101906100329190610223565b33600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036100a55760006040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260040161009c919061025f565b60405180910390fd5b6100b4816100fc60201b60201c565b5080600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505061027a565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006101f0826101c5565b9050919050565b610200816101e5565b811461020b57600080fd5b50565b60008151905061021d816101f7565b92915050565b600060208284031215610239576102386101c0565b5b60006102478482850161020e565b91505092915050565b610259816101e5565b82525050565b60006020820190506102746000830184610250565b92915050565b610b09806102896000396000f3fe608060405234801561001057600080fd5b506004361061009e5760003560e01c80638da5cb5b116100665780638da5cb5b146101315780639015d3711461014f578063d0ebdbe71461017f578063f2fde38b1461019b578063f3ae2415146101b75761009e565b80630aaf7043146100a357806324d7806c146100bf578063704b6c02146100ef578063715018a61461010b57806374a8f10314610115575b600080fd5b6100bd60048036038101906100b89190610966565b6101e7565b005b6100d960048036038101906100d49190610966565b6101fb565b6040516100e691906109ae565b60405180910390f35b61010960048036038101906101049190610966565b6102a8565b005b6101136102bc565b005b61012f600480360381019061012a9190610966565b6102d0565b005b6101396102e4565b60405161014691906109d8565b60405180910390f35b61016960048036038101906101649190610966565b61030d565b60405161017691906109ae565b60405180910390f35b61019960048036038101906101949190610966565b6103bb565b005b6101b560048036038101906101b09190610966565b6103cf565b005b6101d160048036038101906101cc9190610966565b610455565b6040516101de91906109ae565b60405180910390f35b6101ef610502565b6101f881610589565b50565b600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b815260040161025991906109d8565b602060405180830381865afa158015610276573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061029a9190610a29565b905060028114915050919050565b6102b0610502565b6102b981610619565b50565b6102c4610502565b6102ce60006106a9565b565b6102d8610502565b6102e18161076d565b50565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b815260040161036b91906109d8565b602060405180830381865afa158015610388573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ac9190610a29565b90506000811415915050919050565b6103c3610502565b6103cc8161086b565b50565b6103d7610502565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036104495760006040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260040161044091906109d8565b60405180910390fd5b610452816106a9565b50565b600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b81526004016104b391906109d8565b602060405180830381865afa1580156104d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104f49190610a29565b905060038114915050919050565b61050a6108fb565b73ffffffffffffffffffffffffffffffffffffffff166105286102e4565b73ffffffffffffffffffffffffffffffffffffffff16146105875761054b6108fb565b6040517f118cdaa700000000000000000000000000000000000000000000000000000000815260040161057e91906109d8565b60405180910390fd5b565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630aaf7043826040518263ffffffff1660e01b81526004016105e491906109d8565b600060405180830381600087803b1580156105fe57600080fd5b505af1158015610612573d6000803e3d6000fd5b5050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663704b6c02826040518263ffffffff1660e01b815260040161067491906109d8565b600060405180830381600087803b15801561068e57600080fd5b505af11580156106a2573d6000803e3d6000fd5b5050505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b8073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16036107db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107d290610ab3565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638c6bfb3b826040518263ffffffff1660e01b815260040161083691906109d8565b600060405180830381600087803b15801561085057600080fd5b505af1158015610864573d6000803e3d6000fd5b5050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0ebdbe7826040518263ffffffff1660e01b81526004016108c691906109d8565b600060405180830381600087803b1580156108e057600080fd5b505af11580156108f4573d6000803e3d6000fd5b5050505050565b600033905090565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061093382610908565b9050919050565b61094381610928565b811461094e57600080fd5b50565b6000813590506109608161093a565b92915050565b60006020828403121561097c5761097b610903565b5b600061098a84828501610951565b91505092915050565b60008115159050919050565b6109a881610993565b82525050565b60006020820190506109c3600083018461099f565b92915050565b6109d281610928565b82525050565b60006020820190506109ed60008301846109c9565b92915050565b6000819050919050565b610a06816109f3565b8114610a1157600080fd5b50565b600081519050610a23816109fd565b92915050565b600060208284031215610a3f57610a3e610903565b5b6000610a4d84828501610a14565b91505092915050565b600082825260208201905092915050565b7f63616e6e6f74207265766f6b65206f776e20726f6c6500000000000000000000600082015250565b6000610a9d601683610a56565b9150610aa882610a67565b602082019050919050565b60006020820190508181036000830152610acc81610a90565b905091905056fea2646970667358221220653f508c4599dbac96151ace6baf758bb7ce1fcd069eb55b4e32d4a051c77a4064736f6c634300081e0033", } // AllowListABI is the input ABI used to generate the binding from. diff --git a/contracts/bindings/erc20nativeminter.go b/contracts/bindings/erc20nativeminter.go index ff4f7ebd31..c856bbbd0d 100644 --- a/contracts/bindings/erc20nativeminter.go +++ b/contracts/bindings/erc20nativeminter.go @@ -32,7 +32,7 @@ var ( // ERC20NativeMinterMetaData contains all meta data concerning the ERC20NativeMinter contract. var ERC20NativeMinterMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"initSupply\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"allowance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"needed\",\"type\":\"uint256\"}],\"name\":\"ERC20InsufficientAllowance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"needed\",\"type\":\"uint256\"}],\"name\":\"ERC20InsufficientBalance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"approver\",\"type\":\"address\"}],\"name\":\"ERC20InvalidApprover\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"ERC20InvalidReceiver\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"ERC20InvalidSender\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"ERC20InvalidSpender\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"OwnableInvalidOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"OwnableUnauthorizedAccount\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"Deposit\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"src\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"Mintdrawal\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"isAdmin\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"isEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"isManager\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"mintdraw\",\"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\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"revoke\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setEnabled\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x608060405273020000000000000000000000000000000000000160075f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550348015610063575f5ffd5b506040516125fc3803806125fc833981810160405281019061008591906105ac565b730200000000000000000000000000000000000001336040518060400160405280601681526020017f45524332304e61746976654d696e746572546f6b656e000000000000000000008152506040518060400160405280600481526020017f584d504c000000000000000000000000000000000000000000000000000000008152508160039081610116919061080b565b508060049081610126919061080b565b5050505f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610199575f6040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016101909190610919565b60405180910390fd5b6101a88161020d60201b60201c565b508060065f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506102076101fb6102d060201b60201c565b826102d760201b60201c565b506109ef565b5f60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508160055f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f33905090565b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610347575f6040517fec442f0500000000000000000000000000000000000000000000000000000000815260040161033e9190610919565b60405180910390fd5b6103585f838361035c60201b60201c565b5050565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036103ac578060025f8282546103a0919061095f565b9250508190555061047a565b5f5f5f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054905081811015610435578381836040517fe450d38c00000000000000000000000000000000000000000000000000000000815260040161042c939291906109a1565b60405180910390fd5b8181035f5f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081905550505b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036104c1578060025f828254039250508190555061050b565b805f5f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f82825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161056891906109d6565b60405180910390a3505050565b5f5ffd5b5f819050919050565b61058b81610579565b8114610595575f5ffd5b50565b5f815190506105a681610582565b92915050565b5f602082840312156105c1576105c0610575565b5b5f6105ce84828501610598565b91505092915050565b5f81519050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f600282049050600182168061065257607f821691505b6020821081036106655761066461060e565b5b50919050565b5f819050815f5260205f209050919050565b5f6020601f8301049050919050565b5f82821b905092915050565b5f600883026106c77fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8261068c565b6106d1868361068c565b95508019841693508086168417925050509392505050565b5f819050919050565b5f61070c61070761070284610579565b6106e9565b610579565b9050919050565b5f819050919050565b610725836106f2565b61073961073182610713565b848454610698565b825550505050565b5f5f905090565b610750610741565b61075b81848461071c565b505050565b5b8181101561077e576107735f82610748565b600181019050610761565b5050565b601f8211156107c3576107948161066b565b61079d8461067d565b810160208510156107ac578190505b6107c06107b88561067d565b830182610760565b50505b505050565b5f82821c905092915050565b5f6107e35f19846008026107c8565b1980831691505092915050565b5f6107fb83836107d4565b9150826002028217905092915050565b610814826105d7565b67ffffffffffffffff81111561082d5761082c6105e1565b5b610837825461063b565b610842828285610782565b5f60209050601f831160018114610873575f8415610861578287015190505b61086b85826107f0565b8655506108d2565b601f1984166108818661066b565b5f5b828110156108a857848901518255600182019150602085019450602081019050610883565b868310156108c557848901516108c1601f8916826107d4565b8355505b6001600288020188555050505b505050505050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610903826108da565b9050919050565b610913816108f9565b82525050565b5f60208201905061092c5f83018461090a565b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f61096982610579565b915061097483610579565b925082820190508082111561098c5761098b610932565b5b92915050565b61099b81610579565b82525050565b5f6060820190506109b45f83018661090a565b6109c16020830185610992565b6109ce6040830184610992565b949350505050565b5f6020820190506109e95f830184610992565b92915050565b611c00806109fc5f395ff3fe60806040526004361061013f575f3560e01c8063715018a6116100b5578063a9059cbb1161006e578063a9059cbb14610447578063d0e30db014610483578063d0ebdbe71461048d578063dd62ed3e146104b5578063f2fde38b146104f1578063f3ae2415146105195761013f565b8063715018a61461035157806374a8f103146103675780638da5cb5b1461038f5780639015d371146103b957806395d89b41146103f55780639dc29fac1461041f5761013f565b806323b872dd1161010757806323b872dd1461022357806324d7806c1461025f578063313ce5671461029b57806340c10f19146102c5578063704b6c02146102ed57806370a08231146103155761013f565b80630356b6cd1461014357806306fdde031461016b578063095ea7b3146101955780630aaf7043146101d157806318160ddd146101f9575b5f5ffd5b34801561014e575f5ffd5b5061016960048036038101906101649190611747565b610555565b005b348015610176575f5ffd5b5061017f61064e565b60405161018c91906117e2565b60405180910390f35b3480156101a0575f5ffd5b506101bb60048036038101906101b6919061185c565b6106de565b6040516101c891906118b4565b60405180910390f35b3480156101dc575f5ffd5b506101f760048036038101906101f291906118cd565b610700565b005b348015610204575f5ffd5b5061020d610714565b60405161021a9190611907565b60405180910390f35b34801561022e575f5ffd5b5061024960048036038101906102449190611920565b61071d565b60405161025691906118b4565b60405180910390f35b34801561026a575f5ffd5b50610285600480360381019061028091906118cd565b61074b565b60405161029291906118b4565b60405180910390f35b3480156102a6575f5ffd5b506102af6107f4565b6040516102bc919061198b565b60405180910390f35b3480156102d0575f5ffd5b506102eb60048036038101906102e6919061185c565b6107fc565b005b3480156102f8575f5ffd5b50610313600480360381019061030e91906118cd565b610812565b005b348015610320575f5ffd5b5061033b600480360381019061033691906118cd565b610826565b6040516103489190611907565b60405180910390f35b34801561035c575f5ffd5b5061036561086b565b005b348015610372575f5ffd5b5061038d600480360381019061038891906118cd565b61087e565b005b34801561039a575f5ffd5b506103a3610892565b6040516103b091906119b3565b60405180910390f35b3480156103c4575f5ffd5b506103df60048036038101906103da91906118cd565b6108ba565b6040516103ec91906118b4565b60405180910390f35b348015610400575f5ffd5b50610409610963565b60405161041691906117e2565b60405180910390f35b34801561042a575f5ffd5b506104456004803603810190610440919061185c565b6109f3565b005b348015610452575f5ffd5b5061046d6004803603810190610468919061185c565b610a09565b60405161047a91906118b4565b60405180910390f35b61048b610a2b565b005b348015610498575f5ffd5b506104b360048036038101906104ae91906118cd565b610aeb565b005b3480156104c0575f5ffd5b506104db60048036038101906104d691906119cc565b610aff565b6040516104e89190611907565b60405180910390f35b3480156104fc575f5ffd5b50610517600480360381019061051291906118cd565b610b81565b005b348015610524575f5ffd5b5061053f600480360381019061053a91906118cd565b610c05565b60405161054c91906118b4565b60405180910390f35b610566610560610cae565b82610cb5565b60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634f5aaaba6105ab610cae565b836040518363ffffffff1660e01b81526004016105c9929190611a0a565b5f604051808303815f87803b1580156105e0575f5ffd5b505af11580156105f2573d5f5f3e3d5ffd5b505050506105fe610cae565b73ffffffffffffffffffffffffffffffffffffffff167f25bedde6c8ebd3a89b719a16299dbfe271c7bffa42fe1ac1a52e15ab0cb767e6826040516106439190611907565b60405180910390a250565b60606003805461065d90611a5e565b80601f016020809104026020016040519081016040528092919081815260200182805461068990611a5e565b80156106d45780601f106106ab576101008083540402835291602001916106d4565b820191905f5260205f20905b8154815290600101906020018083116106b757829003601f168201915b5050505050905090565b5f5f6106e8610cae565b90506106f5818585610d34565b600191505092915050565b610708610d46565b61071181610dcd565b50565b5f600254905090565b5f5f610727610cae565b9050610734858285610e57565b61073f858585610eea565b60019150509392505050565b5f5f60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b81526004016107a791906119b3565b602060405180830381865afa1580156107c2573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107e69190611aa2565b905060028114915050919050565b5f6012905090565b610804610d46565b61080e8282610fda565b5050565b61081a610d46565b61082381611059565b50565b5f5f5f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050919050565b610873610d46565b61087c5f6110e3565b565b610886610d46565b61088f816111a6565b50565b5f60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b5f5f60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b815260040161091691906119b3565b602060405180830381865afa158015610931573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109559190611aa2565b90505f811415915050919050565b60606004805461097290611a5e565b80601f016020809104026020016040519081016040528092919081815260200182805461099e90611a5e565b80156109e95780601f106109c0576101008083540402835291602001916109e9565b820191905f5260205f20905b8154815290600101906020018083116109cc57829003601f168201915b5050505050905090565b6109fb610d46565b610a058282610cb5565b5050565b5f5f610a13610cae565b9050610a20818585610eea565b600191505092915050565b73010000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166108fc3490811502906040515f60405180830381858888f19350505050158015610a82573d5f5f3e3d5ffd5b50610a94610a8e610cae565b34610fda565b610a9c610cae565b73ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c34604051610ae19190611907565b60405180910390a2565b610af3610d46565b610afc8161129e565b50565b5f60015f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054905092915050565b610b89610d46565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610bf9575f6040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401610bf091906119b3565b60405180910390fd5b610c02816110e3565b50565b5f5f60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b8152600401610c6191906119b3565b602060405180830381865afa158015610c7c573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610ca09190611aa2565b905060038114915050919050565b5f33905090565b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610d25575f6040517f96c6fd1e000000000000000000000000000000000000000000000000000000008152600401610d1c91906119b3565b60405180910390fd5b610d30825f83611328565b5050565b610d418383836001611541565b505050565b610d4e610cae565b73ffffffffffffffffffffffffffffffffffffffff16610d6c610892565b73ffffffffffffffffffffffffffffffffffffffff1614610dcb57610d8f610cae565b6040517f118cdaa7000000000000000000000000000000000000000000000000000000008152600401610dc291906119b3565b60405180910390fd5b565b60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630aaf7043826040518263ffffffff1660e01b8152600401610e2791906119b3565b5f604051808303815f87803b158015610e3e575f5ffd5b505af1158015610e50573d5f5f3e3d5ffd5b5050505050565b5f610e628484610aff565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811015610ee45781811015610ed5578281836040517ffb8f41b2000000000000000000000000000000000000000000000000000000008152600401610ecc93929190611acd565b60405180910390fd5b610ee384848484035f611541565b5b50505050565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610f5a575f6040517f96c6fd1e000000000000000000000000000000000000000000000000000000008152600401610f5191906119b3565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610fca575f6040517fec442f05000000000000000000000000000000000000000000000000000000008152600401610fc191906119b3565b60405180910390fd5b610fd5838383611328565b505050565b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361104a575f6040517fec442f0500000000000000000000000000000000000000000000000000000000815260040161104191906119b3565b60405180910390fd5b6110555f8383611328565b5050565b60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663704b6c02826040518263ffffffff1660e01b81526004016110b391906119b3565b5f604051808303815f87803b1580156110ca575f5ffd5b505af11580156110dc573d5f5f3e3d5ffd5b5050505050565b5f60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508160055f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b8073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1603611214576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161120b90611b4c565b60405180910390fd5b60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638c6bfb3b826040518263ffffffff1660e01b815260040161126e91906119b3565b5f604051808303815f87803b158015611285575f5ffd5b505af1158015611297573d5f5f3e3d5ffd5b5050505050565b60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0ebdbe7826040518263ffffffff1660e01b81526004016112f891906119b3565b5f604051808303815f87803b15801561130f575f5ffd5b505af1158015611321573d5f5f3e3d5ffd5b5050505050565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611378578060025f82825461136c9190611b97565b92505081905550611446565b5f5f5f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054905081811015611401578381836040517fe450d38c0000000000000000000000000000000000000000000000000000000081526004016113f893929190611acd565b60405180910390fd5b8181035f5f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081905550505b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361148d578060025f82825403925050819055506114d7565b805f5f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f82825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516115349190611907565b60405180910390a3505050565b5f73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16036115b1575f6040517fe602df050000000000000000000000000000000000000000000000000000000081526004016115a891906119b3565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611621575f6040517f94280d6200000000000000000000000000000000000000000000000000000000815260040161161891906119b3565b60405180910390fd5b8160015f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081905550801561170a578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516117019190611907565b60405180910390a35b50505050565b5f5ffd5b5f819050919050565b61172681611714565b8114611730575f5ffd5b50565b5f813590506117418161171d565b92915050565b5f6020828403121561175c5761175b611710565b5b5f61176984828501611733565b91505092915050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f6117b482611772565b6117be818561177c565b93506117ce81856020860161178c565b6117d78161179a565b840191505092915050565b5f6020820190508181035f8301526117fa81846117aa565b905092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61182b82611802565b9050919050565b61183b81611821565b8114611845575f5ffd5b50565b5f8135905061185681611832565b92915050565b5f5f6040838503121561187257611871611710565b5b5f61187f85828601611848565b925050602061189085828601611733565b9150509250929050565b5f8115159050919050565b6118ae8161189a565b82525050565b5f6020820190506118c75f8301846118a5565b92915050565b5f602082840312156118e2576118e1611710565b5b5f6118ef84828501611848565b91505092915050565b61190181611714565b82525050565b5f60208201905061191a5f8301846118f8565b92915050565b5f5f5f6060848603121561193757611936611710565b5b5f61194486828701611848565b935050602061195586828701611848565b925050604061196686828701611733565b9150509250925092565b5f60ff82169050919050565b61198581611970565b82525050565b5f60208201905061199e5f83018461197c565b92915050565b6119ad81611821565b82525050565b5f6020820190506119c65f8301846119a4565b92915050565b5f5f604083850312156119e2576119e1611710565b5b5f6119ef85828601611848565b9250506020611a0085828601611848565b9150509250929050565b5f604082019050611a1d5f8301856119a4565b611a2a60208301846118f8565b9392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f6002820490506001821680611a7557607f821691505b602082108103611a8857611a87611a31565b5b50919050565b5f81519050611a9c8161171d565b92915050565b5f60208284031215611ab757611ab6611710565b5b5f611ac484828501611a8e565b91505092915050565b5f606082019050611ae05f8301866119a4565b611aed60208301856118f8565b611afa60408301846118f8565b949350505050565b7f63616e6e6f74207265766f6b65206f776e20726f6c65000000000000000000005f82015250565b5f611b3660168361177c565b9150611b4182611b02565b602082019050919050565b5f6020820190508181035f830152611b6381611b2a565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f611ba182611714565b9150611bac83611714565b9250828201905080821115611bc457611bc3611b6a565b5b9291505056fea2646970667358221220f76c7bc6e0d3f56db1310dc16849d733f6fb6e8733690529fc043dbb68bfde6d64736f6c634300081e0033", + Bin: "0x6080604052730200000000000000000000000000000000000001600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555034801561006557600080fd5b5060405161270c38038061270c833981810160405281019061008791906105c8565b730200000000000000000000000000000000000001336040518060400160405280601681526020017f45524332304e61746976654d696e746572546f6b656e000000000000000000008152506040518060400160405280600481526020017f584d504c000000000000000000000000000000000000000000000000000000008152508160039081610118919061083b565b508060049081610128919061083b565b505050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361019d5760006040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401610194919061094e565b60405180910390fd5b6101ac8161021260201b60201c565b5080600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505061020c6102006102d860201b60201c565b826102e060201b60201c565b50610a2d565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036103525760006040517fec442f05000000000000000000000000000000000000000000000000000000008152600401610349919061094e565b60405180910390fd5b6103646000838361036860201b60201c565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036103ba5780600260008282546103ae9190610998565b9250508190555061048d565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610446578381836040517fe450d38c00000000000000000000000000000000000000000000000000000000815260040161043d939291906109db565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036104d65780600260008282540392505081905550610523565b806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516105809190610a12565b60405180910390a3505050565b600080fd5b6000819050919050565b6105a581610592565b81146105b057600080fd5b50565b6000815190506105c28161059c565b92915050565b6000602082840312156105de576105dd61058d565b5b60006105ec848285016105b3565b91505092915050565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061067657607f821691505b6020821081036106895761068861062f565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026106f17fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826106b4565b6106fb86836106b4565b95508019841693508086168417925050509392505050565b6000819050919050565b600061073861073361072e84610592565b610713565b610592565b9050919050565b6000819050919050565b6107528361071d565b61076661075e8261073f565b8484546106c1565b825550505050565b600090565b61077b61076e565b610786818484610749565b505050565b5b818110156107aa5761079f600082610773565b60018101905061078c565b5050565b601f8211156107ef576107c08161068f565b6107c9846106a4565b810160208510156107d8578190505b6107ec6107e4856106a4565b83018261078b565b50505b505050565b600082821c905092915050565b6000610812600019846008026107f4565b1980831691505092915050565b600061082b8383610801565b9150826002028217905092915050565b610844826105f5565b67ffffffffffffffff81111561085d5761085c610600565b5b610867825461065e565b6108728282856107ae565b600060209050601f8311600181146108a55760008415610893578287015190505b61089d858261081f565b865550610905565b601f1984166108b38661068f565b60005b828110156108db578489015182556001820191506020850194506020810190506108b6565b868310156108f857848901516108f4601f891682610801565b8355505b6001600288020188555050505b505050505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006109388261090d565b9050919050565b6109488161092d565b82525050565b6000602082019050610963600083018461093f565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006109a382610592565b91506109ae83610592565b92508282019050808211156109c6576109c5610969565b5b92915050565b6109d581610592565b82525050565b60006060820190506109f0600083018661093f565b6109fd60208301856109cc565b610a0a60408301846109cc565b949350505050565b6000602082019050610a2760008301846109cc565b92915050565b611cd080610a3c6000396000f3fe6080604052600436106101405760003560e01c8063715018a6116100b6578063a9059cbb1161006f578063a9059cbb1461045a578063d0e30db014610497578063d0ebdbe7146104a1578063dd62ed3e146104ca578063f2fde38b14610507578063f3ae24151461053057610140565b8063715018a61461035e57806374a8f103146103755780638da5cb5b1461039e5780639015d371146103c957806395d89b41146104065780639dc29fac1461043157610140565b806323b872dd1161010857806323b872dd1461022a57806324d7806c14610267578063313ce567146102a457806340c10f19146102cf578063704b6c02146102f857806370a082311461032157610140565b80630356b6cd1461014557806306fdde031461016e578063095ea7b3146101995780630aaf7043146101d657806318160ddd146101ff575b600080fd5b34801561015157600080fd5b5061016c600480360381019061016791906117cb565b61056d565b005b34801561017a57600080fd5b5061018361066c565b6040516101909190611888565b60405180910390f35b3480156101a557600080fd5b506101c060048036038101906101bb9190611908565b6106fe565b6040516101cd9190611963565b60405180910390f35b3480156101e257600080fd5b506101fd60048036038101906101f8919061197e565b610721565b005b34801561020b57600080fd5b50610214610735565b60405161022191906119ba565b60405180910390f35b34801561023657600080fd5b50610251600480360381019061024c91906119d5565b61073f565b60405161025e9190611963565b60405180910390f35b34801561027357600080fd5b5061028e6004803603810190610289919061197e565b61076e565b60405161029b9190611963565b60405180910390f35b3480156102b057600080fd5b506102b961081b565b6040516102c69190611a44565b60405180910390f35b3480156102db57600080fd5b506102f660048036038101906102f19190611908565b610824565b005b34801561030457600080fd5b5061031f600480360381019061031a919061197e565b61083a565b005b34801561032d57600080fd5b506103486004803603810190610343919061197e565b61084e565b60405161035591906119ba565b60405180910390f35b34801561036a57600080fd5b50610373610896565b005b34801561038157600080fd5b5061039c6004803603810190610397919061197e565b6108aa565b005b3480156103aa57600080fd5b506103b36108be565b6040516103c09190611a6e565b60405180910390f35b3480156103d557600080fd5b506103f060048036038101906103eb919061197e565b6108e8565b6040516103fd9190611963565b60405180910390f35b34801561041257600080fd5b5061041b610996565b6040516104289190611888565b60405180910390f35b34801561043d57600080fd5b5061045860048036038101906104539190611908565b610a28565b005b34801561046657600080fd5b50610481600480360381019061047c9190611908565b610a3e565b60405161048e9190611963565b60405180910390f35b61049f610a61565b005b3480156104ad57600080fd5b506104c860048036038101906104c3919061197e565b610b24565b005b3480156104d657600080fd5b506104f160048036038101906104ec9190611a89565b610b38565b6040516104fe91906119ba565b60405180910390f35b34801561051357600080fd5b5061052e6004803603810190610529919061197e565b610bbf565b005b34801561053c57600080fd5b506105576004803603810190610552919061197e565b610c45565b6040516105649190611963565b60405180910390f35b61057e610578610cf2565b82610cfa565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634f5aaaba6105c4610cf2565b836040518363ffffffff1660e01b81526004016105e2929190611ac9565b600060405180830381600087803b1580156105fc57600080fd5b505af1158015610610573d6000803e3d6000fd5b5050505061061c610cf2565b73ffffffffffffffffffffffffffffffffffffffff167f25bedde6c8ebd3a89b719a16299dbfe271c7bffa42fe1ac1a52e15ab0cb767e68260405161066191906119ba565b60405180910390a250565b60606003805461067b90611b21565b80601f01602080910402602001604051908101604052809291908181526020018280546106a790611b21565b80156106f45780601f106106c9576101008083540402835291602001916106f4565b820191906000526020600020905b8154815290600101906020018083116106d757829003601f168201915b5050505050905090565b600080610709610cf2565b9050610716818585610d7c565b600191505092915050565b610729610d8e565b61073281610e15565b50565b6000600254905090565b60008061074a610cf2565b9050610757858285610ea5565b610762858585610f3a565b60019150509392505050565b600080600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b81526004016107cc9190611a6e565b602060405180830381865afa1580156107e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061080d9190611b67565b905060028114915050919050565b60006012905090565b61082c610d8e565b610836828261102e565b5050565b610842610d8e565b61084b816110b0565b50565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61089e610d8e565b6108a86000611140565b565b6108b2610d8e565b6108bb81611206565b50565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b81526004016109469190611a6e565b602060405180830381865afa158015610963573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109879190611b67565b90506000811415915050919050565b6060600480546109a590611b21565b80601f01602080910402602001604051908101604052809291908181526020018280546109d190611b21565b8015610a1e5780601f106109f357610100808354040283529160200191610a1e565b820191906000526020600020905b815481529060010190602001808311610a0157829003601f168201915b5050505050905090565b610a30610d8e565b610a3a8282610cfa565b5050565b600080610a49610cf2565b9050610a56818585610f3a565b600191505092915050565b73010000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015610abb573d6000803e3d6000fd5b50610acd610ac7610cf2565b3461102e565b610ad5610cf2565b73ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c34604051610b1a91906119ba565b60405180910390a2565b610b2c610d8e565b610b3581611304565b50565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610bc7610d8e565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610c395760006040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401610c309190611a6e565b60405180910390fd5b610c4281611140565b50565b600080600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b8152600401610ca39190611a6e565b602060405180830381865afa158015610cc0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ce49190611b67565b905060038114915050919050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610d6c5760006040517f96c6fd1e000000000000000000000000000000000000000000000000000000008152600401610d639190611a6e565b60405180910390fd5b610d7882600083611394565b5050565b610d8983838360016115b9565b505050565b610d96610cf2565b73ffffffffffffffffffffffffffffffffffffffff16610db46108be565b73ffffffffffffffffffffffffffffffffffffffff1614610e1357610dd7610cf2565b6040517f118cdaa7000000000000000000000000000000000000000000000000000000008152600401610e0a9190611a6e565b60405180910390fd5b565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630aaf7043826040518263ffffffff1660e01b8152600401610e709190611a6e565b600060405180830381600087803b158015610e8a57600080fd5b505af1158015610e9e573d6000803e3d6000fd5b5050505050565b6000610eb18484610b38565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811015610f345781811015610f24578281836040517ffb8f41b2000000000000000000000000000000000000000000000000000000008152600401610f1b93929190611b94565b60405180910390fd5b610f33848484840360006115b9565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610fac5760006040517f96c6fd1e000000000000000000000000000000000000000000000000000000008152600401610fa39190611a6e565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361101e5760006040517fec442f050000000000000000000000000000000000000000000000000000000081526004016110159190611a6e565b60405180910390fd5b611029838383611394565b505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036110a05760006040517fec442f050000000000000000000000000000000000000000000000000000000081526004016110979190611a6e565b60405180910390fd5b6110ac60008383611394565b5050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663704b6c02826040518263ffffffff1660e01b815260040161110b9190611a6e565b600060405180830381600087803b15801561112557600080fd5b505af1158015611139573d6000803e3d6000fd5b5050505050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b8073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1603611274576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161126b90611c17565b60405180910390fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638c6bfb3b826040518263ffffffff1660e01b81526004016112cf9190611a6e565b600060405180830381600087803b1580156112e957600080fd5b505af11580156112fd573d6000803e3d6000fd5b5050505050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0ebdbe7826040518263ffffffff1660e01b815260040161135f9190611a6e565b600060405180830381600087803b15801561137957600080fd5b505af115801561138d573d6000803e3d6000fd5b5050505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036113e65780600260008282546113da9190611c66565b925050819055506114b9565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611472578381836040517fe450d38c00000000000000000000000000000000000000000000000000000000815260040161146993929190611b94565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611502578060026000828254039250508190555061154f565b806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516115ac91906119ba565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff160361162b5760006040517fe602df050000000000000000000000000000000000000000000000000000000081526004016116229190611a6e565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361169d5760006040517f94280d620000000000000000000000000000000000000000000000000000000081526004016116949190611a6e565b60405180910390fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550801561178a578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405161178191906119ba565b60405180910390a35b50505050565b600080fd5b6000819050919050565b6117a881611795565b81146117b357600080fd5b50565b6000813590506117c58161179f565b92915050565b6000602082840312156117e1576117e0611790565b5b60006117ef848285016117b6565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611832578082015181840152602081019050611817565b60008484015250505050565b6000601f19601f8301169050919050565b600061185a826117f8565b6118648185611803565b9350611874818560208601611814565b61187d8161183e565b840191505092915050565b600060208201905081810360008301526118a2818461184f565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006118d5826118aa565b9050919050565b6118e5816118ca565b81146118f057600080fd5b50565b600081359050611902816118dc565b92915050565b6000806040838503121561191f5761191e611790565b5b600061192d858286016118f3565b925050602061193e858286016117b6565b9150509250929050565b60008115159050919050565b61195d81611948565b82525050565b60006020820190506119786000830184611954565b92915050565b60006020828403121561199457611993611790565b5b60006119a2848285016118f3565b91505092915050565b6119b481611795565b82525050565b60006020820190506119cf60008301846119ab565b92915050565b6000806000606084860312156119ee576119ed611790565b5b60006119fc868287016118f3565b9350506020611a0d868287016118f3565b9250506040611a1e868287016117b6565b9150509250925092565b600060ff82169050919050565b611a3e81611a28565b82525050565b6000602082019050611a596000830184611a35565b92915050565b611a68816118ca565b82525050565b6000602082019050611a836000830184611a5f565b92915050565b60008060408385031215611aa057611a9f611790565b5b6000611aae858286016118f3565b9250506020611abf858286016118f3565b9150509250929050565b6000604082019050611ade6000830185611a5f565b611aeb60208301846119ab565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680611b3957607f821691505b602082108103611b4c57611b4b611af2565b5b50919050565b600081519050611b618161179f565b92915050565b600060208284031215611b7d57611b7c611790565b5b6000611b8b84828501611b52565b91505092915050565b6000606082019050611ba96000830186611a5f565b611bb660208301856119ab565b611bc360408301846119ab565b949350505050565b7f63616e6e6f74207265766f6b65206f776e20726f6c6500000000000000000000600082015250565b6000611c01601683611803565b9150611c0c82611bcb565b602082019050919050565b60006020820190508181036000830152611c3081611bf4565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611c7182611795565b9150611c7c83611795565b9250828201905080821115611c9457611c93611c37565b5b9291505056fea26469706673582212205b03965b7e7a93066f2f299f420eabaf901243558086de2b6d6882835d4bb40264736f6c634300081e0033", } // ERC20NativeMinterABI is the input ABI used to generate the binding from. diff --git a/contracts/bindings/exampledeployerlist.go b/contracts/bindings/exampledeployerlist.go index 9ebbdfc963..7b8f98f4e2 100644 --- a/contracts/bindings/exampledeployerlist.go +++ b/contracts/bindings/exampledeployerlist.go @@ -32,7 +32,7 @@ var ( // ExampleDeployerListMetaData contains all meta data concerning the ExampleDeployerList contract. var ExampleDeployerListMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"OwnableInvalidOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"OwnableUnauthorizedAccount\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"deployContract\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"isAdmin\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"isEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"isManager\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"revoke\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setEnabled\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x608060405234801561000f575f5ffd5b50730200000000000000000000000000000000000000335f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610096575f6040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260040161008d91906101ec565b60405180910390fd5b6100a5816100ec60201b60201c565b508060015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610205565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6101d6826101ad565b9050919050565b6101e6816101cc565b82525050565b5f6020820190506101ff5f8301846101dd565b92915050565b610b64806102125f395ff3fe608060405234801561000f575f5ffd5b50600436106100a7575f3560e01c806374a8f1031161006f57806374a8f103146101275780638da5cb5b146101435780639015d37114610161578063d0ebdbe714610191578063f2fde38b146101ad578063f3ae2415146101c9576100a7565b80630aaf7043146100ab57806324d7806c146100c75780636cd5c39b146100f7578063704b6c0214610101578063715018a61461011d575b5f5ffd5b6100c560048036038101906100c0919061097a565b6101f9565b005b6100e160048036038101906100dc919061097a565b61020d565b6040516100ee91906109bf565b60405180910390f35b6100ff6102b6565b005b61011b6004803603810190610116919061097a565b6102df565b005b6101256102f3565b005b610141600480360381019061013c919061097a565b610306565b005b61014b61031a565b60405161015891906109e7565b60405180910390f35b61017b6004803603810190610176919061097a565b610341565b60405161018891906109bf565b60405180910390f35b6101ab60048036038101906101a6919061097a565b6103ea565b005b6101c760048036038101906101c2919061097a565b6103fe565b005b6101e360048036038101906101de919061097a565b610482565b6040516101f091906109bf565b60405180910390f35b61020161052b565b61020a816105b2565b50565b5f5f60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b815260040161026991906109e7565b602060405180830381865afa158015610284573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906102a89190610a33565b905060028114915050919050565b6040516102c290610910565b604051809103905ff0801580156102db573d5f5f3e3d5ffd5b5050565b6102e761052b565b6102f08161063c565b50565b6102fb61052b565b6103045f6106c6565b565b61030e61052b565b61031781610787565b50565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b5f5f60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b815260040161039d91906109e7565b602060405180830381865afa1580156103b8573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103dc9190610a33565b90505f811415915050919050565b6103f261052b565b6103fb8161087f565b50565b61040661052b565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610476575f6040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260040161046d91906109e7565b60405180910390fd5b61047f816106c6565b50565b5f5f60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b81526004016104de91906109e7565b602060405180830381865afa1580156104f9573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061051d9190610a33565b905060038114915050919050565b610533610909565b73ffffffffffffffffffffffffffffffffffffffff1661055161031a565b73ffffffffffffffffffffffffffffffffffffffff16146105b057610574610909565b6040517f118cdaa70000000000000000000000000000000000000000000000000000000081526004016105a791906109e7565b60405180910390fd5b565b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630aaf7043826040518263ffffffff1660e01b815260040161060c91906109e7565b5f604051808303815f87803b158015610623575f5ffd5b505af1158015610635573d5f5f3e3d5ffd5b5050505050565b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663704b6c02826040518263ffffffff1660e01b815260040161069691906109e7565b5f604051808303815f87803b1580156106ad575f5ffd5b505af11580156106bf573d5f5f3e3d5ffd5b5050505050565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b8073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16036107f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107ec90610ab8565b60405180910390fd5b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638c6bfb3b826040518263ffffffff1660e01b815260040161084f91906109e7565b5f604051808303815f87803b158015610866575f5ffd5b505af1158015610878573d5f5f3e3d5ffd5b5050505050565b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0ebdbe7826040518263ffffffff1660e01b81526004016108d991906109e7565b5f604051808303815f87803b1580156108f0575f5ffd5b505af1158015610902573d5f5f3e3d5ffd5b5050505050565b5f33905090565b605880610ad783390190565b5f5ffd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61094982610920565b9050919050565b6109598161093f565b8114610963575f5ffd5b50565b5f8135905061097481610950565b92915050565b5f6020828403121561098f5761098e61091c565b5b5f61099c84828501610966565b91505092915050565b5f8115159050919050565b6109b9816109a5565b82525050565b5f6020820190506109d25f8301846109b0565b92915050565b6109e18161093f565b82525050565b5f6020820190506109fa5f8301846109d8565b92915050565b5f819050919050565b610a1281610a00565b8114610a1c575f5ffd5b50565b5f81519050610a2d81610a09565b92915050565b5f60208284031215610a4857610a4761091c565b5b5f610a5584828501610a1f565b91505092915050565b5f82825260208201905092915050565b7f63616e6e6f74207265766f6b65206f776e20726f6c65000000000000000000005f82015250565b5f610aa2601683610a5e565b9150610aad82610a6e565b602082019050919050565b5f6020820190508181035f830152610acf81610a96565b905091905056fe6080604052348015600e575f5ffd5b50603e80601a5f395ff3fe60806040525f5ffdfea26469706673582212204ec2f544eb3d0b4a6bcccfa4c97034822a41b9ca5dfa8d5e912e6b754703f83e64736f6c634300081e0033a264697066735822122074e0033a5890b8801c03002726986741e86eab5032987b4e0f9870b018b50f4764736f6c634300081e0033", + Bin: "0x608060405234801561001057600080fd5b5073020000000000000000000000000000000000000033600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036100995760006040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260040161009091906101f5565b60405180910390fd5b6100a8816100f060201b60201c565b5080600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610210565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006101df826101b4565b9050919050565b6101ef816101d4565b82525050565b600060208201905061020a60008301846101e6565b92915050565b610bb28061021f6000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c806374a8f1031161007157806374a8f1031461012a5780638da5cb5b146101465780639015d37114610164578063d0ebdbe714610194578063f2fde38b146101b0578063f3ae2415146101cc576100a9565b80630aaf7043146100ae57806324d7806c146100ca5780636cd5c39b146100fa578063704b6c0214610104578063715018a614610120575b600080fd5b6100c860048036038101906100c391906109b3565b6101fc565b005b6100e460048036038101906100df91906109b3565b610210565b6040516100f191906109fb565b60405180910390f35b6101026102bd565b005b61011e600480360381019061011991906109b3565b6102e9565b005b6101286102fd565b005b610144600480360381019061013f91906109b3565b610311565b005b61014e610325565b60405161015b9190610a25565b60405180910390f35b61017e600480360381019061017991906109b3565b61034e565b60405161018b91906109fb565b60405180910390f35b6101ae60048036038101906101a991906109b3565b6103fc565b005b6101ca60048036038101906101c591906109b3565b610410565b005b6101e660048036038101906101e191906109b3565b610496565b6040516101f391906109fb565b60405180910390f35b610204610543565b61020d816105ca565b50565b600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b815260040161026e9190610a25565b602060405180830381865afa15801561028b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102af9190610a76565b905060028114915050919050565b6040516102c990610944565b604051809103906000f0801580156102e5573d6000803e3d6000fd5b5050565b6102f1610543565b6102fa8161065a565b50565b610305610543565b61030f60006106ea565b565b610319610543565b610322816107ae565b50565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b81526004016103ac9190610a25565b602060405180830381865afa1580156103c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ed9190610a76565b90506000811415915050919050565b610404610543565b61040d816108ac565b50565b610418610543565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361048a5760006040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016104819190610a25565b60405180910390fd5b610493816106ea565b50565b600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b81526004016104f49190610a25565b602060405180830381865afa158015610511573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105359190610a76565b905060038114915050919050565b61054b61093c565b73ffffffffffffffffffffffffffffffffffffffff16610569610325565b73ffffffffffffffffffffffffffffffffffffffff16146105c85761058c61093c565b6040517f118cdaa70000000000000000000000000000000000000000000000000000000081526004016105bf9190610a25565b60405180910390fd5b565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630aaf7043826040518263ffffffff1660e01b81526004016106259190610a25565b600060405180830381600087803b15801561063f57600080fd5b505af1158015610653573d6000803e3d6000fd5b5050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663704b6c02826040518263ffffffff1660e01b81526004016106b59190610a25565b600060405180830381600087803b1580156106cf57600080fd5b505af11580156106e3573d6000803e3d6000fd5b5050505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b8073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff160361081c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081390610b00565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638c6bfb3b826040518263ffffffff1660e01b81526004016108779190610a25565b600060405180830381600087803b15801561089157600080fd5b505af11580156108a5573d6000803e3d6000fd5b5050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0ebdbe7826040518263ffffffff1660e01b81526004016109079190610a25565b600060405180830381600087803b15801561092157600080fd5b505af1158015610935573d6000803e3d6000fd5b5050505050565b600033905090565b605c80610b2183390190565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061098082610955565b9050919050565b61099081610975565b811461099b57600080fd5b50565b6000813590506109ad81610987565b92915050565b6000602082840312156109c9576109c8610950565b5b60006109d78482850161099e565b91505092915050565b60008115159050919050565b6109f5816109e0565b82525050565b6000602082019050610a1060008301846109ec565b92915050565b610a1f81610975565b82525050565b6000602082019050610a3a6000830184610a16565b92915050565b6000819050919050565b610a5381610a40565b8114610a5e57600080fd5b50565b600081519050610a7081610a4a565b92915050565b600060208284031215610a8c57610a8b610950565b5b6000610a9a84828501610a61565b91505092915050565b600082825260208201905092915050565b7f63616e6e6f74207265766f6b65206f776e20726f6c6500000000000000000000600082015250565b6000610aea601683610aa3565b9150610af582610ab4565b602082019050919050565b60006020820190508181036000830152610b1981610add565b905091905056fe6080604052348015600f57600080fd5b50603f80601d6000396000f3fe6080604052600080fdfea264697066735822122069b6656651a58124f30beea03a2936b1ac592f451971d5486291855cc20b368164736f6c634300081e0033a264697066735822122022245ddf40ed279b85e3812214e6c9bbbb40bae5c111392922b6cb291569426864736f6c634300081e0033", } // ExampleDeployerListABI is the input ABI used to generate the binding from. diff --git a/contracts/bindings/examplefeemanager.go b/contracts/bindings/examplefeemanager.go index 81b4253ff9..afd8a38379 100644 --- a/contracts/bindings/examplefeemanager.go +++ b/contracts/bindings/examplefeemanager.go @@ -44,7 +44,7 @@ type FeeConfig struct { // ExampleFeeManagerMetaData contains all meta data concerning the ExampleFeeManager contract. var ExampleFeeManagerMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"OwnableInvalidOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"OwnableUnauthorizedAccount\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"enableCChainFees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"targetBlockRate\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minBaseFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"targetGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"baseFeeChangeDenominator\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minBlockGasCost\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxBlockGasCost\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockGasCostStep\",\"type\":\"uint256\"}],\"internalType\":\"structFeeConfig\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"enableCustomFees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"enableWAGMIFees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCurrentFeeConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"targetBlockRate\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minBaseFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"targetGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"baseFeeChangeDenominator\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minBlockGasCost\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxBlockGasCost\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockGasCostStep\",\"type\":\"uint256\"}],\"internalType\":\"structFeeConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getFeeConfigLastChangedAt\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"isAdmin\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"isEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"isManager\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"revoke\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setEnabled\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x608060405273020000000000000000000000000000000000000360025f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550348015610063575f5ffd5b50730200000000000000000000000000000000000003335f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036100ea575f6040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016100e19190610240565b60405180910390fd5b6100f98161014060201b60201c565b508060015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610259565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61022a82610201565b9050919050565b61023a81610220565b82525050565b5f6020820190506102535f830184610231565b92915050565b611449806102665f395ff3fe608060405234801561000f575f5ffd5b50600436106100f3575f3560e01c806374a8f103116100955780639e05549a116100645780639e05549a14610221578063d0ebdbe71461023f578063f2fde38b1461025b578063f3ae241514610277576100f3565b806374a8f103146101ad57806385c1b4ac146101c95780638da5cb5b146101d35780639015d371146101f1576100f3565b806352965cfc116100d157806352965cfc146101615780636f0edc9d1461017d578063704b6c0214610187578063715018a6146101a3576100f3565b80630aaf7043146100f757806324d7806c1461011357806341f5772814610143575b5f5ffd5b610111600480360381019061010c9190610e9e565b6102a7565b005b61012d60048036038101906101289190610e9e565b6102bb565b60405161013a9190610ee3565b60405180910390f35b61014b610364565b6040516101589190610fb4565b60405180910390f35b61017b6004803603810190610176919061114b565b610451565b005b610185610550565b005b6101a1600480360381019061019c9190610e9e565b610643565b005b6101ab610657565b005b6101c760048036038101906101c29190610e9e565b61066a565b005b6101d161067e565b005b6101db610770565b6040516101e89190611186565b60405180910390f35b61020b60048036038101906102069190610e9e565b610797565b6040516102189190610ee3565b60405180910390f35b610229610840565b60405161023691906111ae565b60405180910390f35b61025960048036038101906102549190610e9e565b6108d4565b005b61027560048036038101906102709190610e9e565b6108e8565b005b610291600480360381019061028c9190610e9e565b61096c565b60405161029e9190610ee3565b60405180910390f35b6102af610a15565b6102b881610a9c565b50565b5f5f60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b81526004016103179190611186565b602060405180830381865afa158015610332573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061035691906111db565b905060028114915050919050565b61036c610dfa565b610374610dfa565b60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635fbbc0d26040518163ffffffff1660e01b815260040161010060405180830381865afa1580156103df573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104039190611206565b885f01896020018a6040018b6060018c6080018d60a0018e60c0018f60e001888152508881525088815250888152508881525088815250888152508881525050505050505050508091505090565b61045a33610797565b610499576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161049090611311565b60405180910390fd5b60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638f10b586825f015183602001518460400151856060015186608001518760a001518860c001518960e001516040518963ffffffff1660e01b815260040161052098979695949392919061132f565b5f604051808303815f87803b158015610537575f5ffd5b505af1158015610549573d5f5f3e3d5ffd5b5050505050565b61055933610797565b610598576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161058f90611311565b60405180910390fd5b60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638f10b5866301312d006002633b9aca006305f5e10060305f629896806207a1206040518963ffffffff1660e01b815260040161061498979695949392919061132f565b5f604051808303815f87803b15801561062b575f5ffd5b505af115801561063d573d5f5f3e3d5ffd5b50505050565b61064b610a15565b61065481610b26565b50565b61065f610a15565b6106685f610bb0565b565b610672610a15565b61067b81610c71565b50565b61068733610797565b6106c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106bd90611311565b60405180910390fd5b60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638f10b586627a120060026405d21dba0062e4e1c060245f620f4240620186a06040518963ffffffff1660e01b815260040161074198979695949392919061132f565b5f604051808303815f87803b158015610758575f5ffd5b505af115801561076a573d5f5f3e3d5ffd5b50505050565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b5f5f60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b81526004016107f39190611186565b602060405180830381865afa15801561080e573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061083291906111db565b90505f811415915050919050565b5f60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639e05549a6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108ab573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108cf91906111db565b905090565b6108dc610a15565b6108e581610d69565b50565b6108f0610a15565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610960575f6040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016109579190611186565b60405180910390fd5b61096981610bb0565b50565b5f5f60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b81526004016109c89190611186565b602060405180830381865afa1580156109e3573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a0791906111db565b905060038114915050919050565b610a1d610df3565b73ffffffffffffffffffffffffffffffffffffffff16610a3b610770565b73ffffffffffffffffffffffffffffffffffffffff1614610a9a57610a5e610df3565b6040517f118cdaa7000000000000000000000000000000000000000000000000000000008152600401610a919190611186565b60405180910390fd5b565b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630aaf7043826040518263ffffffff1660e01b8152600401610af69190611186565b5f604051808303815f87803b158015610b0d575f5ffd5b505af1158015610b1f573d5f5f3e3d5ffd5b5050505050565b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663704b6c02826040518263ffffffff1660e01b8152600401610b809190611186565b5f604051808303815f87803b158015610b97575f5ffd5b505af1158015610ba9573d5f5f3e3d5ffd5b5050505050565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b8073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1603610cdf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cd6906113f5565b60405180910390fd5b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638c6bfb3b826040518263ffffffff1660e01b8152600401610d399190611186565b5f604051808303815f87803b158015610d50575f5ffd5b505af1158015610d62573d5f5f3e3d5ffd5b5050505050565b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0ebdbe7826040518263ffffffff1660e01b8152600401610dc39190611186565b5f604051808303815f87803b158015610dda575f5ffd5b505af1158015610dec573d5f5f3e3d5ffd5b5050505050565b5f33905090565b6040518061010001604052805f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81525090565b5f604051905090565b5f5ffd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610e6d82610e44565b9050919050565b610e7d81610e63565b8114610e87575f5ffd5b50565b5f81359050610e9881610e74565b92915050565b5f60208284031215610eb357610eb2610e40565b5b5f610ec084828501610e8a565b91505092915050565b5f8115159050919050565b610edd81610ec9565b82525050565b5f602082019050610ef65f830184610ed4565b92915050565b5f819050919050565b610f0e81610efc565b82525050565b61010082015f820151610f295f850182610f05565b506020820151610f3c6020850182610f05565b506040820151610f4f6040850182610f05565b506060820151610f626060850182610f05565b506080820151610f756080850182610f05565b5060a0820151610f8860a0850182610f05565b5060c0820151610f9b60c0850182610f05565b5060e0820151610fae60e0850182610f05565b50505050565b5f61010082019050610fc85f830184610f14565b92915050565b5f5ffd5b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b61101882610fd2565b810181811067ffffffffffffffff8211171561103757611036610fe2565b5b80604052505050565b5f611049610e37565b9050611055828261100f565b919050565b61106381610efc565b811461106d575f5ffd5b50565b5f8135905061107e8161105a565b92915050565b5f610100828403121561109a57611099610fce565b5b6110a5610100611040565b90505f6110b484828501611070565b5f8301525060206110c784828501611070565b60208301525060406110db84828501611070565b60408301525060606110ef84828501611070565b606083015250608061110384828501611070565b60808301525060a061111784828501611070565b60a08301525060c061112b84828501611070565b60c08301525060e061113f84828501611070565b60e08301525092915050565b5f610100828403121561116157611160610e40565b5b5f61116e84828501611084565b91505092915050565b61118081610e63565b82525050565b5f6020820190506111995f830184611177565b92915050565b6111a881610efc565b82525050565b5f6020820190506111c15f83018461119f565b92915050565b5f815190506111d58161105a565b92915050565b5f602082840312156111f0576111ef610e40565b5b5f6111fd848285016111c7565b91505092915050565b5f5f5f5f5f5f5f5f610100898b03121561122357611222610e40565b5b5f6112308b828c016111c7565b98505060206112418b828c016111c7565b97505060406112528b828c016111c7565b96505060606112638b828c016111c7565b95505060806112748b828c016111c7565b94505060a06112858b828c016111c7565b93505060c06112968b828c016111c7565b92505060e06112a78b828c016111c7565b9150509295985092959890939650565b5f82825260208201905092915050565b7f6e6f7420656e61626c65640000000000000000000000000000000000000000005f82015250565b5f6112fb600b836112b7565b9150611306826112c7565b602082019050919050565b5f6020820190508181035f830152611328816112ef565b9050919050565b5f610100820190506113435f83018b61119f565b611350602083018a61119f565b61135d604083018961119f565b61136a606083018861119f565b611377608083018761119f565b61138460a083018661119f565b61139160c083018561119f565b61139e60e083018461119f565b9998505050505050505050565b7f63616e6e6f74207265766f6b65206f776e20726f6c65000000000000000000005f82015250565b5f6113df6016836112b7565b91506113ea826113ab565b602082019050919050565b5f6020820190508181035f83015261140c816113d3565b905091905056fea26469706673582212200981f56c9635d6baee663e3ca720c9019373250741642e5a9ce9301d8e18b0f464736f6c634300081e0033", + Bin: "0x6080604052730200000000000000000000000000000000000003600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555034801561006557600080fd5b5073020000000000000000000000000000000000000333600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036100ee5760006040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016100e5919061024a565b60405180910390fd5b6100fd8161014560201b60201c565b5080600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610265565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061023482610209565b9050919050565b61024481610229565b82525050565b600060208201905061025f600083018461023b565b92915050565b6114d2806102746000396000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806374a8f103116100975780639e05549a116100665780639e05549a14610224578063d0ebdbe714610242578063f2fde38b1461025e578063f3ae24151461027a576100f5565b806374a8f103146101b057806385c1b4ac146101cc5780638da5cb5b146101d65780639015d371146101f4576100f5565b806352965cfc116100d357806352965cfc146101645780636f0edc9d14610180578063704b6c021461018a578063715018a6146101a6576100f5565b80630aaf7043146100fa57806324d7806c1461011657806341f5772814610146575b600080fd5b610114600480360381019061010f9190610efa565b6102aa565b005b610130600480360381019061012b9190610efa565b6102be565b60405161013d9190610f42565b60405180910390f35b61014e61036b565b60405161015b9190611018565b60405180910390f35b61017e600480360381019061017991906111bb565b61045c565b005b610188610562565b005b6101a4600480360381019061019f9190610efa565b61065c565b005b6101ae610670565b005b6101ca60048036038101906101c59190610efa565b610684565b005b6101d4610698565b005b6101de610791565b6040516101eb91906111f8565b60405180910390f35b61020e60048036038101906102099190610efa565b6107ba565b60405161021b9190610f42565b60405180910390f35b61022c610868565b6040516102399190611222565b60405180910390f35b61025c60048036038101906102579190610efa565b610900565b005b61027860048036038101906102739190610efa565b610914565b005b610294600480360381019061028f9190610efa565b61099a565b6040516102a19190610f42565b60405180910390f35b6102b2610a47565b6102bb81610ace565b50565b600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b815260040161031c91906111f8565b602060405180830381865afa158015610339573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061035d9190611252565b905060028114915050919050565b610373610e48565b61037b610e48565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635fbbc0d26040518163ffffffff1660e01b815260040161010060405180830381865afa1580156103e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040d919061127f565b88600001896020018a6040018b6060018c6080018d60a0018e60c0018f60e001888152508881525088815250888152508881525088815250888152508881525050505050505050508091505090565b610465336107ba565b6104a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161049b90611392565b60405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638f10b586826000015183602001518460400151856060015186608001518760a001518860c001518960e001516040518963ffffffff1660e01b815260040161052d9897969594939291906113b2565b600060405180830381600087803b15801561054757600080fd5b505af115801561055b573d6000803e3d6000fd5b5050505050565b61056b336107ba565b6105aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a190611392565b60405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638f10b5866301312d006002633b9aca006305f5e10060306000629896806207a1206040518963ffffffff1660e01b81526004016106289897969594939291906113b2565b600060405180830381600087803b15801561064257600080fd5b505af1158015610656573d6000803e3d6000fd5b50505050565b610664610a47565b61066d81610b5e565b50565b610678610a47565b6106826000610bee565b565b61068c610a47565b61069581610cb2565b50565b6106a1336107ba565b6106e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d790611392565b60405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638f10b586627a120060026405d21dba0062e4e1c060246000620f4240620186a06040518963ffffffff1660e01b815260040161075d9897969594939291906113b2565b600060405180830381600087803b15801561077757600080fd5b505af115801561078b573d6000803e3d6000fd5b50505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b815260040161081891906111f8565b602060405180830381865afa158015610835573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108599190611252565b90506000811415915050919050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639e05549a6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108fb9190611252565b905090565b610908610a47565b61091181610db0565b50565b61091c610a47565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361098e5760006040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260040161098591906111f8565b60405180910390fd5b61099781610bee565b50565b600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b81526004016109f891906111f8565b602060405180830381865afa158015610a15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a399190611252565b905060038114915050919050565b610a4f610e40565b73ffffffffffffffffffffffffffffffffffffffff16610a6d610791565b73ffffffffffffffffffffffffffffffffffffffff1614610acc57610a90610e40565b6040517f118cdaa7000000000000000000000000000000000000000000000000000000008152600401610ac391906111f8565b60405180910390fd5b565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630aaf7043826040518263ffffffff1660e01b8152600401610b2991906111f8565b600060405180830381600087803b158015610b4357600080fd5b505af1158015610b57573d6000803e3d6000fd5b5050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663704b6c02826040518263ffffffff1660e01b8152600401610bb991906111f8565b600060405180830381600087803b158015610bd357600080fd5b505af1158015610be7573d6000803e3d6000fd5b5050505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b8073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1603610d20576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d179061147c565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638c6bfb3b826040518263ffffffff1660e01b8152600401610d7b91906111f8565b600060405180830381600087803b158015610d9557600080fd5b505af1158015610da9573d6000803e3d6000fd5b5050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0ebdbe7826040518263ffffffff1660e01b8152600401610e0b91906111f8565b600060405180830381600087803b158015610e2557600080fd5b505af1158015610e39573d6000803e3d6000fd5b5050505050565b600033905090565b60405180610100016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6000604051905090565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610ec782610e9c565b9050919050565b610ed781610ebc565b8114610ee257600080fd5b50565b600081359050610ef481610ece565b92915050565b600060208284031215610f1057610f0f610e97565b5b6000610f1e84828501610ee5565b91505092915050565b60008115159050919050565b610f3c81610f27565b82525050565b6000602082019050610f576000830184610f33565b92915050565b6000819050919050565b610f7081610f5d565b82525050565b61010082016000820151610f8d6000850182610f67565b506020820151610fa06020850182610f67565b506040820151610fb36040850182610f67565b506060820151610fc66060850182610f67565b506080820151610fd96080850182610f67565b5060a0820151610fec60a0850182610f67565b5060c0820151610fff60c0850182610f67565b5060e082015161101260e0850182610f67565b50505050565b60006101008201905061102e6000830184610f76565b92915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61108282611039565b810181811067ffffffffffffffff821117156110a1576110a061104a565b5b80604052505050565b60006110b4610e8d565b90506110c08282611079565b919050565b6110ce81610f5d565b81146110d957600080fd5b50565b6000813590506110eb816110c5565b92915050565b6000610100828403121561110857611107611034565b5b6111136101006110aa565b90506000611123848285016110dc565b6000830152506020611137848285016110dc565b602083015250604061114b848285016110dc565b604083015250606061115f848285016110dc565b6060830152506080611173848285016110dc565b60808301525060a0611187848285016110dc565b60a08301525060c061119b848285016110dc565b60c08301525060e06111af848285016110dc565b60e08301525092915050565b600061010082840312156111d2576111d1610e97565b5b60006111e0848285016110f1565b91505092915050565b6111f281610ebc565b82525050565b600060208201905061120d60008301846111e9565b92915050565b61121c81610f5d565b82525050565b60006020820190506112376000830184611213565b92915050565b60008151905061124c816110c5565b92915050565b60006020828403121561126857611267610e97565b5b60006112768482850161123d565b91505092915050565b600080600080600080600080610100898b0312156112a05761129f610e97565b5b60006112ae8b828c0161123d565b98505060206112bf8b828c0161123d565b97505060406112d08b828c0161123d565b96505060606112e18b828c0161123d565b95505060806112f28b828c0161123d565b94505060a06113038b828c0161123d565b93505060c06113148b828c0161123d565b92505060e06113258b828c0161123d565b9150509295985092959890939650565b600082825260208201905092915050565b7f6e6f7420656e61626c6564000000000000000000000000000000000000000000600082015250565b600061137c600b83611335565b915061138782611346565b602082019050919050565b600060208201905081810360008301526113ab8161136f565b9050919050565b6000610100820190506113c8600083018b611213565b6113d5602083018a611213565b6113e26040830189611213565b6113ef6060830188611213565b6113fc6080830187611213565b61140960a0830186611213565b61141660c0830185611213565b61142360e0830184611213565b9998505050505050505050565b7f63616e6e6f74207265766f6b65206f776e20726f6c6500000000000000000000600082015250565b6000611466601683611335565b915061147182611430565b602082019050919050565b6000602082019050818103600083015261149581611459565b905091905056fea2646970667358221220d0b91fea29c818847d4dcf4db121a8709dc54729cf872805314a42f97de6966864736f6c634300081e0033", } // ExampleFeeManagerABI is the input ABI used to generate the binding from. diff --git a/contracts/bindings/examplerewardmanager.go b/contracts/bindings/examplerewardmanager.go index 36ca529e0b..3342f9a6e4 100644 --- a/contracts/bindings/examplerewardmanager.go +++ b/contracts/bindings/examplerewardmanager.go @@ -32,7 +32,7 @@ var ( // ExampleRewardManagerMetaData contains all meta data concerning the ExampleRewardManager contract. var ExampleRewardManagerMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"OwnableInvalidOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"OwnableUnauthorizedAccount\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"allowFeeRecipients\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"areFeeRecipientsAllowed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentRewardAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"disableRewards\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setRewardAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x608060405273020000000000000000000000000000000000000460015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550348015610063575f5ffd5b50335f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036100d5575f6040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016100cc91906101ea565b60405180910390fd5b6100e4816100ea60201b60201c565b50610203565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6101d4826101ab565b9050919050565b6101e4816101ca565b82525050565b5f6020820190506101fd5f8301846101db565b92915050565b6107bb806102105f395ff3fe608060405234801561000f575f5ffd5b5060043610610086575f3560e01c8063bc17862811610059578063bc178628146100d8578063e915608b146100e2578063f2fde38b14610100578063f6542b2e1461011c57610086565b80630329099f1461008a5780635e00e67914610094578063715018a6146100b05780638da5cb5b146100ba575b5f5ffd5b61009261013a565b005b6100ae60048036038101906100a9919061066b565b6101c0565b005b6100b8610252565b005b6100c2610265565b6040516100cf91906106a5565b60405180910390f35b6100e061028c565b005b6100ea610312565b6040516100f791906106a5565b60405180910390f35b61011a6004803603810190610115919061066b565b6103a6565b005b61012461042a565b60405161013191906106d8565b60405180910390f35b6101426104be565b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630329099f6040518163ffffffff1660e01b81526004015f604051808303815f87803b1580156101a8575f5ffd5b505af11580156101ba573d5f5f3e3d5ffd5b50505050565b6101c86104be565b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635e00e679826040518263ffffffff1660e01b815260040161022291906106a5565b5f604051808303815f87803b158015610239575f5ffd5b505af115801561024b573d5f5f3e3d5ffd5b5050505050565b61025a6104be565b6102635f610545565b565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6102946104be565b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bc1786286040518163ffffffff1660e01b81526004015f604051808303815f87803b1580156102fa575f5ffd5b505af115801561030c573d5f5f3e3d5ffd5b50505050565b5f60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e915608b6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561037d573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103a19190610705565b905090565b6103ae6104be565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361041e575f6040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260040161041591906106a5565b60405180910390fd5b61042781610545565b50565b5f60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f6542b2e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610495573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104b9919061075a565b905090565b6104c6610606565b73ffffffffffffffffffffffffffffffffffffffff166104e4610265565b73ffffffffffffffffffffffffffffffffffffffff161461054357610507610606565b6040517f118cdaa700000000000000000000000000000000000000000000000000000000815260040161053a91906106a5565b60405180910390fd5b565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f33905090565b5f5ffd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61063a82610611565b9050919050565b61064a81610630565b8114610654575f5ffd5b50565b5f8135905061066581610641565b92915050565b5f602082840312156106805761067f61060d565b5b5f61068d84828501610657565b91505092915050565b61069f81610630565b82525050565b5f6020820190506106b85f830184610696565b92915050565b5f8115159050919050565b6106d2816106be565b82525050565b5f6020820190506106eb5f8301846106c9565b92915050565b5f815190506106ff81610641565b92915050565b5f6020828403121561071a5761071961060d565b5b5f610727848285016106f1565b91505092915050565b610739816106be565b8114610743575f5ffd5b50565b5f8151905061075481610730565b92915050565b5f6020828403121561076f5761076e61060d565b5b5f61077c84828501610746565b9150509291505056fea26469706673582212202d1d60533535c64cb8de6b0de0907c9dfa92e3389e4db13c222087e15ebf612f64736f6c634300081e0033", + Bin: "0x6080604052730200000000000000000000000000000000000004600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555034801561006557600080fd5b5033600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036100d95760006040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016100d091906101f3565b60405180910390fd5b6100e8816100ee60201b60201c565b5061020e565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006101dd826101b2565b9050919050565b6101ed816101d2565b82525050565b600060208201905061020860008301846101e4565b92915050565b6107f48061021d6000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c8063bc1786281161005b578063bc178628146100db578063e915608b146100e5578063f2fde38b14610103578063f6542b2e1461011f57610088565b80630329099f1461008d5780635e00e67914610097578063715018a6146100b35780638da5cb5b146100bd575b600080fd5b61009561013d565b005b6100b160048036038101906100ac9190610696565b6101c9565b005b6100bb610261565b005b6100c5610275565b6040516100d291906106d2565b60405180910390f35b6100e361029e565b005b6100ed61032a565b6040516100fa91906106d2565b60405180910390f35b61011d60048036038101906101189190610696565b6103c2565b005b610127610448565b6040516101349190610708565b60405180910390f35b6101456104e0565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630329099f6040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156101af57600080fd5b505af11580156101c3573d6000803e3d6000fd5b50505050565b6101d16104e0565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635e00e679826040518263ffffffff1660e01b815260040161022c91906106d2565b600060405180830381600087803b15801561024657600080fd5b505af115801561025a573d6000803e3d6000fd5b5050505050565b6102696104e0565b6102736000610567565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6102a66104e0565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bc1786286040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561031057600080fd5b505af1158015610324573d6000803e3d6000fd5b50505050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e915608b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610399573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103bd9190610738565b905090565b6103ca6104e0565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361043c5760006040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260040161043391906106d2565b60405180910390fd5b61044581610567565b50565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f6542b2e6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104db9190610791565b905090565b6104e861062b565b73ffffffffffffffffffffffffffffffffffffffff16610506610275565b73ffffffffffffffffffffffffffffffffffffffff16146105655761052961062b565b6040517f118cdaa700000000000000000000000000000000000000000000000000000000815260040161055c91906106d2565b60405180910390fd5b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600033905090565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061066382610638565b9050919050565b61067381610658565b811461067e57600080fd5b50565b6000813590506106908161066a565b92915050565b6000602082840312156106ac576106ab610633565b5b60006106ba84828501610681565b91505092915050565b6106cc81610658565b82525050565b60006020820190506106e760008301846106c3565b92915050565b60008115159050919050565b610702816106ed565b82525050565b600060208201905061071d60008301846106f9565b92915050565b6000815190506107328161066a565b92915050565b60006020828403121561074e5761074d610633565b5b600061075c84828501610723565b91505092915050565b61076e816106ed565b811461077957600080fd5b50565b60008151905061078b81610765565b92915050565b6000602082840312156107a7576107a6610633565b5b60006107b58482850161077c565b9150509291505056fea264697066735822122084570f899c259febf88f28ea6fbe13fbe192de6b14f550ec974419bfb0d1de6c64736f6c634300081e0033", } // ExampleRewardManagerABI is the input ABI used to generate the binding from. diff --git a/contracts/bindings/exampletxallowlist.go b/contracts/bindings/exampletxallowlist.go index aa2f612fb3..7baf611992 100644 --- a/contracts/bindings/exampletxallowlist.go +++ b/contracts/bindings/exampletxallowlist.go @@ -32,7 +32,7 @@ var ( // ExampleTxAllowListMetaData contains all meta data concerning the ExampleTxAllowList contract. var ExampleTxAllowListMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"OwnableInvalidOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"OwnableUnauthorizedAccount\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"deployContract\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"isAdmin\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"isEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"isManager\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"revoke\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setEnabled\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x608060405234801561000f575f5ffd5b50730200000000000000000000000000000000000002335f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610096575f6040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260040161008d91906101ec565b60405180910390fd5b6100a5816100ec60201b60201c565b508060015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610205565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6101d6826101ad565b9050919050565b6101e6816101cc565b82525050565b5f6020820190506101ff5f8301846101dd565b92915050565b610b64806102125f395ff3fe608060405234801561000f575f5ffd5b50600436106100a7575f3560e01c806374a8f1031161006f57806374a8f103146101275780638da5cb5b146101435780639015d37114610161578063d0ebdbe714610191578063f2fde38b146101ad578063f3ae2415146101c9576100a7565b80630aaf7043146100ab57806324d7806c146100c75780636cd5c39b146100f7578063704b6c0214610101578063715018a61461011d575b5f5ffd5b6100c560048036038101906100c0919061097a565b6101f9565b005b6100e160048036038101906100dc919061097a565b61020d565b6040516100ee91906109bf565b60405180910390f35b6100ff6102b6565b005b61011b6004803603810190610116919061097a565b6102df565b005b6101256102f3565b005b610141600480360381019061013c919061097a565b610306565b005b61014b61031a565b60405161015891906109e7565b60405180910390f35b61017b6004803603810190610176919061097a565b610341565b60405161018891906109bf565b60405180910390f35b6101ab60048036038101906101a6919061097a565b6103ea565b005b6101c760048036038101906101c2919061097a565b6103fe565b005b6101e360048036038101906101de919061097a565b610482565b6040516101f091906109bf565b60405180910390f35b61020161052b565b61020a816105b2565b50565b5f5f60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b815260040161026991906109e7565b602060405180830381865afa158015610284573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906102a89190610a33565b905060028114915050919050565b6040516102c290610910565b604051809103905ff0801580156102db573d5f5f3e3d5ffd5b5050565b6102e761052b565b6102f08161063c565b50565b6102fb61052b565b6103045f6106c6565b565b61030e61052b565b61031781610787565b50565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b5f5f60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b815260040161039d91906109e7565b602060405180830381865afa1580156103b8573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103dc9190610a33565b90505f811415915050919050565b6103f261052b565b6103fb8161087f565b50565b61040661052b565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610476575f6040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260040161046d91906109e7565b60405180910390fd5b61047f816106c6565b50565b5f5f60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b81526004016104de91906109e7565b602060405180830381865afa1580156104f9573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061051d9190610a33565b905060038114915050919050565b610533610909565b73ffffffffffffffffffffffffffffffffffffffff1661055161031a565b73ffffffffffffffffffffffffffffffffffffffff16146105b057610574610909565b6040517f118cdaa70000000000000000000000000000000000000000000000000000000081526004016105a791906109e7565b60405180910390fd5b565b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630aaf7043826040518263ffffffff1660e01b815260040161060c91906109e7565b5f604051808303815f87803b158015610623575f5ffd5b505af1158015610635573d5f5f3e3d5ffd5b5050505050565b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663704b6c02826040518263ffffffff1660e01b815260040161069691906109e7565b5f604051808303815f87803b1580156106ad575f5ffd5b505af11580156106bf573d5f5f3e3d5ffd5b5050505050565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b8073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16036107f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107ec90610ab8565b60405180910390fd5b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638c6bfb3b826040518263ffffffff1660e01b815260040161084f91906109e7565b5f604051808303815f87803b158015610866575f5ffd5b505af1158015610878573d5f5f3e3d5ffd5b5050505050565b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0ebdbe7826040518263ffffffff1660e01b81526004016108d991906109e7565b5f604051808303815f87803b1580156108f0575f5ffd5b505af1158015610902573d5f5f3e3d5ffd5b5050505050565b5f33905090565b605880610ad783390190565b5f5ffd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61094982610920565b9050919050565b6109598161093f565b8114610963575f5ffd5b50565b5f8135905061097481610950565b92915050565b5f6020828403121561098f5761098e61091c565b5b5f61099c84828501610966565b91505092915050565b5f8115159050919050565b6109b9816109a5565b82525050565b5f6020820190506109d25f8301846109b0565b92915050565b6109e18161093f565b82525050565b5f6020820190506109fa5f8301846109d8565b92915050565b5f819050919050565b610a1281610a00565b8114610a1c575f5ffd5b50565b5f81519050610a2d81610a09565b92915050565b5f60208284031215610a4857610a4761091c565b5b5f610a5584828501610a1f565b91505092915050565b5f82825260208201905092915050565b7f63616e6e6f74207265766f6b65206f776e20726f6c65000000000000000000005f82015250565b5f610aa2601683610a5e565b9150610aad82610a6e565b602082019050919050565b5f6020820190508181035f830152610acf81610a96565b905091905056fe6080604052348015600e575f5ffd5b50603e80601a5f395ff3fe60806040525f5ffdfea2646970667358221220702673ea71b999fe7003c1d6b5223db6ebc869ab410cf272faf9bb13442f909c64736f6c634300081e0033a2646970667358221220439f74d40d5469c36c89cab7d507dbaa9b57e90a769bcad816069b4613c7381564736f6c634300081e0033", + Bin: "0x608060405234801561001057600080fd5b5073020000000000000000000000000000000000000233600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036100995760006040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260040161009091906101f5565b60405180910390fd5b6100a8816100f060201b60201c565b5080600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610210565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006101df826101b4565b9050919050565b6101ef816101d4565b82525050565b600060208201905061020a60008301846101e6565b92915050565b610bb28061021f6000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c806374a8f1031161007157806374a8f1031461012a5780638da5cb5b146101465780639015d37114610164578063d0ebdbe714610194578063f2fde38b146101b0578063f3ae2415146101cc576100a9565b80630aaf7043146100ae57806324d7806c146100ca5780636cd5c39b146100fa578063704b6c0214610104578063715018a614610120575b600080fd5b6100c860048036038101906100c391906109b3565b6101fc565b005b6100e460048036038101906100df91906109b3565b610210565b6040516100f191906109fb565b60405180910390f35b6101026102bd565b005b61011e600480360381019061011991906109b3565b6102e9565b005b6101286102fd565b005b610144600480360381019061013f91906109b3565b610311565b005b61014e610325565b60405161015b9190610a25565b60405180910390f35b61017e600480360381019061017991906109b3565b61034e565b60405161018b91906109fb565b60405180910390f35b6101ae60048036038101906101a991906109b3565b6103fc565b005b6101ca60048036038101906101c591906109b3565b610410565b005b6101e660048036038101906101e191906109b3565b610496565b6040516101f391906109fb565b60405180910390f35b610204610543565b61020d816105ca565b50565b600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b815260040161026e9190610a25565b602060405180830381865afa15801561028b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102af9190610a76565b905060028114915050919050565b6040516102c990610944565b604051809103906000f0801580156102e5573d6000803e3d6000fd5b5050565b6102f1610543565b6102fa8161065a565b50565b610305610543565b61030f60006106ea565b565b610319610543565b610322816107ae565b50565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b81526004016103ac9190610a25565b602060405180830381865afa1580156103c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ed9190610a76565b90506000811415915050919050565b610404610543565b61040d816108ac565b50565b610418610543565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361048a5760006040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016104819190610a25565b60405180910390fd5b610493816106ea565b50565b600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b81526004016104f49190610a25565b602060405180830381865afa158015610511573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105359190610a76565b905060038114915050919050565b61054b61093c565b73ffffffffffffffffffffffffffffffffffffffff16610569610325565b73ffffffffffffffffffffffffffffffffffffffff16146105c85761058c61093c565b6040517f118cdaa70000000000000000000000000000000000000000000000000000000081526004016105bf9190610a25565b60405180910390fd5b565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630aaf7043826040518263ffffffff1660e01b81526004016106259190610a25565b600060405180830381600087803b15801561063f57600080fd5b505af1158015610653573d6000803e3d6000fd5b5050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663704b6c02826040518263ffffffff1660e01b81526004016106b59190610a25565b600060405180830381600087803b1580156106cf57600080fd5b505af11580156106e3573d6000803e3d6000fd5b5050505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b8073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff160361081c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081390610b00565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638c6bfb3b826040518263ffffffff1660e01b81526004016108779190610a25565b600060405180830381600087803b15801561089157600080fd5b505af11580156108a5573d6000803e3d6000fd5b5050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0ebdbe7826040518263ffffffff1660e01b81526004016109079190610a25565b600060405180830381600087803b15801561092157600080fd5b505af1158015610935573d6000803e3d6000fd5b5050505050565b600033905090565b605c80610b2183390190565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061098082610955565b9050919050565b61099081610975565b811461099b57600080fd5b50565b6000813590506109ad81610987565b92915050565b6000602082840312156109c9576109c8610950565b5b60006109d78482850161099e565b91505092915050565b60008115159050919050565b6109f5816109e0565b82525050565b6000602082019050610a1060008301846109ec565b92915050565b610a1f81610975565b82525050565b6000602082019050610a3a6000830184610a16565b92915050565b6000819050919050565b610a5381610a40565b8114610a5e57600080fd5b50565b600081519050610a7081610a4a565b92915050565b600060208284031215610a8c57610a8b610950565b5b6000610a9a84828501610a61565b91505092915050565b600082825260208201905092915050565b7f63616e6e6f74207265766f6b65206f776e20726f6c6500000000000000000000600082015250565b6000610aea601683610aa3565b9150610af582610ab4565b602082019050919050565b60006020820190508181036000830152610b1981610add565b905091905056fe6080604052348015600f57600080fd5b50603f80601d6000396000f3fe6080604052600080fdfea2646970667358221220fca91eea49d727340485b03bb9b7aa12355fe29a602dfe104931a95578c9621a64736f6c634300081e0033a2646970667358221220c104aa73c4f174654b1af61a544610e7a121fd1721188a794b30522eabc6f2ca64736f6c634300081e0033", } // ExampleTxAllowListABI is the input ABI used to generate the binding from. diff --git a/contracts/bindings/examplewarp.go b/contracts/bindings/examplewarp.go index 740b618cdd..9a8531b809 100644 --- a/contracts/bindings/examplewarp.go +++ b/contracts/bindings/examplewarp.go @@ -32,7 +32,7 @@ var ( // ExampleWarpMetaData contains all meta data concerning the ExampleWarp contract. var ExampleWarpMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"payload\",\"type\":\"bytes\"}],\"name\":\"sendWarpMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"blockchainID\",\"type\":\"bytes32\"}],\"name\":\"validateGetBlockchainID\",\"outputs\":[],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"index\",\"type\":\"uint32\"}],\"name\":\"validateInvalidWarpBlockHash\",\"outputs\":[],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"index\",\"type\":\"uint32\"}],\"name\":\"validateInvalidWarpMessage\",\"outputs\":[],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"index\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"sourceChainID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"}],\"name\":\"validateWarpBlockHash\",\"outputs\":[],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"index\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"sourceChainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"originSenderAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"payload\",\"type\":\"bytes\"}],\"name\":\"validateWarpMessage\",\"outputs\":[],\"stateMutability\":\"view\",\"type\":\"function\"}]", - Bin: "0x60806040527302000000000000000000000000000000000000055f5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055503480156061575f5ffd5b50610d158061006f5f395ff3fe608060405234801561000f575f5ffd5b5060043610610060575f3560e01c806315f0c959146100645780635bd05f061461008057806377ca84db1461009c578063e519286f146100b8578063ee5b48eb146100d4578063f25ec06a146100f0575b5f5ffd5b61007e60048036038101906100799190610672565b61010c565b005b61009a60048036038101906100959190610791565b6101a6565b005b6100b660048036038101906100b19190610815565b6102cf565b005b6100d260048036038101906100cd9190610840565b61039d565b005b6100ee60048036038101906100e99190610890565b610468565b005b61010a60048036038101906101059190610815565b610508565b005b5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa158015610175573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061019991906108ef565b81146101a3575f5ffd5b50565b5f5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636f825350886040518263ffffffff1660e01b81526004016102019190610929565b5f60405180830381865afa15801561021b573d5f5f3e3d5ffd5b505050506040513d5f823e3d601f19601f820116820180604052508101906102439190610b48565b9150915080610250575f5ffd5b85825f01511461025e575f5ffd5b8473ffffffffffffffffffffffffffffffffffffffff16826020015173ffffffffffffffffffffffffffffffffffffffff1614610299575f5ffd5b83836040516102a9929190610bde565b6040518091039020826040015180519060200120146102c6575f5ffd5b50505050505050565b5f5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ce7f5929846040518263ffffffff1660e01b815260040161032a9190610929565b606060405180830381865afa158015610345573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103699190610c43565b915091508015610377575f5ffd5b5f5f1b825f015114610387575f5ffd5b5f5f1b826020015114610398575f5ffd5b505050565b5f5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ce7f5929866040518263ffffffff1660e01b81526004016103f89190610929565b606060405180830381865afa158015610413573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104379190610c43565b9150915080610444575f5ffd5b83825f015114610452575f5ffd5b82826020015114610461575f5ffd5b5050505050565b5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ee5b48eb83836040518363ffffffff1660e01b81526004016104c3929190610cbd565b6020604051808303815f875af11580156104df573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061050391906108ef565b505050565b5f5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636f825350846040518263ffffffff1660e01b81526004016105639190610929565b5f60405180830381865afa15801561057d573d5f5f3e3d5ffd5b505050506040513d5f823e3d601f19601f820116820180604052508101906105a59190610b48565b9150915080156105b3575f5ffd5b5f5f1b825f0151146105c3575f5ffd5b5f73ffffffffffffffffffffffffffffffffffffffff16826020015173ffffffffffffffffffffffffffffffffffffffff16146105fe575f5ffd5b60405180602001604052805f8152508051906020012082604001518051906020012014610629575f5ffd5b505050565b5f604051905090565b5f5ffd5b5f5ffd5b5f819050919050565b6106518161063f565b811461065b575f5ffd5b50565b5f8135905061066c81610648565b92915050565b5f6020828403121561068757610686610637565b5b5f6106948482850161065e565b91505092915050565b5f63ffffffff82169050919050565b6106b58161069d565b81146106bf575f5ffd5b50565b5f813590506106d0816106ac565b92915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6106ff826106d6565b9050919050565b61070f816106f5565b8114610719575f5ffd5b50565b5f8135905061072a81610706565b92915050565b5f5ffd5b5f5ffd5b5f5ffd5b5f5f83601f84011261075157610750610730565b5b8235905067ffffffffffffffff81111561076e5761076d610734565b5b60208301915083600182028301111561078a57610789610738565b5b9250929050565b5f5f5f5f5f608086880312156107aa576107a9610637565b5b5f6107b7888289016106c2565b95505060206107c88882890161065e565b94505060406107d98882890161071c565b935050606086013567ffffffffffffffff8111156107fa576107f961063b565b5b6108068882890161073c565b92509250509295509295909350565b5f6020828403121561082a57610829610637565b5b5f610837848285016106c2565b91505092915050565b5f5f5f6060848603121561085757610856610637565b5b5f610864868287016106c2565b93505060206108758682870161065e565b92505060406108868682870161065e565b9150509250925092565b5f5f602083850312156108a6576108a5610637565b5b5f83013567ffffffffffffffff8111156108c3576108c261063b565b5b6108cf8582860161073c565b92509250509250929050565b5f815190506108e981610648565b92915050565b5f6020828403121561090457610903610637565b5b5f610911848285016108db565b91505092915050565b6109238161069d565b82525050565b5f60208201905061093c5f83018461091a565b92915050565b5f5ffd5b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b61098c82610946565b810181811067ffffffffffffffff821117156109ab576109aa610956565b5b80604052505050565b5f6109bd61062e565b90506109c98282610983565b919050565b5f5ffd5b5f815190506109e081610706565b92915050565b5f5ffd5b5f67ffffffffffffffff821115610a0457610a03610956565b5b610a0d82610946565b9050602081019050919050565b8281835e5f83830152505050565b5f610a3a610a35846109ea565b6109b4565b905082815260208101848484011115610a5657610a556109e6565b5b610a61848285610a1a565b509392505050565b5f82601f830112610a7d57610a7c610730565b5b8151610a8d848260208601610a28565b91505092915050565b5f60608284031215610aab57610aaa610942565b5b610ab560606109b4565b90505f610ac4848285016108db565b5f830152506020610ad7848285016109d2565b602083015250604082015167ffffffffffffffff811115610afb57610afa6109ce565b5b610b0784828501610a69565b60408301525092915050565b5f8115159050919050565b610b2781610b13565b8114610b31575f5ffd5b50565b5f81519050610b4281610b1e565b92915050565b5f5f60408385031215610b5e57610b5d610637565b5b5f83015167ffffffffffffffff811115610b7b57610b7a61063b565b5b610b8785828601610a96565b9250506020610b9885828601610b34565b9150509250929050565b5f81905092915050565b828183375f83830152505050565b5f610bc58385610ba2565b9350610bd2838584610bac565b82840190509392505050565b5f610bea828486610bba565b91508190509392505050565b5f60408284031215610c0b57610c0a610942565b5b610c1560406109b4565b90505f610c24848285016108db565b5f830152506020610c37848285016108db565b60208301525092915050565b5f5f60608385031215610c5957610c58610637565b5b5f610c6685828601610bf6565b9250506040610c7785828601610b34565b9150509250929050565b5f82825260208201905092915050565b5f610c9c8385610c81565b9350610ca9838584610bac565b610cb283610946565b840190509392505050565b5f6020820190508181035f830152610cd6818486610c91565b9050939250505056fea26469706673582212203b86e0c33d980e66e032f32de5403a4c0c3810e4ac6a28e5ee106b14202b6f1164736f6c634300081e0033", + Bin: "0x60806040527302000000000000000000000000000000000000056000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550348015606357600080fd5b50610da4806100736000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c806315f0c959146100675780635bd05f061461008357806377ca84db1461009f578063e519286f146100bb578063ee5b48eb146100d7578063f25ec06a146100f3575b600080fd5b610081600480360381019061007c91906106a8565b61010f565b005b61009d600480360381019061009891906107d4565b6101ac565b005b6100b960048036038101906100b4919061085c565b6102df565b005b6100d560048036038101906100d09190610889565b6103b6565b005b6100f160048036038101906100ec91906108dc565b610488565b005b61010d6004803603810190610108919061085c565b61052b565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa15801561017a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061019e919061093e565b81146101a957600080fd5b50565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636f825350886040518263ffffffff1660e01b8152600401610208919061097a565b600060405180830381865afa158015610225573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061024e9190610bc8565b915091508061025c57600080fd5b8582600001511461026c57600080fd5b8473ffffffffffffffffffffffffffffffffffffffff16826020015173ffffffffffffffffffffffffffffffffffffffff16146102a857600080fd5b83836040516102b8929190610c63565b6040518091039020826040015180519060200120146102d657600080fd5b50505050505050565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ce7f5929846040518263ffffffff1660e01b815260040161033b919061097a565b606060405180830381865afa158015610358573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061037c9190610ccc565b91509150801561038b57600080fd5b6000801b82600001511461039e57600080fd5b6000801b8260200151146103b157600080fd5b505050565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ce7f5929866040518263ffffffff1660e01b8152600401610412919061097a565b606060405180830381865afa15801561042f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104539190610ccc565b915091508061046157600080fd5b8382600001511461047157600080fd5b8282602001511461048157600080fd5b5050505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ee5b48eb83836040518363ffffffff1660e01b81526004016104e3929190610d4a565b6020604051808303816000875af1158015610502573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610526919061093e565b505050565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636f825350846040518263ffffffff1660e01b8152600401610587919061097a565b600060405180830381865afa1580156105a4573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906105cd9190610bc8565b9150915080156105dc57600080fd5b6000801b8260000151146105ef57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16826020015173ffffffffffffffffffffffffffffffffffffffff161461062c57600080fd5b60405180602001604052806000815250805190602001208260400151805190602001201461065957600080fd5b505050565b6000604051905090565b600080fd5b600080fd5b6000819050919050565b61068581610672565b811461069057600080fd5b50565b6000813590506106a28161067c565b92915050565b6000602082840312156106be576106bd610668565b5b60006106cc84828501610693565b91505092915050565b600063ffffffff82169050919050565b6106ee816106d5565b81146106f957600080fd5b50565b60008135905061070b816106e5565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061073c82610711565b9050919050565b61074c81610731565b811461075757600080fd5b50565b60008135905061076981610743565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f8401126107945761079361076f565b5b8235905067ffffffffffffffff8111156107b1576107b0610774565b5b6020830191508360018202830111156107cd576107cc610779565b5b9250929050565b6000806000806000608086880312156107f0576107ef610668565b5b60006107fe888289016106fc565b955050602061080f88828901610693565b94505060406108208882890161075a565b935050606086013567ffffffffffffffff8111156108415761084061066d565b5b61084d8882890161077e565b92509250509295509295909350565b60006020828403121561087257610871610668565b5b6000610880848285016106fc565b91505092915050565b6000806000606084860312156108a2576108a1610668565b5b60006108b0868287016106fc565b93505060206108c186828701610693565b92505060406108d286828701610693565b9150509250925092565b600080602083850312156108f3576108f2610668565b5b600083013567ffffffffffffffff8111156109115761091061066d565b5b61091d8582860161077e565b92509250509250929050565b6000815190506109388161067c565b92915050565b60006020828403121561095457610953610668565b5b600061096284828501610929565b91505092915050565b610974816106d5565b82525050565b600060208201905061098f600083018461096b565b92915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6109e38261099a565b810181811067ffffffffffffffff82111715610a0257610a016109ab565b5b80604052505050565b6000610a1561065e565b9050610a2182826109da565b919050565b600080fd5b600081519050610a3a81610743565b92915050565b600080fd5b600067ffffffffffffffff821115610a6057610a5f6109ab565b5b610a698261099a565b9050602081019050919050565b60005b83811015610a94578082015181840152602081019050610a79565b60008484015250505050565b6000610ab3610aae84610a45565b610a0b565b905082815260208101848484011115610acf57610ace610a40565b5b610ada848285610a76565b509392505050565b600082601f830112610af757610af661076f565b5b8151610b07848260208601610aa0565b91505092915050565b600060608284031215610b2657610b25610995565b5b610b306060610a0b565b90506000610b4084828501610929565b6000830152506020610b5484828501610a2b565b602083015250604082015167ffffffffffffffff811115610b7857610b77610a26565b5b610b8484828501610ae2565b60408301525092915050565b60008115159050919050565b610ba581610b90565b8114610bb057600080fd5b50565b600081519050610bc281610b9c565b92915050565b60008060408385031215610bdf57610bde610668565b5b600083015167ffffffffffffffff811115610bfd57610bfc61066d565b5b610c0985828601610b10565b9250506020610c1a85828601610bb3565b9150509250929050565b600081905092915050565b82818337600083830152505050565b6000610c4a8385610c24565b9350610c57838584610c2f565b82840190509392505050565b6000610c70828486610c3e565b91508190509392505050565b600060408284031215610c9257610c91610995565b5b610c9c6040610a0b565b90506000610cac84828501610929565b6000830152506020610cc084828501610929565b60208301525092915050565b60008060608385031215610ce357610ce2610668565b5b6000610cf185828601610c7c565b9250506040610d0285828601610bb3565b9150509250929050565b600082825260208201905092915050565b6000610d298385610d0c565b9350610d36838584610c2f565b610d3f8361099a565b840190509392505050565b60006020820190508181036000830152610d65818486610d1d565b9050939250505056fea2646970667358221220e3f858dc0a344a2ad3c566692a2f4551730ea3e157ede8ed0446a67be11fa39364736f6c634300081e0033", } // ExampleWarpABI is the input ABI used to generate the binding from. diff --git a/contracts/bindings/iallowlist.go b/contracts/bindings/iallowlist.go new file mode 100644 index 0000000000..cd0c5b8295 --- /dev/null +++ b/contracts/bindings/iallowlist.go @@ -0,0 +1,459 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ava-labs/libevm" + "github.com/ava-labs/libevm/accounts/abi" + "github.com/ava-labs/libevm/accounts/abi/bind" + "github.com/ava-labs/libevm/common" + "github.com/ava-labs/libevm/core/types" + "github.com/ava-labs/libevm/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +// IAllowListMetaData contains all meta data concerning the IAllowList contract. +var IAllowListMetaData = &bind.MetaData{ + ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"role\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldRole\",\"type\":\"uint256\"}],\"name\":\"RoleSet\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"readAllowList\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"role\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setEnabled\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setNone\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", +} + +// IAllowListABI is the input ABI used to generate the binding from. +// Deprecated: Use IAllowListMetaData.ABI instead. +var IAllowListABI = IAllowListMetaData.ABI + +// IAllowList is an auto generated Go binding around an Ethereum contract. +type IAllowList struct { + IAllowListCaller // Read-only binding to the contract + IAllowListTransactor // Write-only binding to the contract + IAllowListFilterer // Log filterer for contract events +} + +// IAllowListCaller is an auto generated read-only Go binding around an Ethereum contract. +type IAllowListCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// IAllowListTransactor is an auto generated write-only Go binding around an Ethereum contract. +type IAllowListTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// IAllowListFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type IAllowListFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// IAllowListSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type IAllowListSession struct { + Contract *IAllowList // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// IAllowListCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type IAllowListCallerSession struct { + Contract *IAllowListCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// IAllowListTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type IAllowListTransactorSession struct { + Contract *IAllowListTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// IAllowListRaw is an auto generated low-level Go binding around an Ethereum contract. +type IAllowListRaw struct { + Contract *IAllowList // Generic contract binding to access the raw methods on +} + +// IAllowListCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type IAllowListCallerRaw struct { + Contract *IAllowListCaller // Generic read-only contract binding to access the raw methods on +} + +// IAllowListTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type IAllowListTransactorRaw struct { + Contract *IAllowListTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewIAllowList creates a new instance of IAllowList, bound to a specific deployed contract. +func NewIAllowList(address common.Address, backend bind.ContractBackend) (*IAllowList, error) { + contract, err := bindIAllowList(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &IAllowList{IAllowListCaller: IAllowListCaller{contract: contract}, IAllowListTransactor: IAllowListTransactor{contract: contract}, IAllowListFilterer: IAllowListFilterer{contract: contract}}, nil +} + +// NewIAllowListCaller creates a new read-only instance of IAllowList, bound to a specific deployed contract. +func NewIAllowListCaller(address common.Address, caller bind.ContractCaller) (*IAllowListCaller, error) { + contract, err := bindIAllowList(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &IAllowListCaller{contract: contract}, nil +} + +// NewIAllowListTransactor creates a new write-only instance of IAllowList, bound to a specific deployed contract. +func NewIAllowListTransactor(address common.Address, transactor bind.ContractTransactor) (*IAllowListTransactor, error) { + contract, err := bindIAllowList(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &IAllowListTransactor{contract: contract}, nil +} + +// NewIAllowListFilterer creates a new log filterer instance of IAllowList, bound to a specific deployed contract. +func NewIAllowListFilterer(address common.Address, filterer bind.ContractFilterer) (*IAllowListFilterer, error) { + contract, err := bindIAllowList(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &IAllowListFilterer{contract: contract}, nil +} + +// bindIAllowList binds a generic wrapper to an already deployed contract. +func bindIAllowList(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := IAllowListMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_IAllowList *IAllowListRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _IAllowList.Contract.IAllowListCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_IAllowList *IAllowListRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _IAllowList.Contract.IAllowListTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_IAllowList *IAllowListRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _IAllowList.Contract.IAllowListTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_IAllowList *IAllowListCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _IAllowList.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_IAllowList *IAllowListTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _IAllowList.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_IAllowList *IAllowListTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _IAllowList.Contract.contract.Transact(opts, method, params...) +} + +// ReadAllowList is a free data retrieval call binding the contract method 0xeb54dae1. +// +// Solidity: function readAllowList(address addr) view returns(uint256 role) +func (_IAllowList *IAllowListCaller) ReadAllowList(opts *bind.CallOpts, addr common.Address) (*big.Int, error) { + var out []interface{} + err := _IAllowList.contract.Call(opts, &out, "readAllowList", addr) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// ReadAllowList is a free data retrieval call binding the contract method 0xeb54dae1. +// +// Solidity: function readAllowList(address addr) view returns(uint256 role) +func (_IAllowList *IAllowListSession) ReadAllowList(addr common.Address) (*big.Int, error) { + return _IAllowList.Contract.ReadAllowList(&_IAllowList.CallOpts, addr) +} + +// ReadAllowList is a free data retrieval call binding the contract method 0xeb54dae1. +// +// Solidity: function readAllowList(address addr) view returns(uint256 role) +func (_IAllowList *IAllowListCallerSession) ReadAllowList(addr common.Address) (*big.Int, error) { + return _IAllowList.Contract.ReadAllowList(&_IAllowList.CallOpts, addr) +} + +// SetAdmin is a paid mutator transaction binding the contract method 0x704b6c02. +// +// Solidity: function setAdmin(address addr) returns() +func (_IAllowList *IAllowListTransactor) SetAdmin(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { + return _IAllowList.contract.Transact(opts, "setAdmin", addr) +} + +// SetAdmin is a paid mutator transaction binding the contract method 0x704b6c02. +// +// Solidity: function setAdmin(address addr) returns() +func (_IAllowList *IAllowListSession) SetAdmin(addr common.Address) (*types.Transaction, error) { + return _IAllowList.Contract.SetAdmin(&_IAllowList.TransactOpts, addr) +} + +// SetAdmin is a paid mutator transaction binding the contract method 0x704b6c02. +// +// Solidity: function setAdmin(address addr) returns() +func (_IAllowList *IAllowListTransactorSession) SetAdmin(addr common.Address) (*types.Transaction, error) { + return _IAllowList.Contract.SetAdmin(&_IAllowList.TransactOpts, addr) +} + +// SetEnabled is a paid mutator transaction binding the contract method 0x0aaf7043. +// +// Solidity: function setEnabled(address addr) returns() +func (_IAllowList *IAllowListTransactor) SetEnabled(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { + return _IAllowList.contract.Transact(opts, "setEnabled", addr) +} + +// SetEnabled is a paid mutator transaction binding the contract method 0x0aaf7043. +// +// Solidity: function setEnabled(address addr) returns() +func (_IAllowList *IAllowListSession) SetEnabled(addr common.Address) (*types.Transaction, error) { + return _IAllowList.Contract.SetEnabled(&_IAllowList.TransactOpts, addr) +} + +// SetEnabled is a paid mutator transaction binding the contract method 0x0aaf7043. +// +// Solidity: function setEnabled(address addr) returns() +func (_IAllowList *IAllowListTransactorSession) SetEnabled(addr common.Address) (*types.Transaction, error) { + return _IAllowList.Contract.SetEnabled(&_IAllowList.TransactOpts, addr) +} + +// SetManager is a paid mutator transaction binding the contract method 0xd0ebdbe7. +// +// Solidity: function setManager(address addr) returns() +func (_IAllowList *IAllowListTransactor) SetManager(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { + return _IAllowList.contract.Transact(opts, "setManager", addr) +} + +// SetManager is a paid mutator transaction binding the contract method 0xd0ebdbe7. +// +// Solidity: function setManager(address addr) returns() +func (_IAllowList *IAllowListSession) SetManager(addr common.Address) (*types.Transaction, error) { + return _IAllowList.Contract.SetManager(&_IAllowList.TransactOpts, addr) +} + +// SetManager is a paid mutator transaction binding the contract method 0xd0ebdbe7. +// +// Solidity: function setManager(address addr) returns() +func (_IAllowList *IAllowListTransactorSession) SetManager(addr common.Address) (*types.Transaction, error) { + return _IAllowList.Contract.SetManager(&_IAllowList.TransactOpts, addr) +} + +// SetNone is a paid mutator transaction binding the contract method 0x8c6bfb3b. +// +// Solidity: function setNone(address addr) returns() +func (_IAllowList *IAllowListTransactor) SetNone(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { + return _IAllowList.contract.Transact(opts, "setNone", addr) +} + +// SetNone is a paid mutator transaction binding the contract method 0x8c6bfb3b. +// +// Solidity: function setNone(address addr) returns() +func (_IAllowList *IAllowListSession) SetNone(addr common.Address) (*types.Transaction, error) { + return _IAllowList.Contract.SetNone(&_IAllowList.TransactOpts, addr) +} + +// SetNone is a paid mutator transaction binding the contract method 0x8c6bfb3b. +// +// Solidity: function setNone(address addr) returns() +func (_IAllowList *IAllowListTransactorSession) SetNone(addr common.Address) (*types.Transaction, error) { + return _IAllowList.Contract.SetNone(&_IAllowList.TransactOpts, addr) +} + +// IAllowListRoleSetIterator is returned from FilterRoleSet and is used to iterate over the raw logs and unpacked data for RoleSet events raised by the IAllowList contract. +type IAllowListRoleSetIterator struct { + Event *IAllowListRoleSet // 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 *IAllowListRoleSetIterator) 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(IAllowListRoleSet) + 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(IAllowListRoleSet) + 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 *IAllowListRoleSetIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IAllowListRoleSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IAllowListRoleSet represents a RoleSet event raised by the IAllowList contract. +type IAllowListRoleSet struct { + Role *big.Int + Account common.Address + Sender common.Address + OldRole *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterRoleSet is a free log retrieval operation binding the contract event 0xcdb7ea01f00a414d78757bdb0f6391664ba3fedf987eed280927c1e7d695be3e. +// +// Solidity: event RoleSet(uint256 indexed role, address indexed account, address indexed sender, uint256 oldRole) +func (_IAllowList *IAllowListFilterer) FilterRoleSet(opts *bind.FilterOpts, role []*big.Int, account []common.Address, sender []common.Address) (*IAllowListRoleSetIterator, error) { + + var roleRule []interface{} + for _, roleItem := range role { + roleRule = append(roleRule, roleItem) + } + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _IAllowList.contract.FilterLogs(opts, "RoleSet", roleRule, accountRule, senderRule) + if err != nil { + return nil, err + } + return &IAllowListRoleSetIterator{contract: _IAllowList.contract, event: "RoleSet", logs: logs, sub: sub}, nil +} + +// WatchRoleSet is a free log subscription operation binding the contract event 0xcdb7ea01f00a414d78757bdb0f6391664ba3fedf987eed280927c1e7d695be3e. +// +// Solidity: event RoleSet(uint256 indexed role, address indexed account, address indexed sender, uint256 oldRole) +func (_IAllowList *IAllowListFilterer) WatchRoleSet(opts *bind.WatchOpts, sink chan<- *IAllowListRoleSet, role []*big.Int, account []common.Address, sender []common.Address) (event.Subscription, error) { + + var roleRule []interface{} + for _, roleItem := range role { + roleRule = append(roleRule, roleItem) + } + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _IAllowList.contract.WatchLogs(opts, "RoleSet", roleRule, accountRule, senderRule) + 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(IAllowListRoleSet) + if err := _IAllowList.contract.UnpackLog(event, "RoleSet", 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 +} + +// ParseRoleSet is a log parse operation binding the contract event 0xcdb7ea01f00a414d78757bdb0f6391664ba3fedf987eed280927c1e7d695be3e. +// +// Solidity: event RoleSet(uint256 indexed role, address indexed account, address indexed sender, uint256 oldRole) +func (_IAllowList *IAllowListFilterer) ParseRoleSet(log types.Log) (*IAllowListRoleSet, error) { + event := new(IAllowListRoleSet) + if err := _IAllowList.contract.UnpackLog(event, "RoleSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/contracts/bindings/ifeemanager.go b/contracts/bindings/ifeemanager.go new file mode 100644 index 0000000000..8b5013dcc7 --- /dev/null +++ b/contracts/bindings/ifeemanager.go @@ -0,0 +1,744 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ava-labs/libevm" + "github.com/ava-labs/libevm/accounts/abi" + "github.com/ava-labs/libevm/accounts/abi/bind" + "github.com/ava-labs/libevm/common" + "github.com/ava-labs/libevm/core/types" + "github.com/ava-labs/libevm/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +// IFeeManagerFeeConfig is an auto generated low-level Go binding around an user-defined struct. +type IFeeManagerFeeConfig struct { + GasLimit *big.Int + TargetBlockRate *big.Int + MinBaseFee *big.Int + TargetGas *big.Int + BaseFeeChangeDenominator *big.Int + MinBlockGasCost *big.Int + MaxBlockGasCost *big.Int + BlockGasCostStep *big.Int +} + +// IFeeManagerMetaData contains all meta data concerning the IFeeManager contract. +var IFeeManagerMetaData = &bind.MetaData{ + ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"targetBlockRate\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minBaseFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"targetGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"baseFeeChangeDenominator\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minBlockGasCost\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxBlockGasCost\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockGasCostStep\",\"type\":\"uint256\"}],\"indexed\":false,\"internalType\":\"structIFeeManager.FeeConfig\",\"name\":\"oldFeeConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"targetBlockRate\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minBaseFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"targetGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"baseFeeChangeDenominator\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minBlockGasCost\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxBlockGasCost\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockGasCostStep\",\"type\":\"uint256\"}],\"indexed\":false,\"internalType\":\"structIFeeManager.FeeConfig\",\"name\":\"newFeeConfig\",\"type\":\"tuple\"}],\"name\":\"FeeConfigChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"role\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldRole\",\"type\":\"uint256\"}],\"name\":\"RoleSet\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"getFeeConfig\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"targetBlockRate\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minBaseFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"targetGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"baseFeeChangeDenominator\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minBlockGasCost\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxBlockGasCost\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockGasCostStep\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getFeeConfigLastChangedAt\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"readAllowList\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"role\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setEnabled\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"targetBlockRate\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minBaseFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"targetGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"baseFeeChangeDenominator\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minBlockGasCost\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxBlockGasCost\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockGasCostStep\",\"type\":\"uint256\"}],\"name\":\"setFeeConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setNone\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", +} + +// IFeeManagerABI is the input ABI used to generate the binding from. +// Deprecated: Use IFeeManagerMetaData.ABI instead. +var IFeeManagerABI = IFeeManagerMetaData.ABI + +// IFeeManager is an auto generated Go binding around an Ethereum contract. +type IFeeManager struct { + IFeeManagerCaller // Read-only binding to the contract + IFeeManagerTransactor // Write-only binding to the contract + IFeeManagerFilterer // Log filterer for contract events +} + +// IFeeManagerCaller is an auto generated read-only Go binding around an Ethereum contract. +type IFeeManagerCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// IFeeManagerTransactor is an auto generated write-only Go binding around an Ethereum contract. +type IFeeManagerTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// IFeeManagerFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type IFeeManagerFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// IFeeManagerSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type IFeeManagerSession struct { + Contract *IFeeManager // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// IFeeManagerCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type IFeeManagerCallerSession struct { + Contract *IFeeManagerCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// IFeeManagerTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type IFeeManagerTransactorSession struct { + Contract *IFeeManagerTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// IFeeManagerRaw is an auto generated low-level Go binding around an Ethereum contract. +type IFeeManagerRaw struct { + Contract *IFeeManager // Generic contract binding to access the raw methods on +} + +// IFeeManagerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type IFeeManagerCallerRaw struct { + Contract *IFeeManagerCaller // Generic read-only contract binding to access the raw methods on +} + +// IFeeManagerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type IFeeManagerTransactorRaw struct { + Contract *IFeeManagerTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewIFeeManager creates a new instance of IFeeManager, bound to a specific deployed contract. +func NewIFeeManager(address common.Address, backend bind.ContractBackend) (*IFeeManager, error) { + contract, err := bindIFeeManager(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &IFeeManager{IFeeManagerCaller: IFeeManagerCaller{contract: contract}, IFeeManagerTransactor: IFeeManagerTransactor{contract: contract}, IFeeManagerFilterer: IFeeManagerFilterer{contract: contract}}, nil +} + +// NewIFeeManagerCaller creates a new read-only instance of IFeeManager, bound to a specific deployed contract. +func NewIFeeManagerCaller(address common.Address, caller bind.ContractCaller) (*IFeeManagerCaller, error) { + contract, err := bindIFeeManager(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &IFeeManagerCaller{contract: contract}, nil +} + +// NewIFeeManagerTransactor creates a new write-only instance of IFeeManager, bound to a specific deployed contract. +func NewIFeeManagerTransactor(address common.Address, transactor bind.ContractTransactor) (*IFeeManagerTransactor, error) { + contract, err := bindIFeeManager(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &IFeeManagerTransactor{contract: contract}, nil +} + +// NewIFeeManagerFilterer creates a new log filterer instance of IFeeManager, bound to a specific deployed contract. +func NewIFeeManagerFilterer(address common.Address, filterer bind.ContractFilterer) (*IFeeManagerFilterer, error) { + contract, err := bindIFeeManager(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &IFeeManagerFilterer{contract: contract}, nil +} + +// bindIFeeManager binds a generic wrapper to an already deployed contract. +func bindIFeeManager(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := IFeeManagerMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_IFeeManager *IFeeManagerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _IFeeManager.Contract.IFeeManagerCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_IFeeManager *IFeeManagerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _IFeeManager.Contract.IFeeManagerTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_IFeeManager *IFeeManagerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _IFeeManager.Contract.IFeeManagerTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_IFeeManager *IFeeManagerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _IFeeManager.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_IFeeManager *IFeeManagerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _IFeeManager.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_IFeeManager *IFeeManagerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _IFeeManager.Contract.contract.Transact(opts, method, params...) +} + +// GetFeeConfig is a free data retrieval call binding the contract method 0x5fbbc0d2. +// +// Solidity: function getFeeConfig() view returns(uint256 gasLimit, uint256 targetBlockRate, uint256 minBaseFee, uint256 targetGas, uint256 baseFeeChangeDenominator, uint256 minBlockGasCost, uint256 maxBlockGasCost, uint256 blockGasCostStep) +func (_IFeeManager *IFeeManagerCaller) GetFeeConfig(opts *bind.CallOpts) (struct { + GasLimit *big.Int + TargetBlockRate *big.Int + MinBaseFee *big.Int + TargetGas *big.Int + BaseFeeChangeDenominator *big.Int + MinBlockGasCost *big.Int + MaxBlockGasCost *big.Int + BlockGasCostStep *big.Int +}, error) { + var out []interface{} + err := _IFeeManager.contract.Call(opts, &out, "getFeeConfig") + + outstruct := new(struct { + GasLimit *big.Int + TargetBlockRate *big.Int + MinBaseFee *big.Int + TargetGas *big.Int + BaseFeeChangeDenominator *big.Int + MinBlockGasCost *big.Int + MaxBlockGasCost *big.Int + BlockGasCostStep *big.Int + }) + if err != nil { + return *outstruct, err + } + + outstruct.GasLimit = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + outstruct.TargetBlockRate = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + outstruct.MinBaseFee = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) + outstruct.TargetGas = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) + outstruct.BaseFeeChangeDenominator = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) + outstruct.MinBlockGasCost = *abi.ConvertType(out[5], new(*big.Int)).(**big.Int) + outstruct.MaxBlockGasCost = *abi.ConvertType(out[6], new(*big.Int)).(**big.Int) + outstruct.BlockGasCostStep = *abi.ConvertType(out[7], new(*big.Int)).(**big.Int) + + return *outstruct, err + +} + +// GetFeeConfig is a free data retrieval call binding the contract method 0x5fbbc0d2. +// +// Solidity: function getFeeConfig() view returns(uint256 gasLimit, uint256 targetBlockRate, uint256 minBaseFee, uint256 targetGas, uint256 baseFeeChangeDenominator, uint256 minBlockGasCost, uint256 maxBlockGasCost, uint256 blockGasCostStep) +func (_IFeeManager *IFeeManagerSession) GetFeeConfig() (struct { + GasLimit *big.Int + TargetBlockRate *big.Int + MinBaseFee *big.Int + TargetGas *big.Int + BaseFeeChangeDenominator *big.Int + MinBlockGasCost *big.Int + MaxBlockGasCost *big.Int + BlockGasCostStep *big.Int +}, error) { + return _IFeeManager.Contract.GetFeeConfig(&_IFeeManager.CallOpts) +} + +// GetFeeConfig is a free data retrieval call binding the contract method 0x5fbbc0d2. +// +// Solidity: function getFeeConfig() view returns(uint256 gasLimit, uint256 targetBlockRate, uint256 minBaseFee, uint256 targetGas, uint256 baseFeeChangeDenominator, uint256 minBlockGasCost, uint256 maxBlockGasCost, uint256 blockGasCostStep) +func (_IFeeManager *IFeeManagerCallerSession) GetFeeConfig() (struct { + GasLimit *big.Int + TargetBlockRate *big.Int + MinBaseFee *big.Int + TargetGas *big.Int + BaseFeeChangeDenominator *big.Int + MinBlockGasCost *big.Int + MaxBlockGasCost *big.Int + BlockGasCostStep *big.Int +}, error) { + return _IFeeManager.Contract.GetFeeConfig(&_IFeeManager.CallOpts) +} + +// GetFeeConfigLastChangedAt is a free data retrieval call binding the contract method 0x9e05549a. +// +// Solidity: function getFeeConfigLastChangedAt() view returns(uint256 blockNumber) +func (_IFeeManager *IFeeManagerCaller) GetFeeConfigLastChangedAt(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _IFeeManager.contract.Call(opts, &out, "getFeeConfigLastChangedAt") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetFeeConfigLastChangedAt is a free data retrieval call binding the contract method 0x9e05549a. +// +// Solidity: function getFeeConfigLastChangedAt() view returns(uint256 blockNumber) +func (_IFeeManager *IFeeManagerSession) GetFeeConfigLastChangedAt() (*big.Int, error) { + return _IFeeManager.Contract.GetFeeConfigLastChangedAt(&_IFeeManager.CallOpts) +} + +// GetFeeConfigLastChangedAt is a free data retrieval call binding the contract method 0x9e05549a. +// +// Solidity: function getFeeConfigLastChangedAt() view returns(uint256 blockNumber) +func (_IFeeManager *IFeeManagerCallerSession) GetFeeConfigLastChangedAt() (*big.Int, error) { + return _IFeeManager.Contract.GetFeeConfigLastChangedAt(&_IFeeManager.CallOpts) +} + +// ReadAllowList is a free data retrieval call binding the contract method 0xeb54dae1. +// +// Solidity: function readAllowList(address addr) view returns(uint256 role) +func (_IFeeManager *IFeeManagerCaller) ReadAllowList(opts *bind.CallOpts, addr common.Address) (*big.Int, error) { + var out []interface{} + err := _IFeeManager.contract.Call(opts, &out, "readAllowList", addr) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// ReadAllowList is a free data retrieval call binding the contract method 0xeb54dae1. +// +// Solidity: function readAllowList(address addr) view returns(uint256 role) +func (_IFeeManager *IFeeManagerSession) ReadAllowList(addr common.Address) (*big.Int, error) { + return _IFeeManager.Contract.ReadAllowList(&_IFeeManager.CallOpts, addr) +} + +// ReadAllowList is a free data retrieval call binding the contract method 0xeb54dae1. +// +// Solidity: function readAllowList(address addr) view returns(uint256 role) +func (_IFeeManager *IFeeManagerCallerSession) ReadAllowList(addr common.Address) (*big.Int, error) { + return _IFeeManager.Contract.ReadAllowList(&_IFeeManager.CallOpts, addr) +} + +// SetAdmin is a paid mutator transaction binding the contract method 0x704b6c02. +// +// Solidity: function setAdmin(address addr) returns() +func (_IFeeManager *IFeeManagerTransactor) SetAdmin(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { + return _IFeeManager.contract.Transact(opts, "setAdmin", addr) +} + +// SetAdmin is a paid mutator transaction binding the contract method 0x704b6c02. +// +// Solidity: function setAdmin(address addr) returns() +func (_IFeeManager *IFeeManagerSession) SetAdmin(addr common.Address) (*types.Transaction, error) { + return _IFeeManager.Contract.SetAdmin(&_IFeeManager.TransactOpts, addr) +} + +// SetAdmin is a paid mutator transaction binding the contract method 0x704b6c02. +// +// Solidity: function setAdmin(address addr) returns() +func (_IFeeManager *IFeeManagerTransactorSession) SetAdmin(addr common.Address) (*types.Transaction, error) { + return _IFeeManager.Contract.SetAdmin(&_IFeeManager.TransactOpts, addr) +} + +// SetEnabled is a paid mutator transaction binding the contract method 0x0aaf7043. +// +// Solidity: function setEnabled(address addr) returns() +func (_IFeeManager *IFeeManagerTransactor) SetEnabled(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { + return _IFeeManager.contract.Transact(opts, "setEnabled", addr) +} + +// SetEnabled is a paid mutator transaction binding the contract method 0x0aaf7043. +// +// Solidity: function setEnabled(address addr) returns() +func (_IFeeManager *IFeeManagerSession) SetEnabled(addr common.Address) (*types.Transaction, error) { + return _IFeeManager.Contract.SetEnabled(&_IFeeManager.TransactOpts, addr) +} + +// SetEnabled is a paid mutator transaction binding the contract method 0x0aaf7043. +// +// Solidity: function setEnabled(address addr) returns() +func (_IFeeManager *IFeeManagerTransactorSession) SetEnabled(addr common.Address) (*types.Transaction, error) { + return _IFeeManager.Contract.SetEnabled(&_IFeeManager.TransactOpts, addr) +} + +// SetFeeConfig is a paid mutator transaction binding the contract method 0x8f10b586. +// +// Solidity: function setFeeConfig(uint256 gasLimit, uint256 targetBlockRate, uint256 minBaseFee, uint256 targetGas, uint256 baseFeeChangeDenominator, uint256 minBlockGasCost, uint256 maxBlockGasCost, uint256 blockGasCostStep) returns() +func (_IFeeManager *IFeeManagerTransactor) SetFeeConfig(opts *bind.TransactOpts, gasLimit *big.Int, targetBlockRate *big.Int, minBaseFee *big.Int, targetGas *big.Int, baseFeeChangeDenominator *big.Int, minBlockGasCost *big.Int, maxBlockGasCost *big.Int, blockGasCostStep *big.Int) (*types.Transaction, error) { + return _IFeeManager.contract.Transact(opts, "setFeeConfig", gasLimit, targetBlockRate, minBaseFee, targetGas, baseFeeChangeDenominator, minBlockGasCost, maxBlockGasCost, blockGasCostStep) +} + +// SetFeeConfig is a paid mutator transaction binding the contract method 0x8f10b586. +// +// Solidity: function setFeeConfig(uint256 gasLimit, uint256 targetBlockRate, uint256 minBaseFee, uint256 targetGas, uint256 baseFeeChangeDenominator, uint256 minBlockGasCost, uint256 maxBlockGasCost, uint256 blockGasCostStep) returns() +func (_IFeeManager *IFeeManagerSession) SetFeeConfig(gasLimit *big.Int, targetBlockRate *big.Int, minBaseFee *big.Int, targetGas *big.Int, baseFeeChangeDenominator *big.Int, minBlockGasCost *big.Int, maxBlockGasCost *big.Int, blockGasCostStep *big.Int) (*types.Transaction, error) { + return _IFeeManager.Contract.SetFeeConfig(&_IFeeManager.TransactOpts, gasLimit, targetBlockRate, minBaseFee, targetGas, baseFeeChangeDenominator, minBlockGasCost, maxBlockGasCost, blockGasCostStep) +} + +// SetFeeConfig is a paid mutator transaction binding the contract method 0x8f10b586. +// +// Solidity: function setFeeConfig(uint256 gasLimit, uint256 targetBlockRate, uint256 minBaseFee, uint256 targetGas, uint256 baseFeeChangeDenominator, uint256 minBlockGasCost, uint256 maxBlockGasCost, uint256 blockGasCostStep) returns() +func (_IFeeManager *IFeeManagerTransactorSession) SetFeeConfig(gasLimit *big.Int, targetBlockRate *big.Int, minBaseFee *big.Int, targetGas *big.Int, baseFeeChangeDenominator *big.Int, minBlockGasCost *big.Int, maxBlockGasCost *big.Int, blockGasCostStep *big.Int) (*types.Transaction, error) { + return _IFeeManager.Contract.SetFeeConfig(&_IFeeManager.TransactOpts, gasLimit, targetBlockRate, minBaseFee, targetGas, baseFeeChangeDenominator, minBlockGasCost, maxBlockGasCost, blockGasCostStep) +} + +// SetManager is a paid mutator transaction binding the contract method 0xd0ebdbe7. +// +// Solidity: function setManager(address addr) returns() +func (_IFeeManager *IFeeManagerTransactor) SetManager(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { + return _IFeeManager.contract.Transact(opts, "setManager", addr) +} + +// SetManager is a paid mutator transaction binding the contract method 0xd0ebdbe7. +// +// Solidity: function setManager(address addr) returns() +func (_IFeeManager *IFeeManagerSession) SetManager(addr common.Address) (*types.Transaction, error) { + return _IFeeManager.Contract.SetManager(&_IFeeManager.TransactOpts, addr) +} + +// SetManager is a paid mutator transaction binding the contract method 0xd0ebdbe7. +// +// Solidity: function setManager(address addr) returns() +func (_IFeeManager *IFeeManagerTransactorSession) SetManager(addr common.Address) (*types.Transaction, error) { + return _IFeeManager.Contract.SetManager(&_IFeeManager.TransactOpts, addr) +} + +// SetNone is a paid mutator transaction binding the contract method 0x8c6bfb3b. +// +// Solidity: function setNone(address addr) returns() +func (_IFeeManager *IFeeManagerTransactor) SetNone(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { + return _IFeeManager.contract.Transact(opts, "setNone", addr) +} + +// SetNone is a paid mutator transaction binding the contract method 0x8c6bfb3b. +// +// Solidity: function setNone(address addr) returns() +func (_IFeeManager *IFeeManagerSession) SetNone(addr common.Address) (*types.Transaction, error) { + return _IFeeManager.Contract.SetNone(&_IFeeManager.TransactOpts, addr) +} + +// SetNone is a paid mutator transaction binding the contract method 0x8c6bfb3b. +// +// Solidity: function setNone(address addr) returns() +func (_IFeeManager *IFeeManagerTransactorSession) SetNone(addr common.Address) (*types.Transaction, error) { + return _IFeeManager.Contract.SetNone(&_IFeeManager.TransactOpts, addr) +} + +// IFeeManagerFeeConfigChangedIterator is returned from FilterFeeConfigChanged and is used to iterate over the raw logs and unpacked data for FeeConfigChanged events raised by the IFeeManager contract. +type IFeeManagerFeeConfigChangedIterator struct { + Event *IFeeManagerFeeConfigChanged // 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 *IFeeManagerFeeConfigChangedIterator) 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(IFeeManagerFeeConfigChanged) + 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(IFeeManagerFeeConfigChanged) + 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 *IFeeManagerFeeConfigChangedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IFeeManagerFeeConfigChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IFeeManagerFeeConfigChanged represents a FeeConfigChanged event raised by the IFeeManager contract. +type IFeeManagerFeeConfigChanged struct { + Sender common.Address + OldFeeConfig IFeeManagerFeeConfig + NewFeeConfig IFeeManagerFeeConfig + Raw types.Log // Blockchain specific contextual infos +} + +// FilterFeeConfigChanged is a free log retrieval operation binding the contract event 0x4c98e43adb5962c18f3f0e6dd066e2a2de258d3b4f695b317b77c8f27cd044fc. +// +// Solidity: event FeeConfigChanged(address indexed sender, (uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256) oldFeeConfig, (uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256) newFeeConfig) +func (_IFeeManager *IFeeManagerFilterer) FilterFeeConfigChanged(opts *bind.FilterOpts, sender []common.Address) (*IFeeManagerFeeConfigChangedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _IFeeManager.contract.FilterLogs(opts, "FeeConfigChanged", senderRule) + if err != nil { + return nil, err + } + return &IFeeManagerFeeConfigChangedIterator{contract: _IFeeManager.contract, event: "FeeConfigChanged", logs: logs, sub: sub}, nil +} + +// WatchFeeConfigChanged is a free log subscription operation binding the contract event 0x4c98e43adb5962c18f3f0e6dd066e2a2de258d3b4f695b317b77c8f27cd044fc. +// +// Solidity: event FeeConfigChanged(address indexed sender, (uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256) oldFeeConfig, (uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256) newFeeConfig) +func (_IFeeManager *IFeeManagerFilterer) WatchFeeConfigChanged(opts *bind.WatchOpts, sink chan<- *IFeeManagerFeeConfigChanged, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _IFeeManager.contract.WatchLogs(opts, "FeeConfigChanged", senderRule) + 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(IFeeManagerFeeConfigChanged) + if err := _IFeeManager.contract.UnpackLog(event, "FeeConfigChanged", 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 +} + +// ParseFeeConfigChanged is a log parse operation binding the contract event 0x4c98e43adb5962c18f3f0e6dd066e2a2de258d3b4f695b317b77c8f27cd044fc. +// +// Solidity: event FeeConfigChanged(address indexed sender, (uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256) oldFeeConfig, (uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256) newFeeConfig) +func (_IFeeManager *IFeeManagerFilterer) ParseFeeConfigChanged(log types.Log) (*IFeeManagerFeeConfigChanged, error) { + event := new(IFeeManagerFeeConfigChanged) + if err := _IFeeManager.contract.UnpackLog(event, "FeeConfigChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// IFeeManagerRoleSetIterator is returned from FilterRoleSet and is used to iterate over the raw logs and unpacked data for RoleSet events raised by the IFeeManager contract. +type IFeeManagerRoleSetIterator struct { + Event *IFeeManagerRoleSet // 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 *IFeeManagerRoleSetIterator) 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(IFeeManagerRoleSet) + 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(IFeeManagerRoleSet) + 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 *IFeeManagerRoleSetIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IFeeManagerRoleSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IFeeManagerRoleSet represents a RoleSet event raised by the IFeeManager contract. +type IFeeManagerRoleSet struct { + Role *big.Int + Account common.Address + Sender common.Address + OldRole *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterRoleSet is a free log retrieval operation binding the contract event 0xcdb7ea01f00a414d78757bdb0f6391664ba3fedf987eed280927c1e7d695be3e. +// +// Solidity: event RoleSet(uint256 indexed role, address indexed account, address indexed sender, uint256 oldRole) +func (_IFeeManager *IFeeManagerFilterer) FilterRoleSet(opts *bind.FilterOpts, role []*big.Int, account []common.Address, sender []common.Address) (*IFeeManagerRoleSetIterator, error) { + + var roleRule []interface{} + for _, roleItem := range role { + roleRule = append(roleRule, roleItem) + } + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _IFeeManager.contract.FilterLogs(opts, "RoleSet", roleRule, accountRule, senderRule) + if err != nil { + return nil, err + } + return &IFeeManagerRoleSetIterator{contract: _IFeeManager.contract, event: "RoleSet", logs: logs, sub: sub}, nil +} + +// WatchRoleSet is a free log subscription operation binding the contract event 0xcdb7ea01f00a414d78757bdb0f6391664ba3fedf987eed280927c1e7d695be3e. +// +// Solidity: event RoleSet(uint256 indexed role, address indexed account, address indexed sender, uint256 oldRole) +func (_IFeeManager *IFeeManagerFilterer) WatchRoleSet(opts *bind.WatchOpts, sink chan<- *IFeeManagerRoleSet, role []*big.Int, account []common.Address, sender []common.Address) (event.Subscription, error) { + + var roleRule []interface{} + for _, roleItem := range role { + roleRule = append(roleRule, roleItem) + } + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _IFeeManager.contract.WatchLogs(opts, "RoleSet", roleRule, accountRule, senderRule) + 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(IFeeManagerRoleSet) + if err := _IFeeManager.contract.UnpackLog(event, "RoleSet", 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 +} + +// ParseRoleSet is a log parse operation binding the contract event 0xcdb7ea01f00a414d78757bdb0f6391664ba3fedf987eed280927c1e7d695be3e. +// +// Solidity: event RoleSet(uint256 indexed role, address indexed account, address indexed sender, uint256 oldRole) +func (_IFeeManager *IFeeManagerFilterer) ParseRoleSet(log types.Log) (*IFeeManagerRoleSet, error) { + event := new(IFeeManagerRoleSet) + if err := _IFeeManager.contract.UnpackLog(event, "RoleSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/contracts/bindings/inativeminter.go b/contracts/bindings/inativeminter.go new file mode 100644 index 0000000000..c6fb781a70 --- /dev/null +++ b/contracts/bindings/inativeminter.go @@ -0,0 +1,634 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ava-labs/libevm" + "github.com/ava-labs/libevm/accounts/abi" + "github.com/ava-labs/libevm/accounts/abi/bind" + "github.com/ava-labs/libevm/common" + "github.com/ava-labs/libevm/core/types" + "github.com/ava-labs/libevm/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +// INativeMinterMetaData contains all meta data concerning the INativeMinter contract. +var INativeMinterMetaData = &bind.MetaData{ + ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"NativeCoinMinted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"role\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldRole\",\"type\":\"uint256\"}],\"name\":\"RoleSet\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mintNativeCoin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"readAllowList\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"role\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setEnabled\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setNone\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", +} + +// INativeMinterABI is the input ABI used to generate the binding from. +// Deprecated: Use INativeMinterMetaData.ABI instead. +var INativeMinterABI = INativeMinterMetaData.ABI + +// INativeMinter is an auto generated Go binding around an Ethereum contract. +type INativeMinter struct { + INativeMinterCaller // Read-only binding to the contract + INativeMinterTransactor // Write-only binding to the contract + INativeMinterFilterer // Log filterer for contract events +} + +// INativeMinterCaller is an auto generated read-only Go binding around an Ethereum contract. +type INativeMinterCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// INativeMinterTransactor is an auto generated write-only Go binding around an Ethereum contract. +type INativeMinterTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// INativeMinterFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type INativeMinterFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// INativeMinterSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type INativeMinterSession struct { + Contract *INativeMinter // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// INativeMinterCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type INativeMinterCallerSession struct { + Contract *INativeMinterCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// INativeMinterTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type INativeMinterTransactorSession struct { + Contract *INativeMinterTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// INativeMinterRaw is an auto generated low-level Go binding around an Ethereum contract. +type INativeMinterRaw struct { + Contract *INativeMinter // Generic contract binding to access the raw methods on +} + +// INativeMinterCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type INativeMinterCallerRaw struct { + Contract *INativeMinterCaller // Generic read-only contract binding to access the raw methods on +} + +// INativeMinterTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type INativeMinterTransactorRaw struct { + Contract *INativeMinterTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewINativeMinter creates a new instance of INativeMinter, bound to a specific deployed contract. +func NewINativeMinter(address common.Address, backend bind.ContractBackend) (*INativeMinter, error) { + contract, err := bindINativeMinter(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &INativeMinter{INativeMinterCaller: INativeMinterCaller{contract: contract}, INativeMinterTransactor: INativeMinterTransactor{contract: contract}, INativeMinterFilterer: INativeMinterFilterer{contract: contract}}, nil +} + +// NewINativeMinterCaller creates a new read-only instance of INativeMinter, bound to a specific deployed contract. +func NewINativeMinterCaller(address common.Address, caller bind.ContractCaller) (*INativeMinterCaller, error) { + contract, err := bindINativeMinter(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &INativeMinterCaller{contract: contract}, nil +} + +// NewINativeMinterTransactor creates a new write-only instance of INativeMinter, bound to a specific deployed contract. +func NewINativeMinterTransactor(address common.Address, transactor bind.ContractTransactor) (*INativeMinterTransactor, error) { + contract, err := bindINativeMinter(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &INativeMinterTransactor{contract: contract}, nil +} + +// NewINativeMinterFilterer creates a new log filterer instance of INativeMinter, bound to a specific deployed contract. +func NewINativeMinterFilterer(address common.Address, filterer bind.ContractFilterer) (*INativeMinterFilterer, error) { + contract, err := bindINativeMinter(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &INativeMinterFilterer{contract: contract}, nil +} + +// bindINativeMinter binds a generic wrapper to an already deployed contract. +func bindINativeMinter(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := INativeMinterMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_INativeMinter *INativeMinterRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _INativeMinter.Contract.INativeMinterCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_INativeMinter *INativeMinterRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _INativeMinter.Contract.INativeMinterTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_INativeMinter *INativeMinterRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _INativeMinter.Contract.INativeMinterTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_INativeMinter *INativeMinterCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _INativeMinter.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_INativeMinter *INativeMinterTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _INativeMinter.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_INativeMinter *INativeMinterTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _INativeMinter.Contract.contract.Transact(opts, method, params...) +} + +// ReadAllowList is a free data retrieval call binding the contract method 0xeb54dae1. +// +// Solidity: function readAllowList(address addr) view returns(uint256 role) +func (_INativeMinter *INativeMinterCaller) ReadAllowList(opts *bind.CallOpts, addr common.Address) (*big.Int, error) { + var out []interface{} + err := _INativeMinter.contract.Call(opts, &out, "readAllowList", addr) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// ReadAllowList is a free data retrieval call binding the contract method 0xeb54dae1. +// +// Solidity: function readAllowList(address addr) view returns(uint256 role) +func (_INativeMinter *INativeMinterSession) ReadAllowList(addr common.Address) (*big.Int, error) { + return _INativeMinter.Contract.ReadAllowList(&_INativeMinter.CallOpts, addr) +} + +// ReadAllowList is a free data retrieval call binding the contract method 0xeb54dae1. +// +// Solidity: function readAllowList(address addr) view returns(uint256 role) +func (_INativeMinter *INativeMinterCallerSession) ReadAllowList(addr common.Address) (*big.Int, error) { + return _INativeMinter.Contract.ReadAllowList(&_INativeMinter.CallOpts, addr) +} + +// MintNativeCoin is a paid mutator transaction binding the contract method 0x4f5aaaba. +// +// Solidity: function mintNativeCoin(address addr, uint256 amount) returns() +func (_INativeMinter *INativeMinterTransactor) MintNativeCoin(opts *bind.TransactOpts, addr common.Address, amount *big.Int) (*types.Transaction, error) { + return _INativeMinter.contract.Transact(opts, "mintNativeCoin", addr, amount) +} + +// MintNativeCoin is a paid mutator transaction binding the contract method 0x4f5aaaba. +// +// Solidity: function mintNativeCoin(address addr, uint256 amount) returns() +func (_INativeMinter *INativeMinterSession) MintNativeCoin(addr common.Address, amount *big.Int) (*types.Transaction, error) { + return _INativeMinter.Contract.MintNativeCoin(&_INativeMinter.TransactOpts, addr, amount) +} + +// MintNativeCoin is a paid mutator transaction binding the contract method 0x4f5aaaba. +// +// Solidity: function mintNativeCoin(address addr, uint256 amount) returns() +func (_INativeMinter *INativeMinterTransactorSession) MintNativeCoin(addr common.Address, amount *big.Int) (*types.Transaction, error) { + return _INativeMinter.Contract.MintNativeCoin(&_INativeMinter.TransactOpts, addr, amount) +} + +// SetAdmin is a paid mutator transaction binding the contract method 0x704b6c02. +// +// Solidity: function setAdmin(address addr) returns() +func (_INativeMinter *INativeMinterTransactor) SetAdmin(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { + return _INativeMinter.contract.Transact(opts, "setAdmin", addr) +} + +// SetAdmin is a paid mutator transaction binding the contract method 0x704b6c02. +// +// Solidity: function setAdmin(address addr) returns() +func (_INativeMinter *INativeMinterSession) SetAdmin(addr common.Address) (*types.Transaction, error) { + return _INativeMinter.Contract.SetAdmin(&_INativeMinter.TransactOpts, addr) +} + +// SetAdmin is a paid mutator transaction binding the contract method 0x704b6c02. +// +// Solidity: function setAdmin(address addr) returns() +func (_INativeMinter *INativeMinterTransactorSession) SetAdmin(addr common.Address) (*types.Transaction, error) { + return _INativeMinter.Contract.SetAdmin(&_INativeMinter.TransactOpts, addr) +} + +// SetEnabled is a paid mutator transaction binding the contract method 0x0aaf7043. +// +// Solidity: function setEnabled(address addr) returns() +func (_INativeMinter *INativeMinterTransactor) SetEnabled(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { + return _INativeMinter.contract.Transact(opts, "setEnabled", addr) +} + +// SetEnabled is a paid mutator transaction binding the contract method 0x0aaf7043. +// +// Solidity: function setEnabled(address addr) returns() +func (_INativeMinter *INativeMinterSession) SetEnabled(addr common.Address) (*types.Transaction, error) { + return _INativeMinter.Contract.SetEnabled(&_INativeMinter.TransactOpts, addr) +} + +// SetEnabled is a paid mutator transaction binding the contract method 0x0aaf7043. +// +// Solidity: function setEnabled(address addr) returns() +func (_INativeMinter *INativeMinterTransactorSession) SetEnabled(addr common.Address) (*types.Transaction, error) { + return _INativeMinter.Contract.SetEnabled(&_INativeMinter.TransactOpts, addr) +} + +// SetManager is a paid mutator transaction binding the contract method 0xd0ebdbe7. +// +// Solidity: function setManager(address addr) returns() +func (_INativeMinter *INativeMinterTransactor) SetManager(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { + return _INativeMinter.contract.Transact(opts, "setManager", addr) +} + +// SetManager is a paid mutator transaction binding the contract method 0xd0ebdbe7. +// +// Solidity: function setManager(address addr) returns() +func (_INativeMinter *INativeMinterSession) SetManager(addr common.Address) (*types.Transaction, error) { + return _INativeMinter.Contract.SetManager(&_INativeMinter.TransactOpts, addr) +} + +// SetManager is a paid mutator transaction binding the contract method 0xd0ebdbe7. +// +// Solidity: function setManager(address addr) returns() +func (_INativeMinter *INativeMinterTransactorSession) SetManager(addr common.Address) (*types.Transaction, error) { + return _INativeMinter.Contract.SetManager(&_INativeMinter.TransactOpts, addr) +} + +// SetNone is a paid mutator transaction binding the contract method 0x8c6bfb3b. +// +// Solidity: function setNone(address addr) returns() +func (_INativeMinter *INativeMinterTransactor) SetNone(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { + return _INativeMinter.contract.Transact(opts, "setNone", addr) +} + +// SetNone is a paid mutator transaction binding the contract method 0x8c6bfb3b. +// +// Solidity: function setNone(address addr) returns() +func (_INativeMinter *INativeMinterSession) SetNone(addr common.Address) (*types.Transaction, error) { + return _INativeMinter.Contract.SetNone(&_INativeMinter.TransactOpts, addr) +} + +// SetNone is a paid mutator transaction binding the contract method 0x8c6bfb3b. +// +// Solidity: function setNone(address addr) returns() +func (_INativeMinter *INativeMinterTransactorSession) SetNone(addr common.Address) (*types.Transaction, error) { + return _INativeMinter.Contract.SetNone(&_INativeMinter.TransactOpts, addr) +} + +// INativeMinterNativeCoinMintedIterator is returned from FilterNativeCoinMinted and is used to iterate over the raw logs and unpacked data for NativeCoinMinted events raised by the INativeMinter contract. +type INativeMinterNativeCoinMintedIterator struct { + Event *INativeMinterNativeCoinMinted // 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 *INativeMinterNativeCoinMintedIterator) 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(INativeMinterNativeCoinMinted) + 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(INativeMinterNativeCoinMinted) + 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 *INativeMinterNativeCoinMintedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *INativeMinterNativeCoinMintedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// INativeMinterNativeCoinMinted represents a NativeCoinMinted event raised by the INativeMinter contract. +type INativeMinterNativeCoinMinted struct { + Sender common.Address + Recipient common.Address + Amount *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterNativeCoinMinted is a free log retrieval operation binding the contract event 0x400cd392f3d56fd10bb1dbd5839fdda8298208ddaa97b368faa053e1850930ee. +// +// Solidity: event NativeCoinMinted(address indexed sender, address indexed recipient, uint256 amount) +func (_INativeMinter *INativeMinterFilterer) FilterNativeCoinMinted(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*INativeMinterNativeCoinMintedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _INativeMinter.contract.FilterLogs(opts, "NativeCoinMinted", senderRule, recipientRule) + if err != nil { + return nil, err + } + return &INativeMinterNativeCoinMintedIterator{contract: _INativeMinter.contract, event: "NativeCoinMinted", logs: logs, sub: sub}, nil +} + +// WatchNativeCoinMinted is a free log subscription operation binding the contract event 0x400cd392f3d56fd10bb1dbd5839fdda8298208ddaa97b368faa053e1850930ee. +// +// Solidity: event NativeCoinMinted(address indexed sender, address indexed recipient, uint256 amount) +func (_INativeMinter *INativeMinterFilterer) WatchNativeCoinMinted(opts *bind.WatchOpts, sink chan<- *INativeMinterNativeCoinMinted, sender []common.Address, recipient []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _INativeMinter.contract.WatchLogs(opts, "NativeCoinMinted", senderRule, recipientRule) + 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(INativeMinterNativeCoinMinted) + if err := _INativeMinter.contract.UnpackLog(event, "NativeCoinMinted", 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 +} + +// ParseNativeCoinMinted is a log parse operation binding the contract event 0x400cd392f3d56fd10bb1dbd5839fdda8298208ddaa97b368faa053e1850930ee. +// +// Solidity: event NativeCoinMinted(address indexed sender, address indexed recipient, uint256 amount) +func (_INativeMinter *INativeMinterFilterer) ParseNativeCoinMinted(log types.Log) (*INativeMinterNativeCoinMinted, error) { + event := new(INativeMinterNativeCoinMinted) + if err := _INativeMinter.contract.UnpackLog(event, "NativeCoinMinted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// INativeMinterRoleSetIterator is returned from FilterRoleSet and is used to iterate over the raw logs and unpacked data for RoleSet events raised by the INativeMinter contract. +type INativeMinterRoleSetIterator struct { + Event *INativeMinterRoleSet // 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 *INativeMinterRoleSetIterator) 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(INativeMinterRoleSet) + 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(INativeMinterRoleSet) + 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 *INativeMinterRoleSetIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *INativeMinterRoleSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// INativeMinterRoleSet represents a RoleSet event raised by the INativeMinter contract. +type INativeMinterRoleSet struct { + Role *big.Int + Account common.Address + Sender common.Address + OldRole *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterRoleSet is a free log retrieval operation binding the contract event 0xcdb7ea01f00a414d78757bdb0f6391664ba3fedf987eed280927c1e7d695be3e. +// +// Solidity: event RoleSet(uint256 indexed role, address indexed account, address indexed sender, uint256 oldRole) +func (_INativeMinter *INativeMinterFilterer) FilterRoleSet(opts *bind.FilterOpts, role []*big.Int, account []common.Address, sender []common.Address) (*INativeMinterRoleSetIterator, error) { + + var roleRule []interface{} + for _, roleItem := range role { + roleRule = append(roleRule, roleItem) + } + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _INativeMinter.contract.FilterLogs(opts, "RoleSet", roleRule, accountRule, senderRule) + if err != nil { + return nil, err + } + return &INativeMinterRoleSetIterator{contract: _INativeMinter.contract, event: "RoleSet", logs: logs, sub: sub}, nil +} + +// WatchRoleSet is a free log subscription operation binding the contract event 0xcdb7ea01f00a414d78757bdb0f6391664ba3fedf987eed280927c1e7d695be3e. +// +// Solidity: event RoleSet(uint256 indexed role, address indexed account, address indexed sender, uint256 oldRole) +func (_INativeMinter *INativeMinterFilterer) WatchRoleSet(opts *bind.WatchOpts, sink chan<- *INativeMinterRoleSet, role []*big.Int, account []common.Address, sender []common.Address) (event.Subscription, error) { + + var roleRule []interface{} + for _, roleItem := range role { + roleRule = append(roleRule, roleItem) + } + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _INativeMinter.contract.WatchLogs(opts, "RoleSet", roleRule, accountRule, senderRule) + 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(INativeMinterRoleSet) + if err := _INativeMinter.contract.UnpackLog(event, "RoleSet", 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 +} + +// ParseRoleSet is a log parse operation binding the contract event 0xcdb7ea01f00a414d78757bdb0f6391664ba3fedf987eed280927c1e7d695be3e. +// +// Solidity: event RoleSet(uint256 indexed role, address indexed account, address indexed sender, uint256 oldRole) +func (_INativeMinter *INativeMinterFilterer) ParseRoleSet(log types.Log) (*INativeMinterRoleSet, error) { + event := new(INativeMinterRoleSet) + if err := _INativeMinter.contract.UnpackLog(event, "RoleSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/contracts/bindings/irewardmanager.go b/contracts/bindings/irewardmanager.go new file mode 100644 index 0000000000..cc37a8636c --- /dev/null +++ b/contracts/bindings/irewardmanager.go @@ -0,0 +1,1034 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ava-labs/libevm" + "github.com/ava-labs/libevm/accounts/abi" + "github.com/ava-labs/libevm/accounts/abi/bind" + "github.com/ava-labs/libevm/common" + "github.com/ava-labs/libevm/core/types" + "github.com/ava-labs/libevm/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +// IRewardManagerMetaData contains all meta data concerning the IRewardManager contract. +var IRewardManagerMetaData = &bind.MetaData{ + ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"FeeRecipientsAllowed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldRewardAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newRewardAddress\",\"type\":\"address\"}],\"name\":\"RewardAddressChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RewardsDisabled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"role\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldRole\",\"type\":\"uint256\"}],\"name\":\"RoleSet\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"allowFeeRecipients\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"areFeeRecipientsAllowed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"isAllowed\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentRewardAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"rewardAddress\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"disableRewards\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"readAllowList\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"role\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setEnabled\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setNone\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setRewardAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", +} + +// IRewardManagerABI is the input ABI used to generate the binding from. +// Deprecated: Use IRewardManagerMetaData.ABI instead. +var IRewardManagerABI = IRewardManagerMetaData.ABI + +// IRewardManager is an auto generated Go binding around an Ethereum contract. +type IRewardManager struct { + IRewardManagerCaller // Read-only binding to the contract + IRewardManagerTransactor // Write-only binding to the contract + IRewardManagerFilterer // Log filterer for contract events +} + +// IRewardManagerCaller is an auto generated read-only Go binding around an Ethereum contract. +type IRewardManagerCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// IRewardManagerTransactor is an auto generated write-only Go binding around an Ethereum contract. +type IRewardManagerTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// IRewardManagerFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type IRewardManagerFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// IRewardManagerSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type IRewardManagerSession struct { + Contract *IRewardManager // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// IRewardManagerCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type IRewardManagerCallerSession struct { + Contract *IRewardManagerCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// IRewardManagerTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type IRewardManagerTransactorSession struct { + Contract *IRewardManagerTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// IRewardManagerRaw is an auto generated low-level Go binding around an Ethereum contract. +type IRewardManagerRaw struct { + Contract *IRewardManager // Generic contract binding to access the raw methods on +} + +// IRewardManagerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type IRewardManagerCallerRaw struct { + Contract *IRewardManagerCaller // Generic read-only contract binding to access the raw methods on +} + +// IRewardManagerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type IRewardManagerTransactorRaw struct { + Contract *IRewardManagerTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewIRewardManager creates a new instance of IRewardManager, bound to a specific deployed contract. +func NewIRewardManager(address common.Address, backend bind.ContractBackend) (*IRewardManager, error) { + contract, err := bindIRewardManager(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &IRewardManager{IRewardManagerCaller: IRewardManagerCaller{contract: contract}, IRewardManagerTransactor: IRewardManagerTransactor{contract: contract}, IRewardManagerFilterer: IRewardManagerFilterer{contract: contract}}, nil +} + +// NewIRewardManagerCaller creates a new read-only instance of IRewardManager, bound to a specific deployed contract. +func NewIRewardManagerCaller(address common.Address, caller bind.ContractCaller) (*IRewardManagerCaller, error) { + contract, err := bindIRewardManager(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &IRewardManagerCaller{contract: contract}, nil +} + +// NewIRewardManagerTransactor creates a new write-only instance of IRewardManager, bound to a specific deployed contract. +func NewIRewardManagerTransactor(address common.Address, transactor bind.ContractTransactor) (*IRewardManagerTransactor, error) { + contract, err := bindIRewardManager(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &IRewardManagerTransactor{contract: contract}, nil +} + +// NewIRewardManagerFilterer creates a new log filterer instance of IRewardManager, bound to a specific deployed contract. +func NewIRewardManagerFilterer(address common.Address, filterer bind.ContractFilterer) (*IRewardManagerFilterer, error) { + contract, err := bindIRewardManager(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &IRewardManagerFilterer{contract: contract}, nil +} + +// bindIRewardManager binds a generic wrapper to an already deployed contract. +func bindIRewardManager(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := IRewardManagerMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_IRewardManager *IRewardManagerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _IRewardManager.Contract.IRewardManagerCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_IRewardManager *IRewardManagerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _IRewardManager.Contract.IRewardManagerTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_IRewardManager *IRewardManagerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _IRewardManager.Contract.IRewardManagerTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_IRewardManager *IRewardManagerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _IRewardManager.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_IRewardManager *IRewardManagerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _IRewardManager.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_IRewardManager *IRewardManagerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _IRewardManager.Contract.contract.Transact(opts, method, params...) +} + +// AreFeeRecipientsAllowed is a free data retrieval call binding the contract method 0xf6542b2e. +// +// Solidity: function areFeeRecipientsAllowed() view returns(bool isAllowed) +func (_IRewardManager *IRewardManagerCaller) AreFeeRecipientsAllowed(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _IRewardManager.contract.Call(opts, &out, "areFeeRecipientsAllowed") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// AreFeeRecipientsAllowed is a free data retrieval call binding the contract method 0xf6542b2e. +// +// Solidity: function areFeeRecipientsAllowed() view returns(bool isAllowed) +func (_IRewardManager *IRewardManagerSession) AreFeeRecipientsAllowed() (bool, error) { + return _IRewardManager.Contract.AreFeeRecipientsAllowed(&_IRewardManager.CallOpts) +} + +// AreFeeRecipientsAllowed is a free data retrieval call binding the contract method 0xf6542b2e. +// +// Solidity: function areFeeRecipientsAllowed() view returns(bool isAllowed) +func (_IRewardManager *IRewardManagerCallerSession) AreFeeRecipientsAllowed() (bool, error) { + return _IRewardManager.Contract.AreFeeRecipientsAllowed(&_IRewardManager.CallOpts) +} + +// CurrentRewardAddress is a free data retrieval call binding the contract method 0xe915608b. +// +// Solidity: function currentRewardAddress() view returns(address rewardAddress) +func (_IRewardManager *IRewardManagerCaller) CurrentRewardAddress(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _IRewardManager.contract.Call(opts, &out, "currentRewardAddress") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// CurrentRewardAddress is a free data retrieval call binding the contract method 0xe915608b. +// +// Solidity: function currentRewardAddress() view returns(address rewardAddress) +func (_IRewardManager *IRewardManagerSession) CurrentRewardAddress() (common.Address, error) { + return _IRewardManager.Contract.CurrentRewardAddress(&_IRewardManager.CallOpts) +} + +// CurrentRewardAddress is a free data retrieval call binding the contract method 0xe915608b. +// +// Solidity: function currentRewardAddress() view returns(address rewardAddress) +func (_IRewardManager *IRewardManagerCallerSession) CurrentRewardAddress() (common.Address, error) { + return _IRewardManager.Contract.CurrentRewardAddress(&_IRewardManager.CallOpts) +} + +// ReadAllowList is a free data retrieval call binding the contract method 0xeb54dae1. +// +// Solidity: function readAllowList(address addr) view returns(uint256 role) +func (_IRewardManager *IRewardManagerCaller) ReadAllowList(opts *bind.CallOpts, addr common.Address) (*big.Int, error) { + var out []interface{} + err := _IRewardManager.contract.Call(opts, &out, "readAllowList", addr) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// ReadAllowList is a free data retrieval call binding the contract method 0xeb54dae1. +// +// Solidity: function readAllowList(address addr) view returns(uint256 role) +func (_IRewardManager *IRewardManagerSession) ReadAllowList(addr common.Address) (*big.Int, error) { + return _IRewardManager.Contract.ReadAllowList(&_IRewardManager.CallOpts, addr) +} + +// ReadAllowList is a free data retrieval call binding the contract method 0xeb54dae1. +// +// Solidity: function readAllowList(address addr) view returns(uint256 role) +func (_IRewardManager *IRewardManagerCallerSession) ReadAllowList(addr common.Address) (*big.Int, error) { + return _IRewardManager.Contract.ReadAllowList(&_IRewardManager.CallOpts, addr) +} + +// AllowFeeRecipients is a paid mutator transaction binding the contract method 0x0329099f. +// +// Solidity: function allowFeeRecipients() returns() +func (_IRewardManager *IRewardManagerTransactor) AllowFeeRecipients(opts *bind.TransactOpts) (*types.Transaction, error) { + return _IRewardManager.contract.Transact(opts, "allowFeeRecipients") +} + +// AllowFeeRecipients is a paid mutator transaction binding the contract method 0x0329099f. +// +// Solidity: function allowFeeRecipients() returns() +func (_IRewardManager *IRewardManagerSession) AllowFeeRecipients() (*types.Transaction, error) { + return _IRewardManager.Contract.AllowFeeRecipients(&_IRewardManager.TransactOpts) +} + +// AllowFeeRecipients is a paid mutator transaction binding the contract method 0x0329099f. +// +// Solidity: function allowFeeRecipients() returns() +func (_IRewardManager *IRewardManagerTransactorSession) AllowFeeRecipients() (*types.Transaction, error) { + return _IRewardManager.Contract.AllowFeeRecipients(&_IRewardManager.TransactOpts) +} + +// DisableRewards is a paid mutator transaction binding the contract method 0xbc178628. +// +// Solidity: function disableRewards() returns() +func (_IRewardManager *IRewardManagerTransactor) DisableRewards(opts *bind.TransactOpts) (*types.Transaction, error) { + return _IRewardManager.contract.Transact(opts, "disableRewards") +} + +// DisableRewards is a paid mutator transaction binding the contract method 0xbc178628. +// +// Solidity: function disableRewards() returns() +func (_IRewardManager *IRewardManagerSession) DisableRewards() (*types.Transaction, error) { + return _IRewardManager.Contract.DisableRewards(&_IRewardManager.TransactOpts) +} + +// DisableRewards is a paid mutator transaction binding the contract method 0xbc178628. +// +// Solidity: function disableRewards() returns() +func (_IRewardManager *IRewardManagerTransactorSession) DisableRewards() (*types.Transaction, error) { + return _IRewardManager.Contract.DisableRewards(&_IRewardManager.TransactOpts) +} + +// SetAdmin is a paid mutator transaction binding the contract method 0x704b6c02. +// +// Solidity: function setAdmin(address addr) returns() +func (_IRewardManager *IRewardManagerTransactor) SetAdmin(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { + return _IRewardManager.contract.Transact(opts, "setAdmin", addr) +} + +// SetAdmin is a paid mutator transaction binding the contract method 0x704b6c02. +// +// Solidity: function setAdmin(address addr) returns() +func (_IRewardManager *IRewardManagerSession) SetAdmin(addr common.Address) (*types.Transaction, error) { + return _IRewardManager.Contract.SetAdmin(&_IRewardManager.TransactOpts, addr) +} + +// SetAdmin is a paid mutator transaction binding the contract method 0x704b6c02. +// +// Solidity: function setAdmin(address addr) returns() +func (_IRewardManager *IRewardManagerTransactorSession) SetAdmin(addr common.Address) (*types.Transaction, error) { + return _IRewardManager.Contract.SetAdmin(&_IRewardManager.TransactOpts, addr) +} + +// SetEnabled is a paid mutator transaction binding the contract method 0x0aaf7043. +// +// Solidity: function setEnabled(address addr) returns() +func (_IRewardManager *IRewardManagerTransactor) SetEnabled(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { + return _IRewardManager.contract.Transact(opts, "setEnabled", addr) +} + +// SetEnabled is a paid mutator transaction binding the contract method 0x0aaf7043. +// +// Solidity: function setEnabled(address addr) returns() +func (_IRewardManager *IRewardManagerSession) SetEnabled(addr common.Address) (*types.Transaction, error) { + return _IRewardManager.Contract.SetEnabled(&_IRewardManager.TransactOpts, addr) +} + +// SetEnabled is a paid mutator transaction binding the contract method 0x0aaf7043. +// +// Solidity: function setEnabled(address addr) returns() +func (_IRewardManager *IRewardManagerTransactorSession) SetEnabled(addr common.Address) (*types.Transaction, error) { + return _IRewardManager.Contract.SetEnabled(&_IRewardManager.TransactOpts, addr) +} + +// SetManager is a paid mutator transaction binding the contract method 0xd0ebdbe7. +// +// Solidity: function setManager(address addr) returns() +func (_IRewardManager *IRewardManagerTransactor) SetManager(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { + return _IRewardManager.contract.Transact(opts, "setManager", addr) +} + +// SetManager is a paid mutator transaction binding the contract method 0xd0ebdbe7. +// +// Solidity: function setManager(address addr) returns() +func (_IRewardManager *IRewardManagerSession) SetManager(addr common.Address) (*types.Transaction, error) { + return _IRewardManager.Contract.SetManager(&_IRewardManager.TransactOpts, addr) +} + +// SetManager is a paid mutator transaction binding the contract method 0xd0ebdbe7. +// +// Solidity: function setManager(address addr) returns() +func (_IRewardManager *IRewardManagerTransactorSession) SetManager(addr common.Address) (*types.Transaction, error) { + return _IRewardManager.Contract.SetManager(&_IRewardManager.TransactOpts, addr) +} + +// SetNone is a paid mutator transaction binding the contract method 0x8c6bfb3b. +// +// Solidity: function setNone(address addr) returns() +func (_IRewardManager *IRewardManagerTransactor) SetNone(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { + return _IRewardManager.contract.Transact(opts, "setNone", addr) +} + +// SetNone is a paid mutator transaction binding the contract method 0x8c6bfb3b. +// +// Solidity: function setNone(address addr) returns() +func (_IRewardManager *IRewardManagerSession) SetNone(addr common.Address) (*types.Transaction, error) { + return _IRewardManager.Contract.SetNone(&_IRewardManager.TransactOpts, addr) +} + +// SetNone is a paid mutator transaction binding the contract method 0x8c6bfb3b. +// +// Solidity: function setNone(address addr) returns() +func (_IRewardManager *IRewardManagerTransactorSession) SetNone(addr common.Address) (*types.Transaction, error) { + return _IRewardManager.Contract.SetNone(&_IRewardManager.TransactOpts, addr) +} + +// SetRewardAddress is a paid mutator transaction binding the contract method 0x5e00e679. +// +// Solidity: function setRewardAddress(address addr) returns() +func (_IRewardManager *IRewardManagerTransactor) SetRewardAddress(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { + return _IRewardManager.contract.Transact(opts, "setRewardAddress", addr) +} + +// SetRewardAddress is a paid mutator transaction binding the contract method 0x5e00e679. +// +// Solidity: function setRewardAddress(address addr) returns() +func (_IRewardManager *IRewardManagerSession) SetRewardAddress(addr common.Address) (*types.Transaction, error) { + return _IRewardManager.Contract.SetRewardAddress(&_IRewardManager.TransactOpts, addr) +} + +// SetRewardAddress is a paid mutator transaction binding the contract method 0x5e00e679. +// +// Solidity: function setRewardAddress(address addr) returns() +func (_IRewardManager *IRewardManagerTransactorSession) SetRewardAddress(addr common.Address) (*types.Transaction, error) { + return _IRewardManager.Contract.SetRewardAddress(&_IRewardManager.TransactOpts, addr) +} + +// IRewardManagerFeeRecipientsAllowedIterator is returned from FilterFeeRecipientsAllowed and is used to iterate over the raw logs and unpacked data for FeeRecipientsAllowed events raised by the IRewardManager contract. +type IRewardManagerFeeRecipientsAllowedIterator struct { + Event *IRewardManagerFeeRecipientsAllowed // 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 *IRewardManagerFeeRecipientsAllowedIterator) 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(IRewardManagerFeeRecipientsAllowed) + 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(IRewardManagerFeeRecipientsAllowed) + 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 *IRewardManagerFeeRecipientsAllowedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IRewardManagerFeeRecipientsAllowedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IRewardManagerFeeRecipientsAllowed represents a FeeRecipientsAllowed event raised by the IRewardManager contract. +type IRewardManagerFeeRecipientsAllowed struct { + Sender common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterFeeRecipientsAllowed is a free log retrieval operation binding the contract event 0xabb1949bd129fef9b84601a48aee89d600d90074ca10216a02ce43996be55991. +// +// Solidity: event FeeRecipientsAllowed(address indexed sender) +func (_IRewardManager *IRewardManagerFilterer) FilterFeeRecipientsAllowed(opts *bind.FilterOpts, sender []common.Address) (*IRewardManagerFeeRecipientsAllowedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _IRewardManager.contract.FilterLogs(opts, "FeeRecipientsAllowed", senderRule) + if err != nil { + return nil, err + } + return &IRewardManagerFeeRecipientsAllowedIterator{contract: _IRewardManager.contract, event: "FeeRecipientsAllowed", logs: logs, sub: sub}, nil +} + +// WatchFeeRecipientsAllowed is a free log subscription operation binding the contract event 0xabb1949bd129fef9b84601a48aee89d600d90074ca10216a02ce43996be55991. +// +// Solidity: event FeeRecipientsAllowed(address indexed sender) +func (_IRewardManager *IRewardManagerFilterer) WatchFeeRecipientsAllowed(opts *bind.WatchOpts, sink chan<- *IRewardManagerFeeRecipientsAllowed, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _IRewardManager.contract.WatchLogs(opts, "FeeRecipientsAllowed", senderRule) + 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(IRewardManagerFeeRecipientsAllowed) + if err := _IRewardManager.contract.UnpackLog(event, "FeeRecipientsAllowed", 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 +} + +// ParseFeeRecipientsAllowed is a log parse operation binding the contract event 0xabb1949bd129fef9b84601a48aee89d600d90074ca10216a02ce43996be55991. +// +// Solidity: event FeeRecipientsAllowed(address indexed sender) +func (_IRewardManager *IRewardManagerFilterer) ParseFeeRecipientsAllowed(log types.Log) (*IRewardManagerFeeRecipientsAllowed, error) { + event := new(IRewardManagerFeeRecipientsAllowed) + if err := _IRewardManager.contract.UnpackLog(event, "FeeRecipientsAllowed", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// IRewardManagerRewardAddressChangedIterator is returned from FilterRewardAddressChanged and is used to iterate over the raw logs and unpacked data for RewardAddressChanged events raised by the IRewardManager contract. +type IRewardManagerRewardAddressChangedIterator struct { + Event *IRewardManagerRewardAddressChanged // 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 *IRewardManagerRewardAddressChangedIterator) 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(IRewardManagerRewardAddressChanged) + 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(IRewardManagerRewardAddressChanged) + 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 *IRewardManagerRewardAddressChangedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IRewardManagerRewardAddressChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IRewardManagerRewardAddressChanged represents a RewardAddressChanged event raised by the IRewardManager contract. +type IRewardManagerRewardAddressChanged struct { + Sender common.Address + OldRewardAddress common.Address + NewRewardAddress common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterRewardAddressChanged is a free log retrieval operation binding the contract event 0xc2a9e07cba6f4920acaa5933bd0406949d5dbef7ee698e786ea23e8708f32a6c. +// +// Solidity: event RewardAddressChanged(address indexed sender, address indexed oldRewardAddress, address indexed newRewardAddress) +func (_IRewardManager *IRewardManagerFilterer) FilterRewardAddressChanged(opts *bind.FilterOpts, sender []common.Address, oldRewardAddress []common.Address, newRewardAddress []common.Address) (*IRewardManagerRewardAddressChangedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var oldRewardAddressRule []interface{} + for _, oldRewardAddressItem := range oldRewardAddress { + oldRewardAddressRule = append(oldRewardAddressRule, oldRewardAddressItem) + } + var newRewardAddressRule []interface{} + for _, newRewardAddressItem := range newRewardAddress { + newRewardAddressRule = append(newRewardAddressRule, newRewardAddressItem) + } + + logs, sub, err := _IRewardManager.contract.FilterLogs(opts, "RewardAddressChanged", senderRule, oldRewardAddressRule, newRewardAddressRule) + if err != nil { + return nil, err + } + return &IRewardManagerRewardAddressChangedIterator{contract: _IRewardManager.contract, event: "RewardAddressChanged", logs: logs, sub: sub}, nil +} + +// WatchRewardAddressChanged is a free log subscription operation binding the contract event 0xc2a9e07cba6f4920acaa5933bd0406949d5dbef7ee698e786ea23e8708f32a6c. +// +// Solidity: event RewardAddressChanged(address indexed sender, address indexed oldRewardAddress, address indexed newRewardAddress) +func (_IRewardManager *IRewardManagerFilterer) WatchRewardAddressChanged(opts *bind.WatchOpts, sink chan<- *IRewardManagerRewardAddressChanged, sender []common.Address, oldRewardAddress []common.Address, newRewardAddress []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var oldRewardAddressRule []interface{} + for _, oldRewardAddressItem := range oldRewardAddress { + oldRewardAddressRule = append(oldRewardAddressRule, oldRewardAddressItem) + } + var newRewardAddressRule []interface{} + for _, newRewardAddressItem := range newRewardAddress { + newRewardAddressRule = append(newRewardAddressRule, newRewardAddressItem) + } + + logs, sub, err := _IRewardManager.contract.WatchLogs(opts, "RewardAddressChanged", senderRule, oldRewardAddressRule, newRewardAddressRule) + 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(IRewardManagerRewardAddressChanged) + if err := _IRewardManager.contract.UnpackLog(event, "RewardAddressChanged", 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 +} + +// ParseRewardAddressChanged is a log parse operation binding the contract event 0xc2a9e07cba6f4920acaa5933bd0406949d5dbef7ee698e786ea23e8708f32a6c. +// +// Solidity: event RewardAddressChanged(address indexed sender, address indexed oldRewardAddress, address indexed newRewardAddress) +func (_IRewardManager *IRewardManagerFilterer) ParseRewardAddressChanged(log types.Log) (*IRewardManagerRewardAddressChanged, error) { + event := new(IRewardManagerRewardAddressChanged) + if err := _IRewardManager.contract.UnpackLog(event, "RewardAddressChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// IRewardManagerRewardsDisabledIterator is returned from FilterRewardsDisabled and is used to iterate over the raw logs and unpacked data for RewardsDisabled events raised by the IRewardManager contract. +type IRewardManagerRewardsDisabledIterator struct { + Event *IRewardManagerRewardsDisabled // 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 *IRewardManagerRewardsDisabledIterator) 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(IRewardManagerRewardsDisabled) + 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(IRewardManagerRewardsDisabled) + 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 *IRewardManagerRewardsDisabledIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IRewardManagerRewardsDisabledIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IRewardManagerRewardsDisabled represents a RewardsDisabled event raised by the IRewardManager contract. +type IRewardManagerRewardsDisabled struct { + Sender common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterRewardsDisabled is a free log retrieval operation binding the contract event 0xeb121f0335efe8f4b8ebef7793c18c171834696989656a8c345acc558359fabf. +// +// Solidity: event RewardsDisabled(address indexed sender) +func (_IRewardManager *IRewardManagerFilterer) FilterRewardsDisabled(opts *bind.FilterOpts, sender []common.Address) (*IRewardManagerRewardsDisabledIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _IRewardManager.contract.FilterLogs(opts, "RewardsDisabled", senderRule) + if err != nil { + return nil, err + } + return &IRewardManagerRewardsDisabledIterator{contract: _IRewardManager.contract, event: "RewardsDisabled", logs: logs, sub: sub}, nil +} + +// WatchRewardsDisabled is a free log subscription operation binding the contract event 0xeb121f0335efe8f4b8ebef7793c18c171834696989656a8c345acc558359fabf. +// +// Solidity: event RewardsDisabled(address indexed sender) +func (_IRewardManager *IRewardManagerFilterer) WatchRewardsDisabled(opts *bind.WatchOpts, sink chan<- *IRewardManagerRewardsDisabled, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _IRewardManager.contract.WatchLogs(opts, "RewardsDisabled", senderRule) + 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(IRewardManagerRewardsDisabled) + if err := _IRewardManager.contract.UnpackLog(event, "RewardsDisabled", 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 +} + +// ParseRewardsDisabled is a log parse operation binding the contract event 0xeb121f0335efe8f4b8ebef7793c18c171834696989656a8c345acc558359fabf. +// +// Solidity: event RewardsDisabled(address indexed sender) +func (_IRewardManager *IRewardManagerFilterer) ParseRewardsDisabled(log types.Log) (*IRewardManagerRewardsDisabled, error) { + event := new(IRewardManagerRewardsDisabled) + if err := _IRewardManager.contract.UnpackLog(event, "RewardsDisabled", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// IRewardManagerRoleSetIterator is returned from FilterRoleSet and is used to iterate over the raw logs and unpacked data for RoleSet events raised by the IRewardManager contract. +type IRewardManagerRoleSetIterator struct { + Event *IRewardManagerRoleSet // 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 *IRewardManagerRoleSetIterator) 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(IRewardManagerRoleSet) + 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(IRewardManagerRoleSet) + 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 *IRewardManagerRoleSetIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IRewardManagerRoleSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IRewardManagerRoleSet represents a RoleSet event raised by the IRewardManager contract. +type IRewardManagerRoleSet struct { + Role *big.Int + Account common.Address + Sender common.Address + OldRole *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterRoleSet is a free log retrieval operation binding the contract event 0xcdb7ea01f00a414d78757bdb0f6391664ba3fedf987eed280927c1e7d695be3e. +// +// Solidity: event RoleSet(uint256 indexed role, address indexed account, address indexed sender, uint256 oldRole) +func (_IRewardManager *IRewardManagerFilterer) FilterRoleSet(opts *bind.FilterOpts, role []*big.Int, account []common.Address, sender []common.Address) (*IRewardManagerRoleSetIterator, error) { + + var roleRule []interface{} + for _, roleItem := range role { + roleRule = append(roleRule, roleItem) + } + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _IRewardManager.contract.FilterLogs(opts, "RoleSet", roleRule, accountRule, senderRule) + if err != nil { + return nil, err + } + return &IRewardManagerRoleSetIterator{contract: _IRewardManager.contract, event: "RoleSet", logs: logs, sub: sub}, nil +} + +// WatchRoleSet is a free log subscription operation binding the contract event 0xcdb7ea01f00a414d78757bdb0f6391664ba3fedf987eed280927c1e7d695be3e. +// +// Solidity: event RoleSet(uint256 indexed role, address indexed account, address indexed sender, uint256 oldRole) +func (_IRewardManager *IRewardManagerFilterer) WatchRoleSet(opts *bind.WatchOpts, sink chan<- *IRewardManagerRoleSet, role []*big.Int, account []common.Address, sender []common.Address) (event.Subscription, error) { + + var roleRule []interface{} + for _, roleItem := range role { + roleRule = append(roleRule, roleItem) + } + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _IRewardManager.contract.WatchLogs(opts, "RoleSet", roleRule, accountRule, senderRule) + 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(IRewardManagerRoleSet) + if err := _IRewardManager.contract.UnpackLog(event, "RoleSet", 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 +} + +// ParseRoleSet is a log parse operation binding the contract event 0xcdb7ea01f00a414d78757bdb0f6391664ba3fedf987eed280927c1e7d695be3e. +// +// Solidity: event RoleSet(uint256 indexed role, address indexed account, address indexed sender, uint256 oldRole) +func (_IRewardManager *IRewardManagerFilterer) ParseRoleSet(log types.Log) (*IRewardManagerRoleSet, error) { + event := new(IRewardManagerRoleSet) + if err := _IRewardManager.contract.UnpackLog(event, "RoleSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/contracts/bindings/iwarpmessenger.go b/contracts/bindings/iwarpmessenger.go new file mode 100644 index 0000000000..af284b3b16 --- /dev/null +++ b/contracts/bindings/iwarpmessenger.go @@ -0,0 +1,490 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ava-labs/libevm" + "github.com/ava-labs/libevm/accounts/abi" + "github.com/ava-labs/libevm/accounts/abi/bind" + "github.com/ava-labs/libevm/common" + "github.com/ava-labs/libevm/core/types" + "github.com/ava-labs/libevm/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +// WarpBlockHash is an auto generated low-level Go binding around an user-defined struct. +type WarpBlockHash struct { + SourceChainID [32]byte + BlockHash [32]byte +} + +// WarpMessage is an auto generated low-level Go binding around an user-defined struct. +type WarpMessage struct { + SourceChainID [32]byte + OriginSenderAddress common.Address + Payload []byte +} + +// IWarpMessengerMetaData contains all meta data concerning the IWarpMessenger contract. +var IWarpMessengerMetaData = &bind.MetaData{ + ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"messageID\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"name\":\"SendWarpMessage\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"getBlockchainID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"blockchainID\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"index\",\"type\":\"uint32\"}],\"name\":\"getVerifiedWarpBlockHash\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"sourceChainID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"}],\"internalType\":\"structWarpBlockHash\",\"name\":\"warpBlockHash\",\"type\":\"tuple\"},{\"internalType\":\"bool\",\"name\":\"valid\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"index\",\"type\":\"uint32\"}],\"name\":\"getVerifiedWarpMessage\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"sourceChainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"originSenderAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"payload\",\"type\":\"bytes\"}],\"internalType\":\"structWarpMessage\",\"name\":\"message\",\"type\":\"tuple\"},{\"internalType\":\"bool\",\"name\":\"valid\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"payload\",\"type\":\"bytes\"}],\"name\":\"sendWarpMessage\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"messageID\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", +} + +// IWarpMessengerABI is the input ABI used to generate the binding from. +// Deprecated: Use IWarpMessengerMetaData.ABI instead. +var IWarpMessengerABI = IWarpMessengerMetaData.ABI + +// IWarpMessenger is an auto generated Go binding around an Ethereum contract. +type IWarpMessenger struct { + IWarpMessengerCaller // Read-only binding to the contract + IWarpMessengerTransactor // Write-only binding to the contract + IWarpMessengerFilterer // Log filterer for contract events +} + +// IWarpMessengerCaller is an auto generated read-only Go binding around an Ethereum contract. +type IWarpMessengerCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// IWarpMessengerTransactor is an auto generated write-only Go binding around an Ethereum contract. +type IWarpMessengerTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// IWarpMessengerFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type IWarpMessengerFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// IWarpMessengerSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type IWarpMessengerSession struct { + Contract *IWarpMessenger // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// IWarpMessengerCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type IWarpMessengerCallerSession struct { + Contract *IWarpMessengerCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// IWarpMessengerTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type IWarpMessengerTransactorSession struct { + Contract *IWarpMessengerTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// IWarpMessengerRaw is an auto generated low-level Go binding around an Ethereum contract. +type IWarpMessengerRaw struct { + Contract *IWarpMessenger // Generic contract binding to access the raw methods on +} + +// IWarpMessengerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type IWarpMessengerCallerRaw struct { + Contract *IWarpMessengerCaller // Generic read-only contract binding to access the raw methods on +} + +// IWarpMessengerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type IWarpMessengerTransactorRaw struct { + Contract *IWarpMessengerTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewIWarpMessenger creates a new instance of IWarpMessenger, bound to a specific deployed contract. +func NewIWarpMessenger(address common.Address, backend bind.ContractBackend) (*IWarpMessenger, error) { + contract, err := bindIWarpMessenger(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &IWarpMessenger{IWarpMessengerCaller: IWarpMessengerCaller{contract: contract}, IWarpMessengerTransactor: IWarpMessengerTransactor{contract: contract}, IWarpMessengerFilterer: IWarpMessengerFilterer{contract: contract}}, nil +} + +// NewIWarpMessengerCaller creates a new read-only instance of IWarpMessenger, bound to a specific deployed contract. +func NewIWarpMessengerCaller(address common.Address, caller bind.ContractCaller) (*IWarpMessengerCaller, error) { + contract, err := bindIWarpMessenger(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &IWarpMessengerCaller{contract: contract}, nil +} + +// NewIWarpMessengerTransactor creates a new write-only instance of IWarpMessenger, bound to a specific deployed contract. +func NewIWarpMessengerTransactor(address common.Address, transactor bind.ContractTransactor) (*IWarpMessengerTransactor, error) { + contract, err := bindIWarpMessenger(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &IWarpMessengerTransactor{contract: contract}, nil +} + +// NewIWarpMessengerFilterer creates a new log filterer instance of IWarpMessenger, bound to a specific deployed contract. +func NewIWarpMessengerFilterer(address common.Address, filterer bind.ContractFilterer) (*IWarpMessengerFilterer, error) { + contract, err := bindIWarpMessenger(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &IWarpMessengerFilterer{contract: contract}, nil +} + +// bindIWarpMessenger binds a generic wrapper to an already deployed contract. +func bindIWarpMessenger(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := IWarpMessengerMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_IWarpMessenger *IWarpMessengerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _IWarpMessenger.Contract.IWarpMessengerCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_IWarpMessenger *IWarpMessengerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _IWarpMessenger.Contract.IWarpMessengerTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_IWarpMessenger *IWarpMessengerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _IWarpMessenger.Contract.IWarpMessengerTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_IWarpMessenger *IWarpMessengerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _IWarpMessenger.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_IWarpMessenger *IWarpMessengerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _IWarpMessenger.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_IWarpMessenger *IWarpMessengerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _IWarpMessenger.Contract.contract.Transact(opts, method, params...) +} + +// GetBlockchainID is a free data retrieval call binding the contract method 0x4213cf78. +// +// Solidity: function getBlockchainID() view returns(bytes32 blockchainID) +func (_IWarpMessenger *IWarpMessengerCaller) GetBlockchainID(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _IWarpMessenger.contract.Call(opts, &out, "getBlockchainID") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// GetBlockchainID is a free data retrieval call binding the contract method 0x4213cf78. +// +// Solidity: function getBlockchainID() view returns(bytes32 blockchainID) +func (_IWarpMessenger *IWarpMessengerSession) GetBlockchainID() ([32]byte, error) { + return _IWarpMessenger.Contract.GetBlockchainID(&_IWarpMessenger.CallOpts) +} + +// GetBlockchainID is a free data retrieval call binding the contract method 0x4213cf78. +// +// Solidity: function getBlockchainID() view returns(bytes32 blockchainID) +func (_IWarpMessenger *IWarpMessengerCallerSession) GetBlockchainID() ([32]byte, error) { + return _IWarpMessenger.Contract.GetBlockchainID(&_IWarpMessenger.CallOpts) +} + +// GetVerifiedWarpBlockHash is a free data retrieval call binding the contract method 0xce7f5929. +// +// Solidity: function getVerifiedWarpBlockHash(uint32 index) view returns((bytes32,bytes32) warpBlockHash, bool valid) +func (_IWarpMessenger *IWarpMessengerCaller) GetVerifiedWarpBlockHash(opts *bind.CallOpts, index uint32) (struct { + WarpBlockHash WarpBlockHash + Valid bool +}, error) { + var out []interface{} + err := _IWarpMessenger.contract.Call(opts, &out, "getVerifiedWarpBlockHash", index) + + outstruct := new(struct { + WarpBlockHash WarpBlockHash + Valid bool + }) + if err != nil { + return *outstruct, err + } + + outstruct.WarpBlockHash = *abi.ConvertType(out[0], new(WarpBlockHash)).(*WarpBlockHash) + outstruct.Valid = *abi.ConvertType(out[1], new(bool)).(*bool) + + return *outstruct, err + +} + +// GetVerifiedWarpBlockHash is a free data retrieval call binding the contract method 0xce7f5929. +// +// Solidity: function getVerifiedWarpBlockHash(uint32 index) view returns((bytes32,bytes32) warpBlockHash, bool valid) +func (_IWarpMessenger *IWarpMessengerSession) GetVerifiedWarpBlockHash(index uint32) (struct { + WarpBlockHash WarpBlockHash + Valid bool +}, error) { + return _IWarpMessenger.Contract.GetVerifiedWarpBlockHash(&_IWarpMessenger.CallOpts, index) +} + +// GetVerifiedWarpBlockHash is a free data retrieval call binding the contract method 0xce7f5929. +// +// Solidity: function getVerifiedWarpBlockHash(uint32 index) view returns((bytes32,bytes32) warpBlockHash, bool valid) +func (_IWarpMessenger *IWarpMessengerCallerSession) GetVerifiedWarpBlockHash(index uint32) (struct { + WarpBlockHash WarpBlockHash + Valid bool +}, error) { + return _IWarpMessenger.Contract.GetVerifiedWarpBlockHash(&_IWarpMessenger.CallOpts, index) +} + +// GetVerifiedWarpMessage is a free data retrieval call binding the contract method 0x6f825350. +// +// Solidity: function getVerifiedWarpMessage(uint32 index) view returns((bytes32,address,bytes) message, bool valid) +func (_IWarpMessenger *IWarpMessengerCaller) GetVerifiedWarpMessage(opts *bind.CallOpts, index uint32) (struct { + Message WarpMessage + Valid bool +}, error) { + var out []interface{} + err := _IWarpMessenger.contract.Call(opts, &out, "getVerifiedWarpMessage", index) + + outstruct := new(struct { + Message WarpMessage + Valid bool + }) + if err != nil { + return *outstruct, err + } + + outstruct.Message = *abi.ConvertType(out[0], new(WarpMessage)).(*WarpMessage) + outstruct.Valid = *abi.ConvertType(out[1], new(bool)).(*bool) + + return *outstruct, err + +} + +// GetVerifiedWarpMessage is a free data retrieval call binding the contract method 0x6f825350. +// +// Solidity: function getVerifiedWarpMessage(uint32 index) view returns((bytes32,address,bytes) message, bool valid) +func (_IWarpMessenger *IWarpMessengerSession) GetVerifiedWarpMessage(index uint32) (struct { + Message WarpMessage + Valid bool +}, error) { + return _IWarpMessenger.Contract.GetVerifiedWarpMessage(&_IWarpMessenger.CallOpts, index) +} + +// GetVerifiedWarpMessage is a free data retrieval call binding the contract method 0x6f825350. +// +// Solidity: function getVerifiedWarpMessage(uint32 index) view returns((bytes32,address,bytes) message, bool valid) +func (_IWarpMessenger *IWarpMessengerCallerSession) GetVerifiedWarpMessage(index uint32) (struct { + Message WarpMessage + Valid bool +}, error) { + return _IWarpMessenger.Contract.GetVerifiedWarpMessage(&_IWarpMessenger.CallOpts, index) +} + +// SendWarpMessage is a paid mutator transaction binding the contract method 0xee5b48eb. +// +// Solidity: function sendWarpMessage(bytes payload) returns(bytes32 messageID) +func (_IWarpMessenger *IWarpMessengerTransactor) SendWarpMessage(opts *bind.TransactOpts, payload []byte) (*types.Transaction, error) { + return _IWarpMessenger.contract.Transact(opts, "sendWarpMessage", payload) +} + +// SendWarpMessage is a paid mutator transaction binding the contract method 0xee5b48eb. +// +// Solidity: function sendWarpMessage(bytes payload) returns(bytes32 messageID) +func (_IWarpMessenger *IWarpMessengerSession) SendWarpMessage(payload []byte) (*types.Transaction, error) { + return _IWarpMessenger.Contract.SendWarpMessage(&_IWarpMessenger.TransactOpts, payload) +} + +// SendWarpMessage is a paid mutator transaction binding the contract method 0xee5b48eb. +// +// Solidity: function sendWarpMessage(bytes payload) returns(bytes32 messageID) +func (_IWarpMessenger *IWarpMessengerTransactorSession) SendWarpMessage(payload []byte) (*types.Transaction, error) { + return _IWarpMessenger.Contract.SendWarpMessage(&_IWarpMessenger.TransactOpts, payload) +} + +// IWarpMessengerSendWarpMessageIterator is returned from FilterSendWarpMessage and is used to iterate over the raw logs and unpacked data for SendWarpMessage events raised by the IWarpMessenger contract. +type IWarpMessengerSendWarpMessageIterator struct { + Event *IWarpMessengerSendWarpMessage // 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 *IWarpMessengerSendWarpMessageIterator) 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(IWarpMessengerSendWarpMessage) + 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(IWarpMessengerSendWarpMessage) + 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 *IWarpMessengerSendWarpMessageIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IWarpMessengerSendWarpMessageIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IWarpMessengerSendWarpMessage represents a SendWarpMessage event raised by the IWarpMessenger contract. +type IWarpMessengerSendWarpMessage struct { + Sender common.Address + MessageID [32]byte + Message []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSendWarpMessage is a free log retrieval operation binding the contract event 0x56600c567728a800c0aa927500f831cb451df66a7af570eb4df4dfbf4674887d. +// +// Solidity: event SendWarpMessage(address indexed sender, bytes32 indexed messageID, bytes message) +func (_IWarpMessenger *IWarpMessengerFilterer) FilterSendWarpMessage(opts *bind.FilterOpts, sender []common.Address, messageID [][32]byte) (*IWarpMessengerSendWarpMessageIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var messageIDRule []interface{} + for _, messageIDItem := range messageID { + messageIDRule = append(messageIDRule, messageIDItem) + } + + logs, sub, err := _IWarpMessenger.contract.FilterLogs(opts, "SendWarpMessage", senderRule, messageIDRule) + if err != nil { + return nil, err + } + return &IWarpMessengerSendWarpMessageIterator{contract: _IWarpMessenger.contract, event: "SendWarpMessage", logs: logs, sub: sub}, nil +} + +// WatchSendWarpMessage is a free log subscription operation binding the contract event 0x56600c567728a800c0aa927500f831cb451df66a7af570eb4df4dfbf4674887d. +// +// Solidity: event SendWarpMessage(address indexed sender, bytes32 indexed messageID, bytes message) +func (_IWarpMessenger *IWarpMessengerFilterer) WatchSendWarpMessage(opts *bind.WatchOpts, sink chan<- *IWarpMessengerSendWarpMessage, sender []common.Address, messageID [][32]byte) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var messageIDRule []interface{} + for _, messageIDItem := range messageID { + messageIDRule = append(messageIDRule, messageIDItem) + } + + logs, sub, err := _IWarpMessenger.contract.WatchLogs(opts, "SendWarpMessage", senderRule, messageIDRule) + 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(IWarpMessengerSendWarpMessage) + if err := _IWarpMessenger.contract.UnpackLog(event, "SendWarpMessage", 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 +} + +// ParseSendWarpMessage is a log parse operation binding the contract event 0x56600c567728a800c0aa927500f831cb451df66a7af570eb4df4dfbf4674887d. +// +// Solidity: event SendWarpMessage(address indexed sender, bytes32 indexed messageID, bytes message) +func (_IWarpMessenger *IWarpMessengerFilterer) ParseSendWarpMessage(log types.Log) (*IWarpMessengerSendWarpMessage, error) { + event := new(IWarpMessengerSendWarpMessage) + if err := _IWarpMessenger.contract.UnpackLog(event, "SendWarpMessage", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/contracts/contracts/compile.go b/contracts/contracts/compile.go index 51f1416d6a..380f0b96a3 100644 --- a/contracts/contracts/compile.go +++ b/contracts/contracts/compile.go @@ -4,9 +4,10 @@ package contracts // Step 1: Compile Solidity contracts to generate ABI and bin files -//go:generate solc-v0.8.30 -o ../artifacts --overwrite --abi --bin --base-path . @openzeppelin/contracts/=../node_modules/@openzeppelin/contracts/ AllowList.sol ERC20NativeMinter.sol ExampleDeployerList.sol ExampleFeeManager.sol ExampleRewardManager.sol ExampleTxAllowList.sol ExampleWarp.sol +//go:generate solc-v0.8.30 -o ../artifacts --overwrite --abi --bin --base-path . --evm-version paris @openzeppelin/contracts/=../node_modules/@openzeppelin/contracts/ AllowList.sol ERC20NativeMinter.sol ExampleDeployerList.sol ExampleFeeManager.sol ExampleRewardManager.sol ExampleTxAllowList.sol ExampleWarp.sol interfaces/IAllowList.sol interfaces/IFeeManager.sol interfaces/INativeMinter.sol interfaces/IRewardManager.sol interfaces/IWarpMessenger.sol // Step 2: Generate Go bindings from the compiled artifacts +// Main contracts //go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg bindings --type AllowList --abi ../artifacts/AllowList.abi --bin ../artifacts/AllowList.bin --out ../bindings/allowlist.go //go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg bindings --type ERC20NativeMinter --abi ../artifacts/ERC20NativeMinter.abi --bin ../artifacts/ERC20NativeMinter.bin --out ../bindings/erc20nativeminter.go //go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg bindings --type ExampleDeployerList --abi ../artifacts/ExampleDeployerList.abi --bin ../artifacts/ExampleDeployerList.bin --out ../bindings/exampledeployerlist.go @@ -14,3 +15,10 @@ package contracts //go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg bindings --type ExampleRewardManager --abi ../artifacts/ExampleRewardManager.abi --bin ../artifacts/ExampleRewardManager.bin --out ../bindings/examplerewardmanager.go //go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg bindings --type ExampleTxAllowList --abi ../artifacts/ExampleTxAllowList.abi --bin ../artifacts/ExampleTxAllowList.bin --out ../bindings/exampletxallowlist.go //go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg bindings --type ExampleWarp --abi ../artifacts/ExampleWarp.abi --bin ../artifacts/ExampleWarp.bin --out ../bindings/examplewarp.go + +// Interface contracts (for interacting with precompiles) +//go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg bindings --type IAllowList --abi ../artifacts/IAllowList.abi --bin ../artifacts/IAllowList.bin --out ../bindings/iallowlist.go +//go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg bindings --type IFeeManager --abi ../artifacts/IFeeManager.abi --bin ../artifacts/IFeeManager.bin --out ../bindings/ifeemanager.go +//go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg bindings --type INativeMinter --abi ../artifacts/INativeMinter.abi --bin ../artifacts/INativeMinter.bin --out ../bindings/inativeminter.go +//go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg bindings --type IRewardManager --abi ../artifacts/IRewardManager.abi --bin ../artifacts/IRewardManager.bin --out ../bindings/irewardmanager.go +//go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg bindings --type IWarpMessenger --abi ../artifacts/IWarpMessenger.abi --bin ../artifacts/IWarpMessenger.bin --out ../bindings/iwarpmessenger.go diff --git a/go.mod b/go.mod index 7da6c85f0e..32909f9abe 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,7 @@ require ( github.com/holiman/uint256 v1.2.4 github.com/mattn/go-colorable v0.1.13 github.com/mattn/go-isatty v0.0.17 - github.com/onsi/ginkgo/v2 v2.13.1 + github.com/onsi/ginkgo/v2 v2.25.1 github.com/prometheus/client_golang v1.23.0 github.com/spf13/cast v1.9.2 github.com/spf13/pflag v1.0.6 @@ -46,6 +46,7 @@ require ( connectrpc.com/connect v1.18.1 // indirect connectrpc.com/grpcreflect v1.3.0 // indirect github.com/DataDog/zstd v1.5.2 // indirect + github.com/Masterminds/semver/v3 v3.4.0 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/StephenButtolph/canoto v0.17.2 // indirect github.com/ava-labs/coreth v0.15.4-rc.4 // indirect @@ -89,7 +90,7 @@ require ( github.com/go-openapi/jsonreference v0.20.2 // indirect github.com/go-openapi/swag v0.22.3 // indirect github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect - github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect + github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/go-viper/mapstructure/v2 v2.4.0 // indirect github.com/gofrs/flock v0.8.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect @@ -132,6 +133,7 @@ require ( github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect + github.com/onsi/gomega v1.38.2 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opentracing/opentracing-go v1.1.0 // indirect github.com/pelletier/go-toml/v2 v2.2.4 // indirect @@ -168,6 +170,7 @@ require ( go.opentelemetry.io/otel/sdk v1.37.0 // indirect go.opentelemetry.io/otel/trace v1.37.0 // indirect go.opentelemetry.io/proto/otlp v1.7.0 // indirect + go.uber.org/automaxprocs v1.6.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.46.0 // indirect golang.org/x/oauth2 v0.30.0 // indirect diff --git a/go.sum b/go.sum index 37277df436..1c642882de 100644 --- a/go.sum +++ b/go.sum @@ -12,6 +12,8 @@ github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMd github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= github.com/DataDog/zstd v1.5.2/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= +github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0= +github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= @@ -216,8 +218,8 @@ github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+ github.com/go-sourcemap/sourcemap v2.1.3+incompatible h1:W1iEw64niKVGogNgBN3ePyLFfuisuzeidWPMPWmECqU= github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= +github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/go-test/deep v1.1.0 h1:WOcxcdHcvdgThNXjw0t76K42FXTU7HpNQWHpA2HHNlg= github.com/go-test/deep v1.1.0/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= github.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs= @@ -456,16 +458,16 @@ github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vv github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= -github.com/onsi/ginkgo/v2 v2.13.1 h1:LNGfMbR2OVGBfXjvRZIZ2YCTQdGKtPLvuI1rMCCj3OU= -github.com/onsi/ginkgo/v2 v2.13.1/go.mod h1:XStQ8QcGwLyF4HdfcZB8SFOS/MWCgDuXMSBe6zrvLgM= +github.com/onsi/ginkgo/v2 v2.25.1 h1:Fwp6crTREKM+oA6Cz4MsO8RhKQzs2/gOIVOUscMAfZY= +github.com/onsi/ginkgo/v2 v2.25.1/go.mod h1:ppTWQ1dh9KM/F1XgpeRqelR+zHVwV81DGRSDnFxK7Sk= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= -github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg= -github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= +github.com/onsi/gomega v1.38.2 h1:eZCjf2xjZAqe+LeWvKb5weQ+NcPwX84kqJ0cZNxok2A= +github.com/onsi/gomega v1.38.2/go.mod h1:W2MJcYxRGV63b418Ai34Ud0hEdTVXq9NW9+Sx6uXf3k= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= @@ -486,6 +488,8 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= +github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U= github.com/prometheus/client_golang v1.23.0 h1:ust4zpdl9r4trLY/gSjlm07PuiBq2ynaXXlptpfy8Uc= github.com/prometheus/client_golang v1.23.0/go.mod h1:i/o0R9ByOnHX0McrTMTyhYvKE4haaf2mW08I+jGAjEE= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -548,7 +552,6 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= @@ -619,6 +622,8 @@ go.opentelemetry.io/otel/trace v1.37.0 h1:HLdcFNbRQBE2imdSEgm/kwqmQj1Or1l/7bW6mx go.opentelemetry.io/otel/trace v1.37.0/go.mod h1:TlgrlQ+PtQO5XFerSPUYG0JSgGyryXewPGyayAWSBS0= go.opentelemetry.io/proto/otlp v1.7.0 h1:jX1VolD6nHuFzOYso2E73H85i92Mv8JQYk0K9vz09os= go.opentelemetry.io/proto/otlp v1.7.0/go.mod h1:fSKjH6YJ7HDlwzltzyMj036AJ3ejJLCgCSHGj4efDDo= +go.uber.org/automaxprocs v1.6.0 h1:O3y2/QNTOdbF+e/dpXNNW7Rx2hZ4sTIPyybbxyNqTUs= +go.uber.org/automaxprocs v1.6.0/go.mod h1:ifeIMSnPZuznNm6jmdzmU3/bfk01Fe2fotchwEFJ8r8= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/mock v0.5.0 h1:KAMbZvZPyBPWgD14IrIQ38QCyjwpvVVV6K/bHl1IwQU= @@ -627,6 +632,8 @@ go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= +go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= +go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= diff --git a/scripts/run_ginkgo_precompile.sh b/scripts/run_ginkgo_precompile.sh index 01315ffbe6..2ca1cd536b 100755 --- a/scripts/run_ginkgo_precompile.sh +++ b/scripts/run_ginkgo_precompile.sh @@ -17,6 +17,10 @@ TEST_SOURCE_ROOT=$(pwd) # By default, it runs all e2e test cases! # Use "--ginkgo.skip" to skip tests. # Use "--ginkgo.focus" to select tests. -TEST_SOURCE_ROOT="$TEST_SOURCE_ROOT" "${SUBNET_EVM_PATH}"/bin/ginkgo run -procs=5 tests/precompile \ - --ginkgo.vv \ - --ginkgo.label-filter="${GINKGO_LABEL_FILTER:-""}" +# Use GINKGO_LABEL_FILTER environment variable to filter by label (e.g., GINKGO_LABEL_FILTER="Go") +LABEL_FILTER_FLAG="" +if [ -n "${GINKGO_LABEL_FILTER:-}" ]; then + LABEL_FILTER_FLAG="--label-filter=${GINKGO_LABEL_FILTER}" +fi + +TEST_SOURCE_ROOT="$TEST_SOURCE_ROOT" "${SUBNET_EVM_PATH}"/bin/ginkgo run -procs=5 --vv ${LABEL_FILTER_FLAG} tests/precompile diff --git a/tests/precompile/contract_deployer_allow_list_test.go b/tests/precompile/contract_deployer_allow_list_test.go new file mode 100644 index 0000000000..d692c245c0 --- /dev/null +++ b/tests/precompile/contract_deployer_allow_list_test.go @@ -0,0 +1,328 @@ +// Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved. +// See the file LICENSE for licensing terms. + +package precompile + +import ( + "context" + + "github.com/ava-labs/libevm/accounts/abi/bind" + "github.com/ava-labs/libevm/common" + "github.com/ava-labs/libevm/core/types" + "github.com/ava-labs/subnet-evm/contracts/bindings" + "github.com/ava-labs/subnet-evm/tests/precompile/contracttest" + "github.com/ava-labs/subnet-evm/tests/precompile/solidity" + "github.com/ava-labs/subnet-evm/tests/utils" + ginkgo "github.com/onsi/ginkgo/v2" + requirePkg "github.com/stretchr/testify/require" +) + +// Register Go-based contract deployer allow list tests +// Tests within this suite run serially to avoid nonce conflicts on the same subnet +func init() { + ginkgo.Describe("[Go] Contract Deployer Allow List", ginkgo.Serial, ginkgo.Label("Precompile", "ContractDeployerAllowList", "Go"), func() { + var ( + require *requirePkg.Assertions + backend *contracttest.TmpnetBackend + allowList *bindings.IAllowList + waitForReceipt func(tx *types.Transaction) *types.Receipt + ) + + ginkgo.BeforeEach(func() { + require = requirePkg.New(ginkgo.GinkgoT()) + + blockchainID := solidity.SubnetsSuite.GetBlockchainID("contract_deployer_allow_list") + rpcURL := utils.GetDefaultChainURI(blockchainID) + + backend = contracttest.NewTmpnetBackendSimple(rpcURL) + require.NotNil(backend, "failed to create tmpnet backend") + + var err error + allowList, err = bindings.NewIAllowList(contracttest.ContractDeployerAllowListAddress, backend.Client) + require.NoError(err, "failed to bind contract deployer allow list precompile") + + waitForReceipt = func(tx *types.Transaction) *types.Receipt { + receipt, err := bind.WaitMined(context.Background(), backend.Client, tx) + require.NoError(err) + return receipt + } + }) + + ginkgo.AfterEach(func() { + if backend != nil { + backend.Close() + backend = nil + } + allowList = nil + waitForReceipt = nil + require = nil + }) + + ginkgo.It("should emit RoleSet event when setting admin role", func() { + testAddress := common.HexToAddress("0x0111000000000000000000000000000000000001") + + tx, err := allowList.SetAdmin(backend.Admin.Auth, testAddress) + require.NoError(err) + + receipt := waitForReceipt(tx) + require.Equal(types.ReceiptStatusSuccessful, receipt.Status, "transaction failed") + require.Len(receipt.Logs, 1, "should have exactly one log") + + event, err := allowList.ParseRoleSet(*receipt.Logs[0]) + require.NoError(err, "failed to parse RoleSet event") + + require.Equal(uint64(contracttest.RoleAdmin), event.Role.Uint64(), "role should be Admin") + require.Equal(testAddress, event.Account, "account should match test address") + require.Equal(backend.Admin.Address, event.Sender, "sender should be admin") + require.Equal(uint64(contracttest.RoleNone), event.OldRole.Uint64(), "old role should be None") + }) + + ginkgo.It("should emit RoleSet event when setting manager role", func() { + testAddress := common.HexToAddress("0x0222000000000000000000000000000000000002") + + tx, err := allowList.SetManager(backend.Admin.Auth, testAddress) + require.NoError(err) + + receipt := waitForReceipt(tx) + require.Equal(types.ReceiptStatusSuccessful, receipt.Status) + require.Len(receipt.Logs, 1) + + event, err := allowList.ParseRoleSet(*receipt.Logs[0]) + require.NoError(err) + + require.Equal(uint64(contracttest.RoleManager), event.Role.Uint64()) + require.Equal(testAddress, event.Account) + require.Equal(backend.Admin.Address, event.Sender) + require.Equal(uint64(contracttest.RoleNone), event.OldRole.Uint64()) + }) + + ginkgo.It("should emit RoleSet event when setting enabled role", func() { + testAddress := common.HexToAddress("0x0333000000000000000000000000000000000003") + + tx, err := allowList.SetEnabled(backend.Admin.Auth, testAddress) + require.NoError(err) + + receipt := waitForReceipt(tx) + require.Equal(types.ReceiptStatusSuccessful, receipt.Status) + require.Len(receipt.Logs, 1) + + event, err := allowList.ParseRoleSet(*receipt.Logs[0]) + require.NoError(err) + + require.Equal(uint64(contracttest.RoleEnabled), event.Role.Uint64()) + require.Equal(testAddress, event.Account) + require.Equal(backend.Admin.Address, event.Sender) + require.Equal(uint64(contracttest.RoleNone), event.OldRole.Uint64()) + }) + + ginkgo.It("should emit RoleSet event when setting none role", func() { + testAddress := common.HexToAddress("0x0333000000000000000000000000000000000003") + + tx, err := allowList.SetEnabled(backend.Admin.Auth, testAddress) + require.NoError(err) + receipt := waitForReceipt(tx) + require.Equal(types.ReceiptStatusSuccessful, receipt.Status) + + tx, err = allowList.SetNone(backend.Admin.Auth, testAddress) + require.NoError(err) + + receipt = waitForReceipt(tx) + require.Equal(types.ReceiptStatusSuccessful, receipt.Status) + require.Len(receipt.Logs, 1) + + event, err := allowList.ParseRoleSet(*receipt.Logs[0]) + require.NoError(err) + + require.Equal(uint64(contracttest.RoleNone), event.Role.Uint64()) + require.Equal(testAddress, event.Account) + require.Equal(backend.Admin.Address, event.Sender) + require.Equal(uint64(contracttest.RoleEnabled), event.OldRole.Uint64(), "old role should be Enabled") + }) + + ginkgo.It("should verify deployer list shows admin has admin role via precompile", func() { + deployerListAddr, tx, deployerList, err := bindings.DeployExampleDeployerList(backend.Admin.Auth, backend.Client) + require.NoError(err) + + receipt := waitForReceipt(tx) + require.Equal(types.ReceiptStatusSuccessful, receipt.Status) + + tx, err = allowList.SetAdmin(backend.Admin.Auth, deployerListAddr) + require.NoError(err) + receipt = waitForReceipt(tx) + require.Equal(types.ReceiptStatusSuccessful, receipt.Status) + + role, err := allowList.ReadAllowList(nil, deployerListAddr) + require.NoError(err) + require.Equal(uint64(contracttest.RoleAdmin), role.Uint64()) + + isAdmin, err := deployerList.IsAdmin(nil, deployerListAddr) + require.NoError(err) + require.True(isAdmin, "contract should report itself as admin") + }) + + ginkgo.It("should verify new address has no role", func() { + deployerListAddr, tx, _, err := bindings.DeployExampleDeployerList(backend.Admin.Auth, backend.Client) + require.NoError(err) + + receipt := waitForReceipt(tx) + require.Equal(types.ReceiptStatusSuccessful, receipt.Status) + + role, err := allowList.ReadAllowList(nil, deployerListAddr) + require.NoError(err) + require.Equal(uint64(contracttest.RoleNone), role.Uint64(), "new contract should have no role") + }) + + ginkgo.It("should verify contract correctly reports admin status", func() { + deployerListAddr, tx, deployerList, err := bindings.DeployExampleDeployerList(backend.Admin.Auth, backend.Client) + require.NoError(err) + + receipt := waitForReceipt(tx) + require.Equal(types.ReceiptStatusSuccessful, receipt.Status) + + owner, err := deployerList.Owner(nil) + require.NoError(err) + require.Equal(backend.Admin.Address, owner) + + tx, err = allowList.SetAdmin(backend.Admin.Auth, backend.Admin.Address) + require.NoError(err) + _ = waitForReceipt(tx) + + isAdmin, err := deployerList.IsAdmin(nil, backend.Admin.Address) + require.NoError(err) + require.True(isAdmin, "owner should be admin") + + isAdmin, err = deployerList.IsAdmin(nil, deployerListAddr) + require.NoError(err) + require.False(isAdmin, "contract with no role should not be admin") + }) + + ginkgo.It("should not let address with no role deploy contracts", func() { + _, tx, deployerList, err := bindings.DeployExampleDeployerList(backend.Admin.Auth, backend.Client) + require.NoError(err) + + receipt := waitForReceipt(tx) + require.Equal(types.ReceiptStatusSuccessful, receipt.Status) + + require.NotNil(backend.OtherAddr, "missing other test account") + otherAuth := *backend.OtherAddr.Auth + // Override the gas limit so bind skips preflight estimation; otherwise the call + // reverts during estimation and no transaction is sent, which would hide the + // failure status we expect from the mined receipt. + otherAuth.GasLimit = 500000 + + tx, err = deployerList.DeployContract(&otherAuth) + require.NoError(err, "transaction submission should succeed") + + receipt = waitForReceipt(tx) + require.Equal(types.ReceiptStatusFailed, receipt.Status, "deploy should fail for address with no role") + }) + + ginkgo.It("should allow admin to add contract as admin via precompile", func() { + deployerListAddr, tx, deployerList, err := bindings.DeployExampleDeployerList(backend.Admin.Auth, backend.Client) + require.NoError(err) + + receipt := waitForReceipt(tx) + require.Equal(types.ReceiptStatusSuccessful, receipt.Status) + + role, err := allowList.ReadAllowList(nil, deployerListAddr) + require.NoError(err) + require.Equal(uint64(contracttest.RoleNone), role.Uint64()) + + tx, err = allowList.SetAdmin(backend.Admin.Auth, deployerListAddr) + require.NoError(err) + _ = waitForReceipt(tx) + + role, err = allowList.ReadAllowList(nil, deployerListAddr) + require.NoError(err) + require.Equal(uint64(contracttest.RoleAdmin), role.Uint64()) + + isAdmin, err := deployerList.IsAdmin(nil, deployerListAddr) + require.NoError(err) + require.True(isAdmin) + }) + + ginkgo.It("should allow admin to add deployer via contract", func() { + exampleAddr, tx, example, err := bindings.DeployExampleDeployerList(backend.Admin.Auth, backend.Client) + require.NoError(err) + _ = waitForReceipt(tx) + + otherAddr, tx, other, err := bindings.DeployExampleDeployerList(backend.Admin.Auth, backend.Client) + require.NoError(err) + _ = waitForReceipt(tx) + + tx, err = allowList.SetAdmin(backend.Admin.Auth, exampleAddr) + require.NoError(err) + _ = waitForReceipt(tx) + + tx, err = example.SetEnabled(backend.Admin.Auth, otherAddr) + require.NoError(err) + _ = waitForReceipt(tx) + + isEnabled, err := example.IsEnabled(nil, otherAddr) + require.NoError(err) + require.True(isEnabled, "other contract should be enabled") + + isEnabledSelf, err := other.IsEnabled(nil, otherAddr) + require.NoError(err) + require.True(isEnabledSelf, "contract should report itself as enabled") + }) + + ginkgo.It("should allow enabled address to deploy contracts", func() { + exampleAddr, tx, example, err := bindings.DeployExampleDeployerList(backend.Admin.Auth, backend.Client) + require.NoError(err) + _ = waitForReceipt(tx) + + deployerAddr, tx, deployer, err := bindings.DeployExampleDeployerList(backend.Admin.Auth, backend.Client) + require.NoError(err) + _ = waitForReceipt(tx) + + tx, err = allowList.SetAdmin(backend.Admin.Auth, exampleAddr) + require.NoError(err) + _ = waitForReceipt(tx) + + tx, err = example.SetEnabled(backend.Admin.Auth, deployerAddr) + require.NoError(err) + _ = waitForReceipt(tx) + + isEnabled, err := example.IsEnabled(nil, deployerAddr) + require.NoError(err) + require.True(isEnabled) + + tx, err = deployer.DeployContract(backend.Admin.Auth) + require.NoError(err) + + receipt := waitForReceipt(tx) + require.Equal(types.ReceiptStatusSuccessful, receipt.Status, "enabled address should be able to deploy") + }) + + ginkgo.It("should allow admin to revoke deployer role", func() { + exampleAddr, tx, example, err := bindings.DeployExampleDeployerList(backend.Admin.Auth, backend.Client) + require.NoError(err) + _ = waitForReceipt(tx) + + deployerAddr, tx, _, err := bindings.DeployExampleDeployerList(backend.Admin.Auth, backend.Client) + require.NoError(err) + _ = waitForReceipt(tx) + + tx, err = allowList.SetAdmin(backend.Admin.Auth, exampleAddr) + require.NoError(err) + _ = waitForReceipt(tx) + + tx, err = example.SetEnabled(backend.Admin.Auth, deployerAddr) + require.NoError(err) + _ = waitForReceipt(tx) + + isEnabled, err := example.IsEnabled(nil, deployerAddr) + require.NoError(err) + require.True(isEnabled) + + tx, err = example.Revoke(backend.Admin.Auth, deployerAddr) + require.NoError(err) + _ = waitForReceipt(tx) + + role, err := allowList.ReadAllowList(nil, deployerAddr) + require.NoError(err) + require.Equal(uint64(contracttest.RoleNone), role.Uint64(), "deployer should have no role after revoke") + }) + }) +} diff --git a/tests/precompile/contracttest/example_test.go b/tests/precompile/contracttest/example_test.go new file mode 100644 index 0000000000..ac24a82c19 --- /dev/null +++ b/tests/precompile/contracttest/example_test.go @@ -0,0 +1,56 @@ +// Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved. +// See the file LICENSE for licensing terms. + +package contracttest + +import ( + "testing" + + "github.com/ava-labs/subnet-evm/contracts/bindings" + "github.com/stretchr/testify/require" +) + +// TestExampleDeployment demonstrates the test infrastructure +// This is a simple example showing how to deploy and interact with contracts +func TestExampleDeployment(t *testing.T) { + require := require.New(t) + + // Create test backend with funded accounts + backend := NewTestBackend(t) + defer backend.Close() + + // Deploy ExampleDeployerList contract using generated binding + addr, tx, contract, err := bindings.DeployExampleDeployerList(backend.Admin.Auth, backend.Client()) + require.NoError(err, "failed to deploy contract") + require.NotEqual(addr.Hex(), "0x0000000000000000000000000000000000000000", "contract address should not be zero") + + // Wait for deployment + receipt := WaitForReceipt(t, backend, tx) + RequireSuccessReceipt(t, receipt) + + require.NotNil(contract, "contract should not be nil") + + // Example: Check owner (should be admin account) + owner, err := contract.Owner(nil) + require.NoError(err) + require.Equal(backend.Admin.Address, owner, "owner should be admin account") +} + +// TestAllowListRoles demonstrates role management +func TestAllowListRoles(t *testing.T) { + // Create test backend + backend := NewTestBackend(t) + defer backend.Close() + + // Set admin role on the deployer allowlist + SetupAllowListRole(t, backend, ContractDeployerAllowListAddress, + backend.Admin.Address, RoleAdmin, backend.Admin) + + // Verify the role was set + RequireRole(t, backend, ContractDeployerAllowListAddress, + backend.Admin.Address, RoleAdmin) + + // Verify other address has no role + RequireRole(t, backend, ContractDeployerAllowListAddress, + backend.OtherAddr.Address, RoleNone) +} diff --git a/tests/precompile/contracttest/helpers.go b/tests/precompile/contracttest/helpers.go new file mode 100644 index 0000000000..1084c35445 --- /dev/null +++ b/tests/precompile/contracttest/helpers.go @@ -0,0 +1,142 @@ +// Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved. +// See the file LICENSE for licensing terms. + +// Package contracttest provides utilities for testing contracts in Go. +package contracttest + +import ( + "context" + "crypto/ecdsa" + "math/big" + "testing" + + "github.com/ava-labs/libevm/accounts/abi/bind" + "github.com/ava-labs/libevm/common" + "github.com/ava-labs/libevm/core/types" + "github.com/ava-labs/libevm/crypto" + "github.com/ava-labs/libevm/ethclient/simulated" + "github.com/stretchr/testify/require" +) + +var _ bind.ContractBackend = (simulated.Client)(nil) + +// TestBackend wraps a simulated backend with common test utilities +type TestBackend struct { + *simulated.Backend + Accounts +} + +// Common test accounts matching the TypeScript test setup +type Accounts struct { + Admin *TestAccount + OtherAddr *TestAccount + FundedKeys []*TestAccount +} + +// TestAccount represents a funded test account +type TestAccount struct { + Key *ecdsa.PrivateKey + Address common.Address + Auth *bind.TransactOpts +} + +// Common addresses from TypeScript tests +var ( + // AdminAddress is the primary admin account + AdminAddress = common.HexToAddress("0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC") + // OtherAddress is a secondary account for testing + OtherAddress = common.HexToAddress("0x0Fa8EA536Be85F32724D57A37758761B86416123") +) + +// Keys for test accounts +var testPrivateKeys = []string{ + "56289e99c94b6912bfc12adc093c9b51124f0dc54ac7a766b2bc5ccf558d8027", + "7b4198529994b0dc604278c99d153cfd069d594753d471171a1d102a10438e07", + "15614556be13730e9e8d6eacc1603143e7b96987429df8726384c2ec4502ef6e", + "31b571bf6894a248831ff937bb49f7754509fe93bbd2517c9c73c4144c0e97dc", + "6934bef917e01692b789da754a0eae31a8536eb465e7bff752ea291dad88c675", + "e700bdbdbc279b808b1ec45f8c2370e4616d3a02c336e68d85d4668e08f53cff", + "bbc2865b76ba28016bc2255c7504d000e046ae01934b04c694592a6276988630", + "cdbfd34f687ced8c6968854f8a99ae47712c4f4183b78dcc4a903d1bfe8cbf60", + "86f78c5416151fe3546dece84fda4b4b1e36089f2dbc48496faf3a950f16157c", + "750839e9dbbd2a0910efe40f50b2f3b2f2f59f5580bb4b83bd8c1201cf9a010a", +} + +// NewTestBackend creates a simulated backend with funded test accounts +func NewTestBackend(t testing.TB) *TestBackend { + require := require.New(t) + + // Create test accounts + var fundedAccounts Accounts + fundedAccounts.FundedKeys = make([]*TestAccount, len(testPrivateKeys)) + + // Set up genesis allocation with funded accounts + alloc := types.GenesisAlloc{} + balance := new(big.Int).Mul(big.NewInt(1000), big.NewInt(1e18)) // 1000 ETH each + + for i, keyHex := range testPrivateKeys { + key, err := crypto.HexToECDSA(keyHex) + require.NoError(err) + + addr := crypto.PubkeyToAddress(key.PublicKey) + alloc[addr] = types.Account{Balance: balance} + + chainID := big.NewInt(1337) // simulated backend uses chainID 1337 + auth, err := bind.NewKeyedTransactorWithChainID(key, chainID) + require.NoError(err) + + account := &TestAccount{ + Key: key, + Address: addr, + Auth: auth, + } + fundedAccounts.FundedKeys[i] = account + + // Set up special accounts + switch addr { + case AdminAddress: + fundedAccounts.Admin = account + case OtherAddress: + fundedAccounts.OtherAddr = account + } + } + + // Create simulated backend from libevm (uses AllDevChainProtocolChanges by default) + backend := simulated.NewBackend(alloc) + + return &TestBackend{ + Backend: backend, + Accounts: fundedAccounts, + } +} + +// GetAccount returns a TestAccount by address, or nil if not found +func (tb *TestBackend) GetAccount(addr common.Address) *TestAccount { + for _, account := range tb.FundedKeys { + if account.Address == addr { + return account + } + } + return nil +} + +// WaitForReceipt waits for a transaction receipt and commits a block if needed +func WaitForReceipt(t testing.TB, tb *TestBackend, tx *types.Transaction) *types.Receipt { + require := require.New(t) + + // Commit the transaction (mines a block) + tb.Commit() + + // Get the receipt + client := tb.Client() + receipt, err := client.TransactionReceipt(context.Background(), tx.Hash()) + require.NoError(err, "failed to get transaction receipt") + require.NotNil(receipt, "receipt is nil") + + return receipt +} + +// RequireSuccessReceipt asserts that a transaction was successful +func RequireSuccessReceipt(t testing.TB, receipt *types.Receipt) { + require.Equal(t, types.ReceiptStatusSuccessful, receipt.Status, "transaction failed") +} diff --git a/tests/precompile/contracttest/roles.go b/tests/precompile/contracttest/roles.go new file mode 100644 index 0000000000..916acc9025 --- /dev/null +++ b/tests/precompile/contracttest/roles.go @@ -0,0 +1,99 @@ +// Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved. +// See the file LICENSE for licensing terms. + +package contracttest + +import ( + "testing" + + "github.com/ava-labs/libevm/accounts/abi/bind" + "github.com/ava-labs/libevm/common" + "github.com/ava-labs/libevm/core/types" + "github.com/ava-labs/subnet-evm/contracts/bindings" + "github.com/stretchr/testify/require" +) + +// AllowList roles (matching TypeScript Roles in utils.ts) +const ( + RoleNone = uint8(0) + RoleEnabled = uint8(1) + RoleAdmin = uint8(2) + RoleManager = uint8(3) +) + +// Precompile addresses +var ( + ContractDeployerAllowListAddress = common.HexToAddress("0x0200000000000000000000000000000000000000") + TxAllowListAddress = common.HexToAddress("0x0200000000000000000000000000000000000002") + NativeMinterAddress = common.HexToAddress("0x0200000000000000000000000000000000000001") + FeeManagerAddress = common.HexToAddress("0x0200000000000000000000000000000000000003") + RewardManagerAddress = common.HexToAddress("0x0200000000000000000000000000000000000004") + WarpAddress = common.HexToAddress("0x0200000000000000000000000000000000000005") +) + +// SetupAllowListRole configures an address with a specific role on an allowlist precompile +func SetupAllowListRole( + t testing.TB, + backend *TestBackend, + allowListAddress common.Address, + targetAddress common.Address, + role uint8, + fromAccount *TestAccount, +) { + require := require.New(t) + + // Get the IAllowList interface at the precompile address + allowList, err := bindings.NewIAllowList(allowListAddress, backend.Client()) + require.NoError(err, "failed to create allowlist interface") + + var tx *types.Transaction + switch role { + case RoleAdmin: + tx, err = allowList.SetAdmin(fromAccount.Auth, targetAddress) + case RoleManager: + tx, err = allowList.SetManager(fromAccount.Auth, targetAddress) + case RoleEnabled: + tx, err = allowList.SetEnabled(fromAccount.Auth, targetAddress) + case RoleNone: + tx, err = allowList.SetNone(fromAccount.Auth, targetAddress) + default: + require.Fail("invalid role") + } + + require.NoError(err, "failed to set role") + + // Commit and verify + receipt := WaitForReceipt(t, backend, tx) + RequireSuccessReceipt(t, receipt) +} + +// GetAllowListRole returns the role of an address on an allowlist precompile +func GetAllowListRole( + t testing.TB, + backend *TestBackend, + allowListAddress common.Address, + targetAddress common.Address, +) uint8 { + require := require.New(t) + + // Get the IAllowList interface at the precompile address + allowList, err := bindings.NewIAllowList(allowListAddress, backend.Client()) + require.NoError(err, "failed to create allowlist interface") + + role, err := allowList.ReadAllowList(&bind.CallOpts{}, targetAddress) + require.NoError(err, "failed to read allowlist role") + + return uint8(role.Uint64()) +} + +// RequireRole asserts that an address has the expected role +func RequireRole( + t testing.TB, + backend *TestBackend, + allowListAddress common.Address, + targetAddress common.Address, + expectedRole uint8, +) { + actualRole := GetAllowListRole(t, backend, allowListAddress, targetAddress) + require.Equal(t, expectedRole, actualRole, "role mismatch for address %s", targetAddress.Hex()) +} diff --git a/tests/precompile/contracttest/tmpnet.go b/tests/precompile/contracttest/tmpnet.go new file mode 100644 index 0000000000..98983ca873 --- /dev/null +++ b/tests/precompile/contracttest/tmpnet.go @@ -0,0 +1,228 @@ +// Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved. +// See the file LICENSE for licensing terms. + +package contracttest + +import ( + "context" + "testing" + + "github.com/ava-labs/libevm/accounts/abi/bind" + "github.com/ava-labs/libevm/common" + "github.com/ava-labs/libevm/core/types" + "github.com/ava-labs/libevm/crypto" + "github.com/ava-labs/libevm/ethclient" + "github.com/ava-labs/subnet-evm/contracts/bindings" + "github.com/stretchr/testify/require" +) + +// TmpnetBackend wraps an ethclient connection to a tmpnet subnet +// This is used for E2E testing against real subnets with precompiles enabled +type TmpnetBackend struct { + Client *ethclient.Client + Accounts +} + +// NewTmpnetBackendSimple creates a test backend connected to a tmpnet subnet via RPC +// This version doesn't require a testing.TB interface, suitable for use in Ginkgo tests +func NewTmpnetBackendSimple(rpcURL string) *TmpnetBackend { + // Connect to the subnet + client, err := ethclient.Dial(rpcURL) + if err != nil { + panic("failed to connect to tmpnet subnet: " + err.Error()) + } + + // Create test accounts (same keys as simulated backend) + var fundedAccounts Accounts + fundedAccounts.FundedKeys = make([]*TestAccount, len(testPrivateKeys)) + + // Get chainID from the connected chain + chainID, err := client.ChainID(context.Background()) + if err != nil { + panic("failed to get chain ID: " + err.Error()) + } + + for i, keyHex := range testPrivateKeys { + key, err := crypto.HexToECDSA(keyHex) + if err != nil { + panic("failed to parse private key: " + err.Error()) + } + + addr := crypto.PubkeyToAddress(key.PublicKey) + + auth, err := bind.NewKeyedTransactorWithChainID(key, chainID) + if err != nil { + panic("failed to create transactor: " + err.Error()) + } + + // Leave Nonce as nil so the binding fetches it automatically for each transaction + // This is essential for parallel tests to avoid nonce conflicts + + account := &TestAccount{ + Key: key, + Address: addr, + Auth: auth, + } + fundedAccounts.FundedKeys[i] = account + + // Set up special accounts + switch addr { + case AdminAddress: + fundedAccounts.Admin = account + case OtherAddress: + fundedAccounts.OtherAddr = account + } + } + + return &TmpnetBackend{ + Client: client, + Accounts: fundedAccounts, + } +} + +// NewTmpnetBackend creates a test backend connected to a tmpnet subnet via RPC +func NewTmpnetBackend(t testing.TB, rpcURL string) *TmpnetBackend { + require := require.New(t) + + // Connect to the subnet + client, err := ethclient.Dial(rpcURL) + require.NoError(err, "failed to connect to tmpnet subnet") + + // Create test accounts (same keys as simulated backend) + var fundedAccounts Accounts + fundedAccounts.FundedKeys = make([]*TestAccount, len(testPrivateKeys)) + + // Get chainID from the connected chain + chainID, err := client.ChainID(context.Background()) + require.NoError(err, "failed to get chain ID") + + for i, keyHex := range testPrivateKeys { + key, err := crypto.HexToECDSA(keyHex) + require.NoError(err) + + addr := crypto.PubkeyToAddress(key.PublicKey) + + auth, err := bind.NewKeyedTransactorWithChainID(key, chainID) + require.NoError(err) + + // Leave Nonce as nil so the binding fetches it automatically for each transaction + // This is essential for parallel tests to avoid nonce conflicts + + account := &TestAccount{ + Key: key, + Address: addr, + Auth: auth, + } + fundedAccounts.FundedKeys[i] = account + + // Set up special accounts + switch addr { + case AdminAddress: + fundedAccounts.Admin = account + case OtherAddress: + fundedAccounts.OtherAddr = account + } + } + + return &TmpnetBackend{ + Client: client, + Accounts: fundedAccounts, + } +} + +// Close closes the client connection +func (tb *TmpnetBackend) Close() { + if tb.Client != nil { + tb.Client.Close() + } +} + +// GetAccount returns a TestAccount by address, or nil if not found +func (tb *TmpnetBackend) GetAccount(addr common.Address) *TestAccount { + for _, account := range tb.FundedKeys { + if account.Address == addr { + return account + } + } + return nil +} + +// WaitForTxReceipt waits for a transaction receipt from the RPC endpoint +func WaitForTxReceipt(t testing.TB, client *ethclient.Client, tx *types.Transaction) *types.Receipt { + require := require.New(t) + + // Wait for the transaction to be mined + receipt, err := bind.WaitMined(context.Background(), client, tx) + require.NoError(err, "failed to wait for transaction") + require.NotNil(receipt, "receipt is nil") + + return receipt +} + +// DeployContractToTmpnet deploys a contract to a tmpnet subnet +// Example usage: +// +// addr, tx, contract, err := bindings.DeployExampleDeployerList(auth, client) +// receipt := WaitForTxReceipt(t, client, tx) +func DeployContractToTmpnet( + t testing.TB, + client *ethclient.Client, + tx *types.Transaction, +) *types.Receipt { + return WaitForTxReceipt(t, client, tx) +} + +// SetupAllowListRoleOnTmpnet configures an address with a specific role on a tmpnet subnet +func SetupAllowListRoleOnTmpnet( + t testing.TB, + client *ethclient.Client, + allowListAddress common.Address, + targetAddress common.Address, + role uint8, + fromAccount *TestAccount, +) { + require := require.New(t) + + // Get the IAllowList interface at the precompile address + allowList, err := bindings.NewIAllowList(allowListAddress, client) + require.NoError(err, "failed to create allowlist interface") + + var tx *types.Transaction + switch role { + case RoleAdmin: + tx, err = allowList.SetAdmin(fromAccount.Auth, targetAddress) + case RoleManager: + tx, err = allowList.SetManager(fromAccount.Auth, targetAddress) + case RoleEnabled: + tx, err = allowList.SetEnabled(fromAccount.Auth, targetAddress) + case RoleNone: + tx, err = allowList.SetNone(fromAccount.Auth, targetAddress) + default: + require.Fail("invalid role") + } + + require.NoError(err, "failed to set role") + + // Wait for transaction and verify + receipt := WaitForTxReceipt(t, client, tx) + RequireSuccessReceipt(t, receipt) +} + +// GetAllowListRoleOnTmpnet returns the role of an address on a tmpnet subnet +func GetAllowListRoleOnTmpnet( + t testing.TB, + client *ethclient.Client, + allowListAddress common.Address, + targetAddress common.Address, +) uint8 { + require := require.New(t) + + // Get the IAllowList interface at the precompile address + allowList, err := bindings.NewIAllowList(allowListAddress, client) + require.NoError(err, "failed to create allowlist interface") + + role, err := allowList.ReadAllowList(&bind.CallOpts{}, targetAddress) + require.NoError(err, "failed to read allowlist role") + + return uint8(role.Uint64()) +} diff --git a/tests/precompile/solidity/suites.go b/tests/precompile/solidity/suites.go index 37db9e1216..0825e50891 100644 --- a/tests/precompile/solidity/suites.go +++ b/tests/precompile/solidity/suites.go @@ -14,6 +14,10 @@ import ( ginkgo "github.com/onsi/ginkgo/v2" ) +// SubnetsSuite is the shared subnet suite for all precompile tests +// Exported so Go tests can access it +var SubnetsSuite *utils.SubnetSuite + // Registers the Asynchronized Precompile Tests // Before running the tests, this function creates all subnets given in the genesis files // and then runs the hardhat tests for each one asynchronously if called with `ginkgo run -procs=`. @@ -27,7 +31,8 @@ func RegisterAsyncTests() { if len(genesisFiles) == 0 { ginkgo.AbortSuite("No genesis files found") } - subnetsSuite := utils.CreateSubnetsSuite(genesisFiles) + SubnetsSuite = utils.CreateSubnetsSuite(genesisFiles) + subnetsSuite := SubnetsSuite timeout := 3 * time.Minute _ = ginkgo.Describe("[Asynchronized Precompile Tests]", func() { From 03d46d0feb926c07fb87c921edde9f521f08d220 Mon Sep 17 00:00:00 2001 From: Jonathan Oppenheimer Date: Mon, 3 Nov 2025 16:07:48 -0500 Subject: [PATCH 02/11] lint --- tests/precompile/contract_deployer_allow_list_test.go | 2 ++ tests/precompile/contracttest/example_test.go | 3 ++- tests/precompile/contracttest/roles.go | 3 ++- tests/precompile/contracttest/tmpnet.go | 3 ++- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/precompile/contract_deployer_allow_list_test.go b/tests/precompile/contract_deployer_allow_list_test.go index d692c245c0..2c9d547172 100644 --- a/tests/precompile/contract_deployer_allow_list_test.go +++ b/tests/precompile/contract_deployer_allow_list_test.go @@ -9,10 +9,12 @@ import ( "github.com/ava-labs/libevm/accounts/abi/bind" "github.com/ava-labs/libevm/common" "github.com/ava-labs/libevm/core/types" + "github.com/ava-labs/subnet-evm/contracts/bindings" "github.com/ava-labs/subnet-evm/tests/precompile/contracttest" "github.com/ava-labs/subnet-evm/tests/precompile/solidity" "github.com/ava-labs/subnet-evm/tests/utils" + ginkgo "github.com/onsi/ginkgo/v2" requirePkg "github.com/stretchr/testify/require" ) diff --git a/tests/precompile/contracttest/example_test.go b/tests/precompile/contracttest/example_test.go index ac24a82c19..9bd0b13a6b 100644 --- a/tests/precompile/contracttest/example_test.go +++ b/tests/precompile/contracttest/example_test.go @@ -6,8 +6,9 @@ package contracttest import ( "testing" - "github.com/ava-labs/subnet-evm/contracts/bindings" "github.com/stretchr/testify/require" + + "github.com/ava-labs/subnet-evm/contracts/bindings" ) // TestExampleDeployment demonstrates the test infrastructure diff --git a/tests/precompile/contracttest/roles.go b/tests/precompile/contracttest/roles.go index 916acc9025..8b3f03c3fd 100644 --- a/tests/precompile/contracttest/roles.go +++ b/tests/precompile/contracttest/roles.go @@ -9,8 +9,9 @@ import ( "github.com/ava-labs/libevm/accounts/abi/bind" "github.com/ava-labs/libevm/common" "github.com/ava-labs/libevm/core/types" - "github.com/ava-labs/subnet-evm/contracts/bindings" "github.com/stretchr/testify/require" + + "github.com/ava-labs/subnet-evm/contracts/bindings" ) // AllowList roles (matching TypeScript Roles in utils.ts) diff --git a/tests/precompile/contracttest/tmpnet.go b/tests/precompile/contracttest/tmpnet.go index 98983ca873..c18700ea13 100644 --- a/tests/precompile/contracttest/tmpnet.go +++ b/tests/precompile/contracttest/tmpnet.go @@ -12,8 +12,9 @@ import ( "github.com/ava-labs/libevm/core/types" "github.com/ava-labs/libevm/crypto" "github.com/ava-labs/libevm/ethclient" - "github.com/ava-labs/subnet-evm/contracts/bindings" "github.com/stretchr/testify/require" + + "github.com/ava-labs/subnet-evm/contracts/bindings" ) // TmpnetBackend wraps an ethclient connection to a tmpnet subnet From bcf0791f851ad26aedbd88b341f5c5c3e39e9b8f Mon Sep 17 00:00:00 2001 From: Jonathan Oppenheimer Date: Mon, 3 Nov 2025 16:43:02 -0500 Subject: [PATCH 03/11] de-duplicate address --- tests/precompile/contract_deployer_allow_list_test.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/precompile/contract_deployer_allow_list_test.go b/tests/precompile/contract_deployer_allow_list_test.go index 2c9d547172..b6381c515c 100644 --- a/tests/precompile/contract_deployer_allow_list_test.go +++ b/tests/precompile/contract_deployer_allow_list_test.go @@ -61,7 +61,9 @@ func init() { }) ginkgo.It("should emit RoleSet event when setting admin role", func() { - testAddress := common.HexToAddress("0x0111000000000000000000000000000000000001") + // TODO: revert to using the TypeScript address for this after migration (ensures OldRole is None) + // testAddress := common.HexToAddress("0x0111000000000000000000000000000000000001") + testAddress := common.HexToAddress("0x1111111111111111111111111111111111111111") tx, err := allowList.SetAdmin(backend.Admin.Auth, testAddress) require.NoError(err) @@ -80,7 +82,9 @@ func init() { }) ginkgo.It("should emit RoleSet event when setting manager role", func() { - testAddress := common.HexToAddress("0x0222000000000000000000000000000000000002") + // TODO: revert to using the TypeScript address for this after migration (ensures OldRole is None) + // testAddress := common.HexToAddress("0x0222000000000000000000000000000000000002") + testAddress := common.HexToAddress("0x2222222222222222222222222222222222222222") tx, err := allowList.SetManager(backend.Admin.Auth, testAddress) require.NoError(err) From 11b53338929bd6c3f5a32b61139f00ef11329d8c Mon Sep 17 00:00:00 2001 From: Jonathan Oppenheimer Date: Mon, 3 Nov 2025 17:03:47 -0500 Subject: [PATCH 04/11] use double quotes --- scripts/run_ginkgo_precompile.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/run_ginkgo_precompile.sh b/scripts/run_ginkgo_precompile.sh index 2ca1cd536b..ac67c193a9 100755 --- a/scripts/run_ginkgo_precompile.sh +++ b/scripts/run_ginkgo_precompile.sh @@ -23,4 +23,4 @@ if [ -n "${GINKGO_LABEL_FILTER:-}" ]; then LABEL_FILTER_FLAG="--label-filter=${GINKGO_LABEL_FILTER}" fi -TEST_SOURCE_ROOT="$TEST_SOURCE_ROOT" "${SUBNET_EVM_PATH}"/bin/ginkgo run -procs=5 --vv ${LABEL_FILTER_FLAG} tests/precompile +TEST_SOURCE_ROOT="$TEST_SOURCE_ROOT" "${SUBNET_EVM_PATH}"/bin/ginkgo run -procs=5 --vv "${LABEL_FILTER_FLAG}" tests/precompile From 9c158a273ece8ed5078fb46888862f390cc30e78 Mon Sep 17 00:00:00 2001 From: Jonathan Oppenheimer Date: Mon, 3 Nov 2025 17:10:33 -0500 Subject: [PATCH 05/11] remove out of date comments --- tests/precompile/contracttest/tmpnet.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/precompile/contracttest/tmpnet.go b/tests/precompile/contracttest/tmpnet.go index c18700ea13..e0daec9e2d 100644 --- a/tests/precompile/contracttest/tmpnet.go +++ b/tests/precompile/contracttest/tmpnet.go @@ -56,9 +56,6 @@ func NewTmpnetBackendSimple(rpcURL string) *TmpnetBackend { panic("failed to create transactor: " + err.Error()) } - // Leave Nonce as nil so the binding fetches it automatically for each transaction - // This is essential for parallel tests to avoid nonce conflicts - account := &TestAccount{ Key: key, Address: addr, @@ -106,9 +103,6 @@ func NewTmpnetBackend(t testing.TB, rpcURL string) *TmpnetBackend { auth, err := bind.NewKeyedTransactorWithChainID(key, chainID) require.NoError(err) - // Leave Nonce as nil so the binding fetches it automatically for each transaction - // This is essential for parallel tests to avoid nonce conflicts - account := &TestAccount{ Key: key, Address: addr, From fe1aa631b250f2e67f290bd6dcae8a7819e4544a Mon Sep 17 00:00:00 2001 From: Jonathan Oppenheimer Date: Tue, 4 Nov 2025 14:17:37 -0500 Subject: [PATCH 06/11] Tsvetan feedback revisions --- contracts/bindings/ifeemanager.go | 744 ------------ contracts/bindings/inativeminter.go | 634 ---------- contracts/bindings/irewardmanager.go | 1034 ----------------- contracts/bindings/iwarpmessenger.go | 490 -------- contracts/contracts/compile.go | 8 +- .../contract_deployer_allow_list_test.go | 6 +- tests/precompile/contracttest/example_test.go | 2 +- tests/precompile/contracttest/helpers.go | 78 +- tests/precompile/contracttest/roles.go | 8 +- tests/precompile/contracttest/tmpnet.go | 172 +-- 10 files changed, 74 insertions(+), 3102 deletions(-) delete mode 100644 contracts/bindings/ifeemanager.go delete mode 100644 contracts/bindings/inativeminter.go delete mode 100644 contracts/bindings/irewardmanager.go delete mode 100644 contracts/bindings/iwarpmessenger.go diff --git a/contracts/bindings/ifeemanager.go b/contracts/bindings/ifeemanager.go deleted file mode 100644 index 8b5013dcc7..0000000000 --- a/contracts/bindings/ifeemanager.go +++ /dev/null @@ -1,744 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package bindings - -import ( - "errors" - "math/big" - "strings" - - ethereum "github.com/ava-labs/libevm" - "github.com/ava-labs/libevm/accounts/abi" - "github.com/ava-labs/libevm/accounts/abi/bind" - "github.com/ava-labs/libevm/common" - "github.com/ava-labs/libevm/core/types" - "github.com/ava-labs/libevm/event" -) - -// Reference imports to suppress errors if they are not otherwise used. -var ( - _ = errors.New - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription - _ = abi.ConvertType -) - -// IFeeManagerFeeConfig is an auto generated low-level Go binding around an user-defined struct. -type IFeeManagerFeeConfig struct { - GasLimit *big.Int - TargetBlockRate *big.Int - MinBaseFee *big.Int - TargetGas *big.Int - BaseFeeChangeDenominator *big.Int - MinBlockGasCost *big.Int - MaxBlockGasCost *big.Int - BlockGasCostStep *big.Int -} - -// IFeeManagerMetaData contains all meta data concerning the IFeeManager contract. -var IFeeManagerMetaData = &bind.MetaData{ - ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"targetBlockRate\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minBaseFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"targetGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"baseFeeChangeDenominator\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minBlockGasCost\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxBlockGasCost\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockGasCostStep\",\"type\":\"uint256\"}],\"indexed\":false,\"internalType\":\"structIFeeManager.FeeConfig\",\"name\":\"oldFeeConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"targetBlockRate\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minBaseFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"targetGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"baseFeeChangeDenominator\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minBlockGasCost\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxBlockGasCost\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockGasCostStep\",\"type\":\"uint256\"}],\"indexed\":false,\"internalType\":\"structIFeeManager.FeeConfig\",\"name\":\"newFeeConfig\",\"type\":\"tuple\"}],\"name\":\"FeeConfigChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"role\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldRole\",\"type\":\"uint256\"}],\"name\":\"RoleSet\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"getFeeConfig\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"targetBlockRate\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minBaseFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"targetGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"baseFeeChangeDenominator\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minBlockGasCost\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxBlockGasCost\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockGasCostStep\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getFeeConfigLastChangedAt\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"readAllowList\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"role\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setEnabled\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"targetBlockRate\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minBaseFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"targetGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"baseFeeChangeDenominator\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minBlockGasCost\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxBlockGasCost\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockGasCostStep\",\"type\":\"uint256\"}],\"name\":\"setFeeConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setNone\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", -} - -// IFeeManagerABI is the input ABI used to generate the binding from. -// Deprecated: Use IFeeManagerMetaData.ABI instead. -var IFeeManagerABI = IFeeManagerMetaData.ABI - -// IFeeManager is an auto generated Go binding around an Ethereum contract. -type IFeeManager struct { - IFeeManagerCaller // Read-only binding to the contract - IFeeManagerTransactor // Write-only binding to the contract - IFeeManagerFilterer // Log filterer for contract events -} - -// IFeeManagerCaller is an auto generated read-only Go binding around an Ethereum contract. -type IFeeManagerCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// IFeeManagerTransactor is an auto generated write-only Go binding around an Ethereum contract. -type IFeeManagerTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// IFeeManagerFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type IFeeManagerFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// IFeeManagerSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type IFeeManagerSession struct { - Contract *IFeeManager // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// IFeeManagerCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type IFeeManagerCallerSession struct { - Contract *IFeeManagerCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// IFeeManagerTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type IFeeManagerTransactorSession struct { - Contract *IFeeManagerTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// IFeeManagerRaw is an auto generated low-level Go binding around an Ethereum contract. -type IFeeManagerRaw struct { - Contract *IFeeManager // Generic contract binding to access the raw methods on -} - -// IFeeManagerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type IFeeManagerCallerRaw struct { - Contract *IFeeManagerCaller // Generic read-only contract binding to access the raw methods on -} - -// IFeeManagerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type IFeeManagerTransactorRaw struct { - Contract *IFeeManagerTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewIFeeManager creates a new instance of IFeeManager, bound to a specific deployed contract. -func NewIFeeManager(address common.Address, backend bind.ContractBackend) (*IFeeManager, error) { - contract, err := bindIFeeManager(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &IFeeManager{IFeeManagerCaller: IFeeManagerCaller{contract: contract}, IFeeManagerTransactor: IFeeManagerTransactor{contract: contract}, IFeeManagerFilterer: IFeeManagerFilterer{contract: contract}}, nil -} - -// NewIFeeManagerCaller creates a new read-only instance of IFeeManager, bound to a specific deployed contract. -func NewIFeeManagerCaller(address common.Address, caller bind.ContractCaller) (*IFeeManagerCaller, error) { - contract, err := bindIFeeManager(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &IFeeManagerCaller{contract: contract}, nil -} - -// NewIFeeManagerTransactor creates a new write-only instance of IFeeManager, bound to a specific deployed contract. -func NewIFeeManagerTransactor(address common.Address, transactor bind.ContractTransactor) (*IFeeManagerTransactor, error) { - contract, err := bindIFeeManager(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &IFeeManagerTransactor{contract: contract}, nil -} - -// NewIFeeManagerFilterer creates a new log filterer instance of IFeeManager, bound to a specific deployed contract. -func NewIFeeManagerFilterer(address common.Address, filterer bind.ContractFilterer) (*IFeeManagerFilterer, error) { - contract, err := bindIFeeManager(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &IFeeManagerFilterer{contract: contract}, nil -} - -// bindIFeeManager binds a generic wrapper to an already deployed contract. -func bindIFeeManager(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := IFeeManagerMetaData.GetAbi() - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_IFeeManager *IFeeManagerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _IFeeManager.Contract.IFeeManagerCaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_IFeeManager *IFeeManagerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _IFeeManager.Contract.IFeeManagerTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_IFeeManager *IFeeManagerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _IFeeManager.Contract.IFeeManagerTransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_IFeeManager *IFeeManagerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _IFeeManager.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_IFeeManager *IFeeManagerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _IFeeManager.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_IFeeManager *IFeeManagerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _IFeeManager.Contract.contract.Transact(opts, method, params...) -} - -// GetFeeConfig is a free data retrieval call binding the contract method 0x5fbbc0d2. -// -// Solidity: function getFeeConfig() view returns(uint256 gasLimit, uint256 targetBlockRate, uint256 minBaseFee, uint256 targetGas, uint256 baseFeeChangeDenominator, uint256 minBlockGasCost, uint256 maxBlockGasCost, uint256 blockGasCostStep) -func (_IFeeManager *IFeeManagerCaller) GetFeeConfig(opts *bind.CallOpts) (struct { - GasLimit *big.Int - TargetBlockRate *big.Int - MinBaseFee *big.Int - TargetGas *big.Int - BaseFeeChangeDenominator *big.Int - MinBlockGasCost *big.Int - MaxBlockGasCost *big.Int - BlockGasCostStep *big.Int -}, error) { - var out []interface{} - err := _IFeeManager.contract.Call(opts, &out, "getFeeConfig") - - outstruct := new(struct { - GasLimit *big.Int - TargetBlockRate *big.Int - MinBaseFee *big.Int - TargetGas *big.Int - BaseFeeChangeDenominator *big.Int - MinBlockGasCost *big.Int - MaxBlockGasCost *big.Int - BlockGasCostStep *big.Int - }) - if err != nil { - return *outstruct, err - } - - outstruct.GasLimit = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - outstruct.TargetBlockRate = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) - outstruct.MinBaseFee = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) - outstruct.TargetGas = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) - outstruct.BaseFeeChangeDenominator = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) - outstruct.MinBlockGasCost = *abi.ConvertType(out[5], new(*big.Int)).(**big.Int) - outstruct.MaxBlockGasCost = *abi.ConvertType(out[6], new(*big.Int)).(**big.Int) - outstruct.BlockGasCostStep = *abi.ConvertType(out[7], new(*big.Int)).(**big.Int) - - return *outstruct, err - -} - -// GetFeeConfig is a free data retrieval call binding the contract method 0x5fbbc0d2. -// -// Solidity: function getFeeConfig() view returns(uint256 gasLimit, uint256 targetBlockRate, uint256 minBaseFee, uint256 targetGas, uint256 baseFeeChangeDenominator, uint256 minBlockGasCost, uint256 maxBlockGasCost, uint256 blockGasCostStep) -func (_IFeeManager *IFeeManagerSession) GetFeeConfig() (struct { - GasLimit *big.Int - TargetBlockRate *big.Int - MinBaseFee *big.Int - TargetGas *big.Int - BaseFeeChangeDenominator *big.Int - MinBlockGasCost *big.Int - MaxBlockGasCost *big.Int - BlockGasCostStep *big.Int -}, error) { - return _IFeeManager.Contract.GetFeeConfig(&_IFeeManager.CallOpts) -} - -// GetFeeConfig is a free data retrieval call binding the contract method 0x5fbbc0d2. -// -// Solidity: function getFeeConfig() view returns(uint256 gasLimit, uint256 targetBlockRate, uint256 minBaseFee, uint256 targetGas, uint256 baseFeeChangeDenominator, uint256 minBlockGasCost, uint256 maxBlockGasCost, uint256 blockGasCostStep) -func (_IFeeManager *IFeeManagerCallerSession) GetFeeConfig() (struct { - GasLimit *big.Int - TargetBlockRate *big.Int - MinBaseFee *big.Int - TargetGas *big.Int - BaseFeeChangeDenominator *big.Int - MinBlockGasCost *big.Int - MaxBlockGasCost *big.Int - BlockGasCostStep *big.Int -}, error) { - return _IFeeManager.Contract.GetFeeConfig(&_IFeeManager.CallOpts) -} - -// GetFeeConfigLastChangedAt is a free data retrieval call binding the contract method 0x9e05549a. -// -// Solidity: function getFeeConfigLastChangedAt() view returns(uint256 blockNumber) -func (_IFeeManager *IFeeManagerCaller) GetFeeConfigLastChangedAt(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _IFeeManager.contract.Call(opts, &out, "getFeeConfigLastChangedAt") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// GetFeeConfigLastChangedAt is a free data retrieval call binding the contract method 0x9e05549a. -// -// Solidity: function getFeeConfigLastChangedAt() view returns(uint256 blockNumber) -func (_IFeeManager *IFeeManagerSession) GetFeeConfigLastChangedAt() (*big.Int, error) { - return _IFeeManager.Contract.GetFeeConfigLastChangedAt(&_IFeeManager.CallOpts) -} - -// GetFeeConfigLastChangedAt is a free data retrieval call binding the contract method 0x9e05549a. -// -// Solidity: function getFeeConfigLastChangedAt() view returns(uint256 blockNumber) -func (_IFeeManager *IFeeManagerCallerSession) GetFeeConfigLastChangedAt() (*big.Int, error) { - return _IFeeManager.Contract.GetFeeConfigLastChangedAt(&_IFeeManager.CallOpts) -} - -// ReadAllowList is a free data retrieval call binding the contract method 0xeb54dae1. -// -// Solidity: function readAllowList(address addr) view returns(uint256 role) -func (_IFeeManager *IFeeManagerCaller) ReadAllowList(opts *bind.CallOpts, addr common.Address) (*big.Int, error) { - var out []interface{} - err := _IFeeManager.contract.Call(opts, &out, "readAllowList", addr) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// ReadAllowList is a free data retrieval call binding the contract method 0xeb54dae1. -// -// Solidity: function readAllowList(address addr) view returns(uint256 role) -func (_IFeeManager *IFeeManagerSession) ReadAllowList(addr common.Address) (*big.Int, error) { - return _IFeeManager.Contract.ReadAllowList(&_IFeeManager.CallOpts, addr) -} - -// ReadAllowList is a free data retrieval call binding the contract method 0xeb54dae1. -// -// Solidity: function readAllowList(address addr) view returns(uint256 role) -func (_IFeeManager *IFeeManagerCallerSession) ReadAllowList(addr common.Address) (*big.Int, error) { - return _IFeeManager.Contract.ReadAllowList(&_IFeeManager.CallOpts, addr) -} - -// SetAdmin is a paid mutator transaction binding the contract method 0x704b6c02. -// -// Solidity: function setAdmin(address addr) returns() -func (_IFeeManager *IFeeManagerTransactor) SetAdmin(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { - return _IFeeManager.contract.Transact(opts, "setAdmin", addr) -} - -// SetAdmin is a paid mutator transaction binding the contract method 0x704b6c02. -// -// Solidity: function setAdmin(address addr) returns() -func (_IFeeManager *IFeeManagerSession) SetAdmin(addr common.Address) (*types.Transaction, error) { - return _IFeeManager.Contract.SetAdmin(&_IFeeManager.TransactOpts, addr) -} - -// SetAdmin is a paid mutator transaction binding the contract method 0x704b6c02. -// -// Solidity: function setAdmin(address addr) returns() -func (_IFeeManager *IFeeManagerTransactorSession) SetAdmin(addr common.Address) (*types.Transaction, error) { - return _IFeeManager.Contract.SetAdmin(&_IFeeManager.TransactOpts, addr) -} - -// SetEnabled is a paid mutator transaction binding the contract method 0x0aaf7043. -// -// Solidity: function setEnabled(address addr) returns() -func (_IFeeManager *IFeeManagerTransactor) SetEnabled(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { - return _IFeeManager.contract.Transact(opts, "setEnabled", addr) -} - -// SetEnabled is a paid mutator transaction binding the contract method 0x0aaf7043. -// -// Solidity: function setEnabled(address addr) returns() -func (_IFeeManager *IFeeManagerSession) SetEnabled(addr common.Address) (*types.Transaction, error) { - return _IFeeManager.Contract.SetEnabled(&_IFeeManager.TransactOpts, addr) -} - -// SetEnabled is a paid mutator transaction binding the contract method 0x0aaf7043. -// -// Solidity: function setEnabled(address addr) returns() -func (_IFeeManager *IFeeManagerTransactorSession) SetEnabled(addr common.Address) (*types.Transaction, error) { - return _IFeeManager.Contract.SetEnabled(&_IFeeManager.TransactOpts, addr) -} - -// SetFeeConfig is a paid mutator transaction binding the contract method 0x8f10b586. -// -// Solidity: function setFeeConfig(uint256 gasLimit, uint256 targetBlockRate, uint256 minBaseFee, uint256 targetGas, uint256 baseFeeChangeDenominator, uint256 minBlockGasCost, uint256 maxBlockGasCost, uint256 blockGasCostStep) returns() -func (_IFeeManager *IFeeManagerTransactor) SetFeeConfig(opts *bind.TransactOpts, gasLimit *big.Int, targetBlockRate *big.Int, minBaseFee *big.Int, targetGas *big.Int, baseFeeChangeDenominator *big.Int, minBlockGasCost *big.Int, maxBlockGasCost *big.Int, blockGasCostStep *big.Int) (*types.Transaction, error) { - return _IFeeManager.contract.Transact(opts, "setFeeConfig", gasLimit, targetBlockRate, minBaseFee, targetGas, baseFeeChangeDenominator, minBlockGasCost, maxBlockGasCost, blockGasCostStep) -} - -// SetFeeConfig is a paid mutator transaction binding the contract method 0x8f10b586. -// -// Solidity: function setFeeConfig(uint256 gasLimit, uint256 targetBlockRate, uint256 minBaseFee, uint256 targetGas, uint256 baseFeeChangeDenominator, uint256 minBlockGasCost, uint256 maxBlockGasCost, uint256 blockGasCostStep) returns() -func (_IFeeManager *IFeeManagerSession) SetFeeConfig(gasLimit *big.Int, targetBlockRate *big.Int, minBaseFee *big.Int, targetGas *big.Int, baseFeeChangeDenominator *big.Int, minBlockGasCost *big.Int, maxBlockGasCost *big.Int, blockGasCostStep *big.Int) (*types.Transaction, error) { - return _IFeeManager.Contract.SetFeeConfig(&_IFeeManager.TransactOpts, gasLimit, targetBlockRate, minBaseFee, targetGas, baseFeeChangeDenominator, minBlockGasCost, maxBlockGasCost, blockGasCostStep) -} - -// SetFeeConfig is a paid mutator transaction binding the contract method 0x8f10b586. -// -// Solidity: function setFeeConfig(uint256 gasLimit, uint256 targetBlockRate, uint256 minBaseFee, uint256 targetGas, uint256 baseFeeChangeDenominator, uint256 minBlockGasCost, uint256 maxBlockGasCost, uint256 blockGasCostStep) returns() -func (_IFeeManager *IFeeManagerTransactorSession) SetFeeConfig(gasLimit *big.Int, targetBlockRate *big.Int, minBaseFee *big.Int, targetGas *big.Int, baseFeeChangeDenominator *big.Int, minBlockGasCost *big.Int, maxBlockGasCost *big.Int, blockGasCostStep *big.Int) (*types.Transaction, error) { - return _IFeeManager.Contract.SetFeeConfig(&_IFeeManager.TransactOpts, gasLimit, targetBlockRate, minBaseFee, targetGas, baseFeeChangeDenominator, minBlockGasCost, maxBlockGasCost, blockGasCostStep) -} - -// SetManager is a paid mutator transaction binding the contract method 0xd0ebdbe7. -// -// Solidity: function setManager(address addr) returns() -func (_IFeeManager *IFeeManagerTransactor) SetManager(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { - return _IFeeManager.contract.Transact(opts, "setManager", addr) -} - -// SetManager is a paid mutator transaction binding the contract method 0xd0ebdbe7. -// -// Solidity: function setManager(address addr) returns() -func (_IFeeManager *IFeeManagerSession) SetManager(addr common.Address) (*types.Transaction, error) { - return _IFeeManager.Contract.SetManager(&_IFeeManager.TransactOpts, addr) -} - -// SetManager is a paid mutator transaction binding the contract method 0xd0ebdbe7. -// -// Solidity: function setManager(address addr) returns() -func (_IFeeManager *IFeeManagerTransactorSession) SetManager(addr common.Address) (*types.Transaction, error) { - return _IFeeManager.Contract.SetManager(&_IFeeManager.TransactOpts, addr) -} - -// SetNone is a paid mutator transaction binding the contract method 0x8c6bfb3b. -// -// Solidity: function setNone(address addr) returns() -func (_IFeeManager *IFeeManagerTransactor) SetNone(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { - return _IFeeManager.contract.Transact(opts, "setNone", addr) -} - -// SetNone is a paid mutator transaction binding the contract method 0x8c6bfb3b. -// -// Solidity: function setNone(address addr) returns() -func (_IFeeManager *IFeeManagerSession) SetNone(addr common.Address) (*types.Transaction, error) { - return _IFeeManager.Contract.SetNone(&_IFeeManager.TransactOpts, addr) -} - -// SetNone is a paid mutator transaction binding the contract method 0x8c6bfb3b. -// -// Solidity: function setNone(address addr) returns() -func (_IFeeManager *IFeeManagerTransactorSession) SetNone(addr common.Address) (*types.Transaction, error) { - return _IFeeManager.Contract.SetNone(&_IFeeManager.TransactOpts, addr) -} - -// IFeeManagerFeeConfigChangedIterator is returned from FilterFeeConfigChanged and is used to iterate over the raw logs and unpacked data for FeeConfigChanged events raised by the IFeeManager contract. -type IFeeManagerFeeConfigChangedIterator struct { - Event *IFeeManagerFeeConfigChanged // 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 *IFeeManagerFeeConfigChangedIterator) 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(IFeeManagerFeeConfigChanged) - 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(IFeeManagerFeeConfigChanged) - 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 *IFeeManagerFeeConfigChangedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *IFeeManagerFeeConfigChangedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// IFeeManagerFeeConfigChanged represents a FeeConfigChanged event raised by the IFeeManager contract. -type IFeeManagerFeeConfigChanged struct { - Sender common.Address - OldFeeConfig IFeeManagerFeeConfig - NewFeeConfig IFeeManagerFeeConfig - Raw types.Log // Blockchain specific contextual infos -} - -// FilterFeeConfigChanged is a free log retrieval operation binding the contract event 0x4c98e43adb5962c18f3f0e6dd066e2a2de258d3b4f695b317b77c8f27cd044fc. -// -// Solidity: event FeeConfigChanged(address indexed sender, (uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256) oldFeeConfig, (uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256) newFeeConfig) -func (_IFeeManager *IFeeManagerFilterer) FilterFeeConfigChanged(opts *bind.FilterOpts, sender []common.Address) (*IFeeManagerFeeConfigChangedIterator, error) { - - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _IFeeManager.contract.FilterLogs(opts, "FeeConfigChanged", senderRule) - if err != nil { - return nil, err - } - return &IFeeManagerFeeConfigChangedIterator{contract: _IFeeManager.contract, event: "FeeConfigChanged", logs: logs, sub: sub}, nil -} - -// WatchFeeConfigChanged is a free log subscription operation binding the contract event 0x4c98e43adb5962c18f3f0e6dd066e2a2de258d3b4f695b317b77c8f27cd044fc. -// -// Solidity: event FeeConfigChanged(address indexed sender, (uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256) oldFeeConfig, (uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256) newFeeConfig) -func (_IFeeManager *IFeeManagerFilterer) WatchFeeConfigChanged(opts *bind.WatchOpts, sink chan<- *IFeeManagerFeeConfigChanged, sender []common.Address) (event.Subscription, error) { - - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _IFeeManager.contract.WatchLogs(opts, "FeeConfigChanged", senderRule) - 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(IFeeManagerFeeConfigChanged) - if err := _IFeeManager.contract.UnpackLog(event, "FeeConfigChanged", 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 -} - -// ParseFeeConfigChanged is a log parse operation binding the contract event 0x4c98e43adb5962c18f3f0e6dd066e2a2de258d3b4f695b317b77c8f27cd044fc. -// -// Solidity: event FeeConfigChanged(address indexed sender, (uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256) oldFeeConfig, (uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256) newFeeConfig) -func (_IFeeManager *IFeeManagerFilterer) ParseFeeConfigChanged(log types.Log) (*IFeeManagerFeeConfigChanged, error) { - event := new(IFeeManagerFeeConfigChanged) - if err := _IFeeManager.contract.UnpackLog(event, "FeeConfigChanged", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// IFeeManagerRoleSetIterator is returned from FilterRoleSet and is used to iterate over the raw logs and unpacked data for RoleSet events raised by the IFeeManager contract. -type IFeeManagerRoleSetIterator struct { - Event *IFeeManagerRoleSet // 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 *IFeeManagerRoleSetIterator) 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(IFeeManagerRoleSet) - 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(IFeeManagerRoleSet) - 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 *IFeeManagerRoleSetIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *IFeeManagerRoleSetIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// IFeeManagerRoleSet represents a RoleSet event raised by the IFeeManager contract. -type IFeeManagerRoleSet struct { - Role *big.Int - Account common.Address - Sender common.Address - OldRole *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterRoleSet is a free log retrieval operation binding the contract event 0xcdb7ea01f00a414d78757bdb0f6391664ba3fedf987eed280927c1e7d695be3e. -// -// Solidity: event RoleSet(uint256 indexed role, address indexed account, address indexed sender, uint256 oldRole) -func (_IFeeManager *IFeeManagerFilterer) FilterRoleSet(opts *bind.FilterOpts, role []*big.Int, account []common.Address, sender []common.Address) (*IFeeManagerRoleSetIterator, error) { - - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) - } - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _IFeeManager.contract.FilterLogs(opts, "RoleSet", roleRule, accountRule, senderRule) - if err != nil { - return nil, err - } - return &IFeeManagerRoleSetIterator{contract: _IFeeManager.contract, event: "RoleSet", logs: logs, sub: sub}, nil -} - -// WatchRoleSet is a free log subscription operation binding the contract event 0xcdb7ea01f00a414d78757bdb0f6391664ba3fedf987eed280927c1e7d695be3e. -// -// Solidity: event RoleSet(uint256 indexed role, address indexed account, address indexed sender, uint256 oldRole) -func (_IFeeManager *IFeeManagerFilterer) WatchRoleSet(opts *bind.WatchOpts, sink chan<- *IFeeManagerRoleSet, role []*big.Int, account []common.Address, sender []common.Address) (event.Subscription, error) { - - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) - } - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _IFeeManager.contract.WatchLogs(opts, "RoleSet", roleRule, accountRule, senderRule) - 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(IFeeManagerRoleSet) - if err := _IFeeManager.contract.UnpackLog(event, "RoleSet", 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 -} - -// ParseRoleSet is a log parse operation binding the contract event 0xcdb7ea01f00a414d78757bdb0f6391664ba3fedf987eed280927c1e7d695be3e. -// -// Solidity: event RoleSet(uint256 indexed role, address indexed account, address indexed sender, uint256 oldRole) -func (_IFeeManager *IFeeManagerFilterer) ParseRoleSet(log types.Log) (*IFeeManagerRoleSet, error) { - event := new(IFeeManagerRoleSet) - if err := _IFeeManager.contract.UnpackLog(event, "RoleSet", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} diff --git a/contracts/bindings/inativeminter.go b/contracts/bindings/inativeminter.go deleted file mode 100644 index c6fb781a70..0000000000 --- a/contracts/bindings/inativeminter.go +++ /dev/null @@ -1,634 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package bindings - -import ( - "errors" - "math/big" - "strings" - - ethereum "github.com/ava-labs/libevm" - "github.com/ava-labs/libevm/accounts/abi" - "github.com/ava-labs/libevm/accounts/abi/bind" - "github.com/ava-labs/libevm/common" - "github.com/ava-labs/libevm/core/types" - "github.com/ava-labs/libevm/event" -) - -// Reference imports to suppress errors if they are not otherwise used. -var ( - _ = errors.New - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription - _ = abi.ConvertType -) - -// INativeMinterMetaData contains all meta data concerning the INativeMinter contract. -var INativeMinterMetaData = &bind.MetaData{ - ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"NativeCoinMinted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"role\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldRole\",\"type\":\"uint256\"}],\"name\":\"RoleSet\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mintNativeCoin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"readAllowList\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"role\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setEnabled\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setNone\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", -} - -// INativeMinterABI is the input ABI used to generate the binding from. -// Deprecated: Use INativeMinterMetaData.ABI instead. -var INativeMinterABI = INativeMinterMetaData.ABI - -// INativeMinter is an auto generated Go binding around an Ethereum contract. -type INativeMinter struct { - INativeMinterCaller // Read-only binding to the contract - INativeMinterTransactor // Write-only binding to the contract - INativeMinterFilterer // Log filterer for contract events -} - -// INativeMinterCaller is an auto generated read-only Go binding around an Ethereum contract. -type INativeMinterCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// INativeMinterTransactor is an auto generated write-only Go binding around an Ethereum contract. -type INativeMinterTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// INativeMinterFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type INativeMinterFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// INativeMinterSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type INativeMinterSession struct { - Contract *INativeMinter // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// INativeMinterCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type INativeMinterCallerSession struct { - Contract *INativeMinterCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// INativeMinterTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type INativeMinterTransactorSession struct { - Contract *INativeMinterTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// INativeMinterRaw is an auto generated low-level Go binding around an Ethereum contract. -type INativeMinterRaw struct { - Contract *INativeMinter // Generic contract binding to access the raw methods on -} - -// INativeMinterCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type INativeMinterCallerRaw struct { - Contract *INativeMinterCaller // Generic read-only contract binding to access the raw methods on -} - -// INativeMinterTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type INativeMinterTransactorRaw struct { - Contract *INativeMinterTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewINativeMinter creates a new instance of INativeMinter, bound to a specific deployed contract. -func NewINativeMinter(address common.Address, backend bind.ContractBackend) (*INativeMinter, error) { - contract, err := bindINativeMinter(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &INativeMinter{INativeMinterCaller: INativeMinterCaller{contract: contract}, INativeMinterTransactor: INativeMinterTransactor{contract: contract}, INativeMinterFilterer: INativeMinterFilterer{contract: contract}}, nil -} - -// NewINativeMinterCaller creates a new read-only instance of INativeMinter, bound to a specific deployed contract. -func NewINativeMinterCaller(address common.Address, caller bind.ContractCaller) (*INativeMinterCaller, error) { - contract, err := bindINativeMinter(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &INativeMinterCaller{contract: contract}, nil -} - -// NewINativeMinterTransactor creates a new write-only instance of INativeMinter, bound to a specific deployed contract. -func NewINativeMinterTransactor(address common.Address, transactor bind.ContractTransactor) (*INativeMinterTransactor, error) { - contract, err := bindINativeMinter(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &INativeMinterTransactor{contract: contract}, nil -} - -// NewINativeMinterFilterer creates a new log filterer instance of INativeMinter, bound to a specific deployed contract. -func NewINativeMinterFilterer(address common.Address, filterer bind.ContractFilterer) (*INativeMinterFilterer, error) { - contract, err := bindINativeMinter(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &INativeMinterFilterer{contract: contract}, nil -} - -// bindINativeMinter binds a generic wrapper to an already deployed contract. -func bindINativeMinter(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := INativeMinterMetaData.GetAbi() - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_INativeMinter *INativeMinterRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _INativeMinter.Contract.INativeMinterCaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_INativeMinter *INativeMinterRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _INativeMinter.Contract.INativeMinterTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_INativeMinter *INativeMinterRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _INativeMinter.Contract.INativeMinterTransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_INativeMinter *INativeMinterCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _INativeMinter.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_INativeMinter *INativeMinterTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _INativeMinter.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_INativeMinter *INativeMinterTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _INativeMinter.Contract.contract.Transact(opts, method, params...) -} - -// ReadAllowList is a free data retrieval call binding the contract method 0xeb54dae1. -// -// Solidity: function readAllowList(address addr) view returns(uint256 role) -func (_INativeMinter *INativeMinterCaller) ReadAllowList(opts *bind.CallOpts, addr common.Address) (*big.Int, error) { - var out []interface{} - err := _INativeMinter.contract.Call(opts, &out, "readAllowList", addr) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// ReadAllowList is a free data retrieval call binding the contract method 0xeb54dae1. -// -// Solidity: function readAllowList(address addr) view returns(uint256 role) -func (_INativeMinter *INativeMinterSession) ReadAllowList(addr common.Address) (*big.Int, error) { - return _INativeMinter.Contract.ReadAllowList(&_INativeMinter.CallOpts, addr) -} - -// ReadAllowList is a free data retrieval call binding the contract method 0xeb54dae1. -// -// Solidity: function readAllowList(address addr) view returns(uint256 role) -func (_INativeMinter *INativeMinterCallerSession) ReadAllowList(addr common.Address) (*big.Int, error) { - return _INativeMinter.Contract.ReadAllowList(&_INativeMinter.CallOpts, addr) -} - -// MintNativeCoin is a paid mutator transaction binding the contract method 0x4f5aaaba. -// -// Solidity: function mintNativeCoin(address addr, uint256 amount) returns() -func (_INativeMinter *INativeMinterTransactor) MintNativeCoin(opts *bind.TransactOpts, addr common.Address, amount *big.Int) (*types.Transaction, error) { - return _INativeMinter.contract.Transact(opts, "mintNativeCoin", addr, amount) -} - -// MintNativeCoin is a paid mutator transaction binding the contract method 0x4f5aaaba. -// -// Solidity: function mintNativeCoin(address addr, uint256 amount) returns() -func (_INativeMinter *INativeMinterSession) MintNativeCoin(addr common.Address, amount *big.Int) (*types.Transaction, error) { - return _INativeMinter.Contract.MintNativeCoin(&_INativeMinter.TransactOpts, addr, amount) -} - -// MintNativeCoin is a paid mutator transaction binding the contract method 0x4f5aaaba. -// -// Solidity: function mintNativeCoin(address addr, uint256 amount) returns() -func (_INativeMinter *INativeMinterTransactorSession) MintNativeCoin(addr common.Address, amount *big.Int) (*types.Transaction, error) { - return _INativeMinter.Contract.MintNativeCoin(&_INativeMinter.TransactOpts, addr, amount) -} - -// SetAdmin is a paid mutator transaction binding the contract method 0x704b6c02. -// -// Solidity: function setAdmin(address addr) returns() -func (_INativeMinter *INativeMinterTransactor) SetAdmin(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { - return _INativeMinter.contract.Transact(opts, "setAdmin", addr) -} - -// SetAdmin is a paid mutator transaction binding the contract method 0x704b6c02. -// -// Solidity: function setAdmin(address addr) returns() -func (_INativeMinter *INativeMinterSession) SetAdmin(addr common.Address) (*types.Transaction, error) { - return _INativeMinter.Contract.SetAdmin(&_INativeMinter.TransactOpts, addr) -} - -// SetAdmin is a paid mutator transaction binding the contract method 0x704b6c02. -// -// Solidity: function setAdmin(address addr) returns() -func (_INativeMinter *INativeMinterTransactorSession) SetAdmin(addr common.Address) (*types.Transaction, error) { - return _INativeMinter.Contract.SetAdmin(&_INativeMinter.TransactOpts, addr) -} - -// SetEnabled is a paid mutator transaction binding the contract method 0x0aaf7043. -// -// Solidity: function setEnabled(address addr) returns() -func (_INativeMinter *INativeMinterTransactor) SetEnabled(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { - return _INativeMinter.contract.Transact(opts, "setEnabled", addr) -} - -// SetEnabled is a paid mutator transaction binding the contract method 0x0aaf7043. -// -// Solidity: function setEnabled(address addr) returns() -func (_INativeMinter *INativeMinterSession) SetEnabled(addr common.Address) (*types.Transaction, error) { - return _INativeMinter.Contract.SetEnabled(&_INativeMinter.TransactOpts, addr) -} - -// SetEnabled is a paid mutator transaction binding the contract method 0x0aaf7043. -// -// Solidity: function setEnabled(address addr) returns() -func (_INativeMinter *INativeMinterTransactorSession) SetEnabled(addr common.Address) (*types.Transaction, error) { - return _INativeMinter.Contract.SetEnabled(&_INativeMinter.TransactOpts, addr) -} - -// SetManager is a paid mutator transaction binding the contract method 0xd0ebdbe7. -// -// Solidity: function setManager(address addr) returns() -func (_INativeMinter *INativeMinterTransactor) SetManager(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { - return _INativeMinter.contract.Transact(opts, "setManager", addr) -} - -// SetManager is a paid mutator transaction binding the contract method 0xd0ebdbe7. -// -// Solidity: function setManager(address addr) returns() -func (_INativeMinter *INativeMinterSession) SetManager(addr common.Address) (*types.Transaction, error) { - return _INativeMinter.Contract.SetManager(&_INativeMinter.TransactOpts, addr) -} - -// SetManager is a paid mutator transaction binding the contract method 0xd0ebdbe7. -// -// Solidity: function setManager(address addr) returns() -func (_INativeMinter *INativeMinterTransactorSession) SetManager(addr common.Address) (*types.Transaction, error) { - return _INativeMinter.Contract.SetManager(&_INativeMinter.TransactOpts, addr) -} - -// SetNone is a paid mutator transaction binding the contract method 0x8c6bfb3b. -// -// Solidity: function setNone(address addr) returns() -func (_INativeMinter *INativeMinterTransactor) SetNone(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { - return _INativeMinter.contract.Transact(opts, "setNone", addr) -} - -// SetNone is a paid mutator transaction binding the contract method 0x8c6bfb3b. -// -// Solidity: function setNone(address addr) returns() -func (_INativeMinter *INativeMinterSession) SetNone(addr common.Address) (*types.Transaction, error) { - return _INativeMinter.Contract.SetNone(&_INativeMinter.TransactOpts, addr) -} - -// SetNone is a paid mutator transaction binding the contract method 0x8c6bfb3b. -// -// Solidity: function setNone(address addr) returns() -func (_INativeMinter *INativeMinterTransactorSession) SetNone(addr common.Address) (*types.Transaction, error) { - return _INativeMinter.Contract.SetNone(&_INativeMinter.TransactOpts, addr) -} - -// INativeMinterNativeCoinMintedIterator is returned from FilterNativeCoinMinted and is used to iterate over the raw logs and unpacked data for NativeCoinMinted events raised by the INativeMinter contract. -type INativeMinterNativeCoinMintedIterator struct { - Event *INativeMinterNativeCoinMinted // 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 *INativeMinterNativeCoinMintedIterator) 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(INativeMinterNativeCoinMinted) - 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(INativeMinterNativeCoinMinted) - 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 *INativeMinterNativeCoinMintedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *INativeMinterNativeCoinMintedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// INativeMinterNativeCoinMinted represents a NativeCoinMinted event raised by the INativeMinter contract. -type INativeMinterNativeCoinMinted struct { - Sender common.Address - Recipient common.Address - Amount *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterNativeCoinMinted is a free log retrieval operation binding the contract event 0x400cd392f3d56fd10bb1dbd5839fdda8298208ddaa97b368faa053e1850930ee. -// -// Solidity: event NativeCoinMinted(address indexed sender, address indexed recipient, uint256 amount) -func (_INativeMinter *INativeMinterFilterer) FilterNativeCoinMinted(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*INativeMinterNativeCoinMintedIterator, error) { - - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - var recipientRule []interface{} - for _, recipientItem := range recipient { - recipientRule = append(recipientRule, recipientItem) - } - - logs, sub, err := _INativeMinter.contract.FilterLogs(opts, "NativeCoinMinted", senderRule, recipientRule) - if err != nil { - return nil, err - } - return &INativeMinterNativeCoinMintedIterator{contract: _INativeMinter.contract, event: "NativeCoinMinted", logs: logs, sub: sub}, nil -} - -// WatchNativeCoinMinted is a free log subscription operation binding the contract event 0x400cd392f3d56fd10bb1dbd5839fdda8298208ddaa97b368faa053e1850930ee. -// -// Solidity: event NativeCoinMinted(address indexed sender, address indexed recipient, uint256 amount) -func (_INativeMinter *INativeMinterFilterer) WatchNativeCoinMinted(opts *bind.WatchOpts, sink chan<- *INativeMinterNativeCoinMinted, sender []common.Address, recipient []common.Address) (event.Subscription, error) { - - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - var recipientRule []interface{} - for _, recipientItem := range recipient { - recipientRule = append(recipientRule, recipientItem) - } - - logs, sub, err := _INativeMinter.contract.WatchLogs(opts, "NativeCoinMinted", senderRule, recipientRule) - 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(INativeMinterNativeCoinMinted) - if err := _INativeMinter.contract.UnpackLog(event, "NativeCoinMinted", 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 -} - -// ParseNativeCoinMinted is a log parse operation binding the contract event 0x400cd392f3d56fd10bb1dbd5839fdda8298208ddaa97b368faa053e1850930ee. -// -// Solidity: event NativeCoinMinted(address indexed sender, address indexed recipient, uint256 amount) -func (_INativeMinter *INativeMinterFilterer) ParseNativeCoinMinted(log types.Log) (*INativeMinterNativeCoinMinted, error) { - event := new(INativeMinterNativeCoinMinted) - if err := _INativeMinter.contract.UnpackLog(event, "NativeCoinMinted", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// INativeMinterRoleSetIterator is returned from FilterRoleSet and is used to iterate over the raw logs and unpacked data for RoleSet events raised by the INativeMinter contract. -type INativeMinterRoleSetIterator struct { - Event *INativeMinterRoleSet // 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 *INativeMinterRoleSetIterator) 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(INativeMinterRoleSet) - 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(INativeMinterRoleSet) - 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 *INativeMinterRoleSetIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *INativeMinterRoleSetIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// INativeMinterRoleSet represents a RoleSet event raised by the INativeMinter contract. -type INativeMinterRoleSet struct { - Role *big.Int - Account common.Address - Sender common.Address - OldRole *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterRoleSet is a free log retrieval operation binding the contract event 0xcdb7ea01f00a414d78757bdb0f6391664ba3fedf987eed280927c1e7d695be3e. -// -// Solidity: event RoleSet(uint256 indexed role, address indexed account, address indexed sender, uint256 oldRole) -func (_INativeMinter *INativeMinterFilterer) FilterRoleSet(opts *bind.FilterOpts, role []*big.Int, account []common.Address, sender []common.Address) (*INativeMinterRoleSetIterator, error) { - - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) - } - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _INativeMinter.contract.FilterLogs(opts, "RoleSet", roleRule, accountRule, senderRule) - if err != nil { - return nil, err - } - return &INativeMinterRoleSetIterator{contract: _INativeMinter.contract, event: "RoleSet", logs: logs, sub: sub}, nil -} - -// WatchRoleSet is a free log subscription operation binding the contract event 0xcdb7ea01f00a414d78757bdb0f6391664ba3fedf987eed280927c1e7d695be3e. -// -// Solidity: event RoleSet(uint256 indexed role, address indexed account, address indexed sender, uint256 oldRole) -func (_INativeMinter *INativeMinterFilterer) WatchRoleSet(opts *bind.WatchOpts, sink chan<- *INativeMinterRoleSet, role []*big.Int, account []common.Address, sender []common.Address) (event.Subscription, error) { - - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) - } - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _INativeMinter.contract.WatchLogs(opts, "RoleSet", roleRule, accountRule, senderRule) - 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(INativeMinterRoleSet) - if err := _INativeMinter.contract.UnpackLog(event, "RoleSet", 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 -} - -// ParseRoleSet is a log parse operation binding the contract event 0xcdb7ea01f00a414d78757bdb0f6391664ba3fedf987eed280927c1e7d695be3e. -// -// Solidity: event RoleSet(uint256 indexed role, address indexed account, address indexed sender, uint256 oldRole) -func (_INativeMinter *INativeMinterFilterer) ParseRoleSet(log types.Log) (*INativeMinterRoleSet, error) { - event := new(INativeMinterRoleSet) - if err := _INativeMinter.contract.UnpackLog(event, "RoleSet", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} diff --git a/contracts/bindings/irewardmanager.go b/contracts/bindings/irewardmanager.go deleted file mode 100644 index cc37a8636c..0000000000 --- a/contracts/bindings/irewardmanager.go +++ /dev/null @@ -1,1034 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package bindings - -import ( - "errors" - "math/big" - "strings" - - ethereum "github.com/ava-labs/libevm" - "github.com/ava-labs/libevm/accounts/abi" - "github.com/ava-labs/libevm/accounts/abi/bind" - "github.com/ava-labs/libevm/common" - "github.com/ava-labs/libevm/core/types" - "github.com/ava-labs/libevm/event" -) - -// Reference imports to suppress errors if they are not otherwise used. -var ( - _ = errors.New - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription - _ = abi.ConvertType -) - -// IRewardManagerMetaData contains all meta data concerning the IRewardManager contract. -var IRewardManagerMetaData = &bind.MetaData{ - ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"FeeRecipientsAllowed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldRewardAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newRewardAddress\",\"type\":\"address\"}],\"name\":\"RewardAddressChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RewardsDisabled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"role\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldRole\",\"type\":\"uint256\"}],\"name\":\"RoleSet\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"allowFeeRecipients\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"areFeeRecipientsAllowed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"isAllowed\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentRewardAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"rewardAddress\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"disableRewards\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"readAllowList\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"role\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setEnabled\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setNone\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setRewardAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", -} - -// IRewardManagerABI is the input ABI used to generate the binding from. -// Deprecated: Use IRewardManagerMetaData.ABI instead. -var IRewardManagerABI = IRewardManagerMetaData.ABI - -// IRewardManager is an auto generated Go binding around an Ethereum contract. -type IRewardManager struct { - IRewardManagerCaller // Read-only binding to the contract - IRewardManagerTransactor // Write-only binding to the contract - IRewardManagerFilterer // Log filterer for contract events -} - -// IRewardManagerCaller is an auto generated read-only Go binding around an Ethereum contract. -type IRewardManagerCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// IRewardManagerTransactor is an auto generated write-only Go binding around an Ethereum contract. -type IRewardManagerTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// IRewardManagerFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type IRewardManagerFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// IRewardManagerSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type IRewardManagerSession struct { - Contract *IRewardManager // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// IRewardManagerCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type IRewardManagerCallerSession struct { - Contract *IRewardManagerCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// IRewardManagerTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type IRewardManagerTransactorSession struct { - Contract *IRewardManagerTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// IRewardManagerRaw is an auto generated low-level Go binding around an Ethereum contract. -type IRewardManagerRaw struct { - Contract *IRewardManager // Generic contract binding to access the raw methods on -} - -// IRewardManagerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type IRewardManagerCallerRaw struct { - Contract *IRewardManagerCaller // Generic read-only contract binding to access the raw methods on -} - -// IRewardManagerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type IRewardManagerTransactorRaw struct { - Contract *IRewardManagerTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewIRewardManager creates a new instance of IRewardManager, bound to a specific deployed contract. -func NewIRewardManager(address common.Address, backend bind.ContractBackend) (*IRewardManager, error) { - contract, err := bindIRewardManager(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &IRewardManager{IRewardManagerCaller: IRewardManagerCaller{contract: contract}, IRewardManagerTransactor: IRewardManagerTransactor{contract: contract}, IRewardManagerFilterer: IRewardManagerFilterer{contract: contract}}, nil -} - -// NewIRewardManagerCaller creates a new read-only instance of IRewardManager, bound to a specific deployed contract. -func NewIRewardManagerCaller(address common.Address, caller bind.ContractCaller) (*IRewardManagerCaller, error) { - contract, err := bindIRewardManager(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &IRewardManagerCaller{contract: contract}, nil -} - -// NewIRewardManagerTransactor creates a new write-only instance of IRewardManager, bound to a specific deployed contract. -func NewIRewardManagerTransactor(address common.Address, transactor bind.ContractTransactor) (*IRewardManagerTransactor, error) { - contract, err := bindIRewardManager(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &IRewardManagerTransactor{contract: contract}, nil -} - -// NewIRewardManagerFilterer creates a new log filterer instance of IRewardManager, bound to a specific deployed contract. -func NewIRewardManagerFilterer(address common.Address, filterer bind.ContractFilterer) (*IRewardManagerFilterer, error) { - contract, err := bindIRewardManager(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &IRewardManagerFilterer{contract: contract}, nil -} - -// bindIRewardManager binds a generic wrapper to an already deployed contract. -func bindIRewardManager(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := IRewardManagerMetaData.GetAbi() - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_IRewardManager *IRewardManagerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _IRewardManager.Contract.IRewardManagerCaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_IRewardManager *IRewardManagerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _IRewardManager.Contract.IRewardManagerTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_IRewardManager *IRewardManagerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _IRewardManager.Contract.IRewardManagerTransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_IRewardManager *IRewardManagerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _IRewardManager.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_IRewardManager *IRewardManagerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _IRewardManager.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_IRewardManager *IRewardManagerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _IRewardManager.Contract.contract.Transact(opts, method, params...) -} - -// AreFeeRecipientsAllowed is a free data retrieval call binding the contract method 0xf6542b2e. -// -// Solidity: function areFeeRecipientsAllowed() view returns(bool isAllowed) -func (_IRewardManager *IRewardManagerCaller) AreFeeRecipientsAllowed(opts *bind.CallOpts) (bool, error) { - var out []interface{} - err := _IRewardManager.contract.Call(opts, &out, "areFeeRecipientsAllowed") - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// AreFeeRecipientsAllowed is a free data retrieval call binding the contract method 0xf6542b2e. -// -// Solidity: function areFeeRecipientsAllowed() view returns(bool isAllowed) -func (_IRewardManager *IRewardManagerSession) AreFeeRecipientsAllowed() (bool, error) { - return _IRewardManager.Contract.AreFeeRecipientsAllowed(&_IRewardManager.CallOpts) -} - -// AreFeeRecipientsAllowed is a free data retrieval call binding the contract method 0xf6542b2e. -// -// Solidity: function areFeeRecipientsAllowed() view returns(bool isAllowed) -func (_IRewardManager *IRewardManagerCallerSession) AreFeeRecipientsAllowed() (bool, error) { - return _IRewardManager.Contract.AreFeeRecipientsAllowed(&_IRewardManager.CallOpts) -} - -// CurrentRewardAddress is a free data retrieval call binding the contract method 0xe915608b. -// -// Solidity: function currentRewardAddress() view returns(address rewardAddress) -func (_IRewardManager *IRewardManagerCaller) CurrentRewardAddress(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _IRewardManager.contract.Call(opts, &out, "currentRewardAddress") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// CurrentRewardAddress is a free data retrieval call binding the contract method 0xe915608b. -// -// Solidity: function currentRewardAddress() view returns(address rewardAddress) -func (_IRewardManager *IRewardManagerSession) CurrentRewardAddress() (common.Address, error) { - return _IRewardManager.Contract.CurrentRewardAddress(&_IRewardManager.CallOpts) -} - -// CurrentRewardAddress is a free data retrieval call binding the contract method 0xe915608b. -// -// Solidity: function currentRewardAddress() view returns(address rewardAddress) -func (_IRewardManager *IRewardManagerCallerSession) CurrentRewardAddress() (common.Address, error) { - return _IRewardManager.Contract.CurrentRewardAddress(&_IRewardManager.CallOpts) -} - -// ReadAllowList is a free data retrieval call binding the contract method 0xeb54dae1. -// -// Solidity: function readAllowList(address addr) view returns(uint256 role) -func (_IRewardManager *IRewardManagerCaller) ReadAllowList(opts *bind.CallOpts, addr common.Address) (*big.Int, error) { - var out []interface{} - err := _IRewardManager.contract.Call(opts, &out, "readAllowList", addr) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// ReadAllowList is a free data retrieval call binding the contract method 0xeb54dae1. -// -// Solidity: function readAllowList(address addr) view returns(uint256 role) -func (_IRewardManager *IRewardManagerSession) ReadAllowList(addr common.Address) (*big.Int, error) { - return _IRewardManager.Contract.ReadAllowList(&_IRewardManager.CallOpts, addr) -} - -// ReadAllowList is a free data retrieval call binding the contract method 0xeb54dae1. -// -// Solidity: function readAllowList(address addr) view returns(uint256 role) -func (_IRewardManager *IRewardManagerCallerSession) ReadAllowList(addr common.Address) (*big.Int, error) { - return _IRewardManager.Contract.ReadAllowList(&_IRewardManager.CallOpts, addr) -} - -// AllowFeeRecipients is a paid mutator transaction binding the contract method 0x0329099f. -// -// Solidity: function allowFeeRecipients() returns() -func (_IRewardManager *IRewardManagerTransactor) AllowFeeRecipients(opts *bind.TransactOpts) (*types.Transaction, error) { - return _IRewardManager.contract.Transact(opts, "allowFeeRecipients") -} - -// AllowFeeRecipients is a paid mutator transaction binding the contract method 0x0329099f. -// -// Solidity: function allowFeeRecipients() returns() -func (_IRewardManager *IRewardManagerSession) AllowFeeRecipients() (*types.Transaction, error) { - return _IRewardManager.Contract.AllowFeeRecipients(&_IRewardManager.TransactOpts) -} - -// AllowFeeRecipients is a paid mutator transaction binding the contract method 0x0329099f. -// -// Solidity: function allowFeeRecipients() returns() -func (_IRewardManager *IRewardManagerTransactorSession) AllowFeeRecipients() (*types.Transaction, error) { - return _IRewardManager.Contract.AllowFeeRecipients(&_IRewardManager.TransactOpts) -} - -// DisableRewards is a paid mutator transaction binding the contract method 0xbc178628. -// -// Solidity: function disableRewards() returns() -func (_IRewardManager *IRewardManagerTransactor) DisableRewards(opts *bind.TransactOpts) (*types.Transaction, error) { - return _IRewardManager.contract.Transact(opts, "disableRewards") -} - -// DisableRewards is a paid mutator transaction binding the contract method 0xbc178628. -// -// Solidity: function disableRewards() returns() -func (_IRewardManager *IRewardManagerSession) DisableRewards() (*types.Transaction, error) { - return _IRewardManager.Contract.DisableRewards(&_IRewardManager.TransactOpts) -} - -// DisableRewards is a paid mutator transaction binding the contract method 0xbc178628. -// -// Solidity: function disableRewards() returns() -func (_IRewardManager *IRewardManagerTransactorSession) DisableRewards() (*types.Transaction, error) { - return _IRewardManager.Contract.DisableRewards(&_IRewardManager.TransactOpts) -} - -// SetAdmin is a paid mutator transaction binding the contract method 0x704b6c02. -// -// Solidity: function setAdmin(address addr) returns() -func (_IRewardManager *IRewardManagerTransactor) SetAdmin(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { - return _IRewardManager.contract.Transact(opts, "setAdmin", addr) -} - -// SetAdmin is a paid mutator transaction binding the contract method 0x704b6c02. -// -// Solidity: function setAdmin(address addr) returns() -func (_IRewardManager *IRewardManagerSession) SetAdmin(addr common.Address) (*types.Transaction, error) { - return _IRewardManager.Contract.SetAdmin(&_IRewardManager.TransactOpts, addr) -} - -// SetAdmin is a paid mutator transaction binding the contract method 0x704b6c02. -// -// Solidity: function setAdmin(address addr) returns() -func (_IRewardManager *IRewardManagerTransactorSession) SetAdmin(addr common.Address) (*types.Transaction, error) { - return _IRewardManager.Contract.SetAdmin(&_IRewardManager.TransactOpts, addr) -} - -// SetEnabled is a paid mutator transaction binding the contract method 0x0aaf7043. -// -// Solidity: function setEnabled(address addr) returns() -func (_IRewardManager *IRewardManagerTransactor) SetEnabled(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { - return _IRewardManager.contract.Transact(opts, "setEnabled", addr) -} - -// SetEnabled is a paid mutator transaction binding the contract method 0x0aaf7043. -// -// Solidity: function setEnabled(address addr) returns() -func (_IRewardManager *IRewardManagerSession) SetEnabled(addr common.Address) (*types.Transaction, error) { - return _IRewardManager.Contract.SetEnabled(&_IRewardManager.TransactOpts, addr) -} - -// SetEnabled is a paid mutator transaction binding the contract method 0x0aaf7043. -// -// Solidity: function setEnabled(address addr) returns() -func (_IRewardManager *IRewardManagerTransactorSession) SetEnabled(addr common.Address) (*types.Transaction, error) { - return _IRewardManager.Contract.SetEnabled(&_IRewardManager.TransactOpts, addr) -} - -// SetManager is a paid mutator transaction binding the contract method 0xd0ebdbe7. -// -// Solidity: function setManager(address addr) returns() -func (_IRewardManager *IRewardManagerTransactor) SetManager(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { - return _IRewardManager.contract.Transact(opts, "setManager", addr) -} - -// SetManager is a paid mutator transaction binding the contract method 0xd0ebdbe7. -// -// Solidity: function setManager(address addr) returns() -func (_IRewardManager *IRewardManagerSession) SetManager(addr common.Address) (*types.Transaction, error) { - return _IRewardManager.Contract.SetManager(&_IRewardManager.TransactOpts, addr) -} - -// SetManager is a paid mutator transaction binding the contract method 0xd0ebdbe7. -// -// Solidity: function setManager(address addr) returns() -func (_IRewardManager *IRewardManagerTransactorSession) SetManager(addr common.Address) (*types.Transaction, error) { - return _IRewardManager.Contract.SetManager(&_IRewardManager.TransactOpts, addr) -} - -// SetNone is a paid mutator transaction binding the contract method 0x8c6bfb3b. -// -// Solidity: function setNone(address addr) returns() -func (_IRewardManager *IRewardManagerTransactor) SetNone(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { - return _IRewardManager.contract.Transact(opts, "setNone", addr) -} - -// SetNone is a paid mutator transaction binding the contract method 0x8c6bfb3b. -// -// Solidity: function setNone(address addr) returns() -func (_IRewardManager *IRewardManagerSession) SetNone(addr common.Address) (*types.Transaction, error) { - return _IRewardManager.Contract.SetNone(&_IRewardManager.TransactOpts, addr) -} - -// SetNone is a paid mutator transaction binding the contract method 0x8c6bfb3b. -// -// Solidity: function setNone(address addr) returns() -func (_IRewardManager *IRewardManagerTransactorSession) SetNone(addr common.Address) (*types.Transaction, error) { - return _IRewardManager.Contract.SetNone(&_IRewardManager.TransactOpts, addr) -} - -// SetRewardAddress is a paid mutator transaction binding the contract method 0x5e00e679. -// -// Solidity: function setRewardAddress(address addr) returns() -func (_IRewardManager *IRewardManagerTransactor) SetRewardAddress(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { - return _IRewardManager.contract.Transact(opts, "setRewardAddress", addr) -} - -// SetRewardAddress is a paid mutator transaction binding the contract method 0x5e00e679. -// -// Solidity: function setRewardAddress(address addr) returns() -func (_IRewardManager *IRewardManagerSession) SetRewardAddress(addr common.Address) (*types.Transaction, error) { - return _IRewardManager.Contract.SetRewardAddress(&_IRewardManager.TransactOpts, addr) -} - -// SetRewardAddress is a paid mutator transaction binding the contract method 0x5e00e679. -// -// Solidity: function setRewardAddress(address addr) returns() -func (_IRewardManager *IRewardManagerTransactorSession) SetRewardAddress(addr common.Address) (*types.Transaction, error) { - return _IRewardManager.Contract.SetRewardAddress(&_IRewardManager.TransactOpts, addr) -} - -// IRewardManagerFeeRecipientsAllowedIterator is returned from FilterFeeRecipientsAllowed and is used to iterate over the raw logs and unpacked data for FeeRecipientsAllowed events raised by the IRewardManager contract. -type IRewardManagerFeeRecipientsAllowedIterator struct { - Event *IRewardManagerFeeRecipientsAllowed // 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 *IRewardManagerFeeRecipientsAllowedIterator) 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(IRewardManagerFeeRecipientsAllowed) - 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(IRewardManagerFeeRecipientsAllowed) - 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 *IRewardManagerFeeRecipientsAllowedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *IRewardManagerFeeRecipientsAllowedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// IRewardManagerFeeRecipientsAllowed represents a FeeRecipientsAllowed event raised by the IRewardManager contract. -type IRewardManagerFeeRecipientsAllowed struct { - Sender common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterFeeRecipientsAllowed is a free log retrieval operation binding the contract event 0xabb1949bd129fef9b84601a48aee89d600d90074ca10216a02ce43996be55991. -// -// Solidity: event FeeRecipientsAllowed(address indexed sender) -func (_IRewardManager *IRewardManagerFilterer) FilterFeeRecipientsAllowed(opts *bind.FilterOpts, sender []common.Address) (*IRewardManagerFeeRecipientsAllowedIterator, error) { - - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _IRewardManager.contract.FilterLogs(opts, "FeeRecipientsAllowed", senderRule) - if err != nil { - return nil, err - } - return &IRewardManagerFeeRecipientsAllowedIterator{contract: _IRewardManager.contract, event: "FeeRecipientsAllowed", logs: logs, sub: sub}, nil -} - -// WatchFeeRecipientsAllowed is a free log subscription operation binding the contract event 0xabb1949bd129fef9b84601a48aee89d600d90074ca10216a02ce43996be55991. -// -// Solidity: event FeeRecipientsAllowed(address indexed sender) -func (_IRewardManager *IRewardManagerFilterer) WatchFeeRecipientsAllowed(opts *bind.WatchOpts, sink chan<- *IRewardManagerFeeRecipientsAllowed, sender []common.Address) (event.Subscription, error) { - - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _IRewardManager.contract.WatchLogs(opts, "FeeRecipientsAllowed", senderRule) - 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(IRewardManagerFeeRecipientsAllowed) - if err := _IRewardManager.contract.UnpackLog(event, "FeeRecipientsAllowed", 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 -} - -// ParseFeeRecipientsAllowed is a log parse operation binding the contract event 0xabb1949bd129fef9b84601a48aee89d600d90074ca10216a02ce43996be55991. -// -// Solidity: event FeeRecipientsAllowed(address indexed sender) -func (_IRewardManager *IRewardManagerFilterer) ParseFeeRecipientsAllowed(log types.Log) (*IRewardManagerFeeRecipientsAllowed, error) { - event := new(IRewardManagerFeeRecipientsAllowed) - if err := _IRewardManager.contract.UnpackLog(event, "FeeRecipientsAllowed", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// IRewardManagerRewardAddressChangedIterator is returned from FilterRewardAddressChanged and is used to iterate over the raw logs and unpacked data for RewardAddressChanged events raised by the IRewardManager contract. -type IRewardManagerRewardAddressChangedIterator struct { - Event *IRewardManagerRewardAddressChanged // 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 *IRewardManagerRewardAddressChangedIterator) 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(IRewardManagerRewardAddressChanged) - 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(IRewardManagerRewardAddressChanged) - 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 *IRewardManagerRewardAddressChangedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *IRewardManagerRewardAddressChangedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// IRewardManagerRewardAddressChanged represents a RewardAddressChanged event raised by the IRewardManager contract. -type IRewardManagerRewardAddressChanged struct { - Sender common.Address - OldRewardAddress common.Address - NewRewardAddress common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterRewardAddressChanged is a free log retrieval operation binding the contract event 0xc2a9e07cba6f4920acaa5933bd0406949d5dbef7ee698e786ea23e8708f32a6c. -// -// Solidity: event RewardAddressChanged(address indexed sender, address indexed oldRewardAddress, address indexed newRewardAddress) -func (_IRewardManager *IRewardManagerFilterer) FilterRewardAddressChanged(opts *bind.FilterOpts, sender []common.Address, oldRewardAddress []common.Address, newRewardAddress []common.Address) (*IRewardManagerRewardAddressChangedIterator, error) { - - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - var oldRewardAddressRule []interface{} - for _, oldRewardAddressItem := range oldRewardAddress { - oldRewardAddressRule = append(oldRewardAddressRule, oldRewardAddressItem) - } - var newRewardAddressRule []interface{} - for _, newRewardAddressItem := range newRewardAddress { - newRewardAddressRule = append(newRewardAddressRule, newRewardAddressItem) - } - - logs, sub, err := _IRewardManager.contract.FilterLogs(opts, "RewardAddressChanged", senderRule, oldRewardAddressRule, newRewardAddressRule) - if err != nil { - return nil, err - } - return &IRewardManagerRewardAddressChangedIterator{contract: _IRewardManager.contract, event: "RewardAddressChanged", logs: logs, sub: sub}, nil -} - -// WatchRewardAddressChanged is a free log subscription operation binding the contract event 0xc2a9e07cba6f4920acaa5933bd0406949d5dbef7ee698e786ea23e8708f32a6c. -// -// Solidity: event RewardAddressChanged(address indexed sender, address indexed oldRewardAddress, address indexed newRewardAddress) -func (_IRewardManager *IRewardManagerFilterer) WatchRewardAddressChanged(opts *bind.WatchOpts, sink chan<- *IRewardManagerRewardAddressChanged, sender []common.Address, oldRewardAddress []common.Address, newRewardAddress []common.Address) (event.Subscription, error) { - - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - var oldRewardAddressRule []interface{} - for _, oldRewardAddressItem := range oldRewardAddress { - oldRewardAddressRule = append(oldRewardAddressRule, oldRewardAddressItem) - } - var newRewardAddressRule []interface{} - for _, newRewardAddressItem := range newRewardAddress { - newRewardAddressRule = append(newRewardAddressRule, newRewardAddressItem) - } - - logs, sub, err := _IRewardManager.contract.WatchLogs(opts, "RewardAddressChanged", senderRule, oldRewardAddressRule, newRewardAddressRule) - 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(IRewardManagerRewardAddressChanged) - if err := _IRewardManager.contract.UnpackLog(event, "RewardAddressChanged", 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 -} - -// ParseRewardAddressChanged is a log parse operation binding the contract event 0xc2a9e07cba6f4920acaa5933bd0406949d5dbef7ee698e786ea23e8708f32a6c. -// -// Solidity: event RewardAddressChanged(address indexed sender, address indexed oldRewardAddress, address indexed newRewardAddress) -func (_IRewardManager *IRewardManagerFilterer) ParseRewardAddressChanged(log types.Log) (*IRewardManagerRewardAddressChanged, error) { - event := new(IRewardManagerRewardAddressChanged) - if err := _IRewardManager.contract.UnpackLog(event, "RewardAddressChanged", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// IRewardManagerRewardsDisabledIterator is returned from FilterRewardsDisabled and is used to iterate over the raw logs and unpacked data for RewardsDisabled events raised by the IRewardManager contract. -type IRewardManagerRewardsDisabledIterator struct { - Event *IRewardManagerRewardsDisabled // 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 *IRewardManagerRewardsDisabledIterator) 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(IRewardManagerRewardsDisabled) - 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(IRewardManagerRewardsDisabled) - 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 *IRewardManagerRewardsDisabledIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *IRewardManagerRewardsDisabledIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// IRewardManagerRewardsDisabled represents a RewardsDisabled event raised by the IRewardManager contract. -type IRewardManagerRewardsDisabled struct { - Sender common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterRewardsDisabled is a free log retrieval operation binding the contract event 0xeb121f0335efe8f4b8ebef7793c18c171834696989656a8c345acc558359fabf. -// -// Solidity: event RewardsDisabled(address indexed sender) -func (_IRewardManager *IRewardManagerFilterer) FilterRewardsDisabled(opts *bind.FilterOpts, sender []common.Address) (*IRewardManagerRewardsDisabledIterator, error) { - - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _IRewardManager.contract.FilterLogs(opts, "RewardsDisabled", senderRule) - if err != nil { - return nil, err - } - return &IRewardManagerRewardsDisabledIterator{contract: _IRewardManager.contract, event: "RewardsDisabled", logs: logs, sub: sub}, nil -} - -// WatchRewardsDisabled is a free log subscription operation binding the contract event 0xeb121f0335efe8f4b8ebef7793c18c171834696989656a8c345acc558359fabf. -// -// Solidity: event RewardsDisabled(address indexed sender) -func (_IRewardManager *IRewardManagerFilterer) WatchRewardsDisabled(opts *bind.WatchOpts, sink chan<- *IRewardManagerRewardsDisabled, sender []common.Address) (event.Subscription, error) { - - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _IRewardManager.contract.WatchLogs(opts, "RewardsDisabled", senderRule) - 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(IRewardManagerRewardsDisabled) - if err := _IRewardManager.contract.UnpackLog(event, "RewardsDisabled", 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 -} - -// ParseRewardsDisabled is a log parse operation binding the contract event 0xeb121f0335efe8f4b8ebef7793c18c171834696989656a8c345acc558359fabf. -// -// Solidity: event RewardsDisabled(address indexed sender) -func (_IRewardManager *IRewardManagerFilterer) ParseRewardsDisabled(log types.Log) (*IRewardManagerRewardsDisabled, error) { - event := new(IRewardManagerRewardsDisabled) - if err := _IRewardManager.contract.UnpackLog(event, "RewardsDisabled", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// IRewardManagerRoleSetIterator is returned from FilterRoleSet and is used to iterate over the raw logs and unpacked data for RoleSet events raised by the IRewardManager contract. -type IRewardManagerRoleSetIterator struct { - Event *IRewardManagerRoleSet // 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 *IRewardManagerRoleSetIterator) 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(IRewardManagerRoleSet) - 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(IRewardManagerRoleSet) - 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 *IRewardManagerRoleSetIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *IRewardManagerRoleSetIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// IRewardManagerRoleSet represents a RoleSet event raised by the IRewardManager contract. -type IRewardManagerRoleSet struct { - Role *big.Int - Account common.Address - Sender common.Address - OldRole *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterRoleSet is a free log retrieval operation binding the contract event 0xcdb7ea01f00a414d78757bdb0f6391664ba3fedf987eed280927c1e7d695be3e. -// -// Solidity: event RoleSet(uint256 indexed role, address indexed account, address indexed sender, uint256 oldRole) -func (_IRewardManager *IRewardManagerFilterer) FilterRoleSet(opts *bind.FilterOpts, role []*big.Int, account []common.Address, sender []common.Address) (*IRewardManagerRoleSetIterator, error) { - - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) - } - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _IRewardManager.contract.FilterLogs(opts, "RoleSet", roleRule, accountRule, senderRule) - if err != nil { - return nil, err - } - return &IRewardManagerRoleSetIterator{contract: _IRewardManager.contract, event: "RoleSet", logs: logs, sub: sub}, nil -} - -// WatchRoleSet is a free log subscription operation binding the contract event 0xcdb7ea01f00a414d78757bdb0f6391664ba3fedf987eed280927c1e7d695be3e. -// -// Solidity: event RoleSet(uint256 indexed role, address indexed account, address indexed sender, uint256 oldRole) -func (_IRewardManager *IRewardManagerFilterer) WatchRoleSet(opts *bind.WatchOpts, sink chan<- *IRewardManagerRoleSet, role []*big.Int, account []common.Address, sender []common.Address) (event.Subscription, error) { - - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) - } - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _IRewardManager.contract.WatchLogs(opts, "RoleSet", roleRule, accountRule, senderRule) - 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(IRewardManagerRoleSet) - if err := _IRewardManager.contract.UnpackLog(event, "RoleSet", 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 -} - -// ParseRoleSet is a log parse operation binding the contract event 0xcdb7ea01f00a414d78757bdb0f6391664ba3fedf987eed280927c1e7d695be3e. -// -// Solidity: event RoleSet(uint256 indexed role, address indexed account, address indexed sender, uint256 oldRole) -func (_IRewardManager *IRewardManagerFilterer) ParseRoleSet(log types.Log) (*IRewardManagerRoleSet, error) { - event := new(IRewardManagerRoleSet) - if err := _IRewardManager.contract.UnpackLog(event, "RoleSet", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} diff --git a/contracts/bindings/iwarpmessenger.go b/contracts/bindings/iwarpmessenger.go deleted file mode 100644 index af284b3b16..0000000000 --- a/contracts/bindings/iwarpmessenger.go +++ /dev/null @@ -1,490 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package bindings - -import ( - "errors" - "math/big" - "strings" - - ethereum "github.com/ava-labs/libevm" - "github.com/ava-labs/libevm/accounts/abi" - "github.com/ava-labs/libevm/accounts/abi/bind" - "github.com/ava-labs/libevm/common" - "github.com/ava-labs/libevm/core/types" - "github.com/ava-labs/libevm/event" -) - -// Reference imports to suppress errors if they are not otherwise used. -var ( - _ = errors.New - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription - _ = abi.ConvertType -) - -// WarpBlockHash is an auto generated low-level Go binding around an user-defined struct. -type WarpBlockHash struct { - SourceChainID [32]byte - BlockHash [32]byte -} - -// WarpMessage is an auto generated low-level Go binding around an user-defined struct. -type WarpMessage struct { - SourceChainID [32]byte - OriginSenderAddress common.Address - Payload []byte -} - -// IWarpMessengerMetaData contains all meta data concerning the IWarpMessenger contract. -var IWarpMessengerMetaData = &bind.MetaData{ - ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"messageID\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"name\":\"SendWarpMessage\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"getBlockchainID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"blockchainID\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"index\",\"type\":\"uint32\"}],\"name\":\"getVerifiedWarpBlockHash\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"sourceChainID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"}],\"internalType\":\"structWarpBlockHash\",\"name\":\"warpBlockHash\",\"type\":\"tuple\"},{\"internalType\":\"bool\",\"name\":\"valid\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"index\",\"type\":\"uint32\"}],\"name\":\"getVerifiedWarpMessage\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"sourceChainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"originSenderAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"payload\",\"type\":\"bytes\"}],\"internalType\":\"structWarpMessage\",\"name\":\"message\",\"type\":\"tuple\"},{\"internalType\":\"bool\",\"name\":\"valid\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"payload\",\"type\":\"bytes\"}],\"name\":\"sendWarpMessage\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"messageID\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", -} - -// IWarpMessengerABI is the input ABI used to generate the binding from. -// Deprecated: Use IWarpMessengerMetaData.ABI instead. -var IWarpMessengerABI = IWarpMessengerMetaData.ABI - -// IWarpMessenger is an auto generated Go binding around an Ethereum contract. -type IWarpMessenger struct { - IWarpMessengerCaller // Read-only binding to the contract - IWarpMessengerTransactor // Write-only binding to the contract - IWarpMessengerFilterer // Log filterer for contract events -} - -// IWarpMessengerCaller is an auto generated read-only Go binding around an Ethereum contract. -type IWarpMessengerCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// IWarpMessengerTransactor is an auto generated write-only Go binding around an Ethereum contract. -type IWarpMessengerTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// IWarpMessengerFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type IWarpMessengerFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// IWarpMessengerSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type IWarpMessengerSession struct { - Contract *IWarpMessenger // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// IWarpMessengerCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type IWarpMessengerCallerSession struct { - Contract *IWarpMessengerCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// IWarpMessengerTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type IWarpMessengerTransactorSession struct { - Contract *IWarpMessengerTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// IWarpMessengerRaw is an auto generated low-level Go binding around an Ethereum contract. -type IWarpMessengerRaw struct { - Contract *IWarpMessenger // Generic contract binding to access the raw methods on -} - -// IWarpMessengerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type IWarpMessengerCallerRaw struct { - Contract *IWarpMessengerCaller // Generic read-only contract binding to access the raw methods on -} - -// IWarpMessengerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type IWarpMessengerTransactorRaw struct { - Contract *IWarpMessengerTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewIWarpMessenger creates a new instance of IWarpMessenger, bound to a specific deployed contract. -func NewIWarpMessenger(address common.Address, backend bind.ContractBackend) (*IWarpMessenger, error) { - contract, err := bindIWarpMessenger(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &IWarpMessenger{IWarpMessengerCaller: IWarpMessengerCaller{contract: contract}, IWarpMessengerTransactor: IWarpMessengerTransactor{contract: contract}, IWarpMessengerFilterer: IWarpMessengerFilterer{contract: contract}}, nil -} - -// NewIWarpMessengerCaller creates a new read-only instance of IWarpMessenger, bound to a specific deployed contract. -func NewIWarpMessengerCaller(address common.Address, caller bind.ContractCaller) (*IWarpMessengerCaller, error) { - contract, err := bindIWarpMessenger(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &IWarpMessengerCaller{contract: contract}, nil -} - -// NewIWarpMessengerTransactor creates a new write-only instance of IWarpMessenger, bound to a specific deployed contract. -func NewIWarpMessengerTransactor(address common.Address, transactor bind.ContractTransactor) (*IWarpMessengerTransactor, error) { - contract, err := bindIWarpMessenger(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &IWarpMessengerTransactor{contract: contract}, nil -} - -// NewIWarpMessengerFilterer creates a new log filterer instance of IWarpMessenger, bound to a specific deployed contract. -func NewIWarpMessengerFilterer(address common.Address, filterer bind.ContractFilterer) (*IWarpMessengerFilterer, error) { - contract, err := bindIWarpMessenger(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &IWarpMessengerFilterer{contract: contract}, nil -} - -// bindIWarpMessenger binds a generic wrapper to an already deployed contract. -func bindIWarpMessenger(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := IWarpMessengerMetaData.GetAbi() - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_IWarpMessenger *IWarpMessengerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _IWarpMessenger.Contract.IWarpMessengerCaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_IWarpMessenger *IWarpMessengerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _IWarpMessenger.Contract.IWarpMessengerTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_IWarpMessenger *IWarpMessengerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _IWarpMessenger.Contract.IWarpMessengerTransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_IWarpMessenger *IWarpMessengerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _IWarpMessenger.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_IWarpMessenger *IWarpMessengerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _IWarpMessenger.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_IWarpMessenger *IWarpMessengerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _IWarpMessenger.Contract.contract.Transact(opts, method, params...) -} - -// GetBlockchainID is a free data retrieval call binding the contract method 0x4213cf78. -// -// Solidity: function getBlockchainID() view returns(bytes32 blockchainID) -func (_IWarpMessenger *IWarpMessengerCaller) GetBlockchainID(opts *bind.CallOpts) ([32]byte, error) { - var out []interface{} - err := _IWarpMessenger.contract.Call(opts, &out, "getBlockchainID") - - if err != nil { - return *new([32]byte), err - } - - out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) - - return out0, err - -} - -// GetBlockchainID is a free data retrieval call binding the contract method 0x4213cf78. -// -// Solidity: function getBlockchainID() view returns(bytes32 blockchainID) -func (_IWarpMessenger *IWarpMessengerSession) GetBlockchainID() ([32]byte, error) { - return _IWarpMessenger.Contract.GetBlockchainID(&_IWarpMessenger.CallOpts) -} - -// GetBlockchainID is a free data retrieval call binding the contract method 0x4213cf78. -// -// Solidity: function getBlockchainID() view returns(bytes32 blockchainID) -func (_IWarpMessenger *IWarpMessengerCallerSession) GetBlockchainID() ([32]byte, error) { - return _IWarpMessenger.Contract.GetBlockchainID(&_IWarpMessenger.CallOpts) -} - -// GetVerifiedWarpBlockHash is a free data retrieval call binding the contract method 0xce7f5929. -// -// Solidity: function getVerifiedWarpBlockHash(uint32 index) view returns((bytes32,bytes32) warpBlockHash, bool valid) -func (_IWarpMessenger *IWarpMessengerCaller) GetVerifiedWarpBlockHash(opts *bind.CallOpts, index uint32) (struct { - WarpBlockHash WarpBlockHash - Valid bool -}, error) { - var out []interface{} - err := _IWarpMessenger.contract.Call(opts, &out, "getVerifiedWarpBlockHash", index) - - outstruct := new(struct { - WarpBlockHash WarpBlockHash - Valid bool - }) - if err != nil { - return *outstruct, err - } - - outstruct.WarpBlockHash = *abi.ConvertType(out[0], new(WarpBlockHash)).(*WarpBlockHash) - outstruct.Valid = *abi.ConvertType(out[1], new(bool)).(*bool) - - return *outstruct, err - -} - -// GetVerifiedWarpBlockHash is a free data retrieval call binding the contract method 0xce7f5929. -// -// Solidity: function getVerifiedWarpBlockHash(uint32 index) view returns((bytes32,bytes32) warpBlockHash, bool valid) -func (_IWarpMessenger *IWarpMessengerSession) GetVerifiedWarpBlockHash(index uint32) (struct { - WarpBlockHash WarpBlockHash - Valid bool -}, error) { - return _IWarpMessenger.Contract.GetVerifiedWarpBlockHash(&_IWarpMessenger.CallOpts, index) -} - -// GetVerifiedWarpBlockHash is a free data retrieval call binding the contract method 0xce7f5929. -// -// Solidity: function getVerifiedWarpBlockHash(uint32 index) view returns((bytes32,bytes32) warpBlockHash, bool valid) -func (_IWarpMessenger *IWarpMessengerCallerSession) GetVerifiedWarpBlockHash(index uint32) (struct { - WarpBlockHash WarpBlockHash - Valid bool -}, error) { - return _IWarpMessenger.Contract.GetVerifiedWarpBlockHash(&_IWarpMessenger.CallOpts, index) -} - -// GetVerifiedWarpMessage is a free data retrieval call binding the contract method 0x6f825350. -// -// Solidity: function getVerifiedWarpMessage(uint32 index) view returns((bytes32,address,bytes) message, bool valid) -func (_IWarpMessenger *IWarpMessengerCaller) GetVerifiedWarpMessage(opts *bind.CallOpts, index uint32) (struct { - Message WarpMessage - Valid bool -}, error) { - var out []interface{} - err := _IWarpMessenger.contract.Call(opts, &out, "getVerifiedWarpMessage", index) - - outstruct := new(struct { - Message WarpMessage - Valid bool - }) - if err != nil { - return *outstruct, err - } - - outstruct.Message = *abi.ConvertType(out[0], new(WarpMessage)).(*WarpMessage) - outstruct.Valid = *abi.ConvertType(out[1], new(bool)).(*bool) - - return *outstruct, err - -} - -// GetVerifiedWarpMessage is a free data retrieval call binding the contract method 0x6f825350. -// -// Solidity: function getVerifiedWarpMessage(uint32 index) view returns((bytes32,address,bytes) message, bool valid) -func (_IWarpMessenger *IWarpMessengerSession) GetVerifiedWarpMessage(index uint32) (struct { - Message WarpMessage - Valid bool -}, error) { - return _IWarpMessenger.Contract.GetVerifiedWarpMessage(&_IWarpMessenger.CallOpts, index) -} - -// GetVerifiedWarpMessage is a free data retrieval call binding the contract method 0x6f825350. -// -// Solidity: function getVerifiedWarpMessage(uint32 index) view returns((bytes32,address,bytes) message, bool valid) -func (_IWarpMessenger *IWarpMessengerCallerSession) GetVerifiedWarpMessage(index uint32) (struct { - Message WarpMessage - Valid bool -}, error) { - return _IWarpMessenger.Contract.GetVerifiedWarpMessage(&_IWarpMessenger.CallOpts, index) -} - -// SendWarpMessage is a paid mutator transaction binding the contract method 0xee5b48eb. -// -// Solidity: function sendWarpMessage(bytes payload) returns(bytes32 messageID) -func (_IWarpMessenger *IWarpMessengerTransactor) SendWarpMessage(opts *bind.TransactOpts, payload []byte) (*types.Transaction, error) { - return _IWarpMessenger.contract.Transact(opts, "sendWarpMessage", payload) -} - -// SendWarpMessage is a paid mutator transaction binding the contract method 0xee5b48eb. -// -// Solidity: function sendWarpMessage(bytes payload) returns(bytes32 messageID) -func (_IWarpMessenger *IWarpMessengerSession) SendWarpMessage(payload []byte) (*types.Transaction, error) { - return _IWarpMessenger.Contract.SendWarpMessage(&_IWarpMessenger.TransactOpts, payload) -} - -// SendWarpMessage is a paid mutator transaction binding the contract method 0xee5b48eb. -// -// Solidity: function sendWarpMessage(bytes payload) returns(bytes32 messageID) -func (_IWarpMessenger *IWarpMessengerTransactorSession) SendWarpMessage(payload []byte) (*types.Transaction, error) { - return _IWarpMessenger.Contract.SendWarpMessage(&_IWarpMessenger.TransactOpts, payload) -} - -// IWarpMessengerSendWarpMessageIterator is returned from FilterSendWarpMessage and is used to iterate over the raw logs and unpacked data for SendWarpMessage events raised by the IWarpMessenger contract. -type IWarpMessengerSendWarpMessageIterator struct { - Event *IWarpMessengerSendWarpMessage // 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 *IWarpMessengerSendWarpMessageIterator) 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(IWarpMessengerSendWarpMessage) - 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(IWarpMessengerSendWarpMessage) - 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 *IWarpMessengerSendWarpMessageIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *IWarpMessengerSendWarpMessageIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// IWarpMessengerSendWarpMessage represents a SendWarpMessage event raised by the IWarpMessenger contract. -type IWarpMessengerSendWarpMessage struct { - Sender common.Address - MessageID [32]byte - Message []byte - Raw types.Log // Blockchain specific contextual infos -} - -// FilterSendWarpMessage is a free log retrieval operation binding the contract event 0x56600c567728a800c0aa927500f831cb451df66a7af570eb4df4dfbf4674887d. -// -// Solidity: event SendWarpMessage(address indexed sender, bytes32 indexed messageID, bytes message) -func (_IWarpMessenger *IWarpMessengerFilterer) FilterSendWarpMessage(opts *bind.FilterOpts, sender []common.Address, messageID [][32]byte) (*IWarpMessengerSendWarpMessageIterator, error) { - - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - var messageIDRule []interface{} - for _, messageIDItem := range messageID { - messageIDRule = append(messageIDRule, messageIDItem) - } - - logs, sub, err := _IWarpMessenger.contract.FilterLogs(opts, "SendWarpMessage", senderRule, messageIDRule) - if err != nil { - return nil, err - } - return &IWarpMessengerSendWarpMessageIterator{contract: _IWarpMessenger.contract, event: "SendWarpMessage", logs: logs, sub: sub}, nil -} - -// WatchSendWarpMessage is a free log subscription operation binding the contract event 0x56600c567728a800c0aa927500f831cb451df66a7af570eb4df4dfbf4674887d. -// -// Solidity: event SendWarpMessage(address indexed sender, bytes32 indexed messageID, bytes message) -func (_IWarpMessenger *IWarpMessengerFilterer) WatchSendWarpMessage(opts *bind.WatchOpts, sink chan<- *IWarpMessengerSendWarpMessage, sender []common.Address, messageID [][32]byte) (event.Subscription, error) { - - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - var messageIDRule []interface{} - for _, messageIDItem := range messageID { - messageIDRule = append(messageIDRule, messageIDItem) - } - - logs, sub, err := _IWarpMessenger.contract.WatchLogs(opts, "SendWarpMessage", senderRule, messageIDRule) - 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(IWarpMessengerSendWarpMessage) - if err := _IWarpMessenger.contract.UnpackLog(event, "SendWarpMessage", 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 -} - -// ParseSendWarpMessage is a log parse operation binding the contract event 0x56600c567728a800c0aa927500f831cb451df66a7af570eb4df4dfbf4674887d. -// -// Solidity: event SendWarpMessage(address indexed sender, bytes32 indexed messageID, bytes message) -func (_IWarpMessenger *IWarpMessengerFilterer) ParseSendWarpMessage(log types.Log) (*IWarpMessengerSendWarpMessage, error) { - event := new(IWarpMessengerSendWarpMessage) - if err := _IWarpMessenger.contract.UnpackLog(event, "SendWarpMessage", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} diff --git a/contracts/contracts/compile.go b/contracts/contracts/compile.go index 380f0b96a3..dd174eed45 100644 --- a/contracts/contracts/compile.go +++ b/contracts/contracts/compile.go @@ -4,7 +4,7 @@ package contracts // Step 1: Compile Solidity contracts to generate ABI and bin files -//go:generate solc-v0.8.30 -o ../artifacts --overwrite --abi --bin --base-path . --evm-version paris @openzeppelin/contracts/=../node_modules/@openzeppelin/contracts/ AllowList.sol ERC20NativeMinter.sol ExampleDeployerList.sol ExampleFeeManager.sol ExampleRewardManager.sol ExampleTxAllowList.sol ExampleWarp.sol interfaces/IAllowList.sol interfaces/IFeeManager.sol interfaces/INativeMinter.sol interfaces/IRewardManager.sol interfaces/IWarpMessenger.sol +//go:generate solc-v0.8.30 -o ../artifacts --overwrite --abi --bin --base-path . --evm-version paris @openzeppelin/contracts/=../node_modules/@openzeppelin/contracts/ AllowList.sol ERC20NativeMinter.sol ExampleDeployerList.sol ExampleFeeManager.sol ExampleRewardManager.sol ExampleTxAllowList.sol ExampleWarp.sol interfaces/IAllowList.sol // Step 2: Generate Go bindings from the compiled artifacts // Main contracts @@ -16,9 +16,5 @@ package contracts //go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg bindings --type ExampleTxAllowList --abi ../artifacts/ExampleTxAllowList.abi --bin ../artifacts/ExampleTxAllowList.bin --out ../bindings/exampletxallowlist.go //go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg bindings --type ExampleWarp --abi ../artifacts/ExampleWarp.abi --bin ../artifacts/ExampleWarp.bin --out ../bindings/examplewarp.go -// Interface contracts (for interacting with precompiles) +// Interface contracts (for when the interface is implemented by a precompile) //go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg bindings --type IAllowList --abi ../artifacts/IAllowList.abi --bin ../artifacts/IAllowList.bin --out ../bindings/iallowlist.go -//go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg bindings --type IFeeManager --abi ../artifacts/IFeeManager.abi --bin ../artifacts/IFeeManager.bin --out ../bindings/ifeemanager.go -//go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg bindings --type INativeMinter --abi ../artifacts/INativeMinter.abi --bin ../artifacts/INativeMinter.bin --out ../bindings/inativeminter.go -//go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg bindings --type IRewardManager --abi ../artifacts/IRewardManager.abi --bin ../artifacts/IRewardManager.bin --out ../bindings/irewardmanager.go -//go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg bindings --type IWarpMessenger --abi ../artifacts/IWarpMessenger.abi --bin ../artifacts/IWarpMessenger.bin --out ../bindings/iwarpmessenger.go diff --git a/tests/precompile/contract_deployer_allow_list_test.go b/tests/precompile/contract_deployer_allow_list_test.go index b6381c515c..b2e47d5c54 100644 --- a/tests/precompile/contract_deployer_allow_list_test.go +++ b/tests/precompile/contract_deployer_allow_list_test.go @@ -36,7 +36,7 @@ func init() { blockchainID := solidity.SubnetsSuite.GetBlockchainID("contract_deployer_allow_list") rpcURL := utils.GetDefaultChainURI(blockchainID) - backend = contracttest.NewTmpnetBackendSimple(rpcURL) + backend = contracttest.NewTmpnetBackend(ginkgo.GinkgoTB(), rpcURL) require.NotNil(backend, "failed to create tmpnet backend") var err error @@ -209,8 +209,8 @@ func init() { receipt := waitForReceipt(tx) require.Equal(types.ReceiptStatusSuccessful, receipt.Status) - require.NotNil(backend.OtherAddr, "missing other test account") - otherAuth := *backend.OtherAddr.Auth + require.NotNil(backend.Unprivileged, "missing other test account") + otherAuth := *backend.Unprivileged.Auth // Override the gas limit so bind skips preflight estimation; otherwise the call // reverts during estimation and no transaction is sent, which would hide the // failure status we expect from the mined receipt. diff --git a/tests/precompile/contracttest/example_test.go b/tests/precompile/contracttest/example_test.go index 9bd0b13a6b..deb6427077 100644 --- a/tests/precompile/contracttest/example_test.go +++ b/tests/precompile/contracttest/example_test.go @@ -53,5 +53,5 @@ func TestAllowListRoles(t *testing.T) { // Verify other address has no role RequireRole(t, backend, ContractDeployerAllowListAddress, - backend.OtherAddr.Address, RoleNone) + backend.Unprivileged.Address, RoleNone) } diff --git a/tests/precompile/contracttest/helpers.go b/tests/precompile/contracttest/helpers.go index 1084c35445..0bccfcd0ce 100644 --- a/tests/precompile/contracttest/helpers.go +++ b/tests/precompile/contracttest/helpers.go @@ -15,37 +15,17 @@ import ( "github.com/ava-labs/libevm/core/types" "github.com/ava-labs/libevm/crypto" "github.com/ava-labs/libevm/ethclient/simulated" + "github.com/holiman/uint256" "github.com/stretchr/testify/require" ) -var _ bind.ContractBackend = (simulated.Client)(nil) +const simulatedBackendChainID = 1337 -// TestBackend wraps a simulated backend with common test utilities -type TestBackend struct { - *simulated.Backend - Accounts -} - -// Common test accounts matching the TypeScript test setup -type Accounts struct { - Admin *TestAccount - OtherAddr *TestAccount - FundedKeys []*TestAccount -} - -// TestAccount represents a funded test account -type TestAccount struct { - Key *ecdsa.PrivateKey - Address common.Address - Auth *bind.TransactOpts -} - -// Common addresses from TypeScript tests var ( // AdminAddress is the primary admin account AdminAddress = common.HexToAddress("0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC") - // OtherAddress is a secondary account for testing - OtherAddress = common.HexToAddress("0x0Fa8EA536Be85F32724D57A37758761B86416123") + // UnprivilegedAddress is an unprivileged account for testing (has no special roles) + UnprivilegedAddress = common.HexToAddress("0x0Fa8EA536Be85F32724D57A37758761B86416123") ) // Keys for test accounts @@ -62,17 +42,37 @@ var testPrivateKeys = []string{ "750839e9dbbd2a0910efe40f50b2f3b2f2f59f5580bb4b83bd8c1201cf9a010a", } +// Account represents a funded test account +type Account struct { + Key *ecdsa.PrivateKey + Address common.Address + Auth *bind.TransactOpts +} + +// Accounts provides convenient access to test accounts. +// Admin and Unprivileged are convenience pointers to specific accounts in AllAccounts. +type Accounts struct { + Admin *Account // Points to admin account in AllAccounts + Unprivileged *Account // Points to unprivileged test account in AllAccounts (has no special roles) + AllAccounts []*Account // All funded test accounts (includes Admin and Unprivileged) +} + +type Backend struct { + *simulated.Backend + Accounts +} + // NewTestBackend creates a simulated backend with funded test accounts -func NewTestBackend(t testing.TB) *TestBackend { +func NewTestBackend(t testing.TB) *Backend { require := require.New(t) // Create test accounts var fundedAccounts Accounts - fundedAccounts.FundedKeys = make([]*TestAccount, len(testPrivateKeys)) + fundedAccounts.AllAccounts = make([]*Account, len(testPrivateKeys)) // Set up genesis allocation with funded accounts alloc := types.GenesisAlloc{} - balance := new(big.Int).Mul(big.NewInt(1000), big.NewInt(1e18)) // 1000 ETH each + balance := new(uint256.Int).SetAllOne().ToBig() for i, keyHex := range testPrivateKeys { key, err := crypto.HexToECDSA(keyHex) @@ -81,38 +81,36 @@ func NewTestBackend(t testing.TB) *TestBackend { addr := crypto.PubkeyToAddress(key.PublicKey) alloc[addr] = types.Account{Balance: balance} - chainID := big.NewInt(1337) // simulated backend uses chainID 1337 - auth, err := bind.NewKeyedTransactorWithChainID(key, chainID) + auth, err := bind.NewKeyedTransactorWithChainID(key, big.NewInt(simulatedBackendChainID)) require.NoError(err) - account := &TestAccount{ + account := &Account{ Key: key, Address: addr, Auth: auth, } - fundedAccounts.FundedKeys[i] = account + fundedAccounts.AllAccounts[i] = account - // Set up special accounts + // Set up special accounts as convenience pointers switch addr { case AdminAddress: fundedAccounts.Admin = account - case OtherAddress: - fundedAccounts.OtherAddr = account + case UnprivilegedAddress: + fundedAccounts.Unprivileged = account } } // Create simulated backend from libevm (uses AllDevChainProtocolChanges by default) - backend := simulated.NewBackend(alloc) - return &TestBackend{ - Backend: backend, + return &Backend{ + Backend: simulated.NewBackend(alloc), Accounts: fundedAccounts, } } // GetAccount returns a TestAccount by address, or nil if not found -func (tb *TestBackend) GetAccount(addr common.Address) *TestAccount { - for _, account := range tb.FundedKeys { +func (tb *Backend) GetAccount(addr common.Address) *Account { + for _, account := range tb.AllAccounts { if account.Address == addr { return account } @@ -121,7 +119,7 @@ func (tb *TestBackend) GetAccount(addr common.Address) *TestAccount { } // WaitForReceipt waits for a transaction receipt and commits a block if needed -func WaitForReceipt(t testing.TB, tb *TestBackend, tx *types.Transaction) *types.Receipt { +func WaitForReceipt(t testing.TB, tb *Backend, tx *types.Transaction) *types.Receipt { require := require.New(t) // Commit the transaction (mines a block) diff --git a/tests/precompile/contracttest/roles.go b/tests/precompile/contracttest/roles.go index 8b3f03c3fd..addb231b9c 100644 --- a/tests/precompile/contracttest/roles.go +++ b/tests/precompile/contracttest/roles.go @@ -35,11 +35,11 @@ var ( // SetupAllowListRole configures an address with a specific role on an allowlist precompile func SetupAllowListRole( t testing.TB, - backend *TestBackend, + backend *Backend, allowListAddress common.Address, targetAddress common.Address, role uint8, - fromAccount *TestAccount, + fromAccount *Account, ) { require := require.New(t) @@ -71,7 +71,7 @@ func SetupAllowListRole( // GetAllowListRole returns the role of an address on an allowlist precompile func GetAllowListRole( t testing.TB, - backend *TestBackend, + backend *Backend, allowListAddress common.Address, targetAddress common.Address, ) uint8 { @@ -90,7 +90,7 @@ func GetAllowListRole( // RequireRole asserts that an address has the expected role func RequireRole( t testing.TB, - backend *TestBackend, + backend *Backend, allowListAddress common.Address, targetAddress common.Address, expectedRole uint8, diff --git a/tests/precompile/contracttest/tmpnet.go b/tests/precompile/contracttest/tmpnet.go index e0daec9e2d..8a08334e7a 100644 --- a/tests/precompile/contracttest/tmpnet.go +++ b/tests/precompile/contracttest/tmpnet.go @@ -5,16 +5,14 @@ package contracttest import ( "context" + "math/big" "testing" "github.com/ava-labs/libevm/accounts/abi/bind" - "github.com/ava-labs/libevm/common" "github.com/ava-labs/libevm/core/types" "github.com/ava-labs/libevm/crypto" "github.com/ava-labs/libevm/ethclient" "github.com/stretchr/testify/require" - - "github.com/ava-labs/subnet-evm/contracts/bindings" ) // TmpnetBackend wraps an ethclient connection to a tmpnet subnet @@ -24,100 +22,60 @@ type TmpnetBackend struct { Accounts } -// NewTmpnetBackendSimple creates a test backend connected to a tmpnet subnet via RPC -// This version doesn't require a testing.TB interface, suitable for use in Ginkgo tests -func NewTmpnetBackendSimple(rpcURL string) *TmpnetBackend { +// NewTmpnetBackend creates a test backend connected to a tmpnet subnet via RPC +func NewTmpnetBackend(t testing.TB, rpcURL string) *TmpnetBackend { // Connect to the subnet client, err := ethclient.Dial(rpcURL) - if err != nil { - panic("failed to connect to tmpnet subnet: " + err.Error()) - } + require.NoError(t, err, "failed to connect to tmpnet subnet") // Create test accounts (same keys as simulated backend) var fundedAccounts Accounts - fundedAccounts.FundedKeys = make([]*TestAccount, len(testPrivateKeys)) + fundedAccounts.AllAccounts = make([]*Account, len(testPrivateKeys)) // Get chainID from the connected chain chainID, err := client.ChainID(context.Background()) - if err != nil { - panic("failed to get chain ID: " + err.Error()) - } + require.NoError(t, err, "failed to get chain ID") for i, keyHex := range testPrivateKeys { key, err := crypto.HexToECDSA(keyHex) - if err != nil { - panic("failed to parse private key: " + err.Error()) - } + require.NoError(t, err, "failed to parse private key at index %d", i) addr := crypto.PubkeyToAddress(key.PublicKey) auth, err := bind.NewKeyedTransactorWithChainID(key, chainID) - if err != nil { - panic("failed to create transactor: " + err.Error()) - } + require.NoError(t, err, "failed to create transactor for address %s", addr.Hex()) - account := &TestAccount{ + account := &Account{ Key: key, Address: addr, Auth: auth, } - fundedAccounts.FundedKeys[i] = account + fundedAccounts.AllAccounts[i] = account - // Set up special accounts + // Set up special accounts as convenience pointers switch addr { case AdminAddress: fundedAccounts.Admin = account - case OtherAddress: - fundedAccounts.OtherAddr = account + case UnprivilegedAddress: + fundedAccounts.Unprivileged = account } } - return &TmpnetBackend{ - Client: client, - Accounts: fundedAccounts, - } -} - -// NewTmpnetBackend creates a test backend connected to a tmpnet subnet via RPC -func NewTmpnetBackend(t testing.TB, rpcURL string) *TmpnetBackend { - require := require.New(t) - - // Connect to the subnet - client, err := ethclient.Dial(rpcURL) - require.NoError(err, "failed to connect to tmpnet subnet") - - // Create test accounts (same keys as simulated backend) - var fundedAccounts Accounts - fundedAccounts.FundedKeys = make([]*TestAccount, len(testPrivateKeys)) - - // Get chainID from the connected chain - chainID, err := client.ChainID(context.Background()) - require.NoError(err, "failed to get chain ID") - - for i, keyHex := range testPrivateKeys { - key, err := crypto.HexToECDSA(keyHex) - require.NoError(err) - - addr := crypto.PubkeyToAddress(key.PublicKey) - - auth, err := bind.NewKeyedTransactorWithChainID(key, chainID) - require.NoError(err) + // Validate that required accounts were found + require.NotNil(t, fundedAccounts.Admin, "Admin account not found - AdminAddress must match one of testPrivateKeys") + require.NotNil(t, fundedAccounts.Unprivileged, "Unprivileged account not found - UnprivilegedAddress must match one of testPrivateKeys") - account := &TestAccount{ - Key: key, - Address: addr, - Auth: auth, - } - fundedAccounts.FundedKeys[i] = account + // Verify that accounts are funded in genesis (at least Admin account needs balance for transactions) + // This prevents silent failures later when trying to send transactions + adminBalance, err := client.BalanceAt(t.Context(), fundedAccounts.Admin.Address, nil) + require.NoError(t, err, "failed to check Admin account balance") + require.NotNil(t, adminBalance, "Admin account balance is nil") + require.Greater(t, adminBalance.Cmp(big.NewInt(0)), 0, "Admin account (%s) has zero balance - account must be funded in genesis file", fundedAccounts.Admin.Address.Hex()) - // Set up special accounts - switch addr { - case AdminAddress: - fundedAccounts.Admin = account - case OtherAddress: - fundedAccounts.OtherAddr = account - } - } + unprivilegedBalance, err := client.BalanceAt(t.Context(), fundedAccounts.Unprivileged.Address, nil) + require.NoError(t, err, "failed to check Unprivileged account balance") + require.NotNil(t, unprivilegedBalance, "Unprivileged account balance is nil") + require.Greater(t, unprivilegedBalance.Cmp(big.NewInt(0)), 0, "Unprivileged account (%s) has zero balance - account must be funded in genesis file", fundedAccounts.Unprivileged.Address.Hex()) return &TmpnetBackend{ Client: client, @@ -132,16 +90,6 @@ func (tb *TmpnetBackend) Close() { } } -// GetAccount returns a TestAccount by address, or nil if not found -func (tb *TmpnetBackend) GetAccount(addr common.Address) *TestAccount { - for _, account := range tb.FundedKeys { - if account.Address == addr { - return account - } - } - return nil -} - // WaitForTxReceipt waits for a transaction receipt from the RPC endpoint func WaitForTxReceipt(t testing.TB, client *ethclient.Client, tx *types.Transaction) *types.Receipt { require := require.New(t) @@ -153,71 +101,3 @@ func WaitForTxReceipt(t testing.TB, client *ethclient.Client, tx *types.Transact return receipt } - -// DeployContractToTmpnet deploys a contract to a tmpnet subnet -// Example usage: -// -// addr, tx, contract, err := bindings.DeployExampleDeployerList(auth, client) -// receipt := WaitForTxReceipt(t, client, tx) -func DeployContractToTmpnet( - t testing.TB, - client *ethclient.Client, - tx *types.Transaction, -) *types.Receipt { - return WaitForTxReceipt(t, client, tx) -} - -// SetupAllowListRoleOnTmpnet configures an address with a specific role on a tmpnet subnet -func SetupAllowListRoleOnTmpnet( - t testing.TB, - client *ethclient.Client, - allowListAddress common.Address, - targetAddress common.Address, - role uint8, - fromAccount *TestAccount, -) { - require := require.New(t) - - // Get the IAllowList interface at the precompile address - allowList, err := bindings.NewIAllowList(allowListAddress, client) - require.NoError(err, "failed to create allowlist interface") - - var tx *types.Transaction - switch role { - case RoleAdmin: - tx, err = allowList.SetAdmin(fromAccount.Auth, targetAddress) - case RoleManager: - tx, err = allowList.SetManager(fromAccount.Auth, targetAddress) - case RoleEnabled: - tx, err = allowList.SetEnabled(fromAccount.Auth, targetAddress) - case RoleNone: - tx, err = allowList.SetNone(fromAccount.Auth, targetAddress) - default: - require.Fail("invalid role") - } - - require.NoError(err, "failed to set role") - - // Wait for transaction and verify - receipt := WaitForTxReceipt(t, client, tx) - RequireSuccessReceipt(t, receipt) -} - -// GetAllowListRoleOnTmpnet returns the role of an address on a tmpnet subnet -func GetAllowListRoleOnTmpnet( - t testing.TB, - client *ethclient.Client, - allowListAddress common.Address, - targetAddress common.Address, -) uint8 { - require := require.New(t) - - // Get the IAllowList interface at the precompile address - allowList, err := bindings.NewIAllowList(allowListAddress, client) - require.NoError(err, "failed to create allowlist interface") - - role, err := allowList.ReadAllowList(&bind.CallOpts{}, targetAddress) - require.NoError(err, "failed to read allowlist role") - - return uint8(role.Uint64()) -} From 2233fef8735edbf7336fe0bcd583ab72d6161de3 Mon Sep 17 00:00:00 2001 From: Jonathan Oppenheimer Date: Tue, 4 Nov 2025 14:29:14 -0500 Subject: [PATCH 07/11] Apply suggestions from code review Co-authored-by: Arran Schlosberg <519948+ARR4N@users.noreply.github.com> Signed-off-by: Jonathan Oppenheimer <147infiniti@gmail.com> --- tests/precompile/contracttest/example_test.go | 8 +++----- tests/precompile/contracttest/helpers.go | 11 +---------- tests/precompile/contracttest/roles.go | 8 ++++---- 3 files changed, 8 insertions(+), 19 deletions(-) diff --git a/tests/precompile/contracttest/example_test.go b/tests/precompile/contracttest/example_test.go index deb6427077..4a30314094 100644 --- a/tests/precompile/contracttest/example_test.go +++ b/tests/precompile/contracttest/example_test.go @@ -14,7 +14,6 @@ import ( // TestExampleDeployment demonstrates the test infrastructure // This is a simple example showing how to deploy and interact with contracts func TestExampleDeployment(t *testing.T) { - require := require.New(t) // Create test backend with funded accounts backend := NewTestBackend(t) @@ -22,12 +21,12 @@ func TestExampleDeployment(t *testing.T) { // Deploy ExampleDeployerList contract using generated binding addr, tx, contract, err := bindings.DeployExampleDeployerList(backend.Admin.Auth, backend.Client()) - require.NoError(err, "failed to deploy contract") + require.NoError(err, "bindings.DeployExampleDeployerList(...)") require.NotEqual(addr.Hex(), "0x0000000000000000000000000000000000000000", "contract address should not be zero") // Wait for deployment receipt := WaitForReceipt(t, backend, tx) - RequireSuccessReceipt(t, receipt) + require.Equalf(t, types.ReceiptStatusSuccessful, receipt.Status, "%T.Status", receipt) require.NotNil(contract, "contract should not be nil") @@ -44,8 +43,7 @@ func TestAllowListRoles(t *testing.T) { defer backend.Close() // Set admin role on the deployer allowlist - SetupAllowListRole(t, backend, ContractDeployerAllowListAddress, - backend.Admin.Address, RoleAdmin, backend.Admin) + SetupAllowListRole(t, backend, ContractDeployerAllowListAddress, backend.Admin.Address, RoleAdmin, backend.Admin) // Verify the role was set RequireRole(t, backend, ContractDeployerAllowListAddress, diff --git a/tests/precompile/contracttest/helpers.go b/tests/precompile/contracttest/helpers.go index 0bccfcd0ce..0dad8888d3 100644 --- a/tests/precompile/contracttest/helpers.go +++ b/tests/precompile/contracttest/helpers.go @@ -100,7 +100,6 @@ func NewTestBackend(t testing.TB) *Backend { } } - // Create simulated backend from libevm (uses AllDevChainProtocolChanges by default) return &Backend{ Backend: simulated.NewBackend(alloc), @@ -120,21 +119,13 @@ func (tb *Backend) GetAccount(addr common.Address) *Account { // WaitForReceipt waits for a transaction receipt and commits a block if needed func WaitForReceipt(t testing.TB, tb *Backend, tx *types.Transaction) *types.Receipt { - require := require.New(t) - // Commit the transaction (mines a block) tb.Commit() - // Get the receipt client := tb.Client() - receipt, err := client.TransactionReceipt(context.Background(), tx.Hash()) + receipt, err := client.TransactionReceipt(t.Context(), tx.Hash()) require.NoError(err, "failed to get transaction receipt") require.NotNil(receipt, "receipt is nil") return receipt } - -// RequireSuccessReceipt asserts that a transaction was successful -func RequireSuccessReceipt(t testing.TB, receipt *types.Receipt) { - require.Equal(t, types.ReceiptStatusSuccessful, receipt.Status, "transaction failed") -} diff --git a/tests/precompile/contracttest/roles.go b/tests/precompile/contracttest/roles.go index addb231b9c..d6fa7a7b3f 100644 --- a/tests/precompile/contracttest/roles.go +++ b/tests/precompile/contracttest/roles.go @@ -16,10 +16,10 @@ import ( // AllowList roles (matching TypeScript Roles in utils.ts) const ( - RoleNone = uint8(0) - RoleEnabled = uint8(1) - RoleAdmin = uint8(2) - RoleManager = uint8(3) + RoleNone uint = iota + RoleEnabled + RoleAdmin + RoleManager ) // Precompile addresses From 453c817d310aed1131a170dff2fd72e171c9f7bf Mon Sep 17 00:00:00 2001 From: Jonathan Oppenheimer Date: Tue, 4 Nov 2025 14:59:52 -0500 Subject: [PATCH 08/11] Arran feedback revisions --- tests/precompile/contracttest/example_test.go | 21 ++++++-------- tests/precompile/contracttest/helpers.go | 28 ++++++------------- tests/precompile/contracttest/roles.go | 25 ++++++++++------- 3 files changed, 31 insertions(+), 43 deletions(-) diff --git a/tests/precompile/contracttest/example_test.go b/tests/precompile/contracttest/example_test.go index 4a30314094..862b22485f 100644 --- a/tests/precompile/contracttest/example_test.go +++ b/tests/precompile/contracttest/example_test.go @@ -6,6 +6,7 @@ package contracttest import ( "testing" + "github.com/ava-labs/libevm/core/types" "github.com/stretchr/testify/require" "github.com/ava-labs/subnet-evm/contracts/bindings" @@ -14,26 +15,22 @@ import ( // TestExampleDeployment demonstrates the test infrastructure // This is a simple example showing how to deploy and interact with contracts func TestExampleDeployment(t *testing.T) { - // Create test backend with funded accounts backend := NewTestBackend(t) - defer backend.Close() // Deploy ExampleDeployerList contract using generated binding addr, tx, contract, err := bindings.DeployExampleDeployerList(backend.Admin.Auth, backend.Client()) - require.NoError(err, "bindings.DeployExampleDeployerList(...)") - require.NotEqual(addr.Hex(), "0x0000000000000000000000000000000000000000", "contract address should not be zero") + require.NoError(t, err, "bindings.DeployExampleDeployerList(...)") + require.NotZero(t, addr.Hex(), "contract address should not be zero") // Wait for deployment receipt := WaitForReceipt(t, backend, tx) - require.Equalf(t, types.ReceiptStatusSuccessful, receipt.Status, "%T.Status", receipt) - - require.NotNil(contract, "contract should not be nil") + require.Equal(t, types.ReceiptStatusSuccessful, receipt.Status, "%T.Status", receipt) // Example: Check owner (should be admin account) owner, err := contract.Owner(nil) - require.NoError(err) - require.Equal(backend.Admin.Address, owner, "owner should be admin account") + require.NoError(t, err) + require.Equal(t, backend.Admin.Address, owner, "owner should be admin account") } // TestAllowListRoles demonstrates role management @@ -46,10 +43,8 @@ func TestAllowListRoles(t *testing.T) { SetupAllowListRole(t, backend, ContractDeployerAllowListAddress, backend.Admin.Address, RoleAdmin, backend.Admin) // Verify the role was set - RequireRole(t, backend, ContractDeployerAllowListAddress, - backend.Admin.Address, RoleAdmin) + RequireRole(t, backend, ContractDeployerAllowListAddress, backend.Admin.Address, RoleAdmin) // Verify other address has no role - RequireRole(t, backend, ContractDeployerAllowListAddress, - backend.Unprivileged.Address, RoleNone) + RequireRole(t, backend, ContractDeployerAllowListAddress, backend.Unprivileged.Address, RoleNone) } diff --git a/tests/precompile/contracttest/helpers.go b/tests/precompile/contracttest/helpers.go index 0dad8888d3..703e418899 100644 --- a/tests/precompile/contracttest/helpers.go +++ b/tests/precompile/contracttest/helpers.go @@ -5,7 +5,6 @@ package contracttest import ( - "context" "crypto/ecdsa" "math/big" "testing" @@ -64,8 +63,6 @@ type Backend struct { // NewTestBackend creates a simulated backend with funded test accounts func NewTestBackend(t testing.TB) *Backend { - require := require.New(t) - // Create test accounts var fundedAccounts Accounts fundedAccounts.AllAccounts = make([]*Account, len(testPrivateKeys)) @@ -76,13 +73,13 @@ func NewTestBackend(t testing.TB) *Backend { for i, keyHex := range testPrivateKeys { key, err := crypto.HexToECDSA(keyHex) - require.NoError(err) + require.NoError(t, err) addr := crypto.PubkeyToAddress(key.PublicKey) alloc[addr] = types.Account{Balance: balance} auth, err := bind.NewKeyedTransactorWithChainID(key, big.NewInt(simulatedBackendChainID)) - require.NoError(err) + require.NoError(t, err) account := &Account{ Key: key, @@ -91,7 +88,6 @@ func NewTestBackend(t testing.TB) *Backend { } fundedAccounts.AllAccounts[i] = account - // Set up special accounts as convenience pointers switch addr { case AdminAddress: fundedAccounts.Admin = account @@ -100,32 +96,24 @@ func NewTestBackend(t testing.TB) *Backend { } } - - return &Backend{ + backend := &Backend{ Backend: simulated.NewBackend(alloc), Accounts: fundedAccounts, } -} -// GetAccount returns a TestAccount by address, or nil if not found -func (tb *Backend) GetAccount(addr common.Address) *Account { - for _, account := range tb.AllAccounts { - if account.Address == addr { - return account - } - } - return nil + t.Cleanup(func() { backend.Close() }) + + return backend } // WaitForReceipt waits for a transaction receipt and commits a block if needed func WaitForReceipt(t testing.TB, tb *Backend, tx *types.Transaction) *types.Receipt { - + t.Helper() tb.Commit() client := tb.Client() receipt, err := client.TransactionReceipt(t.Context(), tx.Hash()) - require.NoError(err, "failed to get transaction receipt") - require.NotNil(receipt, "receipt is nil") + require.NoError(t, err, "failed to get transaction receipt") return receipt } diff --git a/tests/precompile/contracttest/roles.go b/tests/precompile/contracttest/roles.go index d6fa7a7b3f..668a21794a 100644 --- a/tests/precompile/contracttest/roles.go +++ b/tests/precompile/contracttest/roles.go @@ -12,24 +12,29 @@ import ( "github.com/stretchr/testify/require" "github.com/ava-labs/subnet-evm/contracts/bindings" + "github.com/ava-labs/subnet-evm/precompile/contracts/deployerallowlist" + "github.com/ava-labs/subnet-evm/precompile/contracts/feemanager" + "github.com/ava-labs/subnet-evm/precompile/contracts/nativeminter" + "github.com/ava-labs/subnet-evm/precompile/contracts/rewardmanager" + "github.com/ava-labs/subnet-evm/precompile/contracts/txallowlist" + "github.com/ava-labs/subnet-evm/precompile/contracts/warp" ) -// AllowList roles (matching TypeScript Roles in utils.ts) const ( - RoleNone uint = iota + RoleNone uint8 = iota RoleEnabled RoleAdmin RoleManager ) -// Precompile addresses +// Precompile addresses - aliased from their source modules var ( - ContractDeployerAllowListAddress = common.HexToAddress("0x0200000000000000000000000000000000000000") - TxAllowListAddress = common.HexToAddress("0x0200000000000000000000000000000000000002") - NativeMinterAddress = common.HexToAddress("0x0200000000000000000000000000000000000001") - FeeManagerAddress = common.HexToAddress("0x0200000000000000000000000000000000000003") - RewardManagerAddress = common.HexToAddress("0x0200000000000000000000000000000000000004") - WarpAddress = common.HexToAddress("0x0200000000000000000000000000000000000005") + ContractDeployerAllowListAddress = deployerallowlist.ContractAddress + TxAllowListAddress = txallowlist.ContractAddress + NativeMinterAddress = nativeminter.ContractAddress + FeeManagerAddress = feemanager.ContractAddress + RewardManagerAddress = rewardmanager.ContractAddress + WarpAddress = warp.ContractAddress ) // SetupAllowListRole configures an address with a specific role on an allowlist precompile @@ -65,7 +70,7 @@ func SetupAllowListRole( // Commit and verify receipt := WaitForReceipt(t, backend, tx) - RequireSuccessReceipt(t, receipt) + require.Equal(t, types.ReceiptStatusSuccessful, receipt.Status, "%T.Status", receipt) } // GetAllowListRole returns the role of an address on an allowlist precompile From 04230910ead890e81456ef7b3943ef9dc1039702 Mon Sep 17 00:00:00 2001 From: Jonathan Oppenheimer Date: Tue, 4 Nov 2025 15:05:50 -0500 Subject: [PATCH 09/11] Refactor WaitForReciept --- tests/precompile/contracttest/tmpnet.go | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/tests/precompile/contracttest/tmpnet.go b/tests/precompile/contracttest/tmpnet.go index 8a08334e7a..d6f4618f11 100644 --- a/tests/precompile/contracttest/tmpnet.go +++ b/tests/precompile/contracttest/tmpnet.go @@ -77,10 +77,14 @@ func NewTmpnetBackend(t testing.TB, rpcURL string) *TmpnetBackend { require.NotNil(t, unprivilegedBalance, "Unprivileged account balance is nil") require.Greater(t, unprivilegedBalance.Cmp(big.NewInt(0)), 0, "Unprivileged account (%s) has zero balance - account must be funded in genesis file", fundedAccounts.Unprivileged.Address.Hex()) - return &TmpnetBackend{ + backend := &TmpnetBackend{ Client: client, Accounts: fundedAccounts, } + + t.Cleanup(backend.Close) + + return backend } // Close closes the client connection @@ -90,14 +94,13 @@ func (tb *TmpnetBackend) Close() { } } -// WaitForTxReceipt waits for a transaction receipt from the RPC endpoint -func WaitForTxReceipt(t testing.TB, client *ethclient.Client, tx *types.Transaction) *types.Receipt { - require := require.New(t) +// WaitForReceipt waits for a transaction receipt from the RPC endpoint +func (be *TmpnetBackend) WaitForReceipt(t testing.TB, tx *types.Transaction) *types.Receipt { + t.Helper() - // Wait for the transaction to be mined - receipt, err := bind.WaitMined(context.Background(), client, tx) - require.NoError(err, "failed to wait for transaction") - require.NotNil(receipt, "receipt is nil") + receipt, err := bind.WaitMined(context.Background(), be.Client, tx) + require.NoError(t, err, "failed to wait for transaction") + require.NotNil(t, receipt, "receipt is nil") return receipt } From 81c46c749b4016b8e0e9d826d17b8003319f88cb Mon Sep 17 00:00:00 2001 From: Jonathan Oppenheimer Date: Tue, 4 Nov 2025 15:07:06 -0500 Subject: [PATCH 10/11] t -> tb --- tests/precompile/contracttest/tmpnet.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/precompile/contracttest/tmpnet.go b/tests/precompile/contracttest/tmpnet.go index d6f4618f11..da0cb0a860 100644 --- a/tests/precompile/contracttest/tmpnet.go +++ b/tests/precompile/contracttest/tmpnet.go @@ -95,12 +95,12 @@ func (tb *TmpnetBackend) Close() { } // WaitForReceipt waits for a transaction receipt from the RPC endpoint -func (be *TmpnetBackend) WaitForReceipt(t testing.TB, tx *types.Transaction) *types.Receipt { - t.Helper() +func (be *TmpnetBackend) WaitForReceipt(tb testing.TB, tx *types.Transaction) *types.Receipt { + tb.Helper() receipt, err := bind.WaitMined(context.Background(), be.Client, tx) - require.NoError(t, err, "failed to wait for transaction") - require.NotNil(t, receipt, "receipt is nil") + require.NoError(tb, err, "failed to wait for transaction") + require.NotNil(tb, receipt, "receipt is nil") return receipt } From 0b314b726985bb74ded302fca756ef9bcb054ca1 Mon Sep 17 00:00:00 2001 From: Jonathan Oppenheimer Date: Tue, 4 Nov 2025 15:27:44 -0500 Subject: [PATCH 11/11] lint --- tests/precompile/contracttest/tmpnet.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/precompile/contracttest/tmpnet.go b/tests/precompile/contracttest/tmpnet.go index da0cb0a860..b1c1bcce0a 100644 --- a/tests/precompile/contracttest/tmpnet.go +++ b/tests/precompile/contracttest/tmpnet.go @@ -88,9 +88,9 @@ func NewTmpnetBackend(t testing.TB, rpcURL string) *TmpnetBackend { } // Close closes the client connection -func (tb *TmpnetBackend) Close() { - if tb.Client != nil { - tb.Client.Close() +func (be *TmpnetBackend) Close() { + if be.Client != nil { + be.Client.Close() } }