From 030967ebeb977dd115a8c75ea458fff0a87435d0 Mon Sep 17 00:00:00 2001 From: Jonathan Oppenheimer Date: Fri, 21 Nov 2025 15:51:01 -0500 Subject: [PATCH 01/23] feat: convert mint precompile testing to go --- contracts/bindings/gen_erc20nativeminter.go | 1537 ----------------- contracts/bindings/gen_exampledeployerlist.go | 627 ------- contracts/contracts/compile.go | 1 - .../contracts/test/ERC20NativeMinterTest.sol | 144 -- contracts/scripts/deployERC20NativeMinter.ts | 15 - contracts/test/README.md | 64 - contracts/test/contract_native_minter.ts | 63 - precompile/.gitignore | 2 + precompile/allowlist/allowlist.abi | 104 -- precompile/allowlist/allowlisttest/compile.go | 2 +- .../{ => solidity}/AllowList.sol | 0 .../{ => solidity}/AllowListTest.sol | 0 .../{ => solidity}/IAllowList.sol | 0 .../deployerallowlisttest/simulated_test.go | 54 +- precompile/contracts/feemanager/contract.abi | 291 ---- .../contracts/nativeminter/contract.abi | 116 -- .../nativeminter/nativemintertest/compile.go | 13 + .../{ => nativemintertest}/config_test.go | 39 +- .../{ => nativemintertest}/contract_test.go | 89 +- .../gen_erc20nativemintertest_binding.go | 1537 +++++++++++++++++ .../gen_inativeminter_binding.go | 634 +++++++ .../nativemintertest/gen_minter_binding.go | 266 +++ .../nativemintertest/simulated_test.go | 303 ++++ .../solidity/ERC20NativeMinterTest.sol | 32 +- .../solidity}/INativeMinter.sol | 2 +- .../nativemintertest/solidity/Minter.sol | 25 + .../contracts/rewardmanager/contract.abi | 177 -- .../contracts/testutils/simulated_helpers.go | 41 + precompile/contracts/warp/contract.abi | 136 -- tests/precompile/solidity/suites.go | 7 - 30 files changed, 2923 insertions(+), 3398 deletions(-) delete mode 100644 contracts/bindings/gen_erc20nativeminter.go delete mode 100644 contracts/bindings/gen_exampledeployerlist.go delete mode 100644 contracts/contracts/test/ERC20NativeMinterTest.sol delete mode 100644 contracts/scripts/deployERC20NativeMinter.ts delete mode 100644 contracts/test/README.md delete mode 100644 contracts/test/contract_native_minter.ts delete mode 100644 precompile/allowlist/allowlist.abi rename precompile/allowlist/allowlisttest/{ => solidity}/AllowList.sol (100%) rename precompile/allowlist/allowlisttest/{ => solidity}/AllowListTest.sol (100%) rename precompile/allowlist/allowlisttest/{ => solidity}/IAllowList.sol (100%) delete mode 100644 precompile/contracts/feemanager/contract.abi delete mode 100644 precompile/contracts/nativeminter/contract.abi create mode 100644 precompile/contracts/nativeminter/nativemintertest/compile.go rename precompile/contracts/nativeminter/{ => nativemintertest}/config_test.go (67%) rename precompile/contracts/nativeminter/{ => nativemintertest}/contract_test.go (69%) create mode 100644 precompile/contracts/nativeminter/nativemintertest/gen_erc20nativemintertest_binding.go create mode 100644 precompile/contracts/nativeminter/nativemintertest/gen_inativeminter_binding.go create mode 100644 precompile/contracts/nativeminter/nativemintertest/gen_minter_binding.go create mode 100644 precompile/contracts/nativeminter/nativemintertest/simulated_test.go rename contracts/contracts/ERC20NativeMinter.sol => precompile/contracts/nativeminter/nativemintertest/solidity/ERC20NativeMinterTest.sol (64%) rename {contracts/contracts/interfaces => precompile/contracts/nativeminter/nativemintertest/solidity}/INativeMinter.sol (84%) create mode 100644 precompile/contracts/nativeminter/nativemintertest/solidity/Minter.sol delete mode 100644 precompile/contracts/rewardmanager/contract.abi create mode 100644 precompile/contracts/testutils/simulated_helpers.go delete mode 100644 precompile/contracts/warp/contract.abi diff --git a/contracts/bindings/gen_erc20nativeminter.go b/contracts/bindings/gen_erc20nativeminter.go deleted file mode 100644 index ff4f7ebd31..0000000000 --- a/contracts/bindings/gen_erc20nativeminter.go +++ /dev/null @@ -1,1537 +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 -) - -// 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", -} - -// ERC20NativeMinterABI is the input ABI used to generate the binding from. -// Deprecated: Use ERC20NativeMinterMetaData.ABI instead. -var ERC20NativeMinterABI = ERC20NativeMinterMetaData.ABI - -// ERC20NativeMinterBin is the compiled bytecode used for deploying new contracts. -// Deprecated: Use ERC20NativeMinterMetaData.Bin instead. -var ERC20NativeMinterBin = ERC20NativeMinterMetaData.Bin - -// DeployERC20NativeMinter deploys a new Ethereum contract, binding an instance of ERC20NativeMinter to it. -func DeployERC20NativeMinter(auth *bind.TransactOpts, backend bind.ContractBackend, initSupply *big.Int) (common.Address, *types.Transaction, *ERC20NativeMinter, error) { - parsed, err := ERC20NativeMinterMetaData.GetAbi() - if err != nil { - return common.Address{}, nil, nil, err - } - if parsed == nil { - return common.Address{}, nil, nil, errors.New("GetABI returned nil") - } - - address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(ERC20NativeMinterBin), backend, initSupply) - if err != nil { - return common.Address{}, nil, nil, err - } - return address, tx, &ERC20NativeMinter{ERC20NativeMinterCaller: ERC20NativeMinterCaller{contract: contract}, ERC20NativeMinterTransactor: ERC20NativeMinterTransactor{contract: contract}, ERC20NativeMinterFilterer: ERC20NativeMinterFilterer{contract: contract}}, nil -} - -// ERC20NativeMinter is an auto generated Go binding around an Ethereum contract. -type ERC20NativeMinter struct { - ERC20NativeMinterCaller // Read-only binding to the contract - ERC20NativeMinterTransactor // Write-only binding to the contract - ERC20NativeMinterFilterer // Log filterer for contract events -} - -// ERC20NativeMinterCaller is an auto generated read-only Go binding around an Ethereum contract. -type ERC20NativeMinterCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// ERC20NativeMinterTransactor is an auto generated write-only Go binding around an Ethereum contract. -type ERC20NativeMinterTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// ERC20NativeMinterFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type ERC20NativeMinterFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// ERC20NativeMinterSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type ERC20NativeMinterSession struct { - Contract *ERC20NativeMinter // 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 -} - -// ERC20NativeMinterCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type ERC20NativeMinterCallerSession struct { - Contract *ERC20NativeMinterCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// ERC20NativeMinterTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type ERC20NativeMinterTransactorSession struct { - Contract *ERC20NativeMinterTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// ERC20NativeMinterRaw is an auto generated low-level Go binding around an Ethereum contract. -type ERC20NativeMinterRaw struct { - Contract *ERC20NativeMinter // Generic contract binding to access the raw methods on -} - -// ERC20NativeMinterCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type ERC20NativeMinterCallerRaw struct { - Contract *ERC20NativeMinterCaller // Generic read-only contract binding to access the raw methods on -} - -// ERC20NativeMinterTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type ERC20NativeMinterTransactorRaw struct { - Contract *ERC20NativeMinterTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewERC20NativeMinter creates a new instance of ERC20NativeMinter, bound to a specific deployed contract. -func NewERC20NativeMinter(address common.Address, backend bind.ContractBackend) (*ERC20NativeMinter, error) { - contract, err := bindERC20NativeMinter(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &ERC20NativeMinter{ERC20NativeMinterCaller: ERC20NativeMinterCaller{contract: contract}, ERC20NativeMinterTransactor: ERC20NativeMinterTransactor{contract: contract}, ERC20NativeMinterFilterer: ERC20NativeMinterFilterer{contract: contract}}, nil -} - -// NewERC20NativeMinterCaller creates a new read-only instance of ERC20NativeMinter, bound to a specific deployed contract. -func NewERC20NativeMinterCaller(address common.Address, caller bind.ContractCaller) (*ERC20NativeMinterCaller, error) { - contract, err := bindERC20NativeMinter(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &ERC20NativeMinterCaller{contract: contract}, nil -} - -// NewERC20NativeMinterTransactor creates a new write-only instance of ERC20NativeMinter, bound to a specific deployed contract. -func NewERC20NativeMinterTransactor(address common.Address, transactor bind.ContractTransactor) (*ERC20NativeMinterTransactor, error) { - contract, err := bindERC20NativeMinter(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &ERC20NativeMinterTransactor{contract: contract}, nil -} - -// NewERC20NativeMinterFilterer creates a new log filterer instance of ERC20NativeMinter, bound to a specific deployed contract. -func NewERC20NativeMinterFilterer(address common.Address, filterer bind.ContractFilterer) (*ERC20NativeMinterFilterer, error) { - contract, err := bindERC20NativeMinter(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &ERC20NativeMinterFilterer{contract: contract}, nil -} - -// bindERC20NativeMinter binds a generic wrapper to an already deployed contract. -func bindERC20NativeMinter(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := ERC20NativeMinterMetaData.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 (_ERC20NativeMinter *ERC20NativeMinterRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _ERC20NativeMinter.Contract.ERC20NativeMinterCaller.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 (_ERC20NativeMinter *ERC20NativeMinterRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.ERC20NativeMinterTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_ERC20NativeMinter *ERC20NativeMinterRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.ERC20NativeMinterTransactor.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 (_ERC20NativeMinter *ERC20NativeMinterCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _ERC20NativeMinter.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 (_ERC20NativeMinter *ERC20NativeMinterTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_ERC20NativeMinter *ERC20NativeMinterTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.contract.Transact(opts, method, params...) -} - -// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. -// -// Solidity: function allowance(address owner, address spender) view returns(uint256) -func (_ERC20NativeMinter *ERC20NativeMinterCaller) Allowance(opts *bind.CallOpts, owner common.Address, spender common.Address) (*big.Int, error) { - var out []interface{} - err := _ERC20NativeMinter.contract.Call(opts, &out, "allowance", owner, spender) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. -// -// Solidity: function allowance(address owner, address spender) view returns(uint256) -func (_ERC20NativeMinter *ERC20NativeMinterSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { - return _ERC20NativeMinter.Contract.Allowance(&_ERC20NativeMinter.CallOpts, owner, spender) -} - -// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. -// -// Solidity: function allowance(address owner, address spender) view returns(uint256) -func (_ERC20NativeMinter *ERC20NativeMinterCallerSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { - return _ERC20NativeMinter.Contract.Allowance(&_ERC20NativeMinter.CallOpts, owner, spender) -} - -// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. -// -// Solidity: function balanceOf(address account) view returns(uint256) -func (_ERC20NativeMinter *ERC20NativeMinterCaller) BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) { - var out []interface{} - err := _ERC20NativeMinter.contract.Call(opts, &out, "balanceOf", account) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. -// -// Solidity: function balanceOf(address account) view returns(uint256) -func (_ERC20NativeMinter *ERC20NativeMinterSession) BalanceOf(account common.Address) (*big.Int, error) { - return _ERC20NativeMinter.Contract.BalanceOf(&_ERC20NativeMinter.CallOpts, account) -} - -// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. -// -// Solidity: function balanceOf(address account) view returns(uint256) -func (_ERC20NativeMinter *ERC20NativeMinterCallerSession) BalanceOf(account common.Address) (*big.Int, error) { - return _ERC20NativeMinter.Contract.BalanceOf(&_ERC20NativeMinter.CallOpts, account) -} - -// Decimals is a free data retrieval call binding the contract method 0x313ce567. -// -// Solidity: function decimals() view returns(uint8) -func (_ERC20NativeMinter *ERC20NativeMinterCaller) Decimals(opts *bind.CallOpts) (uint8, error) { - var out []interface{} - err := _ERC20NativeMinter.contract.Call(opts, &out, "decimals") - - if err != nil { - return *new(uint8), err - } - - out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) - - return out0, err - -} - -// Decimals is a free data retrieval call binding the contract method 0x313ce567. -// -// Solidity: function decimals() view returns(uint8) -func (_ERC20NativeMinter *ERC20NativeMinterSession) Decimals() (uint8, error) { - return _ERC20NativeMinter.Contract.Decimals(&_ERC20NativeMinter.CallOpts) -} - -// Decimals is a free data retrieval call binding the contract method 0x313ce567. -// -// Solidity: function decimals() view returns(uint8) -func (_ERC20NativeMinter *ERC20NativeMinterCallerSession) Decimals() (uint8, error) { - return _ERC20NativeMinter.Contract.Decimals(&_ERC20NativeMinter.CallOpts) -} - -// IsAdmin is a free data retrieval call binding the contract method 0x24d7806c. -// -// Solidity: function isAdmin(address addr) view returns(bool) -func (_ERC20NativeMinter *ERC20NativeMinterCaller) IsAdmin(opts *bind.CallOpts, addr common.Address) (bool, error) { - var out []interface{} - err := _ERC20NativeMinter.contract.Call(opts, &out, "isAdmin", addr) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// IsAdmin is a free data retrieval call binding the contract method 0x24d7806c. -// -// Solidity: function isAdmin(address addr) view returns(bool) -func (_ERC20NativeMinter *ERC20NativeMinterSession) IsAdmin(addr common.Address) (bool, error) { - return _ERC20NativeMinter.Contract.IsAdmin(&_ERC20NativeMinter.CallOpts, addr) -} - -// IsAdmin is a free data retrieval call binding the contract method 0x24d7806c. -// -// Solidity: function isAdmin(address addr) view returns(bool) -func (_ERC20NativeMinter *ERC20NativeMinterCallerSession) IsAdmin(addr common.Address) (bool, error) { - return _ERC20NativeMinter.Contract.IsAdmin(&_ERC20NativeMinter.CallOpts, addr) -} - -// IsEnabled is a free data retrieval call binding the contract method 0x9015d371. -// -// Solidity: function isEnabled(address addr) view returns(bool) -func (_ERC20NativeMinter *ERC20NativeMinterCaller) IsEnabled(opts *bind.CallOpts, addr common.Address) (bool, error) { - var out []interface{} - err := _ERC20NativeMinter.contract.Call(opts, &out, "isEnabled", addr) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// IsEnabled is a free data retrieval call binding the contract method 0x9015d371. -// -// Solidity: function isEnabled(address addr) view returns(bool) -func (_ERC20NativeMinter *ERC20NativeMinterSession) IsEnabled(addr common.Address) (bool, error) { - return _ERC20NativeMinter.Contract.IsEnabled(&_ERC20NativeMinter.CallOpts, addr) -} - -// IsEnabled is a free data retrieval call binding the contract method 0x9015d371. -// -// Solidity: function isEnabled(address addr) view returns(bool) -func (_ERC20NativeMinter *ERC20NativeMinterCallerSession) IsEnabled(addr common.Address) (bool, error) { - return _ERC20NativeMinter.Contract.IsEnabled(&_ERC20NativeMinter.CallOpts, addr) -} - -// IsManager is a free data retrieval call binding the contract method 0xf3ae2415. -// -// Solidity: function isManager(address addr) view returns(bool) -func (_ERC20NativeMinter *ERC20NativeMinterCaller) IsManager(opts *bind.CallOpts, addr common.Address) (bool, error) { - var out []interface{} - err := _ERC20NativeMinter.contract.Call(opts, &out, "isManager", addr) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// IsManager is a free data retrieval call binding the contract method 0xf3ae2415. -// -// Solidity: function isManager(address addr) view returns(bool) -func (_ERC20NativeMinter *ERC20NativeMinterSession) IsManager(addr common.Address) (bool, error) { - return _ERC20NativeMinter.Contract.IsManager(&_ERC20NativeMinter.CallOpts, addr) -} - -// IsManager is a free data retrieval call binding the contract method 0xf3ae2415. -// -// Solidity: function isManager(address addr) view returns(bool) -func (_ERC20NativeMinter *ERC20NativeMinterCallerSession) IsManager(addr common.Address) (bool, error) { - return _ERC20NativeMinter.Contract.IsManager(&_ERC20NativeMinter.CallOpts, addr) -} - -// Name is a free data retrieval call binding the contract method 0x06fdde03. -// -// Solidity: function name() view returns(string) -func (_ERC20NativeMinter *ERC20NativeMinterCaller) Name(opts *bind.CallOpts) (string, error) { - var out []interface{} - err := _ERC20NativeMinter.contract.Call(opts, &out, "name") - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -// Name is a free data retrieval call binding the contract method 0x06fdde03. -// -// Solidity: function name() view returns(string) -func (_ERC20NativeMinter *ERC20NativeMinterSession) Name() (string, error) { - return _ERC20NativeMinter.Contract.Name(&_ERC20NativeMinter.CallOpts) -} - -// Name is a free data retrieval call binding the contract method 0x06fdde03. -// -// Solidity: function name() view returns(string) -func (_ERC20NativeMinter *ERC20NativeMinterCallerSession) Name() (string, error) { - return _ERC20NativeMinter.Contract.Name(&_ERC20NativeMinter.CallOpts) -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_ERC20NativeMinter *ERC20NativeMinterCaller) Owner(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _ERC20NativeMinter.contract.Call(opts, &out, "owner") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_ERC20NativeMinter *ERC20NativeMinterSession) Owner() (common.Address, error) { - return _ERC20NativeMinter.Contract.Owner(&_ERC20NativeMinter.CallOpts) -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_ERC20NativeMinter *ERC20NativeMinterCallerSession) Owner() (common.Address, error) { - return _ERC20NativeMinter.Contract.Owner(&_ERC20NativeMinter.CallOpts) -} - -// Symbol is a free data retrieval call binding the contract method 0x95d89b41. -// -// Solidity: function symbol() view returns(string) -func (_ERC20NativeMinter *ERC20NativeMinterCaller) Symbol(opts *bind.CallOpts) (string, error) { - var out []interface{} - err := _ERC20NativeMinter.contract.Call(opts, &out, "symbol") - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -// Symbol is a free data retrieval call binding the contract method 0x95d89b41. -// -// Solidity: function symbol() view returns(string) -func (_ERC20NativeMinter *ERC20NativeMinterSession) Symbol() (string, error) { - return _ERC20NativeMinter.Contract.Symbol(&_ERC20NativeMinter.CallOpts) -} - -// Symbol is a free data retrieval call binding the contract method 0x95d89b41. -// -// Solidity: function symbol() view returns(string) -func (_ERC20NativeMinter *ERC20NativeMinterCallerSession) Symbol() (string, error) { - return _ERC20NativeMinter.Contract.Symbol(&_ERC20NativeMinter.CallOpts) -} - -// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. -// -// Solidity: function totalSupply() view returns(uint256) -func (_ERC20NativeMinter *ERC20NativeMinterCaller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _ERC20NativeMinter.contract.Call(opts, &out, "totalSupply") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. -// -// Solidity: function totalSupply() view returns(uint256) -func (_ERC20NativeMinter *ERC20NativeMinterSession) TotalSupply() (*big.Int, error) { - return _ERC20NativeMinter.Contract.TotalSupply(&_ERC20NativeMinter.CallOpts) -} - -// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. -// -// Solidity: function totalSupply() view returns(uint256) -func (_ERC20NativeMinter *ERC20NativeMinterCallerSession) TotalSupply() (*big.Int, error) { - return _ERC20NativeMinter.Contract.TotalSupply(&_ERC20NativeMinter.CallOpts) -} - -// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. -// -// Solidity: function approve(address spender, uint256 value) returns(bool) -func (_ERC20NativeMinter *ERC20NativeMinterTransactor) Approve(opts *bind.TransactOpts, spender common.Address, value *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinter.contract.Transact(opts, "approve", spender, value) -} - -// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. -// -// Solidity: function approve(address spender, uint256 value) returns(bool) -func (_ERC20NativeMinter *ERC20NativeMinterSession) Approve(spender common.Address, value *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.Approve(&_ERC20NativeMinter.TransactOpts, spender, value) -} - -// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. -// -// Solidity: function approve(address spender, uint256 value) returns(bool) -func (_ERC20NativeMinter *ERC20NativeMinterTransactorSession) Approve(spender common.Address, value *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.Approve(&_ERC20NativeMinter.TransactOpts, spender, value) -} - -// Burn is a paid mutator transaction binding the contract method 0x9dc29fac. -// -// Solidity: function burn(address from, uint256 amount) returns() -func (_ERC20NativeMinter *ERC20NativeMinterTransactor) Burn(opts *bind.TransactOpts, from common.Address, amount *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinter.contract.Transact(opts, "burn", from, amount) -} - -// Burn is a paid mutator transaction binding the contract method 0x9dc29fac. -// -// Solidity: function burn(address from, uint256 amount) returns() -func (_ERC20NativeMinter *ERC20NativeMinterSession) Burn(from common.Address, amount *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.Burn(&_ERC20NativeMinter.TransactOpts, from, amount) -} - -// Burn is a paid mutator transaction binding the contract method 0x9dc29fac. -// -// Solidity: function burn(address from, uint256 amount) returns() -func (_ERC20NativeMinter *ERC20NativeMinterTransactorSession) Burn(from common.Address, amount *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.Burn(&_ERC20NativeMinter.TransactOpts, from, amount) -} - -// Deposit is a paid mutator transaction binding the contract method 0xd0e30db0. -// -// Solidity: function deposit() payable returns() -func (_ERC20NativeMinter *ERC20NativeMinterTransactor) Deposit(opts *bind.TransactOpts) (*types.Transaction, error) { - return _ERC20NativeMinter.contract.Transact(opts, "deposit") -} - -// Deposit is a paid mutator transaction binding the contract method 0xd0e30db0. -// -// Solidity: function deposit() payable returns() -func (_ERC20NativeMinter *ERC20NativeMinterSession) Deposit() (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.Deposit(&_ERC20NativeMinter.TransactOpts) -} - -// Deposit is a paid mutator transaction binding the contract method 0xd0e30db0. -// -// Solidity: function deposit() payable returns() -func (_ERC20NativeMinter *ERC20NativeMinterTransactorSession) Deposit() (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.Deposit(&_ERC20NativeMinter.TransactOpts) -} - -// Mint is a paid mutator transaction binding the contract method 0x40c10f19. -// -// Solidity: function mint(address to, uint256 amount) returns() -func (_ERC20NativeMinter *ERC20NativeMinterTransactor) Mint(opts *bind.TransactOpts, to common.Address, amount *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinter.contract.Transact(opts, "mint", to, amount) -} - -// Mint is a paid mutator transaction binding the contract method 0x40c10f19. -// -// Solidity: function mint(address to, uint256 amount) returns() -func (_ERC20NativeMinter *ERC20NativeMinterSession) Mint(to common.Address, amount *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.Mint(&_ERC20NativeMinter.TransactOpts, to, amount) -} - -// Mint is a paid mutator transaction binding the contract method 0x40c10f19. -// -// Solidity: function mint(address to, uint256 amount) returns() -func (_ERC20NativeMinter *ERC20NativeMinterTransactorSession) Mint(to common.Address, amount *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.Mint(&_ERC20NativeMinter.TransactOpts, to, amount) -} - -// Mintdraw is a paid mutator transaction binding the contract method 0x0356b6cd. -// -// Solidity: function mintdraw(uint256 wad) returns() -func (_ERC20NativeMinter *ERC20NativeMinterTransactor) Mintdraw(opts *bind.TransactOpts, wad *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinter.contract.Transact(opts, "mintdraw", wad) -} - -// Mintdraw is a paid mutator transaction binding the contract method 0x0356b6cd. -// -// Solidity: function mintdraw(uint256 wad) returns() -func (_ERC20NativeMinter *ERC20NativeMinterSession) Mintdraw(wad *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.Mintdraw(&_ERC20NativeMinter.TransactOpts, wad) -} - -// Mintdraw is a paid mutator transaction binding the contract method 0x0356b6cd. -// -// Solidity: function mintdraw(uint256 wad) returns() -func (_ERC20NativeMinter *ERC20NativeMinterTransactorSession) Mintdraw(wad *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.Mintdraw(&_ERC20NativeMinter.TransactOpts, wad) -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_ERC20NativeMinter *ERC20NativeMinterTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { - return _ERC20NativeMinter.contract.Transact(opts, "renounceOwnership") -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_ERC20NativeMinter *ERC20NativeMinterSession) RenounceOwnership() (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.RenounceOwnership(&_ERC20NativeMinter.TransactOpts) -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_ERC20NativeMinter *ERC20NativeMinterTransactorSession) RenounceOwnership() (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.RenounceOwnership(&_ERC20NativeMinter.TransactOpts) -} - -// Revoke is a paid mutator transaction binding the contract method 0x74a8f103. -// -// Solidity: function revoke(address addr) returns() -func (_ERC20NativeMinter *ERC20NativeMinterTransactor) Revoke(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { - return _ERC20NativeMinter.contract.Transact(opts, "revoke", addr) -} - -// Revoke is a paid mutator transaction binding the contract method 0x74a8f103. -// -// Solidity: function revoke(address addr) returns() -func (_ERC20NativeMinter *ERC20NativeMinterSession) Revoke(addr common.Address) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.Revoke(&_ERC20NativeMinter.TransactOpts, addr) -} - -// Revoke is a paid mutator transaction binding the contract method 0x74a8f103. -// -// Solidity: function revoke(address addr) returns() -func (_ERC20NativeMinter *ERC20NativeMinterTransactorSession) Revoke(addr common.Address) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.Revoke(&_ERC20NativeMinter.TransactOpts, addr) -} - -// SetAdmin is a paid mutator transaction binding the contract method 0x704b6c02. -// -// Solidity: function setAdmin(address addr) returns() -func (_ERC20NativeMinter *ERC20NativeMinterTransactor) SetAdmin(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { - return _ERC20NativeMinter.contract.Transact(opts, "setAdmin", addr) -} - -// SetAdmin is a paid mutator transaction binding the contract method 0x704b6c02. -// -// Solidity: function setAdmin(address addr) returns() -func (_ERC20NativeMinter *ERC20NativeMinterSession) SetAdmin(addr common.Address) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.SetAdmin(&_ERC20NativeMinter.TransactOpts, addr) -} - -// SetAdmin is a paid mutator transaction binding the contract method 0x704b6c02. -// -// Solidity: function setAdmin(address addr) returns() -func (_ERC20NativeMinter *ERC20NativeMinterTransactorSession) SetAdmin(addr common.Address) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.SetAdmin(&_ERC20NativeMinter.TransactOpts, addr) -} - -// SetEnabled is a paid mutator transaction binding the contract method 0x0aaf7043. -// -// Solidity: function setEnabled(address addr) returns() -func (_ERC20NativeMinter *ERC20NativeMinterTransactor) SetEnabled(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { - return _ERC20NativeMinter.contract.Transact(opts, "setEnabled", addr) -} - -// SetEnabled is a paid mutator transaction binding the contract method 0x0aaf7043. -// -// Solidity: function setEnabled(address addr) returns() -func (_ERC20NativeMinter *ERC20NativeMinterSession) SetEnabled(addr common.Address) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.SetEnabled(&_ERC20NativeMinter.TransactOpts, addr) -} - -// SetEnabled is a paid mutator transaction binding the contract method 0x0aaf7043. -// -// Solidity: function setEnabled(address addr) returns() -func (_ERC20NativeMinter *ERC20NativeMinterTransactorSession) SetEnabled(addr common.Address) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.SetEnabled(&_ERC20NativeMinter.TransactOpts, addr) -} - -// SetManager is a paid mutator transaction binding the contract method 0xd0ebdbe7. -// -// Solidity: function setManager(address addr) returns() -func (_ERC20NativeMinter *ERC20NativeMinterTransactor) SetManager(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { - return _ERC20NativeMinter.contract.Transact(opts, "setManager", addr) -} - -// SetManager is a paid mutator transaction binding the contract method 0xd0ebdbe7. -// -// Solidity: function setManager(address addr) returns() -func (_ERC20NativeMinter *ERC20NativeMinterSession) SetManager(addr common.Address) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.SetManager(&_ERC20NativeMinter.TransactOpts, addr) -} - -// SetManager is a paid mutator transaction binding the contract method 0xd0ebdbe7. -// -// Solidity: function setManager(address addr) returns() -func (_ERC20NativeMinter *ERC20NativeMinterTransactorSession) SetManager(addr common.Address) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.SetManager(&_ERC20NativeMinter.TransactOpts, addr) -} - -// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. -// -// Solidity: function transfer(address to, uint256 value) returns(bool) -func (_ERC20NativeMinter *ERC20NativeMinterTransactor) Transfer(opts *bind.TransactOpts, to common.Address, value *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinter.contract.Transact(opts, "transfer", to, value) -} - -// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. -// -// Solidity: function transfer(address to, uint256 value) returns(bool) -func (_ERC20NativeMinter *ERC20NativeMinterSession) Transfer(to common.Address, value *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.Transfer(&_ERC20NativeMinter.TransactOpts, to, value) -} - -// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. -// -// Solidity: function transfer(address to, uint256 value) returns(bool) -func (_ERC20NativeMinter *ERC20NativeMinterTransactorSession) Transfer(to common.Address, value *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.Transfer(&_ERC20NativeMinter.TransactOpts, to, value) -} - -// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. -// -// Solidity: function transferFrom(address from, address to, uint256 value) returns(bool) -func (_ERC20NativeMinter *ERC20NativeMinterTransactor) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, value *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinter.contract.Transact(opts, "transferFrom", from, to, value) -} - -// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. -// -// Solidity: function transferFrom(address from, address to, uint256 value) returns(bool) -func (_ERC20NativeMinter *ERC20NativeMinterSession) TransferFrom(from common.Address, to common.Address, value *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.TransferFrom(&_ERC20NativeMinter.TransactOpts, from, to, value) -} - -// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. -// -// Solidity: function transferFrom(address from, address to, uint256 value) returns(bool) -func (_ERC20NativeMinter *ERC20NativeMinterTransactorSession) TransferFrom(from common.Address, to common.Address, value *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.TransferFrom(&_ERC20NativeMinter.TransactOpts, from, to, value) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_ERC20NativeMinter *ERC20NativeMinterTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { - return _ERC20NativeMinter.contract.Transact(opts, "transferOwnership", newOwner) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_ERC20NativeMinter *ERC20NativeMinterSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.TransferOwnership(&_ERC20NativeMinter.TransactOpts, newOwner) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_ERC20NativeMinter *ERC20NativeMinterTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.TransferOwnership(&_ERC20NativeMinter.TransactOpts, newOwner) -} - -// ERC20NativeMinterApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the ERC20NativeMinter contract. -type ERC20NativeMinterApprovalIterator struct { - Event *ERC20NativeMinterApproval // 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 *ERC20NativeMinterApprovalIterator) 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(ERC20NativeMinterApproval) - 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(ERC20NativeMinterApproval) - 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 *ERC20NativeMinterApprovalIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *ERC20NativeMinterApprovalIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// ERC20NativeMinterApproval represents a Approval event raised by the ERC20NativeMinter contract. -type ERC20NativeMinterApproval struct { - Owner common.Address - Spender common.Address - Value *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. -// -// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) -func (_ERC20NativeMinter *ERC20NativeMinterFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*ERC20NativeMinterApprovalIterator, error) { - - var ownerRule []interface{} - for _, ownerItem := range owner { - ownerRule = append(ownerRule, ownerItem) - } - var spenderRule []interface{} - for _, spenderItem := range spender { - spenderRule = append(spenderRule, spenderItem) - } - - logs, sub, err := _ERC20NativeMinter.contract.FilterLogs(opts, "Approval", ownerRule, spenderRule) - if err != nil { - return nil, err - } - return &ERC20NativeMinterApprovalIterator{contract: _ERC20NativeMinter.contract, event: "Approval", logs: logs, sub: sub}, nil -} - -// WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. -// -// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) -func (_ERC20NativeMinter *ERC20NativeMinterFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *ERC20NativeMinterApproval, owner []common.Address, spender []common.Address) (event.Subscription, error) { - - var ownerRule []interface{} - for _, ownerItem := range owner { - ownerRule = append(ownerRule, ownerItem) - } - var spenderRule []interface{} - for _, spenderItem := range spender { - spenderRule = append(spenderRule, spenderItem) - } - - logs, sub, err := _ERC20NativeMinter.contract.WatchLogs(opts, "Approval", ownerRule, spenderRule) - 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(ERC20NativeMinterApproval) - if err := _ERC20NativeMinter.contract.UnpackLog(event, "Approval", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. -// -// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) -func (_ERC20NativeMinter *ERC20NativeMinterFilterer) ParseApproval(log types.Log) (*ERC20NativeMinterApproval, error) { - event := new(ERC20NativeMinterApproval) - if err := _ERC20NativeMinter.contract.UnpackLog(event, "Approval", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// ERC20NativeMinterDepositIterator is returned from FilterDeposit and is used to iterate over the raw logs and unpacked data for Deposit events raised by the ERC20NativeMinter contract. -type ERC20NativeMinterDepositIterator struct { - Event *ERC20NativeMinterDeposit // 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 *ERC20NativeMinterDepositIterator) 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(ERC20NativeMinterDeposit) - 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(ERC20NativeMinterDeposit) - 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 *ERC20NativeMinterDepositIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *ERC20NativeMinterDepositIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// ERC20NativeMinterDeposit represents a Deposit event raised by the ERC20NativeMinter contract. -type ERC20NativeMinterDeposit struct { - Dst common.Address - Wad *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterDeposit is a free log retrieval operation binding the contract event 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c. -// -// Solidity: event Deposit(address indexed dst, uint256 wad) -func (_ERC20NativeMinter *ERC20NativeMinterFilterer) FilterDeposit(opts *bind.FilterOpts, dst []common.Address) (*ERC20NativeMinterDepositIterator, error) { - - var dstRule []interface{} - for _, dstItem := range dst { - dstRule = append(dstRule, dstItem) - } - - logs, sub, err := _ERC20NativeMinter.contract.FilterLogs(opts, "Deposit", dstRule) - if err != nil { - return nil, err - } - return &ERC20NativeMinterDepositIterator{contract: _ERC20NativeMinter.contract, event: "Deposit", logs: logs, sub: sub}, nil -} - -// WatchDeposit is a free log subscription operation binding the contract event 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c. -// -// Solidity: event Deposit(address indexed dst, uint256 wad) -func (_ERC20NativeMinter *ERC20NativeMinterFilterer) WatchDeposit(opts *bind.WatchOpts, sink chan<- *ERC20NativeMinterDeposit, dst []common.Address) (event.Subscription, error) { - - var dstRule []interface{} - for _, dstItem := range dst { - dstRule = append(dstRule, dstItem) - } - - logs, sub, err := _ERC20NativeMinter.contract.WatchLogs(opts, "Deposit", dstRule) - 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(ERC20NativeMinterDeposit) - if err := _ERC20NativeMinter.contract.UnpackLog(event, "Deposit", 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 -} - -// ParseDeposit is a log parse operation binding the contract event 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c. -// -// Solidity: event Deposit(address indexed dst, uint256 wad) -func (_ERC20NativeMinter *ERC20NativeMinterFilterer) ParseDeposit(log types.Log) (*ERC20NativeMinterDeposit, error) { - event := new(ERC20NativeMinterDeposit) - if err := _ERC20NativeMinter.contract.UnpackLog(event, "Deposit", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// ERC20NativeMinterMintdrawalIterator is returned from FilterMintdrawal and is used to iterate over the raw logs and unpacked data for Mintdrawal events raised by the ERC20NativeMinter contract. -type ERC20NativeMinterMintdrawalIterator struct { - Event *ERC20NativeMinterMintdrawal // 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 *ERC20NativeMinterMintdrawalIterator) 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(ERC20NativeMinterMintdrawal) - 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(ERC20NativeMinterMintdrawal) - 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 *ERC20NativeMinterMintdrawalIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *ERC20NativeMinterMintdrawalIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// ERC20NativeMinterMintdrawal represents a Mintdrawal event raised by the ERC20NativeMinter contract. -type ERC20NativeMinterMintdrawal struct { - Src common.Address - Wad *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterMintdrawal is a free log retrieval operation binding the contract event 0x25bedde6c8ebd3a89b719a16299dbfe271c7bffa42fe1ac1a52e15ab0cb767e6. -// -// Solidity: event Mintdrawal(address indexed src, uint256 wad) -func (_ERC20NativeMinter *ERC20NativeMinterFilterer) FilterMintdrawal(opts *bind.FilterOpts, src []common.Address) (*ERC20NativeMinterMintdrawalIterator, error) { - - var srcRule []interface{} - for _, srcItem := range src { - srcRule = append(srcRule, srcItem) - } - - logs, sub, err := _ERC20NativeMinter.contract.FilterLogs(opts, "Mintdrawal", srcRule) - if err != nil { - return nil, err - } - return &ERC20NativeMinterMintdrawalIterator{contract: _ERC20NativeMinter.contract, event: "Mintdrawal", logs: logs, sub: sub}, nil -} - -// WatchMintdrawal is a free log subscription operation binding the contract event 0x25bedde6c8ebd3a89b719a16299dbfe271c7bffa42fe1ac1a52e15ab0cb767e6. -// -// Solidity: event Mintdrawal(address indexed src, uint256 wad) -func (_ERC20NativeMinter *ERC20NativeMinterFilterer) WatchMintdrawal(opts *bind.WatchOpts, sink chan<- *ERC20NativeMinterMintdrawal, src []common.Address) (event.Subscription, error) { - - var srcRule []interface{} - for _, srcItem := range src { - srcRule = append(srcRule, srcItem) - } - - logs, sub, err := _ERC20NativeMinter.contract.WatchLogs(opts, "Mintdrawal", srcRule) - 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(ERC20NativeMinterMintdrawal) - if err := _ERC20NativeMinter.contract.UnpackLog(event, "Mintdrawal", 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 -} - -// ParseMintdrawal is a log parse operation binding the contract event 0x25bedde6c8ebd3a89b719a16299dbfe271c7bffa42fe1ac1a52e15ab0cb767e6. -// -// Solidity: event Mintdrawal(address indexed src, uint256 wad) -func (_ERC20NativeMinter *ERC20NativeMinterFilterer) ParseMintdrawal(log types.Log) (*ERC20NativeMinterMintdrawal, error) { - event := new(ERC20NativeMinterMintdrawal) - if err := _ERC20NativeMinter.contract.UnpackLog(event, "Mintdrawal", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// ERC20NativeMinterOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the ERC20NativeMinter contract. -type ERC20NativeMinterOwnershipTransferredIterator struct { - Event *ERC20NativeMinterOwnershipTransferred // 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 *ERC20NativeMinterOwnershipTransferredIterator) 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(ERC20NativeMinterOwnershipTransferred) - 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(ERC20NativeMinterOwnershipTransferred) - 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 *ERC20NativeMinterOwnershipTransferredIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *ERC20NativeMinterOwnershipTransferredIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// ERC20NativeMinterOwnershipTransferred represents a OwnershipTransferred event raised by the ERC20NativeMinter contract. -type ERC20NativeMinterOwnershipTransferred struct { - PreviousOwner common.Address - NewOwner common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_ERC20NativeMinter *ERC20NativeMinterFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*ERC20NativeMinterOwnershipTransferredIterator, error) { - - var previousOwnerRule []interface{} - for _, previousOwnerItem := range previousOwner { - previousOwnerRule = append(previousOwnerRule, previousOwnerItem) - } - var newOwnerRule []interface{} - for _, newOwnerItem := range newOwner { - newOwnerRule = append(newOwnerRule, newOwnerItem) - } - - logs, sub, err := _ERC20NativeMinter.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) - if err != nil { - return nil, err - } - return &ERC20NativeMinterOwnershipTransferredIterator{contract: _ERC20NativeMinter.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil -} - -// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_ERC20NativeMinter *ERC20NativeMinterFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *ERC20NativeMinterOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { - - var previousOwnerRule []interface{} - for _, previousOwnerItem := range previousOwner { - previousOwnerRule = append(previousOwnerRule, previousOwnerItem) - } - var newOwnerRule []interface{} - for _, newOwnerItem := range newOwner { - newOwnerRule = append(newOwnerRule, newOwnerItem) - } - - logs, sub, err := _ERC20NativeMinter.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(ERC20NativeMinterOwnershipTransferred) - if err := _ERC20NativeMinter.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_ERC20NativeMinter *ERC20NativeMinterFilterer) ParseOwnershipTransferred(log types.Log) (*ERC20NativeMinterOwnershipTransferred, error) { - event := new(ERC20NativeMinterOwnershipTransferred) - if err := _ERC20NativeMinter.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// ERC20NativeMinterTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the ERC20NativeMinter contract. -type ERC20NativeMinterTransferIterator struct { - Event *ERC20NativeMinterTransfer // 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 *ERC20NativeMinterTransferIterator) 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(ERC20NativeMinterTransfer) - 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(ERC20NativeMinterTransfer) - 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 *ERC20NativeMinterTransferIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *ERC20NativeMinterTransferIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// ERC20NativeMinterTransfer represents a Transfer event raised by the ERC20NativeMinter contract. -type ERC20NativeMinterTransfer struct { - From common.Address - To common.Address - Value *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. -// -// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) -func (_ERC20NativeMinter *ERC20NativeMinterFilterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*ERC20NativeMinterTransferIterator, error) { - - var fromRule []interface{} - for _, fromItem := range from { - fromRule = append(fromRule, fromItem) - } - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - - logs, sub, err := _ERC20NativeMinter.contract.FilterLogs(opts, "Transfer", fromRule, toRule) - if err != nil { - return nil, err - } - return &ERC20NativeMinterTransferIterator{contract: _ERC20NativeMinter.contract, event: "Transfer", logs: logs, sub: sub}, nil -} - -// WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. -// -// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) -func (_ERC20NativeMinter *ERC20NativeMinterFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *ERC20NativeMinterTransfer, from []common.Address, to []common.Address) (event.Subscription, error) { - - var fromRule []interface{} - for _, fromItem := range from { - fromRule = append(fromRule, fromItem) - } - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - - logs, sub, err := _ERC20NativeMinter.contract.WatchLogs(opts, "Transfer", fromRule, toRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(ERC20NativeMinterTransfer) - if err := _ERC20NativeMinter.contract.UnpackLog(event, "Transfer", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. -// -// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) -func (_ERC20NativeMinter *ERC20NativeMinterFilterer) ParseTransfer(log types.Log) (*ERC20NativeMinterTransfer, error) { - event := new(ERC20NativeMinterTransfer) - if err := _ERC20NativeMinter.contract.UnpackLog(event, "Transfer", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} diff --git a/contracts/bindings/gen_exampledeployerlist.go b/contracts/bindings/gen_exampledeployerlist.go deleted file mode 100644 index 9ebbdfc963..0000000000 --- a/contracts/bindings/gen_exampledeployerlist.go +++ /dev/null @@ -1,627 +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 -) - -// 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", -} - -// ExampleDeployerListABI is the input ABI used to generate the binding from. -// Deprecated: Use ExampleDeployerListMetaData.ABI instead. -var ExampleDeployerListABI = ExampleDeployerListMetaData.ABI - -// ExampleDeployerListBin is the compiled bytecode used for deploying new contracts. -// Deprecated: Use ExampleDeployerListMetaData.Bin instead. -var ExampleDeployerListBin = ExampleDeployerListMetaData.Bin - -// DeployExampleDeployerList deploys a new Ethereum contract, binding an instance of ExampleDeployerList to it. -func DeployExampleDeployerList(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *ExampleDeployerList, error) { - parsed, err := ExampleDeployerListMetaData.GetAbi() - if err != nil { - return common.Address{}, nil, nil, err - } - if parsed == nil { - return common.Address{}, nil, nil, errors.New("GetABI returned nil") - } - - address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(ExampleDeployerListBin), backend) - if err != nil { - return common.Address{}, nil, nil, err - } - return address, tx, &ExampleDeployerList{ExampleDeployerListCaller: ExampleDeployerListCaller{contract: contract}, ExampleDeployerListTransactor: ExampleDeployerListTransactor{contract: contract}, ExampleDeployerListFilterer: ExampleDeployerListFilterer{contract: contract}}, nil -} - -// ExampleDeployerList is an auto generated Go binding around an Ethereum contract. -type ExampleDeployerList struct { - ExampleDeployerListCaller // Read-only binding to the contract - ExampleDeployerListTransactor // Write-only binding to the contract - ExampleDeployerListFilterer // Log filterer for contract events -} - -// ExampleDeployerListCaller is an auto generated read-only Go binding around an Ethereum contract. -type ExampleDeployerListCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// ExampleDeployerListTransactor is an auto generated write-only Go binding around an Ethereum contract. -type ExampleDeployerListTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// ExampleDeployerListFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type ExampleDeployerListFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// ExampleDeployerListSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type ExampleDeployerListSession struct { - Contract *ExampleDeployerList // 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 -} - -// ExampleDeployerListCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type ExampleDeployerListCallerSession struct { - Contract *ExampleDeployerListCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// ExampleDeployerListTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type ExampleDeployerListTransactorSession struct { - Contract *ExampleDeployerListTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// ExampleDeployerListRaw is an auto generated low-level Go binding around an Ethereum contract. -type ExampleDeployerListRaw struct { - Contract *ExampleDeployerList // Generic contract binding to access the raw methods on -} - -// ExampleDeployerListCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type ExampleDeployerListCallerRaw struct { - Contract *ExampleDeployerListCaller // Generic read-only contract binding to access the raw methods on -} - -// ExampleDeployerListTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type ExampleDeployerListTransactorRaw struct { - Contract *ExampleDeployerListTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewExampleDeployerList creates a new instance of ExampleDeployerList, bound to a specific deployed contract. -func NewExampleDeployerList(address common.Address, backend bind.ContractBackend) (*ExampleDeployerList, error) { - contract, err := bindExampleDeployerList(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &ExampleDeployerList{ExampleDeployerListCaller: ExampleDeployerListCaller{contract: contract}, ExampleDeployerListTransactor: ExampleDeployerListTransactor{contract: contract}, ExampleDeployerListFilterer: ExampleDeployerListFilterer{contract: contract}}, nil -} - -// NewExampleDeployerListCaller creates a new read-only instance of ExampleDeployerList, bound to a specific deployed contract. -func NewExampleDeployerListCaller(address common.Address, caller bind.ContractCaller) (*ExampleDeployerListCaller, error) { - contract, err := bindExampleDeployerList(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &ExampleDeployerListCaller{contract: contract}, nil -} - -// NewExampleDeployerListTransactor creates a new write-only instance of ExampleDeployerList, bound to a specific deployed contract. -func NewExampleDeployerListTransactor(address common.Address, transactor bind.ContractTransactor) (*ExampleDeployerListTransactor, error) { - contract, err := bindExampleDeployerList(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &ExampleDeployerListTransactor{contract: contract}, nil -} - -// NewExampleDeployerListFilterer creates a new log filterer instance of ExampleDeployerList, bound to a specific deployed contract. -func NewExampleDeployerListFilterer(address common.Address, filterer bind.ContractFilterer) (*ExampleDeployerListFilterer, error) { - contract, err := bindExampleDeployerList(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &ExampleDeployerListFilterer{contract: contract}, nil -} - -// bindExampleDeployerList binds a generic wrapper to an already deployed contract. -func bindExampleDeployerList(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := ExampleDeployerListMetaData.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 (_ExampleDeployerList *ExampleDeployerListRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _ExampleDeployerList.Contract.ExampleDeployerListCaller.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 (_ExampleDeployerList *ExampleDeployerListRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _ExampleDeployerList.Contract.ExampleDeployerListTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_ExampleDeployerList *ExampleDeployerListRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _ExampleDeployerList.Contract.ExampleDeployerListTransactor.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 (_ExampleDeployerList *ExampleDeployerListCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _ExampleDeployerList.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 (_ExampleDeployerList *ExampleDeployerListTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _ExampleDeployerList.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_ExampleDeployerList *ExampleDeployerListTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _ExampleDeployerList.Contract.contract.Transact(opts, method, params...) -} - -// IsAdmin is a free data retrieval call binding the contract method 0x24d7806c. -// -// Solidity: function isAdmin(address addr) view returns(bool) -func (_ExampleDeployerList *ExampleDeployerListCaller) IsAdmin(opts *bind.CallOpts, addr common.Address) (bool, error) { - var out []interface{} - err := _ExampleDeployerList.contract.Call(opts, &out, "isAdmin", addr) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// IsAdmin is a free data retrieval call binding the contract method 0x24d7806c. -// -// Solidity: function isAdmin(address addr) view returns(bool) -func (_ExampleDeployerList *ExampleDeployerListSession) IsAdmin(addr common.Address) (bool, error) { - return _ExampleDeployerList.Contract.IsAdmin(&_ExampleDeployerList.CallOpts, addr) -} - -// IsAdmin is a free data retrieval call binding the contract method 0x24d7806c. -// -// Solidity: function isAdmin(address addr) view returns(bool) -func (_ExampleDeployerList *ExampleDeployerListCallerSession) IsAdmin(addr common.Address) (bool, error) { - return _ExampleDeployerList.Contract.IsAdmin(&_ExampleDeployerList.CallOpts, addr) -} - -// IsEnabled is a free data retrieval call binding the contract method 0x9015d371. -// -// Solidity: function isEnabled(address addr) view returns(bool) -func (_ExampleDeployerList *ExampleDeployerListCaller) IsEnabled(opts *bind.CallOpts, addr common.Address) (bool, error) { - var out []interface{} - err := _ExampleDeployerList.contract.Call(opts, &out, "isEnabled", addr) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// IsEnabled is a free data retrieval call binding the contract method 0x9015d371. -// -// Solidity: function isEnabled(address addr) view returns(bool) -func (_ExampleDeployerList *ExampleDeployerListSession) IsEnabled(addr common.Address) (bool, error) { - return _ExampleDeployerList.Contract.IsEnabled(&_ExampleDeployerList.CallOpts, addr) -} - -// IsEnabled is a free data retrieval call binding the contract method 0x9015d371. -// -// Solidity: function isEnabled(address addr) view returns(bool) -func (_ExampleDeployerList *ExampleDeployerListCallerSession) IsEnabled(addr common.Address) (bool, error) { - return _ExampleDeployerList.Contract.IsEnabled(&_ExampleDeployerList.CallOpts, addr) -} - -// IsManager is a free data retrieval call binding the contract method 0xf3ae2415. -// -// Solidity: function isManager(address addr) view returns(bool) -func (_ExampleDeployerList *ExampleDeployerListCaller) IsManager(opts *bind.CallOpts, addr common.Address) (bool, error) { - var out []interface{} - err := _ExampleDeployerList.contract.Call(opts, &out, "isManager", addr) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// IsManager is a free data retrieval call binding the contract method 0xf3ae2415. -// -// Solidity: function isManager(address addr) view returns(bool) -func (_ExampleDeployerList *ExampleDeployerListSession) IsManager(addr common.Address) (bool, error) { - return _ExampleDeployerList.Contract.IsManager(&_ExampleDeployerList.CallOpts, addr) -} - -// IsManager is a free data retrieval call binding the contract method 0xf3ae2415. -// -// Solidity: function isManager(address addr) view returns(bool) -func (_ExampleDeployerList *ExampleDeployerListCallerSession) IsManager(addr common.Address) (bool, error) { - return _ExampleDeployerList.Contract.IsManager(&_ExampleDeployerList.CallOpts, addr) -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_ExampleDeployerList *ExampleDeployerListCaller) Owner(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _ExampleDeployerList.contract.Call(opts, &out, "owner") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_ExampleDeployerList *ExampleDeployerListSession) Owner() (common.Address, error) { - return _ExampleDeployerList.Contract.Owner(&_ExampleDeployerList.CallOpts) -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_ExampleDeployerList *ExampleDeployerListCallerSession) Owner() (common.Address, error) { - return _ExampleDeployerList.Contract.Owner(&_ExampleDeployerList.CallOpts) -} - -// DeployContract is a paid mutator transaction binding the contract method 0x6cd5c39b. -// -// Solidity: function deployContract() returns() -func (_ExampleDeployerList *ExampleDeployerListTransactor) DeployContract(opts *bind.TransactOpts) (*types.Transaction, error) { - return _ExampleDeployerList.contract.Transact(opts, "deployContract") -} - -// DeployContract is a paid mutator transaction binding the contract method 0x6cd5c39b. -// -// Solidity: function deployContract() returns() -func (_ExampleDeployerList *ExampleDeployerListSession) DeployContract() (*types.Transaction, error) { - return _ExampleDeployerList.Contract.DeployContract(&_ExampleDeployerList.TransactOpts) -} - -// DeployContract is a paid mutator transaction binding the contract method 0x6cd5c39b. -// -// Solidity: function deployContract() returns() -func (_ExampleDeployerList *ExampleDeployerListTransactorSession) DeployContract() (*types.Transaction, error) { - return _ExampleDeployerList.Contract.DeployContract(&_ExampleDeployerList.TransactOpts) -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_ExampleDeployerList *ExampleDeployerListTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { - return _ExampleDeployerList.contract.Transact(opts, "renounceOwnership") -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_ExampleDeployerList *ExampleDeployerListSession) RenounceOwnership() (*types.Transaction, error) { - return _ExampleDeployerList.Contract.RenounceOwnership(&_ExampleDeployerList.TransactOpts) -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_ExampleDeployerList *ExampleDeployerListTransactorSession) RenounceOwnership() (*types.Transaction, error) { - return _ExampleDeployerList.Contract.RenounceOwnership(&_ExampleDeployerList.TransactOpts) -} - -// Revoke is a paid mutator transaction binding the contract method 0x74a8f103. -// -// Solidity: function revoke(address addr) returns() -func (_ExampleDeployerList *ExampleDeployerListTransactor) Revoke(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { - return _ExampleDeployerList.contract.Transact(opts, "revoke", addr) -} - -// Revoke is a paid mutator transaction binding the contract method 0x74a8f103. -// -// Solidity: function revoke(address addr) returns() -func (_ExampleDeployerList *ExampleDeployerListSession) Revoke(addr common.Address) (*types.Transaction, error) { - return _ExampleDeployerList.Contract.Revoke(&_ExampleDeployerList.TransactOpts, addr) -} - -// Revoke is a paid mutator transaction binding the contract method 0x74a8f103. -// -// Solidity: function revoke(address addr) returns() -func (_ExampleDeployerList *ExampleDeployerListTransactorSession) Revoke(addr common.Address) (*types.Transaction, error) { - return _ExampleDeployerList.Contract.Revoke(&_ExampleDeployerList.TransactOpts, addr) -} - -// SetAdmin is a paid mutator transaction binding the contract method 0x704b6c02. -// -// Solidity: function setAdmin(address addr) returns() -func (_ExampleDeployerList *ExampleDeployerListTransactor) SetAdmin(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { - return _ExampleDeployerList.contract.Transact(opts, "setAdmin", addr) -} - -// SetAdmin is a paid mutator transaction binding the contract method 0x704b6c02. -// -// Solidity: function setAdmin(address addr) returns() -func (_ExampleDeployerList *ExampleDeployerListSession) SetAdmin(addr common.Address) (*types.Transaction, error) { - return _ExampleDeployerList.Contract.SetAdmin(&_ExampleDeployerList.TransactOpts, addr) -} - -// SetAdmin is a paid mutator transaction binding the contract method 0x704b6c02. -// -// Solidity: function setAdmin(address addr) returns() -func (_ExampleDeployerList *ExampleDeployerListTransactorSession) SetAdmin(addr common.Address) (*types.Transaction, error) { - return _ExampleDeployerList.Contract.SetAdmin(&_ExampleDeployerList.TransactOpts, addr) -} - -// SetEnabled is a paid mutator transaction binding the contract method 0x0aaf7043. -// -// Solidity: function setEnabled(address addr) returns() -func (_ExampleDeployerList *ExampleDeployerListTransactor) SetEnabled(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { - return _ExampleDeployerList.contract.Transact(opts, "setEnabled", addr) -} - -// SetEnabled is a paid mutator transaction binding the contract method 0x0aaf7043. -// -// Solidity: function setEnabled(address addr) returns() -func (_ExampleDeployerList *ExampleDeployerListSession) SetEnabled(addr common.Address) (*types.Transaction, error) { - return _ExampleDeployerList.Contract.SetEnabled(&_ExampleDeployerList.TransactOpts, addr) -} - -// SetEnabled is a paid mutator transaction binding the contract method 0x0aaf7043. -// -// Solidity: function setEnabled(address addr) returns() -func (_ExampleDeployerList *ExampleDeployerListTransactorSession) SetEnabled(addr common.Address) (*types.Transaction, error) { - return _ExampleDeployerList.Contract.SetEnabled(&_ExampleDeployerList.TransactOpts, addr) -} - -// SetManager is a paid mutator transaction binding the contract method 0xd0ebdbe7. -// -// Solidity: function setManager(address addr) returns() -func (_ExampleDeployerList *ExampleDeployerListTransactor) SetManager(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { - return _ExampleDeployerList.contract.Transact(opts, "setManager", addr) -} - -// SetManager is a paid mutator transaction binding the contract method 0xd0ebdbe7. -// -// Solidity: function setManager(address addr) returns() -func (_ExampleDeployerList *ExampleDeployerListSession) SetManager(addr common.Address) (*types.Transaction, error) { - return _ExampleDeployerList.Contract.SetManager(&_ExampleDeployerList.TransactOpts, addr) -} - -// SetManager is a paid mutator transaction binding the contract method 0xd0ebdbe7. -// -// Solidity: function setManager(address addr) returns() -func (_ExampleDeployerList *ExampleDeployerListTransactorSession) SetManager(addr common.Address) (*types.Transaction, error) { - return _ExampleDeployerList.Contract.SetManager(&_ExampleDeployerList.TransactOpts, addr) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_ExampleDeployerList *ExampleDeployerListTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { - return _ExampleDeployerList.contract.Transact(opts, "transferOwnership", newOwner) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_ExampleDeployerList *ExampleDeployerListSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { - return _ExampleDeployerList.Contract.TransferOwnership(&_ExampleDeployerList.TransactOpts, newOwner) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_ExampleDeployerList *ExampleDeployerListTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { - return _ExampleDeployerList.Contract.TransferOwnership(&_ExampleDeployerList.TransactOpts, newOwner) -} - -// ExampleDeployerListOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the ExampleDeployerList contract. -type ExampleDeployerListOwnershipTransferredIterator struct { - Event *ExampleDeployerListOwnershipTransferred // 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 *ExampleDeployerListOwnershipTransferredIterator) 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(ExampleDeployerListOwnershipTransferred) - 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(ExampleDeployerListOwnershipTransferred) - 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 *ExampleDeployerListOwnershipTransferredIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *ExampleDeployerListOwnershipTransferredIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// ExampleDeployerListOwnershipTransferred represents a OwnershipTransferred event raised by the ExampleDeployerList contract. -type ExampleDeployerListOwnershipTransferred struct { - PreviousOwner common.Address - NewOwner common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_ExampleDeployerList *ExampleDeployerListFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*ExampleDeployerListOwnershipTransferredIterator, error) { - - var previousOwnerRule []interface{} - for _, previousOwnerItem := range previousOwner { - previousOwnerRule = append(previousOwnerRule, previousOwnerItem) - } - var newOwnerRule []interface{} - for _, newOwnerItem := range newOwner { - newOwnerRule = append(newOwnerRule, newOwnerItem) - } - - logs, sub, err := _ExampleDeployerList.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) - if err != nil { - return nil, err - } - return &ExampleDeployerListOwnershipTransferredIterator{contract: _ExampleDeployerList.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil -} - -// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_ExampleDeployerList *ExampleDeployerListFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *ExampleDeployerListOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { - - var previousOwnerRule []interface{} - for _, previousOwnerItem := range previousOwner { - previousOwnerRule = append(previousOwnerRule, previousOwnerItem) - } - var newOwnerRule []interface{} - for _, newOwnerItem := range newOwner { - newOwnerRule = append(newOwnerRule, newOwnerItem) - } - - logs, sub, err := _ExampleDeployerList.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(ExampleDeployerListOwnershipTransferred) - if err := _ExampleDeployerList.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_ExampleDeployerList *ExampleDeployerListFilterer) ParseOwnershipTransferred(log types.Log) (*ExampleDeployerListOwnershipTransferred, error) { - event := new(ExampleDeployerListOwnershipTransferred) - if err := _ExampleDeployerList.contract.UnpackLog(event, "OwnershipTransferred", 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 2fb05d8715..d2ccda7dbe 100644 --- a/contracts/contracts/compile.go +++ b/contracts/contracts/compile.go @@ -8,7 +8,6 @@ package contracts // Step 2: Generate Go bindings from the compiled artifacts //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/gen_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/gen_erc20nativeminter.go //go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg bindings --type ExampleFeeManager --abi ../artifacts/ExampleFeeManager.abi --bin ../artifacts/ExampleFeeManager.bin --out ../bindings/gen_examplefeemanager.go //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/gen_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/gen_exampletxallowlist.go diff --git a/contracts/contracts/test/ERC20NativeMinterTest.sol b/contracts/contracts/test/ERC20NativeMinterTest.sol deleted file mode 100644 index d8d41b1af0..0000000000 --- a/contracts/contracts/test/ERC20NativeMinterTest.sol +++ /dev/null @@ -1,144 +0,0 @@ -//SPDX-License-Identifier: MIT -pragma solidity ^0.8.24; - -import "../ERC20NativeMinter.sol"; -import "../interfaces/INativeMinter.sol"; -import "./AllowListTest.sol"; - -// TODO: -// this contract adds another (unwanted) layer of indirection -// but it's the easiest way to match the previous HardHat testing functionality. -// Once we completely migrate to DS-test, we can simplify this set of tests. -contract Minter { - ERC20NativeMinter token; - - constructor(address tokenAddress) { - token = ERC20NativeMinter(tokenAddress); - } - - function mintdraw(uint amount) external { - token.mintdraw(amount); - } - - function deposit(uint value) external { - token.deposit{value: value}(); - } -} - -contract ERC20NativeMinterTest is AllowListTest { - INativeMinter nativeMinter = INativeMinter(MINTER_ADDRESS); - - function setUp() public { - // noop - } - - function step_mintdrawFailure() public { - ERC20NativeMinter token = new ERC20NativeMinter(1000); - address tokenAddress = address(token); - - assertRole(nativeMinter.readAllowList(tokenAddress), AllowList.Role.None); - - try token.mintdraw(100) { - assertTrue(false, "mintdraw should fail"); - } catch {} // TODO should match on an error to make sure that this is failing in the way that's expected - } - - function step_addMinter() public { - ERC20NativeMinter token = new ERC20NativeMinter(1000); - address tokenAddress = address(token); - - assertRole(nativeMinter.readAllowList(tokenAddress), AllowList.Role.None); - - nativeMinter.setEnabled(tokenAddress); - - assertRole(nativeMinter.readAllowList(tokenAddress), AllowList.Role.Enabled); - } - - function step_adminMintdraw() public { - ERC20NativeMinter token = new ERC20NativeMinter(1000); - address tokenAddress = address(token); - - address testAddress = address(this); - - nativeMinter.setEnabled(tokenAddress); - - uint initialTokenBalance = token.balanceOf(testAddress); - uint initialNativeBalance = testAddress.balance; - - uint amount = 100; - - token.mintdraw(amount); - - assertEq(token.balanceOf(testAddress), initialTokenBalance - amount); - assertEq(testAddress.balance, initialNativeBalance + amount); - } - - function step_minterMintdrawFailure() public { - ERC20NativeMinter token = new ERC20NativeMinter(1000); - address tokenAddress = address(token); - - Minter minter = new Minter(tokenAddress); - address minterAddress = address(minter); - - nativeMinter.setEnabled(tokenAddress); - - uint initialTokenBalance = token.balanceOf(minterAddress); - uint initialNativeBalance = minterAddress.balance; - - assertEq(initialTokenBalance, 0); - - try minter.mintdraw(100) { - assertTrue(false, "mintdraw should fail"); - } catch {} // TODO should match on an error to make sure that this is failing in the way that's expected - - assertEq(token.balanceOf(minterAddress), initialTokenBalance); - assertEq(minterAddress.balance, initialNativeBalance); - } - - function step_minterDeposit() public { - ERC20NativeMinter token = new ERC20NativeMinter(1000); - address tokenAddress = address(token); - - Minter minter = new Minter(tokenAddress); - address minterAddress = address(minter); - - nativeMinter.setEnabled(tokenAddress); - - uint amount = 100; - - nativeMinter.mintNativeCoin(minterAddress, amount); - - uint initialTokenBalance = token.balanceOf(minterAddress); - uint initialNativeBalance = minterAddress.balance; - - minter.deposit(amount); - - assertEq(token.balanceOf(minterAddress), initialTokenBalance + amount); - assertEq(minterAddress.balance, initialNativeBalance - amount); - } - - function step_mintdraw() public { - ERC20NativeMinter token = new ERC20NativeMinter(1000); - address tokenAddress = address(token); - - Minter minter = new Minter(tokenAddress); - address minterAddress = address(minter); - - nativeMinter.setEnabled(tokenAddress); - - uint amount = 100; - - uint initialNativeBalance = minterAddress.balance; - assertEq(initialNativeBalance, 0); - - token.mint(minterAddress, amount); - - uint initialTokenBalance = token.balanceOf(minterAddress); - assertEq(initialTokenBalance, amount); - - minter.mintdraw(amount); - - assertEq(token.balanceOf(minterAddress), 0); - assertEq(minterAddress.balance, amount); - } -} diff --git a/contracts/scripts/deployERC20NativeMinter.ts b/contracts/scripts/deployERC20NativeMinter.ts deleted file mode 100644 index 9ca2461726..0000000000 --- a/contracts/scripts/deployERC20NativeMinter.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { ethers } from "hardhat" -import { ERC20NativeMinter } from "typechain-types" - -const main = async (): Promise => { - const token: ERC20NativeMinter = await ethers.deployContract("ERC20NativeMinter") - await token.waitForDeployment() - console.log(`Token deployed to: ${token.target}`) -} - -main() - .then(() => process.exit(0)) - .catch(error => { - console.error(error) - process.exit(1) - }) diff --git a/contracts/test/README.md b/contracts/test/README.md deleted file mode 100644 index 2983ba29d3..0000000000 --- a/contracts/test/README.md +++ /dev/null @@ -1,64 +0,0 @@ -# Testing Precompiles - -If you can, put all of your test logic into DS-test tests. Prefix test functions with `step_`. There's also a `setUp` function that gets called before the test contract is deployed. The current best-practice is to re-deploy one test contract per `test` function called in `*.ts` test definitions. The `setUp` method should be called once, then `step_` functions passed in as the 2nd argument to `test("", )` will be called in order. `test.only` and `test.skip` behave the same way as `it.only` and `it.skip`. There's also a `test.debug` that combines `test.only` with some extra event logging (you can use `emit log_string` to help debug Solidity test code). - -The `test` function is a wrapper around Mocha's `it` function. It provides a normalized framework for running the -majority of your test assertions inside of a smart-contract, using `DS-Test`. -The API can be used as follows (all of the examples are equivalent): - -```ts -test("", ""); - -test("", [""]); - -test("", { - method: "", - overrides: {}, - shouldFail: false, - debug: false, -}); - -test("", [ - { - method: "", - overrides: {}, - shouldFail: false, - debug: false, - }, -]); - -test( - "", - [{ method: "", shouldFail: false, debug: false }], - {} -); -``` - -Many contract functions can be called as a part of the same test: - -```ts -test("", ["", "", ""]) -``` - -Individual test functions can describe their own overrides with the `overrides` property. -If an object is passed in as the third argument to `test`, it will be used as the default overrides for all test -functions. -The following are equivalent: - -```ts -test("", [ - { method: "", overrides: { from: "0x123" } }, -]); - -test("", [{ method: "" }], { - from: "0x123", -}); -``` - -In the above cases, the `from` override must be a signer. -The `shouldFail` property can be used to indicate that the test function should fail. This should be used sparingly -as it is not possible to match on the failure reason. -Furthermore, the `debug` property can be used to print any thrown errors when attempting to -send a transaction or while waiting for the transaction to be confirmed (the transaction is the smart contract call). -`debug` will also cause any parseable event logs to be printed that start with the `log_` prefix. -`DSTest` contracts have several options for emitting `log_` events. diff --git a/contracts/test/contract_native_minter.ts b/contracts/test/contract_native_minter.ts deleted file mode 100644 index 076b7552ab..0000000000 --- a/contracts/test/contract_native_minter.ts +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - -import { ethers } from "hardhat" -import { test } from "./utils" -import { expect } from "chai"; -import { Contract, Signer } from "ethers" -import { INativeMinter } from "typechain-types"; - -const ADMIN_ADDRESS: string = "0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC" -const MINT_PRECOMPILE_ADDRESS = "0x0200000000000000000000000000000000000001" - -describe("ERC20NativeMinter", function () { - beforeEach('Setup DS-Test contract', async function () { - const signer = await ethers.getSigner(ADMIN_ADDRESS) - const nativeMinterPromise = ethers.getContractAt("INativeMinter", MINT_PRECOMPILE_ADDRESS, signer) - - return ethers.getContractFactory("ERC20NativeMinterTest", { signer }) - .then(factory => factory.deploy()) - .then(contract => { - this.testContract = contract - return contract.waitForDeployment().then(() => contract) - }) - .then(contract => contract.setUp()) - .then(tx => Promise.all([nativeMinterPromise, tx.wait()])) - .then(([nativeMinter]) => nativeMinter.setAdmin(this.testContract.target)) - .then(tx => tx.wait()) - }) - - test("contract should not be able to mintdraw", "step_mintdrawFailure") - - test("should be added to minter list", "step_addMinter") - - test("admin should mintdraw", "step_adminMintdraw") - - test("minter should not mintdraw", "step_minterMintdrawFailure") - - test("should deposit for minter", "step_minterDeposit") - - test("minter should mintdraw", "step_mintdraw") -}) - - -describe("INativeMinter", function () { - let owner: Signer - let ownerAddress: string - let contract: INativeMinter - before(async function () { - owner = await ethers.getSigner(ADMIN_ADDRESS); - ownerAddress = await owner.getAddress() - contract = await ethers.getContractAt("INativeMinter", MINT_PRECOMPILE_ADDRESS, owner) - }); - - it("should emit NativeCoinMinted event", async function () { - let testAddress = "0x0444400000000000000000000000000000000004" - let amount = 1000 - let tx = await contract.mintNativeCoin(testAddress, amount) - let receipt = await tx.wait() - await expect(receipt) - .to.emit(contract, 'NativeCoinMinted') - .withArgs(ownerAddress, testAddress, amount) - }) -}) diff --git a/precompile/.gitignore b/precompile/.gitignore index d4f588edfe..a32ec92f6a 100644 --- a/precompile/.gitignore +++ b/precompile/.gitignore @@ -1 +1,3 @@ artifacts/ +*.abi +*.bin diff --git a/precompile/allowlist/allowlist.abi b/precompile/allowlist/allowlist.abi deleted file mode 100644 index 4e1c4f1fcb..0000000000 --- a/precompile/allowlist/allowlist.abi +++ /dev/null @@ -1,104 +0,0 @@ -[ - { - "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" - } -] diff --git a/precompile/allowlist/allowlisttest/compile.go b/precompile/allowlist/allowlisttest/compile.go index 20d3012ae3..ebb5f5dc2c 100644 --- a/precompile/allowlist/allowlisttest/compile.go +++ b/precompile/allowlist/allowlisttest/compile.go @@ -4,7 +4,7 @@ package allowlisttest // Step 1: Compile Solidity contracts to generate ABI and bin files -//go:generate solc-v0.8.30 -o artifacts --overwrite --abi --bin --base-path . precompile/=../../ --evm-version paris AllowListTest.sol +//go:generate solc-v0.8.30 -o artifacts --overwrite --abi --bin --base-path . precompile/=../../ --evm-version paris solidity/AllowListTest.sol // Step 2: Generate Go bindings from the compiled artifacts //go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg allowlisttest --type IAllowList --abi artifacts/IAllowList.abi --bin artifacts/IAllowList.bin --out gen_allowlist_binding.go //go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg allowlisttest --type AllowListTest --abi artifacts/AllowListTest.abi --bin artifacts/AllowListTest.bin --out gen_allowlisttest_binding.go diff --git a/precompile/allowlist/allowlisttest/AllowList.sol b/precompile/allowlist/allowlisttest/solidity/AllowList.sol similarity index 100% rename from precompile/allowlist/allowlisttest/AllowList.sol rename to precompile/allowlist/allowlisttest/solidity/AllowList.sol diff --git a/precompile/allowlist/allowlisttest/AllowListTest.sol b/precompile/allowlist/allowlisttest/solidity/AllowListTest.sol similarity index 100% rename from precompile/allowlist/allowlisttest/AllowListTest.sol rename to precompile/allowlist/allowlisttest/solidity/AllowListTest.sol diff --git a/precompile/allowlist/allowlisttest/IAllowList.sol b/precompile/allowlist/allowlisttest/solidity/IAllowList.sol similarity index 100% rename from precompile/allowlist/allowlisttest/IAllowList.sol rename to precompile/allowlist/allowlisttest/solidity/IAllowList.sol diff --git a/precompile/contracts/deployerallowlist/deployerallowlisttest/simulated_test.go b/precompile/contracts/deployerallowlist/deployerallowlisttest/simulated_test.go index d557cb6fbf..9f772838d8 100644 --- a/precompile/contracts/deployerallowlist/deployerallowlisttest/simulated_test.go +++ b/precompile/contracts/deployerallowlist/deployerallowlisttest/simulated_test.go @@ -1,12 +1,9 @@ // Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. -// -// This test suite migrates the Hardhat tests for the ContractDeployerAllowList -// to Go using the simulated backend and the generated bindings in this package. + package deployerallowlisttest import ( - "crypto/ecdsa" "math/big" "testing" @@ -24,6 +21,7 @@ import ( "github.com/ava-labs/subnet-evm/precompile/allowlist" "github.com/ava-labs/subnet-evm/precompile/allowlist/allowlisttest" "github.com/ava-labs/subnet-evm/precompile/contracts/deployerallowlist" + "github.com/ava-labs/subnet-evm/precompile/contracts/testutils" "github.com/ava-labs/subnet-evm/utils" sim "github.com/ava-labs/subnet-evm/ethclient/simulated" @@ -45,13 +43,6 @@ func TestMain(m *testing.M) { m.Run() } -func newAuth(t *testing.T, key *ecdsa.PrivateKey, chainID *big.Int) *bind.TransactOpts { - t.Helper() - auth, err := bind.NewKeyedTransactorWithChainID(key, chainID) - require.NoError(t, err) - return auth -} - func newBackendWithDeployerAllowList(t *testing.T) *sim.Backend { t.Helper() chainCfg := params.Copy(params.TestChainConfig) @@ -70,22 +61,13 @@ func newBackendWithDeployerAllowList(t *testing.T) *sim.Backend { ) } -func waitReceipt(t *testing.T, b *sim.Backend, tx *types.Transaction) *types.Receipt { - t.Helper() - b.Commit(true) - receipt, err := b.Client().TransactionReceipt(t.Context(), tx.Hash()) - require.NoError(t, err, "failed to get transaction receipt") - return receipt -} - // Helper functions to reduce test boilerplate func deployAllowListTestContract(t *testing.T, b *sim.Backend, auth *bind.TransactOpts) (common.Address, *allowlisttest.AllowListTest) { t.Helper() addr, tx, contract, err := allowlisttest.DeployAllowListTest(auth, b.Client(), deployerallowlist.ContractAddress) require.NoError(t, err) - receipt := waitReceipt(t, b, tx) - require.Equal(t, types.ReceiptStatusSuccessful, receipt.Status) + testutils.WaitReceiptSuccessful(t, b, tx) return addr, contract } @@ -100,14 +82,13 @@ func setAsAdmin(t *testing.T, b *sim.Backend, allowList *allowlisttest.IAllowLis t.Helper() tx, err := allowList.SetAdmin(auth, address) require.NoError(t, err) - receipt := waitReceipt(t, b, tx) - require.Equal(t, types.ReceiptStatusSuccessful, receipt.Status) + testutils.WaitReceiptSuccessful(t, b, tx) } func TestDeployerAllowList(t *testing.T) { chainID := big.NewInt(1337) - admin := newAuth(t, adminKey, chainID) - unprivileged := newAuth(t, unprivilegedKey, chainID) + admin := testutils.NewAuth(t, adminKey, chainID) + unprivileged := testutils.NewAuth(t, unprivilegedKey, chainID) type testCase struct { name string @@ -183,7 +164,7 @@ func TestDeployerAllowList(t *testing.T) { tx, err := allowListTest.SetEnabled(admin, otherContractAddr) require.NoError(t, err) - waitReceipt(t, backend, tx) + testutils.WaitReceipt(t, backend, tx) isEnabled, err := allowListTest.IsEnabled(nil, otherContractAddr) require.NoError(t, err) @@ -201,7 +182,7 @@ func TestDeployerAllowList(t *testing.T) { tx, err := allowListTest.SetEnabled(admin, deployerContractAddr) require.NoError(t, err) - waitReceipt(t, backend, tx) + testutils.WaitReceipt(t, backend, tx) isEnabled, err := allowListTest.IsEnabled(nil, deployerContractAddr) require.NoError(t, err) @@ -209,8 +190,7 @@ func TestDeployerAllowList(t *testing.T) { tx, err = deployerContract.DeployContract(admin) require.NoError(t, err) - receipt := waitReceipt(t, backend, tx) - require.Equal(t, types.ReceiptStatusSuccessful, receipt.Status) + testutils.WaitReceiptSuccessful(t, backend, tx) }, }, { @@ -223,7 +203,7 @@ func TestDeployerAllowList(t *testing.T) { tx, err := allowListTest.SetEnabled(admin, deployerContractAddr) require.NoError(t, err) - waitReceipt(t, backend, tx) + testutils.WaitReceipt(t, backend, tx) isEnabled, err := allowListTest.IsEnabled(nil, deployerContractAddr) require.NoError(t, err) @@ -231,7 +211,7 @@ func TestDeployerAllowList(t *testing.T) { tx, err = allowListTest.Revoke(admin, deployerContractAddr) require.NoError(t, err) - waitReceipt(t, backend, tx) + testutils.WaitReceipt(t, backend, tx) verifyRole(t, allowList, deployerContractAddr, allowlist.NoRole) }, @@ -253,7 +233,7 @@ func TestDeployerAllowList(t *testing.T) { func TestIAllowList_Events(t *testing.T) { chainID := big.NewInt(1337) - admin := newAuth(t, adminKey, chainID) + admin := testutils.NewAuth(t, adminKey, chainID) testKey, _ := crypto.GenerateKey() testAddress := crypto.PubkeyToAddress(testKey.PublicKey) @@ -269,7 +249,7 @@ func TestIAllowList_Events(t *testing.T) { testRun: func(allowList *allowlisttest.IAllowList, auth *bind.TransactOpts, backend *sim.Backend, t *testing.T, addr common.Address) { tx, err := allowList.SetAdmin(auth, addr) require.NoError(t, err) - waitReceipt(t, backend, tx) + testutils.WaitReceipt(t, backend, tx) }, expectedEvents: []allowlisttest.IAllowListRoleSet{ { @@ -285,7 +265,7 @@ func TestIAllowList_Events(t *testing.T) { testRun: func(allowList *allowlisttest.IAllowList, auth *bind.TransactOpts, backend *sim.Backend, t *testing.T, addr common.Address) { tx, err := allowList.SetManager(auth, addr) require.NoError(t, err) - waitReceipt(t, backend, tx) + testutils.WaitReceipt(t, backend, tx) }, expectedEvents: []allowlisttest.IAllowListRoleSet{ { @@ -301,7 +281,7 @@ func TestIAllowList_Events(t *testing.T) { testRun: func(allowList *allowlisttest.IAllowList, auth *bind.TransactOpts, backend *sim.Backend, t *testing.T, addr common.Address) { tx, err := allowList.SetEnabled(auth, addr) require.NoError(t, err) - waitReceipt(t, backend, tx) + testutils.WaitReceipt(t, backend, tx) }, expectedEvents: []allowlisttest.IAllowListRoleSet{ { @@ -318,11 +298,11 @@ func TestIAllowList_Events(t *testing.T) { // First set the address to Enabled so we can test setting it to None tx, err := allowList.SetEnabled(auth, addr) require.NoError(t, err) - waitReceipt(t, backend, tx) + testutils.WaitReceipt(t, backend, tx) tx, err = allowList.SetNone(auth, addr) require.NoError(t, err) - waitReceipt(t, backend, tx) + testutils.WaitReceipt(t, backend, tx) }, expectedEvents: []allowlisttest.IAllowListRoleSet{ { diff --git a/precompile/contracts/feemanager/contract.abi b/precompile/contracts/feemanager/contract.abi deleted file mode 100644 index 0e49755fbf..0000000000 --- a/precompile/contracts/feemanager/contract.abi +++ /dev/null @@ -1,291 +0,0 @@ -[ - { - "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": "struct IFeeManager.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": "struct IFeeManager.FeeConfig", - "name": "newFeeConfig", - "type": "tuple" - } - ], - "name": "FeeConfigChanged", - "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" - } -] diff --git a/precompile/contracts/nativeminter/contract.abi b/precompile/contracts/nativeminter/contract.abi deleted file mode 100644 index 49655d790a..0000000000 --- a/precompile/contracts/nativeminter/contract.abi +++ /dev/null @@ -1,116 +0,0 @@ -[ - { - "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" - }, - { - "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" - } -] diff --git a/precompile/contracts/nativeminter/nativemintertest/compile.go b/precompile/contracts/nativeminter/nativemintertest/compile.go new file mode 100644 index 0000000000..5afed2d567 --- /dev/null +++ b/precompile/contracts/nativeminter/nativemintertest/compile.go @@ -0,0 +1,13 @@ +// Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved. +// See the file LICENSE for licensing terms. + +package nativemintertest + +// 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/=contracts/lib/openzeppelin-contracts/contracts/ precompile/=precompile/ --evm-version paris solidity/ERC20NativeMinterTest.sol solidity/Minter.sol +// Step 2: Generate Go bindings from the compiled artifacts +//go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg nativemintertest --type INativeMinter --abi artifacts/INativeMinter.abi --bin artifacts/INativeMinter.bin --out gen_inativeminter_binding.go +//go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg nativemintertest --type ERC20NativeMinterTest --abi artifacts/ERC20NativeMinterTest.abi --bin artifacts/ERC20NativeMinterTest.bin --out gen_erc20nativemintertest_binding.go +//go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg nativemintertest --type Minter --abi artifacts/Minter.abi --bin artifacts/Minter.bin --out gen_minter_binding.go +// Step 3: Replace import paths in generated binding to use subnet-evm instead of libevm +//go:generate sh -c "sed -i.bak -e 's|github.com/ava-labs/libevm/accounts/abi|github.com/ava-labs/subnet-evm/accounts/abi|g' -e 's|github.com/ava-labs/libevm/accounts/abi/bind|github.com/ava-labs/subnet-evm/accounts/abi/bind|g' gen_inativeminter_binding.go gen_erc20nativemintertest_binding.go gen_minter_binding.go && rm -f gen_inativeminter_binding.go.bak gen_erc20nativemintertest_binding.go.bak gen_minter_binding.go.bak" diff --git a/precompile/contracts/nativeminter/config_test.go b/precompile/contracts/nativeminter/nativemintertest/config_test.go similarity index 67% rename from precompile/contracts/nativeminter/config_test.go rename to precompile/contracts/nativeminter/nativemintertest/config_test.go index 649e16cc59..322d1dd814 100644 --- a/precompile/contracts/nativeminter/config_test.go +++ b/precompile/contracts/nativeminter/nativemintertest/config_test.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. -package nativeminter +package nativemintertest import ( "testing" @@ -11,6 +11,7 @@ import ( "go.uber.org/mock/gomock" "github.com/ava-labs/subnet-evm/precompile/allowlist/allowlisttest" + "github.com/ava-labs/subnet-evm/precompile/contracts/nativeminter" "github.com/ava-labs/subnet-evm/precompile/precompileconfig" "github.com/ava-labs/subnet-evm/precompile/precompiletest" "github.com/ava-labs/subnet-evm/utils" @@ -22,7 +23,7 @@ func TestVerify(t *testing.T) { managers := []common.Address{allowlisttest.TestManagerAddr} tests := map[string]precompiletest.ConfigVerifyTest{ "valid config": { - Config: NewConfig(utils.NewUint64(3), admins, enableds, managers, nil), + Config: nativeminter.NewConfig(utils.NewUint64(3), admins, enableds, managers, nil), ChainConfig: func() precompileconfig.ChainConfig { config := precompileconfig.NewMockChainConfig(gomock.NewController(t)) config.EXPECT().IsDurango(gomock.Any()).Return(true).AnyTimes() @@ -31,19 +32,19 @@ func TestVerify(t *testing.T) { ExpectedError: "", }, "invalid allow list config in native minter allowlisttest": { - Config: NewConfig(utils.NewUint64(3), admins, admins, nil, nil), + Config: nativeminter.NewConfig(utils.NewUint64(3), admins, admins, nil, nil), ExpectedError: "cannot set address", }, "duplicate admins in config in native minter allowlisttest": { - Config: NewConfig(utils.NewUint64(3), append(admins, admins[0]), enableds, managers, nil), + Config: nativeminter.NewConfig(utils.NewUint64(3), append(admins, admins[0]), enableds, managers, nil), ExpectedError: "duplicate address", }, "duplicate enableds in config in native minter allowlisttest": { - Config: NewConfig(utils.NewUint64(3), admins, append(enableds, enableds[0]), managers, nil), + Config: nativeminter.NewConfig(utils.NewUint64(3), admins, append(enableds, enableds[0]), managers, nil), ExpectedError: "duplicate address", }, "nil amount in native minter config": { - Config: NewConfig(utils.NewUint64(3), admins, nil, nil, + Config: nativeminter.NewConfig(utils.NewUint64(3), admins, nil, nil, map[common.Address]*math.HexOrDecimal256{ common.HexToAddress("0x01"): math.NewHexOrDecimal256(123), common.HexToAddress("0x02"): nil, @@ -51,7 +52,7 @@ func TestVerify(t *testing.T) { ExpectedError: "initial mint cannot contain nil", }, "negative amount in native minter config": { - Config: NewConfig(utils.NewUint64(3), admins, nil, nil, + Config: nativeminter.NewConfig(utils.NewUint64(3), admins, nil, nil, map[common.Address]*math.HexOrDecimal256{ common.HexToAddress("0x01"): math.NewHexOrDecimal256(123), common.HexToAddress("0x02"): math.NewHexOrDecimal256(-1), @@ -59,7 +60,7 @@ func TestVerify(t *testing.T) { ExpectedError: "initial mint cannot contain invalid amount", }, } - allowlisttest.VerifyPrecompileWithAllowListTests(t, Module, tests) + allowlisttest.VerifyPrecompileWithAllowListTests(t, nativeminter.Module, tests) } func TestEqual(t *testing.T) { @@ -68,53 +69,53 @@ func TestEqual(t *testing.T) { managers := []common.Address{allowlisttest.TestManagerAddr} tests := map[string]precompiletest.ConfigEqualTest{ "non-nil config and nil other": { - Config: NewConfig(utils.NewUint64(3), admins, enableds, managers, nil), + Config: nativeminter.NewConfig(utils.NewUint64(3), admins, enableds, managers, nil), Other: nil, Expected: false, }, "different type": { - Config: NewConfig(utils.NewUint64(3), admins, enableds, managers, nil), + Config: nativeminter.NewConfig(utils.NewUint64(3), admins, enableds, managers, nil), Other: precompileconfig.NewMockConfig(gomock.NewController(t)), Expected: false, }, "different timestamp": { - Config: NewConfig(utils.NewUint64(3), admins, nil, nil, nil), - Other: NewConfig(utils.NewUint64(4), admins, nil, nil, nil), + Config: nativeminter.NewConfig(utils.NewUint64(3), admins, nil, nil, nil), + Other: nativeminter.NewConfig(utils.NewUint64(4), admins, nil, nil, nil), Expected: false, }, "different initial mint amounts": { - Config: NewConfig(utils.NewUint64(3), admins, nil, nil, + Config: nativeminter.NewConfig(utils.NewUint64(3), admins, nil, nil, map[common.Address]*math.HexOrDecimal256{ common.HexToAddress("0x01"): math.NewHexOrDecimal256(1), }), - Other: NewConfig(utils.NewUint64(3), admins, nil, nil, + Other: nativeminter.NewConfig(utils.NewUint64(3), admins, nil, nil, map[common.Address]*math.HexOrDecimal256{ common.HexToAddress("0x01"): math.NewHexOrDecimal256(2), }), Expected: false, }, "different initial mint addresses": { - Config: NewConfig(utils.NewUint64(3), admins, nil, nil, + Config: nativeminter.NewConfig(utils.NewUint64(3), admins, nil, nil, map[common.Address]*math.HexOrDecimal256{ common.HexToAddress("0x01"): math.NewHexOrDecimal256(1), }), - Other: NewConfig(utils.NewUint64(3), admins, nil, nil, + Other: nativeminter.NewConfig(utils.NewUint64(3), admins, nil, nil, map[common.Address]*math.HexOrDecimal256{ common.HexToAddress("0x02"): math.NewHexOrDecimal256(1), }), Expected: false, }, "same config": { - Config: NewConfig(utils.NewUint64(3), admins, nil, nil, + Config: nativeminter.NewConfig(utils.NewUint64(3), admins, nil, nil, map[common.Address]*math.HexOrDecimal256{ common.HexToAddress("0x01"): math.NewHexOrDecimal256(1), }), - Other: NewConfig(utils.NewUint64(3), admins, nil, nil, + Other: nativeminter.NewConfig(utils.NewUint64(3), admins, nil, nil, map[common.Address]*math.HexOrDecimal256{ common.HexToAddress("0x01"): math.NewHexOrDecimal256(1), }), Expected: true, }, } - allowlisttest.EqualPrecompileWithAllowListTests(t, Module, tests) + allowlisttest.EqualPrecompileWithAllowListTests(t, nativeminter.Module, tests) } diff --git a/precompile/contracts/nativeminter/contract_test.go b/precompile/contracts/nativeminter/nativemintertest/contract_test.go similarity index 69% rename from precompile/contracts/nativeminter/contract_test.go rename to precompile/contracts/nativeminter/nativemintertest/contract_test.go index beb4220d62..074eb273f9 100644 --- a/precompile/contracts/nativeminter/contract_test.go +++ b/precompile/contracts/nativeminter/nativemintertest/contract_test.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. -package nativeminter +package nativemintertest import ( "math/big" @@ -16,6 +16,7 @@ import ( "github.com/ava-labs/subnet-evm/core/extstate" "github.com/ava-labs/subnet-evm/precompile/allowlist/allowlisttest" + "github.com/ava-labs/subnet-evm/precompile/contracts/nativeminter" "github.com/ava-labs/subnet-evm/precompile/precompileconfig" "github.com/ava-labs/subnet-evm/precompile/precompiletest" @@ -26,28 +27,28 @@ var tests = []precompiletest.PrecompileTest{ { Name: "calling_mintNativeCoin_from_NoRole_should_fail", Caller: allowlisttest.TestNoRoleAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(nativeminter.Module.Address), InputFn: func(t testing.TB) []byte { - input, err := PackMintNativeCoin(allowlisttest.TestNoRoleAddr, common.Big1) + input, err := nativeminter.PackMintNativeCoin(allowlisttest.TestNoRoleAddr, common.Big1) require.NoError(t, err) return input }, - SuppliedGas: MintGasCost, + SuppliedGas: nativeminter.MintGasCost, ReadOnly: false, - ExpectedErr: ErrCannotMint.Error(), + ExpectedErr: nativeminter.ErrCannotMint.Error(), }, { Name: "calling_mintNativeCoin_from_Enabled_should_succeed", Caller: allowlisttest.TestEnabledAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(nativeminter.Module.Address), InputFn: func(t testing.TB) []byte { - input, err := PackMintNativeCoin(allowlisttest.TestEnabledAddr, common.Big1) + input, err := nativeminter.PackMintNativeCoin(allowlisttest.TestEnabledAddr, common.Big1) require.NoError(t, err) return input }, - SuppliedGas: MintGasCost + NativeCoinMintedEventGasCost, + SuppliedGas: nativeminter.MintGasCost + nativeminter.NativeCoinMintedEventGasCost, ReadOnly: false, ExpectedRes: []byte{}, AfterHook: func(t testing.TB, stateDB *extstate.StateDB) { @@ -61,8 +62,8 @@ var tests = []precompiletest.PrecompileTest{ { Name: "initial_mint_funds", Caller: allowlisttest.TestEnabledAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), - Config: &Config{ + BeforeHook: allowlisttest.SetDefaultRoles(nativeminter.Module.Address), + Config: &nativeminter.Config{ InitialMint: map[common.Address]*math.HexOrDecimal256{ allowlisttest.TestEnabledAddr: math.NewHexOrDecimal256(2), }, @@ -75,14 +76,14 @@ var tests = []precompiletest.PrecompileTest{ { Name: "calling_mintNativeCoin_from_Manager_should_succeed", Caller: allowlisttest.TestManagerAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(nativeminter.Module.Address), InputFn: func(t testing.TB) []byte { - input, err := PackMintNativeCoin(allowlisttest.TestEnabledAddr, common.Big1) + input, err := nativeminter.PackMintNativeCoin(allowlisttest.TestEnabledAddr, common.Big1) require.NoError(t, err) return input }, - SuppliedGas: MintGasCost + NativeCoinMintedEventGasCost, + SuppliedGas: nativeminter.MintGasCost + nativeminter.NativeCoinMintedEventGasCost, ReadOnly: false, ExpectedRes: []byte{}, AfterHook: func(t testing.TB, stateDB *extstate.StateDB) { @@ -96,14 +97,14 @@ var tests = []precompiletest.PrecompileTest{ { Name: "mint_funds_from_admin_address", Caller: allowlisttest.TestAdminAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(nativeminter.Module.Address), InputFn: func(t testing.TB) []byte { - input, err := PackMintNativeCoin(allowlisttest.TestAdminAddr, common.Big1) + input, err := nativeminter.PackMintNativeCoin(allowlisttest.TestAdminAddr, common.Big1) require.NoError(t, err) return input }, - SuppliedGas: MintGasCost + NativeCoinMintedEventGasCost, + SuppliedGas: nativeminter.MintGasCost + nativeminter.NativeCoinMintedEventGasCost, ReadOnly: false, ExpectedRes: []byte{}, AfterHook: func(t testing.TB, stateDB *extstate.StateDB) { @@ -117,14 +118,14 @@ var tests = []precompiletest.PrecompileTest{ { Name: "mint_max_big_funds", Caller: allowlisttest.TestAdminAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(nativeminter.Module.Address), InputFn: func(t testing.TB) []byte { - input, err := PackMintNativeCoin(allowlisttest.TestAdminAddr, math.MaxBig256) + input, err := nativeminter.PackMintNativeCoin(allowlisttest.TestAdminAddr, math.MaxBig256) require.NoError(t, err) return input }, - SuppliedGas: MintGasCost + NativeCoinMintedEventGasCost, + SuppliedGas: nativeminter.MintGasCost + nativeminter.NativeCoinMintedEventGasCost, ReadOnly: false, ExpectedRes: []byte{}, AfterHook: func(t testing.TB, stateDB *extstate.StateDB) { @@ -138,74 +139,74 @@ var tests = []precompiletest.PrecompileTest{ { Name: "readOnly_mint_with_noRole_fails", Caller: allowlisttest.TestNoRoleAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(nativeminter.Module.Address), InputFn: func(t testing.TB) []byte { - input, err := PackMintNativeCoin(allowlisttest.TestAdminAddr, common.Big1) + input, err := nativeminter.PackMintNativeCoin(allowlisttest.TestAdminAddr, common.Big1) require.NoError(t, err) return input }, - SuppliedGas: MintGasCost, + SuppliedGas: nativeminter.MintGasCost, ReadOnly: true, ExpectedErr: vm.ErrWriteProtection.Error(), }, { Name: "readOnly_mint_with_allow_role_fails", Caller: allowlisttest.TestEnabledAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(nativeminter.Module.Address), InputFn: func(t testing.TB) []byte { - input, err := PackMintNativeCoin(allowlisttest.TestEnabledAddr, common.Big1) + input, err := nativeminter.PackMintNativeCoin(allowlisttest.TestEnabledAddr, common.Big1) require.NoError(t, err) return input }, - SuppliedGas: MintGasCost, + SuppliedGas: nativeminter.MintGasCost, ReadOnly: true, ExpectedErr: vm.ErrWriteProtection.Error(), }, { Name: "readOnly_mint_with_admin_role_fails", Caller: allowlisttest.TestAdminAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(nativeminter.Module.Address), InputFn: func(t testing.TB) []byte { - input, err := PackMintNativeCoin(allowlisttest.TestAdminAddr, common.Big1) + input, err := nativeminter.PackMintNativeCoin(allowlisttest.TestAdminAddr, common.Big1) require.NoError(t, err) return input }, - SuppliedGas: MintGasCost, + SuppliedGas: nativeminter.MintGasCost, ReadOnly: true, ExpectedErr: vm.ErrWriteProtection.Error(), }, { Name: "insufficient_gas_mint_from_admin", Caller: allowlisttest.TestAdminAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(nativeminter.Module.Address), InputFn: func(t testing.TB) []byte { - input, err := PackMintNativeCoin(allowlisttest.TestEnabledAddr, common.Big1) + input, err := nativeminter.PackMintNativeCoin(allowlisttest.TestEnabledAddr, common.Big1) require.NoError(t, err) return input }, - SuppliedGas: MintGasCost + NativeCoinMintedEventGasCost - 1, + SuppliedGas: nativeminter.MintGasCost + nativeminter.NativeCoinMintedEventGasCost - 1, ReadOnly: false, ExpectedErr: vm.ErrOutOfGas.Error(), }, { Name: "mint_does_not_log_pre_Durango", Caller: allowlisttest.TestEnabledAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(nativeminter.Module.Address), ChainConfigFn: func(ctrl *gomock.Controller) precompileconfig.ChainConfig { config := precompileconfig.NewMockChainConfig(ctrl) config.EXPECT().IsDurango(gomock.Any()).Return(false).AnyTimes() return config }, InputFn: func(t testing.TB) []byte { - input, err := PackMintNativeCoin(allowlisttest.TestEnabledAddr, common.Big1) + input, err := nativeminter.PackMintNativeCoin(allowlisttest.TestEnabledAddr, common.Big1) require.NoError(t, err) return input }, - SuppliedGas: MintGasCost, + SuppliedGas: nativeminter.MintGasCost, ReadOnly: false, ExpectedRes: []byte{}, AfterHook: func(t testing.TB, stateDB *extstate.StateDB) { @@ -217,14 +218,14 @@ var tests = []precompiletest.PrecompileTest{ { Name: "mint_with_extra_padded_bytes_should_fail_pre_Durango", Caller: allowlisttest.TestEnabledAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(nativeminter.Module.Address), ChainConfigFn: func(ctrl *gomock.Controller) precompileconfig.ChainConfig { config := precompileconfig.NewMockChainConfig(ctrl) config.EXPECT().IsDurango(gomock.Any()).Return(false).AnyTimes() return config }, InputFn: func(t testing.TB) []byte { - input, err := PackMintNativeCoin(allowlisttest.TestEnabledAddr, common.Big1) + input, err := nativeminter.PackMintNativeCoin(allowlisttest.TestEnabledAddr, common.Big1) require.NoError(t, err) // Add extra bytes to the end of the input @@ -232,21 +233,21 @@ var tests = []precompiletest.PrecompileTest{ return input }, - SuppliedGas: MintGasCost, + SuppliedGas: nativeminter.MintGasCost, ReadOnly: false, - ExpectedErr: ErrInvalidLen.Error(), + ExpectedErr: nativeminter.ErrInvalidLen.Error(), }, { Name: "mint_with_extra_padded_bytes_should_succeed_with_Durango", Caller: allowlisttest.TestEnabledAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(nativeminter.Module.Address), ChainConfigFn: func(ctrl *gomock.Controller) precompileconfig.ChainConfig { config := precompileconfig.NewMockChainConfig(ctrl) config.EXPECT().IsDurango(gomock.Any()).Return(true).AnyTimes() return config }, InputFn: func(t testing.TB) []byte { - input, err := PackMintNativeCoin(allowlisttest.TestEnabledAddr, common.Big1) + input, err := nativeminter.PackMintNativeCoin(allowlisttest.TestEnabledAddr, common.Big1) require.NoError(t, err) // Add extra bytes to the end of the input @@ -255,7 +256,7 @@ var tests = []precompiletest.PrecompileTest{ return input }, ExpectedRes: []byte{}, - SuppliedGas: MintGasCost + NativeCoinMintedEventGasCost, + SuppliedGas: nativeminter.MintGasCost + nativeminter.NativeCoinMintedEventGasCost, ReadOnly: false, AfterHook: func(t testing.TB, state *extstate.StateDB) { expected := uint256.MustFromBig(common.Big1) @@ -268,7 +269,7 @@ var tests = []precompiletest.PrecompileTest{ } func TestContractNativeMinterRun(t *testing.T) { - allowlisttest.RunPrecompileWithAllowListTests(t, Module, tests) + allowlisttest.RunPrecompileWithAllowListTests(t, nativeminter.Module, tests) } func assertNativeCoinMintedEvent(t testing.TB, @@ -282,14 +283,14 @@ func assertNativeCoinMintedEvent(t testing.TB, require.Equal( t, []common.Hash{ - NativeMinterABI.Events["NativeCoinMinted"].ID, + nativeminter.NativeMinterABI.Events["NativeCoinMinted"].ID, common.BytesToHash(expectedSender[:]), common.BytesToHash(expectedRecipient[:]), }, log.Topics, ) require.NotEmpty(t, log.Data) - amount, err := UnpackNativeCoinMintedEventData(log.Data) + amount, err := nativeminter.UnpackNativeCoinMintedEventData(log.Data) require.NoError(t, err) require.Zero(t, expectedAmount.Cmp(amount), "expected", expectedAmount, "got", amount) } diff --git a/precompile/contracts/nativeminter/nativemintertest/gen_erc20nativemintertest_binding.go b/precompile/contracts/nativeminter/nativemintertest/gen_erc20nativemintertest_binding.go new file mode 100644 index 0000000000..80862c1ac6 --- /dev/null +++ b/precompile/contracts/nativeminter/nativemintertest/gen_erc20nativemintertest_binding.go @@ -0,0 +1,1537 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package nativemintertest + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ava-labs/libevm" + "github.com/ava-labs/subnet-evm/accounts/abi" + "github.com/ava-labs/subnet-evm/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 +) + +// ERC20NativeMinterTestMetaData contains all meta data concerning the ERC20NativeMinterTest contract. +var ERC20NativeMinterTestMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nativeMinterPrecompile\",\"type\":\"address\"},{\"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: "0x608060405234801561001057600080fd5b50604051612898380380612898833981810160405281019061003291906105ea565b81336040518060400160405280601681526020017f45524332304e61746976654d696e746572546f6b656e000000000000000000008152506040518060400160405280600481526020017f584d504c0000000000000000000000000000000000000000000000000000000081525081600390816100af9190610870565b5080600490816100bf9190610870565b505050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036101345760006040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260040161012b9190610951565b60405180910390fd5b610143816101de60201b60201c565b5080600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505081600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506101d733826102a460201b60201c565b5050610a30565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036103165760006040517fec442f0500000000000000000000000000000000000000000000000000000000815260040161030d9190610951565b60405180910390fd5b6103286000838361032c60201b60201c565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361037e578060026000828254610372919061099b565b92505081905550610451565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561040a578381836040517fe450d38c000000000000000000000000000000000000000000000000000000008152600401610401939291906109de565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361049a57806002600082825403925050819055506104e7565b806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516105449190610a15565b60405180910390a3505050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061058182610556565b9050919050565b61059181610576565b811461059c57600080fd5b50565b6000815190506105ae81610588565b92915050565b6000819050919050565b6105c7816105b4565b81146105d257600080fd5b50565b6000815190506105e4816105be565b92915050565b6000806040838503121561060157610600610551565b5b600061060f8582860161059f565b9250506020610620858286016105d5565b9150509250929050565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806106ab57607f821691505b6020821081036106be576106bd610664565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026107267fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826106e9565b61073086836106e9565b95508019841693508086168417925050509392505050565b6000819050919050565b600061076d610768610763846105b4565b610748565b6105b4565b9050919050565b6000819050919050565b61078783610752565b61079b61079382610774565b8484546106f6565b825550505050565b600090565b6107b06107a3565b6107bb81848461077e565b505050565b5b818110156107df576107d46000826107a8565b6001810190506107c1565b5050565b601f821115610824576107f5816106c4565b6107fe846106d9565b8101602085101561080d578190505b610821610819856106d9565b8301826107c0565b50505b505050565b600082821c905092915050565b600061084760001984600802610829565b1980831691505092915050565b60006108608383610836565b9150826002028217905092915050565b6108798261062a565b67ffffffffffffffff81111561089257610891610635565b5b61089c8254610693565b6108a78282856107e3565b600060209050601f8311600181146108da57600084156108c8578287015190505b6108d28582610854565b86555061093a565b601f1984166108e8866106c4565b60005b82811015610910578489015182556001820191506020850194506020810190506108eb565b8683101561092d5784890151610929601f891682610836565b8355505b6001600288020188555050505b505050505050565b61094b81610576565b82525050565b60006020820190506109666000830184610942565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006109a6826105b4565b91506109b1836105b4565b92508282019050808211156109c9576109c861096c565b5b92915050565b6109d8816105b4565b82525050565b60006060820190506109f36000830186610942565b610a0060208301856109cf565b610a0d60408301846109cf565b949350505050565b6000602082019050610a2a60008301846109cf565b92915050565b611e5980610a3f6000396000f3fe6080604052600436106101405760003560e01c8063715018a6116100b6578063a9059cbb1161006f578063a9059cbb1461045a578063d0e30db014610497578063d0ebdbe7146104a1578063dd62ed3e146104ca578063f2fde38b14610507578063f3ae24151461053057610140565b8063715018a61461035e57806374a8f103146103755780638da5cb5b1461039e5780639015d371146103c957806395d89b41146104065780639dc29fac1461043157610140565b806323b872dd1161010857806323b872dd1461022a57806324d7806c14610267578063313ce567146102a457806340c10f19146102cf578063704b6c02146102f857806370a082311461032157610140565b80630356b6cd1461014557806306fdde031461016e578063095ea7b3146101995780630aaf7043146101d657806318160ddd146101ff575b600080fd5b34801561015157600080fd5b5061016c600480360381019061016791906118e8565b61056d565b005b34801561017a57600080fd5b50610183610657565b60405161019091906119a5565b60405180910390f35b3480156101a557600080fd5b506101c060048036038101906101bb9190611a25565b6106e9565b6040516101cd9190611a80565b60405180910390f35b3480156101e257600080fd5b506101fd60048036038101906101f89190611a9b565b61070c565b005b34801561020b57600080fd5b50610214610770565b6040516102219190611ad7565b60405180910390f35b34801561023657600080fd5b50610251600480360381019061024c9190611af2565b61077a565b60405161025e9190611a80565b60405180910390f35b34801561027357600080fd5b5061028e60048036038101906102899190611a9b565b6107a9565b60405161029b9190611a80565b60405180910390f35b3480156102b057600080fd5b506102b9610856565b6040516102c69190611b61565b60405180910390f35b3480156102db57600080fd5b506102f660048036038101906102f19190611a25565b61085f565b005b34801561030457600080fd5b5061031f600480360381019061031a9190611a9b565b610875565b005b34801561032d57600080fd5b5061034860048036038101906103439190611a9b565b6108d9565b6040516103559190611ad7565b60405180910390f35b34801561036a57600080fd5b50610373610921565b005b34801561038157600080fd5b5061039c60048036038101906103979190611a9b565b610935565b005b3480156103aa57600080fd5b506103b3610999565b6040516103c09190611b8b565b60405180910390f35b3480156103d557600080fd5b506103f060048036038101906103eb9190611a9b565b6109c3565b6040516103fd9190611a80565b60405180910390f35b34801561041257600080fd5b5061041b610a71565b60405161042891906119a5565b60405180910390f35b34801561043d57600080fd5b5061045860048036038101906104539190611a25565b610b03565b005b34801561046657600080fd5b50610481600480360381019061047c9190611a25565b610b19565b60405161048e9190611a80565b60405180910390f35b61049f610b3c565b005b3480156104ad57600080fd5b506104c860048036038101906104c39190611a9b565b610bf1565b005b3480156104d657600080fd5b506104f160048036038101906104ec9190611ba6565b610c55565b6040516104fe9190611ad7565b60405180910390f35b34801561051357600080fd5b5061052e60048036038101906105299190611a9b565b610cdc565b005b34801561053c57600080fd5b5061055760048036038101906105529190611a9b565b610d62565b6040516105649190611a80565b60405180910390f35b6105773382610e0f565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634f5aaaba33836040518363ffffffff1660e01b81526004016105d4929190611be6565b600060405180830381600087803b1580156105ee57600080fd5b505af1158015610602573d6000803e3d6000fd5b505050503373ffffffffffffffffffffffffffffffffffffffff167f25bedde6c8ebd3a89b719a16299dbfe271c7bffa42fe1ac1a52e15ab0cb767e68260405161064c9190611ad7565b60405180910390a250565b60606003805461066690611c3e565b80601f016020809104026020016040519081016040528092919081815260200182805461069290611c3e565b80156106df5780601f106106b4576101008083540402835291602001916106df565b820191906000526020600020905b8154815290600101906020018083116106c257829003601f168201915b5050505050905090565b6000806106f4610e91565b9050610701818585610e99565b600191505092915050565b610715336107a9565b80610725575061072433610d62565b5b610764576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161075b90611cbb565b60405180910390fd5b61076d81610eab565b50565b6000600254905090565b600080610785610e91565b9050610792858285610f3b565b61079d858585610fd0565b60019150509392505050565b600080600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b81526004016108079190611b8b565b602060405180830381865afa158015610824573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108489190611cf0565b905060028114915050919050565b60006012905090565b6108676110c4565b610871828261114b565b5050565b61087e336107a9565b8061088e575061088d33610d62565b5b6108cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108c490611cbb565b60405180910390fd5b6108d6816111cd565b50565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6109296110c4565b610933600061125d565b565b61093e336107a9565b8061094e575061094d33610d62565b5b61098d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161098490611cbb565b60405180910390fd5b61099681611323565b50565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b8152600401610a219190611b8b565b602060405180830381865afa158015610a3e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a629190611cf0565b90506000811415915050919050565b606060048054610a8090611c3e565b80601f0160208091040260200160405190810160405280929190818152602001828054610aac90611c3e565b8015610af95780601f10610ace57610100808354040283529160200191610af9565b820191906000526020600020905b815481529060010190602001808311610adc57829003601f168201915b5050505050905090565b610b0b6110c4565b610b158282610e0f565b5050565b600080610b24610e91565b9050610b31818585610fd0565b600191505092915050565b73010000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015610b96573d6000803e3d6000fd5b50610ba1333461114b565b3373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c34604051610be79190611ad7565b60405180910390a2565b610bfa336107a9565b80610c0a5750610c0933610d62565b5b610c49576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c4090611cbb565b60405180910390fd5b610c5281611421565b50565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610ce46110c4565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610d565760006040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401610d4d9190611b8b565b60405180910390fd5b610d5f8161125d565b50565b600080600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b8152600401610dc09190611b8b565b602060405180830381865afa158015610ddd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e019190611cf0565b905060038114915050919050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610e815760006040517f96c6fd1e000000000000000000000000000000000000000000000000000000008152600401610e789190611b8b565b60405180910390fd5b610e8d826000836114b1565b5050565b600033905090565b610ea683838360016116d6565b505050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630aaf7043826040518263ffffffff1660e01b8152600401610f069190611b8b565b600060405180830381600087803b158015610f2057600080fd5b505af1158015610f34573d6000803e3d6000fd5b5050505050565b6000610f478484610c55565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811015610fca5781811015610fba578281836040517ffb8f41b2000000000000000000000000000000000000000000000000000000008152600401610fb193929190611d1d565b60405180910390fd5b610fc9848484840360006116d6565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036110425760006040517f96c6fd1e0000000000000000000000000000000000000000000000000000000081526004016110399190611b8b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036110b45760006040517fec442f050000000000000000000000000000000000000000000000000000000081526004016110ab9190611b8b565b60405180910390fd5b6110bf8383836114b1565b505050565b6110cc610e91565b73ffffffffffffffffffffffffffffffffffffffff166110ea610999565b73ffffffffffffffffffffffffffffffffffffffff16146111495761110d610e91565b6040517f118cdaa70000000000000000000000000000000000000000000000000000000081526004016111409190611b8b565b60405180910390fd5b565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036111bd5760006040517fec442f050000000000000000000000000000000000000000000000000000000081526004016111b49190611b8b565b60405180910390fd5b6111c9600083836114b1565b5050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663704b6c02826040518263ffffffff1660e01b81526004016112289190611b8b565b600060405180830381600087803b15801561124257600080fd5b505af1158015611256573d6000803e3d6000fd5b5050505050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b8073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1603611391576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138890611da0565b60405180910390fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638c6bfb3b826040518263ffffffff1660e01b81526004016113ec9190611b8b565b600060405180830381600087803b15801561140657600080fd5b505af115801561141a573d6000803e3d6000fd5b5050505050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0ebdbe7826040518263ffffffff1660e01b815260040161147c9190611b8b565b600060405180830381600087803b15801561149657600080fd5b505af11580156114aa573d6000803e3d6000fd5b5050505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036115035780600260008282546114f79190611def565b925050819055506115d6565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561158f578381836040517fe450d38c00000000000000000000000000000000000000000000000000000000815260040161158693929190611d1d565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361161f578060026000828254039250508190555061166c565b806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516116c99190611ad7565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16036117485760006040517fe602df0500000000000000000000000000000000000000000000000000000000815260040161173f9190611b8b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036117ba5760006040517f94280d620000000000000000000000000000000000000000000000000000000081526004016117b19190611b8b565b60405180910390fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080156118a7578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405161189e9190611ad7565b60405180910390a35b50505050565b600080fd5b6000819050919050565b6118c5816118b2565b81146118d057600080fd5b50565b6000813590506118e2816118bc565b92915050565b6000602082840312156118fe576118fd6118ad565b5b600061190c848285016118d3565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561194f578082015181840152602081019050611934565b60008484015250505050565b6000601f19601f8301169050919050565b600061197782611915565b6119818185611920565b9350611991818560208601611931565b61199a8161195b565b840191505092915050565b600060208201905081810360008301526119bf818461196c565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006119f2826119c7565b9050919050565b611a02816119e7565b8114611a0d57600080fd5b50565b600081359050611a1f816119f9565b92915050565b60008060408385031215611a3c57611a3b6118ad565b5b6000611a4a85828601611a10565b9250506020611a5b858286016118d3565b9150509250929050565b60008115159050919050565b611a7a81611a65565b82525050565b6000602082019050611a956000830184611a71565b92915050565b600060208284031215611ab157611ab06118ad565b5b6000611abf84828501611a10565b91505092915050565b611ad1816118b2565b82525050565b6000602082019050611aec6000830184611ac8565b92915050565b600080600060608486031215611b0b57611b0a6118ad565b5b6000611b1986828701611a10565b9350506020611b2a86828701611a10565b9250506040611b3b868287016118d3565b9150509250925092565b600060ff82169050919050565b611b5b81611b45565b82525050565b6000602082019050611b766000830184611b52565b92915050565b611b85816119e7565b82525050565b6000602082019050611ba06000830184611b7c565b92915050565b60008060408385031215611bbd57611bbc6118ad565b5b6000611bcb85828601611a10565b9250506020611bdc85828601611a10565b9150509250929050565b6000604082019050611bfb6000830185611b7c565b611c086020830184611ac8565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680611c5657607f821691505b602082108103611c6957611c68611c0f565b5b50919050565b7f63616e6e6f74206d6f6469667920616c6c6f77206c6973740000000000000000600082015250565b6000611ca5601883611920565b9150611cb082611c6f565b602082019050919050565b60006020820190508181036000830152611cd481611c98565b9050919050565b600081519050611cea816118bc565b92915050565b600060208284031215611d0657611d056118ad565b5b6000611d1484828501611cdb565b91505092915050565b6000606082019050611d326000830186611b7c565b611d3f6020830185611ac8565b611d4c6040830184611ac8565b949350505050565b7f63616e6e6f74207265766f6b65206f776e20726f6c6500000000000000000000600082015250565b6000611d8a601683611920565b9150611d9582611d54565b602082019050919050565b60006020820190508181036000830152611db981611d7d565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611dfa826118b2565b9150611e05836118b2565b9250828201905080821115611e1d57611e1c611dc0565b5b9291505056fea2646970667358221220d951a00d4131bbe3db6a9977d69f9acbbf24acb083de98cea08b44067634691964736f6c634300081e0033", +} + +// ERC20NativeMinterTestABI is the input ABI used to generate the binding from. +// Deprecated: Use ERC20NativeMinterTestMetaData.ABI instead. +var ERC20NativeMinterTestABI = ERC20NativeMinterTestMetaData.ABI + +// ERC20NativeMinterTestBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use ERC20NativeMinterTestMetaData.Bin instead. +var ERC20NativeMinterTestBin = ERC20NativeMinterTestMetaData.Bin + +// DeployERC20NativeMinterTest deploys a new Ethereum contract, binding an instance of ERC20NativeMinterTest to it. +func DeployERC20NativeMinterTest(auth *bind.TransactOpts, backend bind.ContractBackend, nativeMinterPrecompile common.Address, initSupply *big.Int) (common.Address, *types.Transaction, *ERC20NativeMinterTest, error) { + parsed, err := ERC20NativeMinterTestMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(ERC20NativeMinterTestBin), backend, nativeMinterPrecompile, initSupply) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &ERC20NativeMinterTest{ERC20NativeMinterTestCaller: ERC20NativeMinterTestCaller{contract: contract}, ERC20NativeMinterTestTransactor: ERC20NativeMinterTestTransactor{contract: contract}, ERC20NativeMinterTestFilterer: ERC20NativeMinterTestFilterer{contract: contract}}, nil +} + +// ERC20NativeMinterTest is an auto generated Go binding around an Ethereum contract. +type ERC20NativeMinterTest struct { + ERC20NativeMinterTestCaller // Read-only binding to the contract + ERC20NativeMinterTestTransactor // Write-only binding to the contract + ERC20NativeMinterTestFilterer // Log filterer for contract events +} + +// ERC20NativeMinterTestCaller is an auto generated read-only Go binding around an Ethereum contract. +type ERC20NativeMinterTestCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ERC20NativeMinterTestTransactor is an auto generated write-only Go binding around an Ethereum contract. +type ERC20NativeMinterTestTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ERC20NativeMinterTestFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type ERC20NativeMinterTestFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ERC20NativeMinterTestSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type ERC20NativeMinterTestSession struct { + Contract *ERC20NativeMinterTest // 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 +} + +// ERC20NativeMinterTestCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type ERC20NativeMinterTestCallerSession struct { + Contract *ERC20NativeMinterTestCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// ERC20NativeMinterTestTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type ERC20NativeMinterTestTransactorSession struct { + Contract *ERC20NativeMinterTestTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// ERC20NativeMinterTestRaw is an auto generated low-level Go binding around an Ethereum contract. +type ERC20NativeMinterTestRaw struct { + Contract *ERC20NativeMinterTest // Generic contract binding to access the raw methods on +} + +// ERC20NativeMinterTestCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type ERC20NativeMinterTestCallerRaw struct { + Contract *ERC20NativeMinterTestCaller // Generic read-only contract binding to access the raw methods on +} + +// ERC20NativeMinterTestTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type ERC20NativeMinterTestTransactorRaw struct { + Contract *ERC20NativeMinterTestTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewERC20NativeMinterTest creates a new instance of ERC20NativeMinterTest, bound to a specific deployed contract. +func NewERC20NativeMinterTest(address common.Address, backend bind.ContractBackend) (*ERC20NativeMinterTest, error) { + contract, err := bindERC20NativeMinterTest(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &ERC20NativeMinterTest{ERC20NativeMinterTestCaller: ERC20NativeMinterTestCaller{contract: contract}, ERC20NativeMinterTestTransactor: ERC20NativeMinterTestTransactor{contract: contract}, ERC20NativeMinterTestFilterer: ERC20NativeMinterTestFilterer{contract: contract}}, nil +} + +// NewERC20NativeMinterTestCaller creates a new read-only instance of ERC20NativeMinterTest, bound to a specific deployed contract. +func NewERC20NativeMinterTestCaller(address common.Address, caller bind.ContractCaller) (*ERC20NativeMinterTestCaller, error) { + contract, err := bindERC20NativeMinterTest(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &ERC20NativeMinterTestCaller{contract: contract}, nil +} + +// NewERC20NativeMinterTestTransactor creates a new write-only instance of ERC20NativeMinterTest, bound to a specific deployed contract. +func NewERC20NativeMinterTestTransactor(address common.Address, transactor bind.ContractTransactor) (*ERC20NativeMinterTestTransactor, error) { + contract, err := bindERC20NativeMinterTest(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &ERC20NativeMinterTestTransactor{contract: contract}, nil +} + +// NewERC20NativeMinterTestFilterer creates a new log filterer instance of ERC20NativeMinterTest, bound to a specific deployed contract. +func NewERC20NativeMinterTestFilterer(address common.Address, filterer bind.ContractFilterer) (*ERC20NativeMinterTestFilterer, error) { + contract, err := bindERC20NativeMinterTest(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &ERC20NativeMinterTestFilterer{contract: contract}, nil +} + +// bindERC20NativeMinterTest binds a generic wrapper to an already deployed contract. +func bindERC20NativeMinterTest(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := ERC20NativeMinterTestMetaData.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 (_ERC20NativeMinterTest *ERC20NativeMinterTestRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _ERC20NativeMinterTest.Contract.ERC20NativeMinterTestCaller.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 (_ERC20NativeMinterTest *ERC20NativeMinterTestRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ERC20NativeMinterTest.Contract.ERC20NativeMinterTestTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_ERC20NativeMinterTest *ERC20NativeMinterTestRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ERC20NativeMinterTest.Contract.ERC20NativeMinterTestTransactor.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 (_ERC20NativeMinterTest *ERC20NativeMinterTestCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _ERC20NativeMinterTest.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 (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ERC20NativeMinterTest.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ERC20NativeMinterTest.Contract.contract.Transact(opts, method, params...) +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) view returns(uint256) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestCaller) Allowance(opts *bind.CallOpts, owner common.Address, spender common.Address) (*big.Int, error) { + var out []interface{} + err := _ERC20NativeMinterTest.contract.Call(opts, &out, "allowance", owner, spender) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) view returns(uint256) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { + return _ERC20NativeMinterTest.Contract.Allowance(&_ERC20NativeMinterTest.CallOpts, owner, spender) +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) view returns(uint256) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestCallerSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { + return _ERC20NativeMinterTest.Contract.Allowance(&_ERC20NativeMinterTest.CallOpts, owner, spender) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) view returns(uint256) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestCaller) BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) { + var out []interface{} + err := _ERC20NativeMinterTest.contract.Call(opts, &out, "balanceOf", account) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) view returns(uint256) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestSession) BalanceOf(account common.Address) (*big.Int, error) { + return _ERC20NativeMinterTest.Contract.BalanceOf(&_ERC20NativeMinterTest.CallOpts, account) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) view returns(uint256) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestCallerSession) BalanceOf(account common.Address) (*big.Int, error) { + return _ERC20NativeMinterTest.Contract.BalanceOf(&_ERC20NativeMinterTest.CallOpts, account) +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestCaller) Decimals(opts *bind.CallOpts) (uint8, error) { + var out []interface{} + err := _ERC20NativeMinterTest.contract.Call(opts, &out, "decimals") + + if err != nil { + return *new(uint8), err + } + + out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) + + return out0, err + +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestSession) Decimals() (uint8, error) { + return _ERC20NativeMinterTest.Contract.Decimals(&_ERC20NativeMinterTest.CallOpts) +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestCallerSession) Decimals() (uint8, error) { + return _ERC20NativeMinterTest.Contract.Decimals(&_ERC20NativeMinterTest.CallOpts) +} + +// IsAdmin is a free data retrieval call binding the contract method 0x24d7806c. +// +// Solidity: function isAdmin(address addr) view returns(bool) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestCaller) IsAdmin(opts *bind.CallOpts, addr common.Address) (bool, error) { + var out []interface{} + err := _ERC20NativeMinterTest.contract.Call(opts, &out, "isAdmin", addr) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsAdmin is a free data retrieval call binding the contract method 0x24d7806c. +// +// Solidity: function isAdmin(address addr) view returns(bool) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestSession) IsAdmin(addr common.Address) (bool, error) { + return _ERC20NativeMinterTest.Contract.IsAdmin(&_ERC20NativeMinterTest.CallOpts, addr) +} + +// IsAdmin is a free data retrieval call binding the contract method 0x24d7806c. +// +// Solidity: function isAdmin(address addr) view returns(bool) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestCallerSession) IsAdmin(addr common.Address) (bool, error) { + return _ERC20NativeMinterTest.Contract.IsAdmin(&_ERC20NativeMinterTest.CallOpts, addr) +} + +// IsEnabled is a free data retrieval call binding the contract method 0x9015d371. +// +// Solidity: function isEnabled(address addr) view returns(bool) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestCaller) IsEnabled(opts *bind.CallOpts, addr common.Address) (bool, error) { + var out []interface{} + err := _ERC20NativeMinterTest.contract.Call(opts, &out, "isEnabled", addr) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsEnabled is a free data retrieval call binding the contract method 0x9015d371. +// +// Solidity: function isEnabled(address addr) view returns(bool) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestSession) IsEnabled(addr common.Address) (bool, error) { + return _ERC20NativeMinterTest.Contract.IsEnabled(&_ERC20NativeMinterTest.CallOpts, addr) +} + +// IsEnabled is a free data retrieval call binding the contract method 0x9015d371. +// +// Solidity: function isEnabled(address addr) view returns(bool) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestCallerSession) IsEnabled(addr common.Address) (bool, error) { + return _ERC20NativeMinterTest.Contract.IsEnabled(&_ERC20NativeMinterTest.CallOpts, addr) +} + +// IsManager is a free data retrieval call binding the contract method 0xf3ae2415. +// +// Solidity: function isManager(address addr) view returns(bool) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestCaller) IsManager(opts *bind.CallOpts, addr common.Address) (bool, error) { + var out []interface{} + err := _ERC20NativeMinterTest.contract.Call(opts, &out, "isManager", addr) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsManager is a free data retrieval call binding the contract method 0xf3ae2415. +// +// Solidity: function isManager(address addr) view returns(bool) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestSession) IsManager(addr common.Address) (bool, error) { + return _ERC20NativeMinterTest.Contract.IsManager(&_ERC20NativeMinterTest.CallOpts, addr) +} + +// IsManager is a free data retrieval call binding the contract method 0xf3ae2415. +// +// Solidity: function isManager(address addr) view returns(bool) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestCallerSession) IsManager(addr common.Address) (bool, error) { + return _ERC20NativeMinterTest.Contract.IsManager(&_ERC20NativeMinterTest.CallOpts, addr) +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestCaller) Name(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _ERC20NativeMinterTest.contract.Call(opts, &out, "name") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestSession) Name() (string, error) { + return _ERC20NativeMinterTest.Contract.Name(&_ERC20NativeMinterTest.CallOpts) +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestCallerSession) Name() (string, error) { + return _ERC20NativeMinterTest.Contract.Name(&_ERC20NativeMinterTest.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _ERC20NativeMinterTest.contract.Call(opts, &out, "owner") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestSession) Owner() (common.Address, error) { + return _ERC20NativeMinterTest.Contract.Owner(&_ERC20NativeMinterTest.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestCallerSession) Owner() (common.Address, error) { + return _ERC20NativeMinterTest.Contract.Owner(&_ERC20NativeMinterTest.CallOpts) +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestCaller) Symbol(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _ERC20NativeMinterTest.contract.Call(opts, &out, "symbol") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestSession) Symbol() (string, error) { + return _ERC20NativeMinterTest.Contract.Symbol(&_ERC20NativeMinterTest.CallOpts) +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestCallerSession) Symbol() (string, error) { + return _ERC20NativeMinterTest.Contract.Symbol(&_ERC20NativeMinterTest.CallOpts) +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestCaller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _ERC20NativeMinterTest.contract.Call(opts, &out, "totalSupply") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestSession) TotalSupply() (*big.Int, error) { + return _ERC20NativeMinterTest.Contract.TotalSupply(&_ERC20NativeMinterTest.CallOpts) +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestCallerSession) TotalSupply() (*big.Int, error) { + return _ERC20NativeMinterTest.Contract.TotalSupply(&_ERC20NativeMinterTest.CallOpts) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 value) returns(bool) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactor) Approve(opts *bind.TransactOpts, spender common.Address, value *big.Int) (*types.Transaction, error) { + return _ERC20NativeMinterTest.contract.Transact(opts, "approve", spender, value) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 value) returns(bool) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestSession) Approve(spender common.Address, value *big.Int) (*types.Transaction, error) { + return _ERC20NativeMinterTest.Contract.Approve(&_ERC20NativeMinterTest.TransactOpts, spender, value) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 value) returns(bool) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactorSession) Approve(spender common.Address, value *big.Int) (*types.Transaction, error) { + return _ERC20NativeMinterTest.Contract.Approve(&_ERC20NativeMinterTest.TransactOpts, spender, value) +} + +// Burn is a paid mutator transaction binding the contract method 0x9dc29fac. +// +// Solidity: function burn(address from, uint256 amount) returns() +func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactor) Burn(opts *bind.TransactOpts, from common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20NativeMinterTest.contract.Transact(opts, "burn", from, amount) +} + +// Burn is a paid mutator transaction binding the contract method 0x9dc29fac. +// +// Solidity: function burn(address from, uint256 amount) returns() +func (_ERC20NativeMinterTest *ERC20NativeMinterTestSession) Burn(from common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20NativeMinterTest.Contract.Burn(&_ERC20NativeMinterTest.TransactOpts, from, amount) +} + +// Burn is a paid mutator transaction binding the contract method 0x9dc29fac. +// +// Solidity: function burn(address from, uint256 amount) returns() +func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactorSession) Burn(from common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20NativeMinterTest.Contract.Burn(&_ERC20NativeMinterTest.TransactOpts, from, amount) +} + +// Deposit is a paid mutator transaction binding the contract method 0xd0e30db0. +// +// Solidity: function deposit() payable returns() +func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactor) Deposit(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ERC20NativeMinterTest.contract.Transact(opts, "deposit") +} + +// Deposit is a paid mutator transaction binding the contract method 0xd0e30db0. +// +// Solidity: function deposit() payable returns() +func (_ERC20NativeMinterTest *ERC20NativeMinterTestSession) Deposit() (*types.Transaction, error) { + return _ERC20NativeMinterTest.Contract.Deposit(&_ERC20NativeMinterTest.TransactOpts) +} + +// Deposit is a paid mutator transaction binding the contract method 0xd0e30db0. +// +// Solidity: function deposit() payable returns() +func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactorSession) Deposit() (*types.Transaction, error) { + return _ERC20NativeMinterTest.Contract.Deposit(&_ERC20NativeMinterTest.TransactOpts) +} + +// Mint is a paid mutator transaction binding the contract method 0x40c10f19. +// +// Solidity: function mint(address to, uint256 amount) returns() +func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactor) Mint(opts *bind.TransactOpts, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20NativeMinterTest.contract.Transact(opts, "mint", to, amount) +} + +// Mint is a paid mutator transaction binding the contract method 0x40c10f19. +// +// Solidity: function mint(address to, uint256 amount) returns() +func (_ERC20NativeMinterTest *ERC20NativeMinterTestSession) Mint(to common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20NativeMinterTest.Contract.Mint(&_ERC20NativeMinterTest.TransactOpts, to, amount) +} + +// Mint is a paid mutator transaction binding the contract method 0x40c10f19. +// +// Solidity: function mint(address to, uint256 amount) returns() +func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactorSession) Mint(to common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20NativeMinterTest.Contract.Mint(&_ERC20NativeMinterTest.TransactOpts, to, amount) +} + +// Mintdraw is a paid mutator transaction binding the contract method 0x0356b6cd. +// +// Solidity: function mintdraw(uint256 wad) returns() +func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactor) Mintdraw(opts *bind.TransactOpts, wad *big.Int) (*types.Transaction, error) { + return _ERC20NativeMinterTest.contract.Transact(opts, "mintdraw", wad) +} + +// Mintdraw is a paid mutator transaction binding the contract method 0x0356b6cd. +// +// Solidity: function mintdraw(uint256 wad) returns() +func (_ERC20NativeMinterTest *ERC20NativeMinterTestSession) Mintdraw(wad *big.Int) (*types.Transaction, error) { + return _ERC20NativeMinterTest.Contract.Mintdraw(&_ERC20NativeMinterTest.TransactOpts, wad) +} + +// Mintdraw is a paid mutator transaction binding the contract method 0x0356b6cd. +// +// Solidity: function mintdraw(uint256 wad) returns() +func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactorSession) Mintdraw(wad *big.Int) (*types.Transaction, error) { + return _ERC20NativeMinterTest.Contract.Mintdraw(&_ERC20NativeMinterTest.TransactOpts, wad) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ERC20NativeMinterTest.contract.Transact(opts, "renounceOwnership") +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_ERC20NativeMinterTest *ERC20NativeMinterTestSession) RenounceOwnership() (*types.Transaction, error) { + return _ERC20NativeMinterTest.Contract.RenounceOwnership(&_ERC20NativeMinterTest.TransactOpts) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactorSession) RenounceOwnership() (*types.Transaction, error) { + return _ERC20NativeMinterTest.Contract.RenounceOwnership(&_ERC20NativeMinterTest.TransactOpts) +} + +// Revoke is a paid mutator transaction binding the contract method 0x74a8f103. +// +// Solidity: function revoke(address addr) returns() +func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactor) Revoke(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { + return _ERC20NativeMinterTest.contract.Transact(opts, "revoke", addr) +} + +// Revoke is a paid mutator transaction binding the contract method 0x74a8f103. +// +// Solidity: function revoke(address addr) returns() +func (_ERC20NativeMinterTest *ERC20NativeMinterTestSession) Revoke(addr common.Address) (*types.Transaction, error) { + return _ERC20NativeMinterTest.Contract.Revoke(&_ERC20NativeMinterTest.TransactOpts, addr) +} + +// Revoke is a paid mutator transaction binding the contract method 0x74a8f103. +// +// Solidity: function revoke(address addr) returns() +func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactorSession) Revoke(addr common.Address) (*types.Transaction, error) { + return _ERC20NativeMinterTest.Contract.Revoke(&_ERC20NativeMinterTest.TransactOpts, addr) +} + +// SetAdmin is a paid mutator transaction binding the contract method 0x704b6c02. +// +// Solidity: function setAdmin(address addr) returns() +func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactor) SetAdmin(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { + return _ERC20NativeMinterTest.contract.Transact(opts, "setAdmin", addr) +} + +// SetAdmin is a paid mutator transaction binding the contract method 0x704b6c02. +// +// Solidity: function setAdmin(address addr) returns() +func (_ERC20NativeMinterTest *ERC20NativeMinterTestSession) SetAdmin(addr common.Address) (*types.Transaction, error) { + return _ERC20NativeMinterTest.Contract.SetAdmin(&_ERC20NativeMinterTest.TransactOpts, addr) +} + +// SetAdmin is a paid mutator transaction binding the contract method 0x704b6c02. +// +// Solidity: function setAdmin(address addr) returns() +func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactorSession) SetAdmin(addr common.Address) (*types.Transaction, error) { + return _ERC20NativeMinterTest.Contract.SetAdmin(&_ERC20NativeMinterTest.TransactOpts, addr) +} + +// SetEnabled is a paid mutator transaction binding the contract method 0x0aaf7043. +// +// Solidity: function setEnabled(address addr) returns() +func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactor) SetEnabled(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { + return _ERC20NativeMinterTest.contract.Transact(opts, "setEnabled", addr) +} + +// SetEnabled is a paid mutator transaction binding the contract method 0x0aaf7043. +// +// Solidity: function setEnabled(address addr) returns() +func (_ERC20NativeMinterTest *ERC20NativeMinterTestSession) SetEnabled(addr common.Address) (*types.Transaction, error) { + return _ERC20NativeMinterTest.Contract.SetEnabled(&_ERC20NativeMinterTest.TransactOpts, addr) +} + +// SetEnabled is a paid mutator transaction binding the contract method 0x0aaf7043. +// +// Solidity: function setEnabled(address addr) returns() +func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactorSession) SetEnabled(addr common.Address) (*types.Transaction, error) { + return _ERC20NativeMinterTest.Contract.SetEnabled(&_ERC20NativeMinterTest.TransactOpts, addr) +} + +// SetManager is a paid mutator transaction binding the contract method 0xd0ebdbe7. +// +// Solidity: function setManager(address addr) returns() +func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactor) SetManager(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { + return _ERC20NativeMinterTest.contract.Transact(opts, "setManager", addr) +} + +// SetManager is a paid mutator transaction binding the contract method 0xd0ebdbe7. +// +// Solidity: function setManager(address addr) returns() +func (_ERC20NativeMinterTest *ERC20NativeMinterTestSession) SetManager(addr common.Address) (*types.Transaction, error) { + return _ERC20NativeMinterTest.Contract.SetManager(&_ERC20NativeMinterTest.TransactOpts, addr) +} + +// SetManager is a paid mutator transaction binding the contract method 0xd0ebdbe7. +// +// Solidity: function setManager(address addr) returns() +func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactorSession) SetManager(addr common.Address) (*types.Transaction, error) { + return _ERC20NativeMinterTest.Contract.SetManager(&_ERC20NativeMinterTest.TransactOpts, addr) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address to, uint256 value) returns(bool) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactor) Transfer(opts *bind.TransactOpts, to common.Address, value *big.Int) (*types.Transaction, error) { + return _ERC20NativeMinterTest.contract.Transact(opts, "transfer", to, value) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address to, uint256 value) returns(bool) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestSession) Transfer(to common.Address, value *big.Int) (*types.Transaction, error) { + return _ERC20NativeMinterTest.Contract.Transfer(&_ERC20NativeMinterTest.TransactOpts, to, value) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address to, uint256 value) returns(bool) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactorSession) Transfer(to common.Address, value *big.Int) (*types.Transaction, error) { + return _ERC20NativeMinterTest.Contract.Transfer(&_ERC20NativeMinterTest.TransactOpts, to, value) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address from, address to, uint256 value) returns(bool) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactor) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, value *big.Int) (*types.Transaction, error) { + return _ERC20NativeMinterTest.contract.Transact(opts, "transferFrom", from, to, value) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address from, address to, uint256 value) returns(bool) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestSession) TransferFrom(from common.Address, to common.Address, value *big.Int) (*types.Transaction, error) { + return _ERC20NativeMinterTest.Contract.TransferFrom(&_ERC20NativeMinterTest.TransactOpts, from, to, value) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address from, address to, uint256 value) returns(bool) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactorSession) TransferFrom(from common.Address, to common.Address, value *big.Int) (*types.Transaction, error) { + return _ERC20NativeMinterTest.Contract.TransferFrom(&_ERC20NativeMinterTest.TransactOpts, from, to, value) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { + return _ERC20NativeMinterTest.contract.Transact(opts, "transferOwnership", newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_ERC20NativeMinterTest *ERC20NativeMinterTestSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _ERC20NativeMinterTest.Contract.TransferOwnership(&_ERC20NativeMinterTest.TransactOpts, newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _ERC20NativeMinterTest.Contract.TransferOwnership(&_ERC20NativeMinterTest.TransactOpts, newOwner) +} + +// ERC20NativeMinterTestApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the ERC20NativeMinterTest contract. +type ERC20NativeMinterTestApprovalIterator struct { + Event *ERC20NativeMinterTestApproval // 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 *ERC20NativeMinterTestApprovalIterator) 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(ERC20NativeMinterTestApproval) + 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(ERC20NativeMinterTestApproval) + 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 *ERC20NativeMinterTestApprovalIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC20NativeMinterTestApprovalIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC20NativeMinterTestApproval represents a Approval event raised by the ERC20NativeMinterTest contract. +type ERC20NativeMinterTestApproval struct { + Owner common.Address + Spender common.Address + Value *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*ERC20NativeMinterTestApprovalIterator, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var spenderRule []interface{} + for _, spenderItem := range spender { + spenderRule = append(spenderRule, spenderItem) + } + + logs, sub, err := _ERC20NativeMinterTest.contract.FilterLogs(opts, "Approval", ownerRule, spenderRule) + if err != nil { + return nil, err + } + return &ERC20NativeMinterTestApprovalIterator{contract: _ERC20NativeMinterTest.contract, event: "Approval", logs: logs, sub: sub}, nil +} + +// WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *ERC20NativeMinterTestApproval, owner []common.Address, spender []common.Address) (event.Subscription, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var spenderRule []interface{} + for _, spenderItem := range spender { + spenderRule = append(spenderRule, spenderItem) + } + + logs, sub, err := _ERC20NativeMinterTest.contract.WatchLogs(opts, "Approval", ownerRule, spenderRule) + 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(ERC20NativeMinterTestApproval) + if err := _ERC20NativeMinterTest.contract.UnpackLog(event, "Approval", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestFilterer) ParseApproval(log types.Log) (*ERC20NativeMinterTestApproval, error) { + event := new(ERC20NativeMinterTestApproval) + if err := _ERC20NativeMinterTest.contract.UnpackLog(event, "Approval", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// ERC20NativeMinterTestDepositIterator is returned from FilterDeposit and is used to iterate over the raw logs and unpacked data for Deposit events raised by the ERC20NativeMinterTest contract. +type ERC20NativeMinterTestDepositIterator struct { + Event *ERC20NativeMinterTestDeposit // 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 *ERC20NativeMinterTestDepositIterator) 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(ERC20NativeMinterTestDeposit) + 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(ERC20NativeMinterTestDeposit) + 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 *ERC20NativeMinterTestDepositIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC20NativeMinterTestDepositIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC20NativeMinterTestDeposit represents a Deposit event raised by the ERC20NativeMinterTest contract. +type ERC20NativeMinterTestDeposit struct { + Dst common.Address + Wad *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterDeposit is a free log retrieval operation binding the contract event 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c. +// +// Solidity: event Deposit(address indexed dst, uint256 wad) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestFilterer) FilterDeposit(opts *bind.FilterOpts, dst []common.Address) (*ERC20NativeMinterTestDepositIterator, error) { + + var dstRule []interface{} + for _, dstItem := range dst { + dstRule = append(dstRule, dstItem) + } + + logs, sub, err := _ERC20NativeMinterTest.contract.FilterLogs(opts, "Deposit", dstRule) + if err != nil { + return nil, err + } + return &ERC20NativeMinterTestDepositIterator{contract: _ERC20NativeMinterTest.contract, event: "Deposit", logs: logs, sub: sub}, nil +} + +// WatchDeposit is a free log subscription operation binding the contract event 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c. +// +// Solidity: event Deposit(address indexed dst, uint256 wad) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestFilterer) WatchDeposit(opts *bind.WatchOpts, sink chan<- *ERC20NativeMinterTestDeposit, dst []common.Address) (event.Subscription, error) { + + var dstRule []interface{} + for _, dstItem := range dst { + dstRule = append(dstRule, dstItem) + } + + logs, sub, err := _ERC20NativeMinterTest.contract.WatchLogs(opts, "Deposit", dstRule) + 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(ERC20NativeMinterTestDeposit) + if err := _ERC20NativeMinterTest.contract.UnpackLog(event, "Deposit", 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 +} + +// ParseDeposit is a log parse operation binding the contract event 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c. +// +// Solidity: event Deposit(address indexed dst, uint256 wad) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestFilterer) ParseDeposit(log types.Log) (*ERC20NativeMinterTestDeposit, error) { + event := new(ERC20NativeMinterTestDeposit) + if err := _ERC20NativeMinterTest.contract.UnpackLog(event, "Deposit", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// ERC20NativeMinterTestMintdrawalIterator is returned from FilterMintdrawal and is used to iterate over the raw logs and unpacked data for Mintdrawal events raised by the ERC20NativeMinterTest contract. +type ERC20NativeMinterTestMintdrawalIterator struct { + Event *ERC20NativeMinterTestMintdrawal // 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 *ERC20NativeMinterTestMintdrawalIterator) 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(ERC20NativeMinterTestMintdrawal) + 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(ERC20NativeMinterTestMintdrawal) + 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 *ERC20NativeMinterTestMintdrawalIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC20NativeMinterTestMintdrawalIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC20NativeMinterTestMintdrawal represents a Mintdrawal event raised by the ERC20NativeMinterTest contract. +type ERC20NativeMinterTestMintdrawal struct { + Src common.Address + Wad *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterMintdrawal is a free log retrieval operation binding the contract event 0x25bedde6c8ebd3a89b719a16299dbfe271c7bffa42fe1ac1a52e15ab0cb767e6. +// +// Solidity: event Mintdrawal(address indexed src, uint256 wad) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestFilterer) FilterMintdrawal(opts *bind.FilterOpts, src []common.Address) (*ERC20NativeMinterTestMintdrawalIterator, error) { + + var srcRule []interface{} + for _, srcItem := range src { + srcRule = append(srcRule, srcItem) + } + + logs, sub, err := _ERC20NativeMinterTest.contract.FilterLogs(opts, "Mintdrawal", srcRule) + if err != nil { + return nil, err + } + return &ERC20NativeMinterTestMintdrawalIterator{contract: _ERC20NativeMinterTest.contract, event: "Mintdrawal", logs: logs, sub: sub}, nil +} + +// WatchMintdrawal is a free log subscription operation binding the contract event 0x25bedde6c8ebd3a89b719a16299dbfe271c7bffa42fe1ac1a52e15ab0cb767e6. +// +// Solidity: event Mintdrawal(address indexed src, uint256 wad) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestFilterer) WatchMintdrawal(opts *bind.WatchOpts, sink chan<- *ERC20NativeMinterTestMintdrawal, src []common.Address) (event.Subscription, error) { + + var srcRule []interface{} + for _, srcItem := range src { + srcRule = append(srcRule, srcItem) + } + + logs, sub, err := _ERC20NativeMinterTest.contract.WatchLogs(opts, "Mintdrawal", srcRule) + 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(ERC20NativeMinterTestMintdrawal) + if err := _ERC20NativeMinterTest.contract.UnpackLog(event, "Mintdrawal", 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 +} + +// ParseMintdrawal is a log parse operation binding the contract event 0x25bedde6c8ebd3a89b719a16299dbfe271c7bffa42fe1ac1a52e15ab0cb767e6. +// +// Solidity: event Mintdrawal(address indexed src, uint256 wad) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestFilterer) ParseMintdrawal(log types.Log) (*ERC20NativeMinterTestMintdrawal, error) { + event := new(ERC20NativeMinterTestMintdrawal) + if err := _ERC20NativeMinterTest.contract.UnpackLog(event, "Mintdrawal", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// ERC20NativeMinterTestOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the ERC20NativeMinterTest contract. +type ERC20NativeMinterTestOwnershipTransferredIterator struct { + Event *ERC20NativeMinterTestOwnershipTransferred // 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 *ERC20NativeMinterTestOwnershipTransferredIterator) 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(ERC20NativeMinterTestOwnershipTransferred) + 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(ERC20NativeMinterTestOwnershipTransferred) + 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 *ERC20NativeMinterTestOwnershipTransferredIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC20NativeMinterTestOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC20NativeMinterTestOwnershipTransferred represents a OwnershipTransferred event raised by the ERC20NativeMinterTest contract. +type ERC20NativeMinterTestOwnershipTransferred struct { + PreviousOwner common.Address + NewOwner common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*ERC20NativeMinterTestOwnershipTransferredIterator, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _ERC20NativeMinterTest.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return &ERC20NativeMinterTestOwnershipTransferredIterator{contract: _ERC20NativeMinterTest.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *ERC20NativeMinterTestOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _ERC20NativeMinterTest.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(ERC20NativeMinterTestOwnershipTransferred) + if err := _ERC20NativeMinterTest.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestFilterer) ParseOwnershipTransferred(log types.Log) (*ERC20NativeMinterTestOwnershipTransferred, error) { + event := new(ERC20NativeMinterTestOwnershipTransferred) + if err := _ERC20NativeMinterTest.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// ERC20NativeMinterTestTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the ERC20NativeMinterTest contract. +type ERC20NativeMinterTestTransferIterator struct { + Event *ERC20NativeMinterTestTransfer // 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 *ERC20NativeMinterTestTransferIterator) 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(ERC20NativeMinterTestTransfer) + 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(ERC20NativeMinterTestTransfer) + 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 *ERC20NativeMinterTestTransferIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC20NativeMinterTestTransferIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC20NativeMinterTestTransfer represents a Transfer event raised by the ERC20NativeMinterTest contract. +type ERC20NativeMinterTestTransfer struct { + From common.Address + To common.Address + Value *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestFilterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*ERC20NativeMinterTestTransferIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _ERC20NativeMinterTest.contract.FilterLogs(opts, "Transfer", fromRule, toRule) + if err != nil { + return nil, err + } + return &ERC20NativeMinterTestTransferIterator{contract: _ERC20NativeMinterTest.contract, event: "Transfer", logs: logs, sub: sub}, nil +} + +// WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *ERC20NativeMinterTestTransfer, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _ERC20NativeMinterTest.contract.WatchLogs(opts, "Transfer", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(ERC20NativeMinterTestTransfer) + if err := _ERC20NativeMinterTest.contract.UnpackLog(event, "Transfer", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_ERC20NativeMinterTest *ERC20NativeMinterTestFilterer) ParseTransfer(log types.Log) (*ERC20NativeMinterTestTransfer, error) { + event := new(ERC20NativeMinterTestTransfer) + if err := _ERC20NativeMinterTest.contract.UnpackLog(event, "Transfer", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/precompile/contracts/nativeminter/nativemintertest/gen_inativeminter_binding.go b/precompile/contracts/nativeminter/nativemintertest/gen_inativeminter_binding.go new file mode 100644 index 0000000000..85cfc1386e --- /dev/null +++ b/precompile/contracts/nativeminter/nativemintertest/gen_inativeminter_binding.go @@ -0,0 +1,634 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package nativemintertest + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ava-labs/libevm" + "github.com/ava-labs/subnet-evm/accounts/abi" + "github.com/ava-labs/subnet-evm/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/precompile/contracts/nativeminter/nativemintertest/gen_minter_binding.go b/precompile/contracts/nativeminter/nativemintertest/gen_minter_binding.go new file mode 100644 index 0000000000..5551fceb7c --- /dev/null +++ b/precompile/contracts/nativeminter/nativemintertest/gen_minter_binding.go @@ -0,0 +1,266 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package nativemintertest + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ava-labs/libevm" + "github.com/ava-labs/subnet-evm/accounts/abi" + "github.com/ava-labs/subnet-evm/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 +) + +// MinterMetaData contains all meta data concerning the Minter contract. +var MinterMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mintdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", + Bin: "0x608060405234801561001057600080fd5b5060405161037c38038061037c833981810160405281019061003291906100db565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610108565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100a88261007d565b9050919050565b6100b88161009d565b81146100c357600080fd5b50565b6000815190506100d5816100af565b92915050565b6000602082840312156100f1576100f0610078565b5b60006100ff848285016100c6565b91505092915050565b610265806101176000396000f3fe60806040526004361061002d5760003560e01c80630356b6cd14610039578063b6b55f251461006257610034565b3661003457005b600080fd5b34801561004557600080fd5b50610060600480360381019061005b91906101d8565b61008b565b005b34801561006e57600080fd5b50610089600480360381019061008491906101d8565b610119565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630356b6cd826040518263ffffffff1660e01b81526004016100e49190610214565b600060405180830381600087803b1580156100fe57600080fd5b505af1158015610112573d6000803e3d6000fd5b5050505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b15801561018157600080fd5b505af1158015610195573d6000803e3d6000fd5b505050505050565b600080fd5b6000819050919050565b6101b5816101a2565b81146101c057600080fd5b50565b6000813590506101d2816101ac565b92915050565b6000602082840312156101ee576101ed61019d565b5b60006101fc848285016101c3565b91505092915050565b61020e816101a2565b82525050565b60006020820190506102296000830184610205565b9291505056fea2646970667358221220604a52a3b491209cf462bf00111878c11d818c0e9a407b9c0b4e4cb3dc7411e964736f6c634300081e0033", +} + +// MinterABI is the input ABI used to generate the binding from. +// Deprecated: Use MinterMetaData.ABI instead. +var MinterABI = MinterMetaData.ABI + +// MinterBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use MinterMetaData.Bin instead. +var MinterBin = MinterMetaData.Bin + +// DeployMinter deploys a new Ethereum contract, binding an instance of Minter to it. +func DeployMinter(auth *bind.TransactOpts, backend bind.ContractBackend, tokenAddress common.Address) (common.Address, *types.Transaction, *Minter, error) { + parsed, err := MinterMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(MinterBin), backend, tokenAddress) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &Minter{MinterCaller: MinterCaller{contract: contract}, MinterTransactor: MinterTransactor{contract: contract}, MinterFilterer: MinterFilterer{contract: contract}}, nil +} + +// Minter is an auto generated Go binding around an Ethereum contract. +type Minter struct { + MinterCaller // Read-only binding to the contract + MinterTransactor // Write-only binding to the contract + MinterFilterer // Log filterer for contract events +} + +// MinterCaller is an auto generated read-only Go binding around an Ethereum contract. +type MinterCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// MinterTransactor is an auto generated write-only Go binding around an Ethereum contract. +type MinterTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// MinterFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type MinterFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// MinterSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type MinterSession struct { + Contract *Minter // 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 +} + +// MinterCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type MinterCallerSession struct { + Contract *MinterCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// MinterTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type MinterTransactorSession struct { + Contract *MinterTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// MinterRaw is an auto generated low-level Go binding around an Ethereum contract. +type MinterRaw struct { + Contract *Minter // Generic contract binding to access the raw methods on +} + +// MinterCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type MinterCallerRaw struct { + Contract *MinterCaller // Generic read-only contract binding to access the raw methods on +} + +// MinterTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type MinterTransactorRaw struct { + Contract *MinterTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewMinter creates a new instance of Minter, bound to a specific deployed contract. +func NewMinter(address common.Address, backend bind.ContractBackend) (*Minter, error) { + contract, err := bindMinter(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &Minter{MinterCaller: MinterCaller{contract: contract}, MinterTransactor: MinterTransactor{contract: contract}, MinterFilterer: MinterFilterer{contract: contract}}, nil +} + +// NewMinterCaller creates a new read-only instance of Minter, bound to a specific deployed contract. +func NewMinterCaller(address common.Address, caller bind.ContractCaller) (*MinterCaller, error) { + contract, err := bindMinter(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &MinterCaller{contract: contract}, nil +} + +// NewMinterTransactor creates a new write-only instance of Minter, bound to a specific deployed contract. +func NewMinterTransactor(address common.Address, transactor bind.ContractTransactor) (*MinterTransactor, error) { + contract, err := bindMinter(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &MinterTransactor{contract: contract}, nil +} + +// NewMinterFilterer creates a new log filterer instance of Minter, bound to a specific deployed contract. +func NewMinterFilterer(address common.Address, filterer bind.ContractFilterer) (*MinterFilterer, error) { + contract, err := bindMinter(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &MinterFilterer{contract: contract}, nil +} + +// bindMinter binds a generic wrapper to an already deployed contract. +func bindMinter(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := MinterMetaData.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 (_Minter *MinterRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Minter.Contract.MinterCaller.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 (_Minter *MinterRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Minter.Contract.MinterTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Minter *MinterRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Minter.Contract.MinterTransactor.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 (_Minter *MinterCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Minter.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 (_Minter *MinterTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Minter.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Minter *MinterTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Minter.Contract.contract.Transact(opts, method, params...) +} + +// Deposit is a paid mutator transaction binding the contract method 0xb6b55f25. +// +// Solidity: function deposit(uint256 value) returns() +func (_Minter *MinterTransactor) Deposit(opts *bind.TransactOpts, value *big.Int) (*types.Transaction, error) { + return _Minter.contract.Transact(opts, "deposit", value) +} + +// Deposit is a paid mutator transaction binding the contract method 0xb6b55f25. +// +// Solidity: function deposit(uint256 value) returns() +func (_Minter *MinterSession) Deposit(value *big.Int) (*types.Transaction, error) { + return _Minter.Contract.Deposit(&_Minter.TransactOpts, value) +} + +// Deposit is a paid mutator transaction binding the contract method 0xb6b55f25. +// +// Solidity: function deposit(uint256 value) returns() +func (_Minter *MinterTransactorSession) Deposit(value *big.Int) (*types.Transaction, error) { + return _Minter.Contract.Deposit(&_Minter.TransactOpts, value) +} + +// Mintdraw is a paid mutator transaction binding the contract method 0x0356b6cd. +// +// Solidity: function mintdraw(uint256 amount) returns() +func (_Minter *MinterTransactor) Mintdraw(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) { + return _Minter.contract.Transact(opts, "mintdraw", amount) +} + +// Mintdraw is a paid mutator transaction binding the contract method 0x0356b6cd. +// +// Solidity: function mintdraw(uint256 amount) returns() +func (_Minter *MinterSession) Mintdraw(amount *big.Int) (*types.Transaction, error) { + return _Minter.Contract.Mintdraw(&_Minter.TransactOpts, amount) +} + +// Mintdraw is a paid mutator transaction binding the contract method 0x0356b6cd. +// +// Solidity: function mintdraw(uint256 amount) returns() +func (_Minter *MinterTransactorSession) Mintdraw(amount *big.Int) (*types.Transaction, error) { + return _Minter.Contract.Mintdraw(&_Minter.TransactOpts, amount) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_Minter *MinterTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Minter.contract.RawTransact(opts, nil) // calldata is disallowed for receive function +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_Minter *MinterSession) Receive() (*types.Transaction, error) { + return _Minter.Contract.Receive(&_Minter.TransactOpts) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_Minter *MinterTransactorSession) Receive() (*types.Transaction, error) { + return _Minter.Contract.Receive(&_Minter.TransactOpts) +} diff --git a/precompile/contracts/nativeminter/nativemintertest/simulated_test.go b/precompile/contracts/nativeminter/nativemintertest/simulated_test.go new file mode 100644 index 0000000000..e67a24239a --- /dev/null +++ b/precompile/contracts/nativeminter/nativemintertest/simulated_test.go @@ -0,0 +1,303 @@ +// Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved. +// See the file LICENSE for licensing terms. + +package nativemintertest + +import ( + "math/big" + "testing" + + "github.com/ava-labs/libevm/common" + "github.com/ava-labs/libevm/core/types" + "github.com/ava-labs/libevm/core/vm" + "github.com/ava-labs/libevm/crypto" + "github.com/stretchr/testify/require" + + "github.com/ava-labs/subnet-evm/accounts/abi/bind" + "github.com/ava-labs/subnet-evm/core" + "github.com/ava-labs/subnet-evm/params" + "github.com/ava-labs/subnet-evm/params/extras" + "github.com/ava-labs/subnet-evm/plugin/evm/customtypes" + "github.com/ava-labs/subnet-evm/precompile/allowlist" + "github.com/ava-labs/subnet-evm/precompile/contracts/nativeminter" + "github.com/ava-labs/subnet-evm/precompile/contracts/testutils" + "github.com/ava-labs/subnet-evm/utils" + + sim "github.com/ava-labs/subnet-evm/ethclient/simulated" +) + +var ( + adminKey, _ = crypto.GenerateKey() + unprivilegedKey, _ = crypto.GenerateKey() + + adminAddress = crypto.PubkeyToAddress(adminKey.PublicKey) + unprivilegedAddress = crypto.PubkeyToAddress(unprivilegedKey.PublicKey) +) + +func TestMain(m *testing.M) { + // Ensure libevm extras are registered for tests. + core.RegisterExtras() + customtypes.Register() + params.RegisterExtras() + m.Run() +} + +func newBackendWithNativeMinter(t *testing.T) *sim.Backend { + t.Helper() + chainCfg := params.Copy(params.TestChainConfig) + // Match the simulated backend chain ID used for signing (1337). + chainCfg.ChainID = big.NewInt(1337) + // Enable ContractNativeMinter at genesis with admin set to adminAddress. + params.GetExtra(&chainCfg).GenesisPrecompiles = extras.Precompiles{ + nativeminter.ConfigKey: nativeminter.NewConfig(utils.NewUint64(0), []common.Address{adminAddress}, nil, nil, nil), + } + return sim.NewBackend( + types.GenesisAlloc{ + adminAddress: {Balance: big.NewInt(1000000000000000000)}, + unprivilegedAddress: {Balance: big.NewInt(1000000000000000000)}, + }, + sim.WithChainConfig(&chainCfg), + ) +} + +// Helper functions to reduce test boilerplate + +func deployERC20NativeMinterTest(t *testing.T, b *sim.Backend, auth *bind.TransactOpts, initSupply *big.Int) (common.Address, *ERC20NativeMinterTest) { + t.Helper() + addr, tx, contract, err := DeployERC20NativeMinterTest(auth, b.Client(), nativeminter.ContractAddress, initSupply) + require.NoError(t, err) + testutils.WaitReceiptSuccessful(t, b, tx) + return addr, contract +} + +func deployMinter(t *testing.T, b *sim.Backend, auth *bind.TransactOpts, tokenAddress common.Address) (common.Address, *Minter) { + t.Helper() + addr, tx, contract, err := DeployMinter(auth, b.Client(), tokenAddress) + require.NoError(t, err) + testutils.WaitReceiptSuccessful(t, b, tx) + return addr, contract +} + +func verifyRole(t *testing.T, nativeMinter *INativeMinter, address common.Address, expectedRole allowlist.Role) { + t.Helper() + role, err := nativeMinter.ReadAllowList(nil, address) + require.NoError(t, err) + require.Equal(t, expectedRole.Big(), role) +} + +func setAsEnabled(t *testing.T, b *sim.Backend, nativeMinter *INativeMinter, auth *bind.TransactOpts, address common.Address) { + t.Helper() + tx, err := nativeMinter.SetEnabled(auth, address) + require.NoError(t, err) + testutils.WaitReceiptSuccessful(t, b, tx) +} + +func TestNativeMinter(t *testing.T) { + chainID := big.NewInt(1337) + admin := testutils.NewAuth(t, adminKey, chainID) + + initSupply := big.NewInt(1000) + amount := big.NewInt(100) + + type testCase struct { + name string + test func(t *testing.T, backend *sim.Backend, nativeMinterIntf *INativeMinter) + } + + testCases := []testCase{ + { + name: "contract should not be able to mintdraw", + test: func(t *testing.T, backend *sim.Backend, nativeMinter *INativeMinter) { + tokenAddr, token := deployERC20NativeMinterTest(t, backend, admin, initSupply) + + verifyRole(t, nativeMinter, tokenAddr, allowlist.NoRole) + + // Try to mintdraw - should fail because token contract is not enabled + _, err := token.Mintdraw(admin, amount) + require.ErrorContains(t, err, vm.ErrExecutionReverted.Error()) + }, + }, + { + name: "should be added to minter list", + test: func(t *testing.T, backend *sim.Backend, nativeMinter *INativeMinter) { + tokenAddr, _ := deployERC20NativeMinterTest(t, backend, admin, initSupply) + + verifyRole(t, nativeMinter, tokenAddr, allowlist.NoRole) + + setAsEnabled(t, backend, nativeMinter, admin, tokenAddr) + + verifyRole(t, nativeMinter, tokenAddr, allowlist.EnabledRole) + }, + }, + { + name: "admin should mintdraw", + test: func(t *testing.T, backend *sim.Backend, nativeMinter *INativeMinter) { + tokenAddr, token := deployERC20NativeMinterTest(t, backend, admin, initSupply) + + setAsEnabled(t, backend, nativeMinter, admin, tokenAddr) + + // Get initial token balance (admin has the tokens) + initialTokenBalance, err := token.BalanceOf(nil, adminAddress) + require.NoError(t, err) + + // Perform mintdraw - burns admin's ERC20 tokens and mints native coins to admin + tx, err := token.Mintdraw(admin, amount) + require.NoError(t, err) + testutils.WaitReceiptSuccessful(t, backend, tx) + + // Verify ERC20 token balance decreased by exactly the amount + finalTokenBalance, err := token.BalanceOf(nil, adminAddress) + require.NoError(t, err) + expectedTokenBalance := new(big.Int).Sub(initialTokenBalance, amount) + require.Zero(t, expectedTokenBalance.Cmp(finalTokenBalance), "ERC20 balance should have decreased by amount") + }, + }, + { + name: "minter should not mintdraw without tokens", + test: func(t *testing.T, backend *sim.Backend, nativeMinter *INativeMinter) { + tokenAddr, token := deployERC20NativeMinterTest(t, backend, admin, initSupply) + minterAddr, minter := deployMinter(t, backend, admin, tokenAddr) + + setAsEnabled(t, backend, nativeMinter, admin, tokenAddr) + + // Verify minter has no ERC20 tokens + initialTokenBalance, err := token.BalanceOf(nil, minterAddr) + require.NoError(t, err) + require.Zero(t, initialTokenBalance.Cmp(big.NewInt(0)), "minter should have no ERC20 tokens") + + // Try to mintdraw - should fail because minter has no ERC20 tokens to burn + _, err = minter.Mintdraw(admin, amount) + require.Error(t, err) + }, + }, + { + name: "should deposit for minter", + test: func(t *testing.T, backend *sim.Backend, nativeMinter *INativeMinter) { + tokenAddr, token := deployERC20NativeMinterTest(t, backend, admin, initSupply) + minterAddr, minter := deployMinter(t, backend, admin, tokenAddr) + + setAsEnabled(t, backend, nativeMinter, admin, tokenAddr) + + // Mint native coins to minter address + tx, err := nativeMinter.MintNativeCoin(admin, minterAddr, amount) + require.NoError(t, err) + testutils.WaitReceipt(t, backend, tx) + + // Get initial balances + initialTokenBalance, err := token.BalanceOf(nil, minterAddr) + require.NoError(t, err) + initialNativeBalance, err := backend.Client().BalanceAt(t.Context(), minterAddr, nil) + require.NoError(t, err) + + // Deposit (convert native coin to ERC20 token) + tx, err = minter.Deposit(admin, amount) + require.NoError(t, err) + testutils.WaitReceiptSuccessful(t, backend, tx) + + // Verify balances changed correctly + finalTokenBalance, err := token.BalanceOf(nil, minterAddr) + require.NoError(t, err) + expectedTokenBalance := new(big.Int).Add(initialTokenBalance, amount) + require.Equal(t, expectedTokenBalance, finalTokenBalance) + + finalNativeBalance, err := backend.Client().BalanceAt(t.Context(), minterAddr, nil) + require.NoError(t, err) + expectedNativeBalance := new(big.Int).Sub(initialNativeBalance, amount) + require.Equal(t, expectedNativeBalance, finalNativeBalance) + }, + }, + { + name: "minter should mintdraw", + test: func(t *testing.T, backend *sim.Backend, nativeMinter *INativeMinter) { + tokenAddr, token := deployERC20NativeMinterTest(t, backend, admin, initSupply) + minterAddr, minter := deployMinter(t, backend, admin, tokenAddr) + + setAsEnabled(t, backend, nativeMinter, admin, tokenAddr) + + // Verify minter starts with no native balance + initialNativeBalance, err := backend.Client().BalanceAt(t.Context(), minterAddr, nil) + require.NoError(t, err) + require.Zero(t, initialNativeBalance.Cmp(big.NewInt(0)), "minter should start with no native balance") + + // Mint ERC20 tokens to minter + tx, err := token.Mint(admin, minterAddr, amount) + require.NoError(t, err) + testutils.WaitReceipt(t, backend, tx) + + // Verify minter received tokens + initialTokenBalance, err := token.BalanceOf(nil, minterAddr) + require.NoError(t, err) + require.Zero(t, amount.Cmp(initialTokenBalance), "minter should have received ERC20 tokens") + + // Mintdraw (convert ERC20 token to native coin) + tx, err = minter.Mintdraw(admin, amount) + require.NoError(t, err) + testutils.WaitReceiptSuccessful(t, backend, tx) + + // Verify final balances + finalTokenBalance, err := token.BalanceOf(nil, minterAddr) + require.NoError(t, err) + require.Zero(t, finalTokenBalance.Cmp(big.NewInt(0)), "minter should have no ERC20 tokens left") + + finalNativeBalance, err := backend.Client().BalanceAt(t.Context(), minterAddr, nil) + require.NoError(t, err) + require.Zero(t, amount.Cmp(finalNativeBalance), "minter should have received native coins") + }, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + backend := newBackendWithNativeMinter(t) + defer backend.Close() + + nativeMinter, err := NewINativeMinter(nativeminter.ContractAddress, backend.Client()) + require.NoError(t, err) + + tc.test(t, backend, nativeMinter) + }) + } +} + +func TestINativeMinter_Events(t *testing.T) { + chainID := big.NewInt(1337) + admin := testutils.NewAuth(t, adminKey, chainID) + testKey, _ := crypto.GenerateKey() + testAddress := crypto.PubkeyToAddress(testKey.PublicKey) + + backend := newBackendWithNativeMinter(t) + defer backend.Close() + + nativeMinter, err := NewINativeMinter(nativeminter.ContractAddress, backend.Client()) + require.NoError(t, err) + + t.Run("should emit NativeCoinMinted event", func(t *testing.T) { + require := require.New(t) + + amount := big.NewInt(1000) + + tx, err := nativeMinter.MintNativeCoin(admin, testAddress, amount) + require.NoError(err) + testutils.WaitReceiptSuccessful(t, backend, tx) + + // Filter for NativeCoinMinted events + iter, err := nativeMinter.FilterNativeCoinMinted( + nil, + []common.Address{adminAddress}, + []common.Address{testAddress}, + ) + require.NoError(err) + defer iter.Close() + + // Verify event fields match expected values + require.True(iter.Next(), "expected to find NativeCoinMinted event") + event := iter.Event + require.Equal(adminAddress, event.Sender) + require.Equal(testAddress, event.Recipient) + require.Zero(amount.Cmp(event.Amount), "amount mismatch") + + // Verify there are no more events + require.False(iter.Next(), "expected no more NativeCoinMinted events") + require.NoError(iter.Error()) + }) +} diff --git a/contracts/contracts/ERC20NativeMinter.sol b/precompile/contracts/nativeminter/nativemintertest/solidity/ERC20NativeMinterTest.sol similarity index 64% rename from contracts/contracts/ERC20NativeMinter.sol rename to precompile/contracts/nativeminter/nativemintertest/solidity/ERC20NativeMinterTest.sol index 34fb231fc9..7b97a4948e 100644 --- a/contracts/contracts/ERC20NativeMinter.sol +++ b/precompile/contracts/nativeminter/nativemintertest/solidity/ERC20NativeMinterTest.sol @@ -2,26 +2,30 @@ pragma solidity ^0.8.24; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; -import "./AllowList.sol"; -import "./interfaces/INativeMinter.sol"; +import "@openzeppelin/contracts/access/Ownable.sol"; +import "precompile/allowlist/allowlisttest/AllowList.sol"; +import "precompile/contracts/nativeminter/nativemintertest/INativeMinter.sol"; -// Precompiled Native Minter Contract Address -address constant MINTER_ADDRESS = 0x0200000000000000000000000000000000000001; // Designated Blackhole Address address constant BLACKHOLE_ADDRESS = 0x0100000000000000000000000000000000000000; -contract ERC20NativeMinter is ERC20, AllowList { +contract ERC20NativeMinterTest is ERC20, Ownable, AllowList { string private constant TOKEN_NAME = "ERC20NativeMinterToken"; string private constant TOKEN_SYMBOL = "XMPL"; - INativeMinter nativeMinter = INativeMinter(MINTER_ADDRESS); + INativeMinter nativeMinter; event Deposit(address indexed dst, uint256 wad); event Mintdrawal(address indexed src, uint256 wad); - constructor(uint256 initSupply) ERC20(TOKEN_NAME, TOKEN_SYMBOL) AllowList(MINTER_ADDRESS) { - // Mints INIT_SUPPLY to owner - _mint(_msgSender(), initSupply); + constructor(address nativeMinterPrecompile, uint256 initSupply) + ERC20(TOKEN_NAME, TOKEN_SYMBOL) + Ownable(msg.sender) + AllowList(nativeMinterPrecompile) + { + nativeMinter = INativeMinter(nativeMinterPrecompile); + // Mints init supply to msg.sender + _mint(msg.sender, initSupply); } // Mints [amount] number of ERC20 token to [to] address. @@ -37,11 +41,11 @@ contract ERC20NativeMinter is ERC20, AllowList { // Swaps [amount] number of ERC20 token for native coin. function mintdraw(uint256 wad) external { // Burn ERC20 token first. - _burn(_msgSender(), wad); + _burn(msg.sender, wad); // Mints [amount] number of native coins (gas coin) to [msg.sender] address. // Calls NativeMinter precompile through INativeMinter interface. - nativeMinter.mintNativeCoin(_msgSender(), wad); - emit Mintdrawal(_msgSender(), wad); + nativeMinter.mintNativeCoin(msg.sender, wad); + emit Mintdrawal(msg.sender, wad); } // Swaps [amount] number of native gas coins for ERC20 tokens. @@ -49,8 +53,8 @@ contract ERC20NativeMinter is ERC20, AllowList { // Burn native token by sending to BLACKHOLE_ADDRESS payable(BLACKHOLE_ADDRESS).transfer(msg.value); // Mint ERC20 token. - _mint(_msgSender(), msg.value); - emit Deposit(_msgSender(), msg.value); + _mint(msg.sender, msg.value); + emit Deposit(msg.sender, msg.value); } function decimals() public view virtual override returns (uint8) { diff --git a/contracts/contracts/interfaces/INativeMinter.sol b/precompile/contracts/nativeminter/nativemintertest/solidity/INativeMinter.sol similarity index 84% rename from contracts/contracts/interfaces/INativeMinter.sol rename to precompile/contracts/nativeminter/nativemintertest/solidity/INativeMinter.sol index 822f8af86f..376a872638 100644 --- a/contracts/contracts/interfaces/INativeMinter.sol +++ b/precompile/contracts/nativeminter/nativemintertest/solidity/INativeMinter.sol @@ -1,6 +1,6 @@ //SPDX-License-Identifier: MIT pragma solidity ^0.8.24; -import "./IAllowList.sol"; +import "precompile/allowlist/allowlisttest/IAllowList.sol"; interface INativeMinter is IAllowList { event NativeCoinMinted(address indexed sender, address indexed recipient, uint256 amount); diff --git a/precompile/contracts/nativeminter/nativemintertest/solidity/Minter.sol b/precompile/contracts/nativeminter/nativemintertest/solidity/Minter.sol new file mode 100644 index 0000000000..632324fce2 --- /dev/null +++ b/precompile/contracts/nativeminter/nativemintertest/solidity/Minter.sol @@ -0,0 +1,25 @@ +//SPDX-License-Identifier: MIT +pragma solidity ^0.8.24; + +import "precompile/contracts/nativeminter/nativemintertest/ERC20NativeMinterTest.sol"; + +// Helper contract to test minting from another contract +contract Minter { + ERC20NativeMinterTest token; + + constructor(address tokenAddress) { + token = ERC20NativeMinterTest(tokenAddress); + } + + function mintdraw(uint amount) external { + token.mintdraw(amount); + } + + function deposit(uint value) external { + token.deposit{value: value}(); + } + + // Allow the contract to receive ETH + receive() external payable {} +} + diff --git a/precompile/contracts/rewardmanager/contract.abi b/precompile/contracts/rewardmanager/contract.abi deleted file mode 100644 index 5b80821de3..0000000000 --- a/precompile/contracts/rewardmanager/contract.abi +++ /dev/null @@ -1,177 +0,0 @@ -[ - { - "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" - }, - { - "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" - } -] diff --git a/precompile/contracts/testutils/simulated_helpers.go b/precompile/contracts/testutils/simulated_helpers.go new file mode 100644 index 0000000000..a94c0dabdc --- /dev/null +++ b/precompile/contracts/testutils/simulated_helpers.go @@ -0,0 +1,41 @@ +// Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved. +// See the file LICENSE for licensing terms. + +package testutils + +import ( + "crypto/ecdsa" + "math/big" + "testing" + + "github.com/ava-labs/libevm/core/types" + "github.com/stretchr/testify/require" + + "github.com/ava-labs/subnet-evm/accounts/abi/bind" + sim "github.com/ava-labs/subnet-evm/ethclient/simulated" +) + +// NewAuth creates a new transactor with the given private key and chain ID. +func NewAuth(t *testing.T, key *ecdsa.PrivateKey, chainID *big.Int) *bind.TransactOpts { + t.Helper() + auth, err := bind.NewKeyedTransactorWithChainID(key, chainID) + require.NoError(t, err) + return auth +} + +// WaitReceipt commits the simulated backend and waits for the transaction receipt. +func WaitReceipt(t *testing.T, b *sim.Backend, tx *types.Transaction) *types.Receipt { + t.Helper() + b.Commit(true) + receipt, err := b.Client().TransactionReceipt(t.Context(), tx.Hash()) + require.NoError(t, err, "failed to get transaction receipt") + return receipt +} + +// WaitReceiptSuccessful commits the backend, waits for the receipt, and asserts success. +func WaitReceiptSuccessful(t *testing.T, b *sim.Backend, tx *types.Transaction) *types.Receipt { + t.Helper() + receipt := WaitReceipt(t, b, tx) + require.Equal(t, types.ReceiptStatusSuccessful, receipt.Status, "transaction should succeed") + return receipt +} diff --git a/precompile/contracts/warp/contract.abi b/precompile/contracts/warp/contract.abi deleted file mode 100644 index 771103ecbc..0000000000 --- a/precompile/contracts/warp/contract.abi +++ /dev/null @@ -1,136 +0,0 @@ -[ - { - "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": "struct WarpBlockHash", - "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": "struct WarpMessage", - "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" - } -] diff --git a/tests/precompile/solidity/suites.go b/tests/precompile/solidity/suites.go index 66d897ffde..63cdafedf3 100644 --- a/tests/precompile/solidity/suites.go +++ b/tests/precompile/solidity/suites.go @@ -36,13 +36,6 @@ func RegisterAsyncTests() { // Each ginkgo It node specifies the name of the genesis file (in ./tests/precompile/genesis/) // to use to launch the subnet and the name of the TS test file to run on the subnet (in ./contracts/tests/) - ginkgo.It("contract native minter", ginkgo.Label("Precompile"), ginkgo.Label("ContractNativeMinter"), func() { - ctx, cancel := context.WithTimeout(context.Background(), timeout) - defer cancel() - - blockchainID := subnetsSuite.GetBlockchainID("contract_native_minter") - runDefaultHardhatTests(ctx, blockchainID, "contract_native_minter") - }) ginkgo.It("tx allow list", ginkgo.Label("Precompile"), ginkgo.Label("TxAllowList"), func() { ctx, cancel := context.WithTimeout(context.Background(), timeout) From b7eec85c3a66901ba9a09b891fe7f7a63d1981bc Mon Sep 17 00:00:00 2001 From: Jonathan Oppenheimer Date: Fri, 21 Nov 2025 15:59:10 -0500 Subject: [PATCH 02/23] Add abi files back --- precompile/.gitignore | 6 +++--- precompile/allowlist/allowlist.abi | 1 + .../allowlist/allowlisttest/gen_allowlisttest_binding.go | 2 +- precompile/allowlist/allowlisttest/solidity/AllowList.sol | 2 +- .../allowlist/allowlisttest/solidity/AllowListTest.sol | 4 ++-- precompile/contracts/feemanager/contract.abi | 1 + precompile/contracts/nativeminter/contract.abi | 1 + .../nativemintertest/gen_erc20nativemintertest_binding.go | 2 +- .../nativeminter/nativemintertest/gen_minter_binding.go | 2 +- .../nativemintertest/solidity/ERC20NativeMinterTest.sol | 4 ++-- .../nativemintertest/solidity/INativeMinter.sol | 2 +- .../nativeminter/nativemintertest/solidity/Minter.sol | 2 +- precompile/contracts/rewardmanager/contract.abi | 1 + precompile/contracts/warp/contract.abi | 1 + 14 files changed, 18 insertions(+), 13 deletions(-) create mode 100644 precompile/allowlist/allowlist.abi create mode 100644 precompile/contracts/feemanager/contract.abi create mode 100644 precompile/contracts/nativeminter/contract.abi create mode 100644 precompile/contracts/rewardmanager/contract.abi create mode 100644 precompile/contracts/warp/contract.abi diff --git a/precompile/.gitignore b/precompile/.gitignore index a32ec92f6a..c75d83d135 100644 --- a/precompile/.gitignore +++ b/precompile/.gitignore @@ -1,3 +1,3 @@ -artifacts/ -*.abi -*.bin +**/artifacts/ +**/artifacts/*.abi +**/artifacts/*.bin diff --git a/precompile/allowlist/allowlist.abi b/precompile/allowlist/allowlist.abi new file mode 100644 index 0000000000..957929d8c3 --- /dev/null +++ b/precompile/allowlist/allowlist.abi @@ -0,0 +1 @@ +[{"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"}] \ No newline at end of file diff --git a/precompile/allowlist/allowlisttest/gen_allowlisttest_binding.go b/precompile/allowlist/allowlisttest/gen_allowlisttest_binding.go index cd2739dcab..9fb9c352ae 100644 --- a/precompile/allowlist/allowlisttest/gen_allowlisttest_binding.go +++ b/precompile/allowlist/allowlisttest/gen_allowlisttest_binding.go @@ -32,7 +32,7 @@ var ( // AllowListTestMetaData contains all meta data concerning the AllowListTest contract. var AllowListTestMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"precompileAddr\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"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\":[{\"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\"}]", - Bin: "0x608060405234801561001057600080fd5b50604051610bee380380610bee833981810160405281019061003291906100dd565b80806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505061010a565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100aa8261007f565b9050919050565b6100ba8161009f565b81146100c557600080fd5b50565b6000815190506100d7816100b1565b92915050565b6000602082840312156100f3576100f261007a565b5b6000610101848285016100c8565b91505092915050565b610ad5806101196000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c806374a8f1031161005b57806374a8f103146100ff5780639015d3711461011b578063d0ebdbe71461014b578063f3ae24151461016757610088565b80630aaf70431461008d57806324d7806c146100a95780636cd5c39b146100d9578063704b6c02146100e3575b600080fd5b6100a760048036038101906100a2919061086a565b610197565b005b6100c360048036038101906100be919061086a565b6101fb565b6040516100d091906108b2565b60405180910390f35b6100e16102a6565b005b6100fd60048036038101906100f8919061086a565b6102d2565b005b6101196004803603810190610114919061086a565b610336565b005b6101356004803603810190610130919061086a565b61039a565b60405161014291906108b2565b60405180910390f35b6101656004803603810190610160919061086a565b610446565b005b610181600480360381019061017c919061086a565b6104aa565b60405161018e91906108b2565b60405180910390f35b6101a0336101fb565b806101b057506101af336104aa565b5b6101ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101e69061092a565b60405180910390fd5b6101f881610555565b50565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b81526004016102579190610959565b602060405180830381865afa158015610274573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061029891906109aa565b905060028114915050919050565b6040516102b2906107fb565b604051809103906000f0801580156102ce573d6000803e3d6000fd5b5050565b6102db336101fb565b806102eb57506102ea336104aa565b5b61032a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103219061092a565b60405180910390fd5b610333816105e3565b50565b61033f336101fb565b8061034f575061034e336104aa565b5b61038e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103859061092a565b60405180910390fd5b61039781610671565b50565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b81526004016103f69190610959565b602060405180830381865afa158015610413573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061043791906109aa565b90506000811415915050919050565b61044f336101fb565b8061045f575061045e336104aa565b5b61049e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104959061092a565b60405180910390fd5b6104a78161076d565b50565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b81526004016105069190610959565b602060405180830381865afa158015610523573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054791906109aa565b905060038114915050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630aaf7043826040518263ffffffff1660e01b81526004016105ae9190610959565b600060405180830381600087803b1580156105c857600080fd5b505af11580156105dc573d6000803e3d6000fd5b5050505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663704b6c02826040518263ffffffff1660e01b815260040161063c9190610959565b600060405180830381600087803b15801561065657600080fd5b505af115801561066a573d6000803e3d6000fd5b5050505050565b8073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16036106df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d690610a23565b60405180910390fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638c6bfb3b826040518263ffffffff1660e01b81526004016107389190610959565b600060405180830381600087803b15801561075257600080fd5b505af1158015610766573d6000803e3d6000fd5b5050505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0ebdbe7826040518263ffffffff1660e01b81526004016107c69190610959565b600060405180830381600087803b1580156107e057600080fd5b505af11580156107f4573d6000803e3d6000fd5b5050505050565b605c80610a4483390190565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006108378261080c565b9050919050565b6108478161082c565b811461085257600080fd5b50565b6000813590506108648161083e565b92915050565b6000602082840312156108805761087f610807565b5b600061088e84828501610855565b91505092915050565b60008115159050919050565b6108ac81610897565b82525050565b60006020820190506108c760008301846108a3565b92915050565b600082825260208201905092915050565b7f63616e6e6f74206d6f6469667920616c6c6f77206c6973740000000000000000600082015250565b60006109146018836108cd565b915061091f826108de565b602082019050919050565b6000602082019050818103600083015261094381610907565b9050919050565b6109538161082c565b82525050565b600060208201905061096e600083018461094a565b92915050565b6000819050919050565b61098781610974565b811461099257600080fd5b50565b6000815190506109a48161097e565b92915050565b6000602082840312156109c0576109bf610807565b5b60006109ce84828501610995565b91505092915050565b7f63616e6e6f74207265766f6b65206f776e20726f6c6500000000000000000000600082015250565b6000610a0d6016836108cd565b9150610a18826109d7565b602082019050919050565b60006020820190508181036000830152610a3c81610a00565b905091905056fe6080604052348015600f57600080fd5b50603f80601d6000396000f3fe6080604052600080fdfea26469706673582212201b63ada7abb6e91d2d1e12f296495b8869914cb13f5e997f27ba66970aa940d664736f6c634300081e0033a2646970667358221220025e7ac7049d4fa024ad2b0dc09cafc87f270b781d61bf6c11a711f4ddd0ef2164736f6c634300081e0033", + Bin: "0x608060405234801561001057600080fd5b50604051610bee380380610bee833981810160405281019061003291906100dd565b80806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505061010a565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100aa8261007f565b9050919050565b6100ba8161009f565b81146100c557600080fd5b50565b6000815190506100d7816100b1565b92915050565b6000602082840312156100f3576100f261007a565b5b6000610101848285016100c8565b91505092915050565b610ad5806101196000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c806374a8f1031161005b57806374a8f103146100ff5780639015d3711461011b578063d0ebdbe71461014b578063f3ae24151461016757610088565b80630aaf70431461008d57806324d7806c146100a95780636cd5c39b146100d9578063704b6c02146100e3575b600080fd5b6100a760048036038101906100a2919061086a565b610197565b005b6100c360048036038101906100be919061086a565b6101fb565b6040516100d091906108b2565b60405180910390f35b6100e16102a6565b005b6100fd60048036038101906100f8919061086a565b6102d2565b005b6101196004803603810190610114919061086a565b610336565b005b6101356004803603810190610130919061086a565b61039a565b60405161014291906108b2565b60405180910390f35b6101656004803603810190610160919061086a565b610446565b005b610181600480360381019061017c919061086a565b6104aa565b60405161018e91906108b2565b60405180910390f35b6101a0336101fb565b806101b057506101af336104aa565b5b6101ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101e69061092a565b60405180910390fd5b6101f881610555565b50565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b81526004016102579190610959565b602060405180830381865afa158015610274573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061029891906109aa565b905060028114915050919050565b6040516102b2906107fb565b604051809103906000f0801580156102ce573d6000803e3d6000fd5b5050565b6102db336101fb565b806102eb57506102ea336104aa565b5b61032a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103219061092a565b60405180910390fd5b610333816105e3565b50565b61033f336101fb565b8061034f575061034e336104aa565b5b61038e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103859061092a565b60405180910390fd5b61039781610671565b50565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b81526004016103f69190610959565b602060405180830381865afa158015610413573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061043791906109aa565b90506000811415915050919050565b61044f336101fb565b8061045f575061045e336104aa565b5b61049e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104959061092a565b60405180910390fd5b6104a78161076d565b50565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b81526004016105069190610959565b602060405180830381865afa158015610523573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054791906109aa565b905060038114915050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630aaf7043826040518263ffffffff1660e01b81526004016105ae9190610959565b600060405180830381600087803b1580156105c857600080fd5b505af11580156105dc573d6000803e3d6000fd5b5050505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663704b6c02826040518263ffffffff1660e01b815260040161063c9190610959565b600060405180830381600087803b15801561065657600080fd5b505af115801561066a573d6000803e3d6000fd5b5050505050565b8073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16036106df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d690610a23565b60405180910390fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638c6bfb3b826040518263ffffffff1660e01b81526004016107389190610959565b600060405180830381600087803b15801561075257600080fd5b505af1158015610766573d6000803e3d6000fd5b5050505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0ebdbe7826040518263ffffffff1660e01b81526004016107c69190610959565b600060405180830381600087803b1580156107e057600080fd5b505af11580156107f4573d6000803e3d6000fd5b5050505050565b605c80610a4483390190565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006108378261080c565b9050919050565b6108478161082c565b811461085257600080fd5b50565b6000813590506108648161083e565b92915050565b6000602082840312156108805761087f610807565b5b600061088e84828501610855565b91505092915050565b60008115159050919050565b6108ac81610897565b82525050565b60006020820190506108c760008301846108a3565b92915050565b600082825260208201905092915050565b7f63616e6e6f74206d6f6469667920616c6c6f77206c6973740000000000000000600082015250565b60006109146018836108cd565b915061091f826108de565b602082019050919050565b6000602082019050818103600083015261094381610907565b9050919050565b6109538161082c565b82525050565b600060208201905061096e600083018461094a565b92915050565b6000819050919050565b61098781610974565b811461099257600080fd5b50565b6000815190506109a48161097e565b92915050565b6000602082840312156109c0576109bf610807565b5b60006109ce84828501610995565b91505092915050565b7f63616e6e6f74207265766f6b65206f776e20726f6c6500000000000000000000600082015250565b6000610a0d6016836108cd565b9150610a18826109d7565b602082019050919050565b60006020820190508181036000830152610a3c81610a00565b905091905056fe6080604052348015600f57600080fd5b50603f80601d6000396000f3fe6080604052600080fdfea26469706673582212207d4b4c070c77654d2f96919d97077b901f3fa4e9510d8ed7d01405863db347f364736f6c634300081e0033a2646970667358221220bdf4f63fd052facd332f269a12bea50b742de223c13ee9a5f705f3199b1fd4e764736f6c634300081e0033", } // AllowListTestABI is the input ABI used to generate the binding from. diff --git a/precompile/allowlist/allowlisttest/solidity/AllowList.sol b/precompile/allowlist/allowlisttest/solidity/AllowList.sol index 390c64b915..f3eb1c84c3 100644 --- a/precompile/allowlist/allowlisttest/solidity/AllowList.sol +++ b/precompile/allowlist/allowlisttest/solidity/AllowList.sol @@ -1,7 +1,7 @@ //SPDX-License-Identifier: MIT pragma solidity ^0.8.24; -import "precompile/allowlist/allowlisttest/IAllowList.sol"; +import "./IAllowList.sol"; // AllowList is a base contract to use AllowList precompile capabilities. contract AllowList { diff --git a/precompile/allowlist/allowlisttest/solidity/AllowListTest.sol b/precompile/allowlist/allowlisttest/solidity/AllowListTest.sol index f71a434069..c872192ffd 100644 --- a/precompile/allowlist/allowlisttest/solidity/AllowListTest.sol +++ b/precompile/allowlist/allowlisttest/solidity/AllowListTest.sol @@ -1,8 +1,8 @@ //SPDX-License-Identifier: MIT pragma solidity ^0.8.24; -import "precompile/allowlist/allowlisttest/IAllowList.sol"; -import "precompile/allowlist/allowlisttest/AllowList.sol"; +import "./IAllowList.sol"; +import "./AllowList.sol"; contract AllowListTest is AllowList { // Precompiled Allow List Contract Address diff --git a/precompile/contracts/feemanager/contract.abi b/precompile/contracts/feemanager/contract.abi new file mode 100644 index 0000000000..1d7b197666 --- /dev/null +++ b/precompile/contracts/feemanager/contract.abi @@ -0,0 +1 @@ +[{"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":"struct IFeeManager.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":"struct IFeeManager.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"}] \ No newline at end of file diff --git a/precompile/contracts/nativeminter/contract.abi b/precompile/contracts/nativeminter/contract.abi new file mode 100644 index 0000000000..3c6ee05e8e --- /dev/null +++ b/precompile/contracts/nativeminter/contract.abi @@ -0,0 +1 @@ +[{"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"}] \ No newline at end of file diff --git a/precompile/contracts/nativeminter/nativemintertest/gen_erc20nativemintertest_binding.go b/precompile/contracts/nativeminter/nativemintertest/gen_erc20nativemintertest_binding.go index 80862c1ac6..a16851ce14 100644 --- a/precompile/contracts/nativeminter/nativemintertest/gen_erc20nativemintertest_binding.go +++ b/precompile/contracts/nativeminter/nativemintertest/gen_erc20nativemintertest_binding.go @@ -32,7 +32,7 @@ var ( // ERC20NativeMinterTestMetaData contains all meta data concerning the ERC20NativeMinterTest contract. var ERC20NativeMinterTestMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nativeMinterPrecompile\",\"type\":\"address\"},{\"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: "0x608060405234801561001057600080fd5b50604051612898380380612898833981810160405281019061003291906105ea565b81336040518060400160405280601681526020017f45524332304e61746976654d696e746572546f6b656e000000000000000000008152506040518060400160405280600481526020017f584d504c0000000000000000000000000000000000000000000000000000000081525081600390816100af9190610870565b5080600490816100bf9190610870565b505050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036101345760006040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260040161012b9190610951565b60405180910390fd5b610143816101de60201b60201c565b5080600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505081600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506101d733826102a460201b60201c565b5050610a30565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036103165760006040517fec442f0500000000000000000000000000000000000000000000000000000000815260040161030d9190610951565b60405180910390fd5b6103286000838361032c60201b60201c565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361037e578060026000828254610372919061099b565b92505081905550610451565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561040a578381836040517fe450d38c000000000000000000000000000000000000000000000000000000008152600401610401939291906109de565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361049a57806002600082825403925050819055506104e7565b806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516105449190610a15565b60405180910390a3505050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061058182610556565b9050919050565b61059181610576565b811461059c57600080fd5b50565b6000815190506105ae81610588565b92915050565b6000819050919050565b6105c7816105b4565b81146105d257600080fd5b50565b6000815190506105e4816105be565b92915050565b6000806040838503121561060157610600610551565b5b600061060f8582860161059f565b9250506020610620858286016105d5565b9150509250929050565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806106ab57607f821691505b6020821081036106be576106bd610664565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026107267fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826106e9565b61073086836106e9565b95508019841693508086168417925050509392505050565b6000819050919050565b600061076d610768610763846105b4565b610748565b6105b4565b9050919050565b6000819050919050565b61078783610752565b61079b61079382610774565b8484546106f6565b825550505050565b600090565b6107b06107a3565b6107bb81848461077e565b505050565b5b818110156107df576107d46000826107a8565b6001810190506107c1565b5050565b601f821115610824576107f5816106c4565b6107fe846106d9565b8101602085101561080d578190505b610821610819856106d9565b8301826107c0565b50505b505050565b600082821c905092915050565b600061084760001984600802610829565b1980831691505092915050565b60006108608383610836565b9150826002028217905092915050565b6108798261062a565b67ffffffffffffffff81111561089257610891610635565b5b61089c8254610693565b6108a78282856107e3565b600060209050601f8311600181146108da57600084156108c8578287015190505b6108d28582610854565b86555061093a565b601f1984166108e8866106c4565b60005b82811015610910578489015182556001820191506020850194506020810190506108eb565b8683101561092d5784890151610929601f891682610836565b8355505b6001600288020188555050505b505050505050565b61094b81610576565b82525050565b60006020820190506109666000830184610942565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006109a6826105b4565b91506109b1836105b4565b92508282019050808211156109c9576109c861096c565b5b92915050565b6109d8816105b4565b82525050565b60006060820190506109f36000830186610942565b610a0060208301856109cf565b610a0d60408301846109cf565b949350505050565b6000602082019050610a2a60008301846109cf565b92915050565b611e5980610a3f6000396000f3fe6080604052600436106101405760003560e01c8063715018a6116100b6578063a9059cbb1161006f578063a9059cbb1461045a578063d0e30db014610497578063d0ebdbe7146104a1578063dd62ed3e146104ca578063f2fde38b14610507578063f3ae24151461053057610140565b8063715018a61461035e57806374a8f103146103755780638da5cb5b1461039e5780639015d371146103c957806395d89b41146104065780639dc29fac1461043157610140565b806323b872dd1161010857806323b872dd1461022a57806324d7806c14610267578063313ce567146102a457806340c10f19146102cf578063704b6c02146102f857806370a082311461032157610140565b80630356b6cd1461014557806306fdde031461016e578063095ea7b3146101995780630aaf7043146101d657806318160ddd146101ff575b600080fd5b34801561015157600080fd5b5061016c600480360381019061016791906118e8565b61056d565b005b34801561017a57600080fd5b50610183610657565b60405161019091906119a5565b60405180910390f35b3480156101a557600080fd5b506101c060048036038101906101bb9190611a25565b6106e9565b6040516101cd9190611a80565b60405180910390f35b3480156101e257600080fd5b506101fd60048036038101906101f89190611a9b565b61070c565b005b34801561020b57600080fd5b50610214610770565b6040516102219190611ad7565b60405180910390f35b34801561023657600080fd5b50610251600480360381019061024c9190611af2565b61077a565b60405161025e9190611a80565b60405180910390f35b34801561027357600080fd5b5061028e60048036038101906102899190611a9b565b6107a9565b60405161029b9190611a80565b60405180910390f35b3480156102b057600080fd5b506102b9610856565b6040516102c69190611b61565b60405180910390f35b3480156102db57600080fd5b506102f660048036038101906102f19190611a25565b61085f565b005b34801561030457600080fd5b5061031f600480360381019061031a9190611a9b565b610875565b005b34801561032d57600080fd5b5061034860048036038101906103439190611a9b565b6108d9565b6040516103559190611ad7565b60405180910390f35b34801561036a57600080fd5b50610373610921565b005b34801561038157600080fd5b5061039c60048036038101906103979190611a9b565b610935565b005b3480156103aa57600080fd5b506103b3610999565b6040516103c09190611b8b565b60405180910390f35b3480156103d557600080fd5b506103f060048036038101906103eb9190611a9b565b6109c3565b6040516103fd9190611a80565b60405180910390f35b34801561041257600080fd5b5061041b610a71565b60405161042891906119a5565b60405180910390f35b34801561043d57600080fd5b5061045860048036038101906104539190611a25565b610b03565b005b34801561046657600080fd5b50610481600480360381019061047c9190611a25565b610b19565b60405161048e9190611a80565b60405180910390f35b61049f610b3c565b005b3480156104ad57600080fd5b506104c860048036038101906104c39190611a9b565b610bf1565b005b3480156104d657600080fd5b506104f160048036038101906104ec9190611ba6565b610c55565b6040516104fe9190611ad7565b60405180910390f35b34801561051357600080fd5b5061052e60048036038101906105299190611a9b565b610cdc565b005b34801561053c57600080fd5b5061055760048036038101906105529190611a9b565b610d62565b6040516105649190611a80565b60405180910390f35b6105773382610e0f565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634f5aaaba33836040518363ffffffff1660e01b81526004016105d4929190611be6565b600060405180830381600087803b1580156105ee57600080fd5b505af1158015610602573d6000803e3d6000fd5b505050503373ffffffffffffffffffffffffffffffffffffffff167f25bedde6c8ebd3a89b719a16299dbfe271c7bffa42fe1ac1a52e15ab0cb767e68260405161064c9190611ad7565b60405180910390a250565b60606003805461066690611c3e565b80601f016020809104026020016040519081016040528092919081815260200182805461069290611c3e565b80156106df5780601f106106b4576101008083540402835291602001916106df565b820191906000526020600020905b8154815290600101906020018083116106c257829003601f168201915b5050505050905090565b6000806106f4610e91565b9050610701818585610e99565b600191505092915050565b610715336107a9565b80610725575061072433610d62565b5b610764576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161075b90611cbb565b60405180910390fd5b61076d81610eab565b50565b6000600254905090565b600080610785610e91565b9050610792858285610f3b565b61079d858585610fd0565b60019150509392505050565b600080600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b81526004016108079190611b8b565b602060405180830381865afa158015610824573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108489190611cf0565b905060028114915050919050565b60006012905090565b6108676110c4565b610871828261114b565b5050565b61087e336107a9565b8061088e575061088d33610d62565b5b6108cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108c490611cbb565b60405180910390fd5b6108d6816111cd565b50565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6109296110c4565b610933600061125d565b565b61093e336107a9565b8061094e575061094d33610d62565b5b61098d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161098490611cbb565b60405180910390fd5b61099681611323565b50565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b8152600401610a219190611b8b565b602060405180830381865afa158015610a3e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a629190611cf0565b90506000811415915050919050565b606060048054610a8090611c3e565b80601f0160208091040260200160405190810160405280929190818152602001828054610aac90611c3e565b8015610af95780601f10610ace57610100808354040283529160200191610af9565b820191906000526020600020905b815481529060010190602001808311610adc57829003601f168201915b5050505050905090565b610b0b6110c4565b610b158282610e0f565b5050565b600080610b24610e91565b9050610b31818585610fd0565b600191505092915050565b73010000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015610b96573d6000803e3d6000fd5b50610ba1333461114b565b3373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c34604051610be79190611ad7565b60405180910390a2565b610bfa336107a9565b80610c0a5750610c0933610d62565b5b610c49576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c4090611cbb565b60405180910390fd5b610c5281611421565b50565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610ce46110c4565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610d565760006040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401610d4d9190611b8b565b60405180910390fd5b610d5f8161125d565b50565b600080600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b8152600401610dc09190611b8b565b602060405180830381865afa158015610ddd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e019190611cf0565b905060038114915050919050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610e815760006040517f96c6fd1e000000000000000000000000000000000000000000000000000000008152600401610e789190611b8b565b60405180910390fd5b610e8d826000836114b1565b5050565b600033905090565b610ea683838360016116d6565b505050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630aaf7043826040518263ffffffff1660e01b8152600401610f069190611b8b565b600060405180830381600087803b158015610f2057600080fd5b505af1158015610f34573d6000803e3d6000fd5b5050505050565b6000610f478484610c55565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811015610fca5781811015610fba578281836040517ffb8f41b2000000000000000000000000000000000000000000000000000000008152600401610fb193929190611d1d565b60405180910390fd5b610fc9848484840360006116d6565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036110425760006040517f96c6fd1e0000000000000000000000000000000000000000000000000000000081526004016110399190611b8b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036110b45760006040517fec442f050000000000000000000000000000000000000000000000000000000081526004016110ab9190611b8b565b60405180910390fd5b6110bf8383836114b1565b505050565b6110cc610e91565b73ffffffffffffffffffffffffffffffffffffffff166110ea610999565b73ffffffffffffffffffffffffffffffffffffffff16146111495761110d610e91565b6040517f118cdaa70000000000000000000000000000000000000000000000000000000081526004016111409190611b8b565b60405180910390fd5b565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036111bd5760006040517fec442f050000000000000000000000000000000000000000000000000000000081526004016111b49190611b8b565b60405180910390fd5b6111c9600083836114b1565b5050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663704b6c02826040518263ffffffff1660e01b81526004016112289190611b8b565b600060405180830381600087803b15801561124257600080fd5b505af1158015611256573d6000803e3d6000fd5b5050505050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b8073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1603611391576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138890611da0565b60405180910390fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638c6bfb3b826040518263ffffffff1660e01b81526004016113ec9190611b8b565b600060405180830381600087803b15801561140657600080fd5b505af115801561141a573d6000803e3d6000fd5b5050505050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0ebdbe7826040518263ffffffff1660e01b815260040161147c9190611b8b565b600060405180830381600087803b15801561149657600080fd5b505af11580156114aa573d6000803e3d6000fd5b5050505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036115035780600260008282546114f79190611def565b925050819055506115d6565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561158f578381836040517fe450d38c00000000000000000000000000000000000000000000000000000000815260040161158693929190611d1d565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361161f578060026000828254039250508190555061166c565b806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516116c99190611ad7565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16036117485760006040517fe602df0500000000000000000000000000000000000000000000000000000000815260040161173f9190611b8b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036117ba5760006040517f94280d620000000000000000000000000000000000000000000000000000000081526004016117b19190611b8b565b60405180910390fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080156118a7578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405161189e9190611ad7565b60405180910390a35b50505050565b600080fd5b6000819050919050565b6118c5816118b2565b81146118d057600080fd5b50565b6000813590506118e2816118bc565b92915050565b6000602082840312156118fe576118fd6118ad565b5b600061190c848285016118d3565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561194f578082015181840152602081019050611934565b60008484015250505050565b6000601f19601f8301169050919050565b600061197782611915565b6119818185611920565b9350611991818560208601611931565b61199a8161195b565b840191505092915050565b600060208201905081810360008301526119bf818461196c565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006119f2826119c7565b9050919050565b611a02816119e7565b8114611a0d57600080fd5b50565b600081359050611a1f816119f9565b92915050565b60008060408385031215611a3c57611a3b6118ad565b5b6000611a4a85828601611a10565b9250506020611a5b858286016118d3565b9150509250929050565b60008115159050919050565b611a7a81611a65565b82525050565b6000602082019050611a956000830184611a71565b92915050565b600060208284031215611ab157611ab06118ad565b5b6000611abf84828501611a10565b91505092915050565b611ad1816118b2565b82525050565b6000602082019050611aec6000830184611ac8565b92915050565b600080600060608486031215611b0b57611b0a6118ad565b5b6000611b1986828701611a10565b9350506020611b2a86828701611a10565b9250506040611b3b868287016118d3565b9150509250925092565b600060ff82169050919050565b611b5b81611b45565b82525050565b6000602082019050611b766000830184611b52565b92915050565b611b85816119e7565b82525050565b6000602082019050611ba06000830184611b7c565b92915050565b60008060408385031215611bbd57611bbc6118ad565b5b6000611bcb85828601611a10565b9250506020611bdc85828601611a10565b9150509250929050565b6000604082019050611bfb6000830185611b7c565b611c086020830184611ac8565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680611c5657607f821691505b602082108103611c6957611c68611c0f565b5b50919050565b7f63616e6e6f74206d6f6469667920616c6c6f77206c6973740000000000000000600082015250565b6000611ca5601883611920565b9150611cb082611c6f565b602082019050919050565b60006020820190508181036000830152611cd481611c98565b9050919050565b600081519050611cea816118bc565b92915050565b600060208284031215611d0657611d056118ad565b5b6000611d1484828501611cdb565b91505092915050565b6000606082019050611d326000830186611b7c565b611d3f6020830185611ac8565b611d4c6040830184611ac8565b949350505050565b7f63616e6e6f74207265766f6b65206f776e20726f6c6500000000000000000000600082015250565b6000611d8a601683611920565b9150611d9582611d54565b602082019050919050565b60006020820190508181036000830152611db981611d7d565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611dfa826118b2565b9150611e05836118b2565b9250828201905080821115611e1d57611e1c611dc0565b5b9291505056fea2646970667358221220d951a00d4131bbe3db6a9977d69f9acbbf24acb083de98cea08b44067634691964736f6c634300081e0033", + Bin: "0x608060405234801561001057600080fd5b50604051612898380380612898833981810160405281019061003291906105ea565b81336040518060400160405280601681526020017f45524332304e61746976654d696e746572546f6b656e000000000000000000008152506040518060400160405280600481526020017f584d504c0000000000000000000000000000000000000000000000000000000081525081600390816100af9190610870565b5080600490816100bf9190610870565b505050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036101345760006040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260040161012b9190610951565b60405180910390fd5b610143816101de60201b60201c565b5080600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505081600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506101d733826102a460201b60201c565b5050610a30565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036103165760006040517fec442f0500000000000000000000000000000000000000000000000000000000815260040161030d9190610951565b60405180910390fd5b6103286000838361032c60201b60201c565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361037e578060026000828254610372919061099b565b92505081905550610451565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561040a578381836040517fe450d38c000000000000000000000000000000000000000000000000000000008152600401610401939291906109de565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361049a57806002600082825403925050819055506104e7565b806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516105449190610a15565b60405180910390a3505050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061058182610556565b9050919050565b61059181610576565b811461059c57600080fd5b50565b6000815190506105ae81610588565b92915050565b6000819050919050565b6105c7816105b4565b81146105d257600080fd5b50565b6000815190506105e4816105be565b92915050565b6000806040838503121561060157610600610551565b5b600061060f8582860161059f565b9250506020610620858286016105d5565b9150509250929050565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806106ab57607f821691505b6020821081036106be576106bd610664565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026107267fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826106e9565b61073086836106e9565b95508019841693508086168417925050509392505050565b6000819050919050565b600061076d610768610763846105b4565b610748565b6105b4565b9050919050565b6000819050919050565b61078783610752565b61079b61079382610774565b8484546106f6565b825550505050565b600090565b6107b06107a3565b6107bb81848461077e565b505050565b5b818110156107df576107d46000826107a8565b6001810190506107c1565b5050565b601f821115610824576107f5816106c4565b6107fe846106d9565b8101602085101561080d578190505b610821610819856106d9565b8301826107c0565b50505b505050565b600082821c905092915050565b600061084760001984600802610829565b1980831691505092915050565b60006108608383610836565b9150826002028217905092915050565b6108798261062a565b67ffffffffffffffff81111561089257610891610635565b5b61089c8254610693565b6108a78282856107e3565b600060209050601f8311600181146108da57600084156108c8578287015190505b6108d28582610854565b86555061093a565b601f1984166108e8866106c4565b60005b82811015610910578489015182556001820191506020850194506020810190506108eb565b8683101561092d5784890151610929601f891682610836565b8355505b6001600288020188555050505b505050505050565b61094b81610576565b82525050565b60006020820190506109666000830184610942565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006109a6826105b4565b91506109b1836105b4565b92508282019050808211156109c9576109c861096c565b5b92915050565b6109d8816105b4565b82525050565b60006060820190506109f36000830186610942565b610a0060208301856109cf565b610a0d60408301846109cf565b949350505050565b6000602082019050610a2a60008301846109cf565b92915050565b611e5980610a3f6000396000f3fe6080604052600436106101405760003560e01c8063715018a6116100b6578063a9059cbb1161006f578063a9059cbb1461045a578063d0e30db014610497578063d0ebdbe7146104a1578063dd62ed3e146104ca578063f2fde38b14610507578063f3ae24151461053057610140565b8063715018a61461035e57806374a8f103146103755780638da5cb5b1461039e5780639015d371146103c957806395d89b41146104065780639dc29fac1461043157610140565b806323b872dd1161010857806323b872dd1461022a57806324d7806c14610267578063313ce567146102a457806340c10f19146102cf578063704b6c02146102f857806370a082311461032157610140565b80630356b6cd1461014557806306fdde031461016e578063095ea7b3146101995780630aaf7043146101d657806318160ddd146101ff575b600080fd5b34801561015157600080fd5b5061016c600480360381019061016791906118e8565b61056d565b005b34801561017a57600080fd5b50610183610657565b60405161019091906119a5565b60405180910390f35b3480156101a557600080fd5b506101c060048036038101906101bb9190611a25565b6106e9565b6040516101cd9190611a80565b60405180910390f35b3480156101e257600080fd5b506101fd60048036038101906101f89190611a9b565b61070c565b005b34801561020b57600080fd5b50610214610770565b6040516102219190611ad7565b60405180910390f35b34801561023657600080fd5b50610251600480360381019061024c9190611af2565b61077a565b60405161025e9190611a80565b60405180910390f35b34801561027357600080fd5b5061028e60048036038101906102899190611a9b565b6107a9565b60405161029b9190611a80565b60405180910390f35b3480156102b057600080fd5b506102b9610856565b6040516102c69190611b61565b60405180910390f35b3480156102db57600080fd5b506102f660048036038101906102f19190611a25565b61085f565b005b34801561030457600080fd5b5061031f600480360381019061031a9190611a9b565b610875565b005b34801561032d57600080fd5b5061034860048036038101906103439190611a9b565b6108d9565b6040516103559190611ad7565b60405180910390f35b34801561036a57600080fd5b50610373610921565b005b34801561038157600080fd5b5061039c60048036038101906103979190611a9b565b610935565b005b3480156103aa57600080fd5b506103b3610999565b6040516103c09190611b8b565b60405180910390f35b3480156103d557600080fd5b506103f060048036038101906103eb9190611a9b565b6109c3565b6040516103fd9190611a80565b60405180910390f35b34801561041257600080fd5b5061041b610a71565b60405161042891906119a5565b60405180910390f35b34801561043d57600080fd5b5061045860048036038101906104539190611a25565b610b03565b005b34801561046657600080fd5b50610481600480360381019061047c9190611a25565b610b19565b60405161048e9190611a80565b60405180910390f35b61049f610b3c565b005b3480156104ad57600080fd5b506104c860048036038101906104c39190611a9b565b610bf1565b005b3480156104d657600080fd5b506104f160048036038101906104ec9190611ba6565b610c55565b6040516104fe9190611ad7565b60405180910390f35b34801561051357600080fd5b5061052e60048036038101906105299190611a9b565b610cdc565b005b34801561053c57600080fd5b5061055760048036038101906105529190611a9b565b610d62565b6040516105649190611a80565b60405180910390f35b6105773382610e0f565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634f5aaaba33836040518363ffffffff1660e01b81526004016105d4929190611be6565b600060405180830381600087803b1580156105ee57600080fd5b505af1158015610602573d6000803e3d6000fd5b505050503373ffffffffffffffffffffffffffffffffffffffff167f25bedde6c8ebd3a89b719a16299dbfe271c7bffa42fe1ac1a52e15ab0cb767e68260405161064c9190611ad7565b60405180910390a250565b60606003805461066690611c3e565b80601f016020809104026020016040519081016040528092919081815260200182805461069290611c3e565b80156106df5780601f106106b4576101008083540402835291602001916106df565b820191906000526020600020905b8154815290600101906020018083116106c257829003601f168201915b5050505050905090565b6000806106f4610e91565b9050610701818585610e99565b600191505092915050565b610715336107a9565b80610725575061072433610d62565b5b610764576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161075b90611cbb565b60405180910390fd5b61076d81610eab565b50565b6000600254905090565b600080610785610e91565b9050610792858285610f3b565b61079d858585610fd0565b60019150509392505050565b600080600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b81526004016108079190611b8b565b602060405180830381865afa158015610824573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108489190611cf0565b905060028114915050919050565b60006012905090565b6108676110c4565b610871828261114b565b5050565b61087e336107a9565b8061088e575061088d33610d62565b5b6108cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108c490611cbb565b60405180910390fd5b6108d6816111cd565b50565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6109296110c4565b610933600061125d565b565b61093e336107a9565b8061094e575061094d33610d62565b5b61098d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161098490611cbb565b60405180910390fd5b61099681611323565b50565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b8152600401610a219190611b8b565b602060405180830381865afa158015610a3e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a629190611cf0565b90506000811415915050919050565b606060048054610a8090611c3e565b80601f0160208091040260200160405190810160405280929190818152602001828054610aac90611c3e565b8015610af95780601f10610ace57610100808354040283529160200191610af9565b820191906000526020600020905b815481529060010190602001808311610adc57829003601f168201915b5050505050905090565b610b0b6110c4565b610b158282610e0f565b5050565b600080610b24610e91565b9050610b31818585610fd0565b600191505092915050565b73010000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015610b96573d6000803e3d6000fd5b50610ba1333461114b565b3373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c34604051610be79190611ad7565b60405180910390a2565b610bfa336107a9565b80610c0a5750610c0933610d62565b5b610c49576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c4090611cbb565b60405180910390fd5b610c5281611421565b50565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610ce46110c4565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610d565760006040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401610d4d9190611b8b565b60405180910390fd5b610d5f8161125d565b50565b600080600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b8152600401610dc09190611b8b565b602060405180830381865afa158015610ddd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e019190611cf0565b905060038114915050919050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610e815760006040517f96c6fd1e000000000000000000000000000000000000000000000000000000008152600401610e789190611b8b565b60405180910390fd5b610e8d826000836114b1565b5050565b600033905090565b610ea683838360016116d6565b505050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630aaf7043826040518263ffffffff1660e01b8152600401610f069190611b8b565b600060405180830381600087803b158015610f2057600080fd5b505af1158015610f34573d6000803e3d6000fd5b5050505050565b6000610f478484610c55565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811015610fca5781811015610fba578281836040517ffb8f41b2000000000000000000000000000000000000000000000000000000008152600401610fb193929190611d1d565b60405180910390fd5b610fc9848484840360006116d6565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036110425760006040517f96c6fd1e0000000000000000000000000000000000000000000000000000000081526004016110399190611b8b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036110b45760006040517fec442f050000000000000000000000000000000000000000000000000000000081526004016110ab9190611b8b565b60405180910390fd5b6110bf8383836114b1565b505050565b6110cc610e91565b73ffffffffffffffffffffffffffffffffffffffff166110ea610999565b73ffffffffffffffffffffffffffffffffffffffff16146111495761110d610e91565b6040517f118cdaa70000000000000000000000000000000000000000000000000000000081526004016111409190611b8b565b60405180910390fd5b565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036111bd5760006040517fec442f050000000000000000000000000000000000000000000000000000000081526004016111b49190611b8b565b60405180910390fd5b6111c9600083836114b1565b5050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663704b6c02826040518263ffffffff1660e01b81526004016112289190611b8b565b600060405180830381600087803b15801561124257600080fd5b505af1158015611256573d6000803e3d6000fd5b5050505050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b8073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1603611391576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138890611da0565b60405180910390fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638c6bfb3b826040518263ffffffff1660e01b81526004016113ec9190611b8b565b600060405180830381600087803b15801561140657600080fd5b505af115801561141a573d6000803e3d6000fd5b5050505050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0ebdbe7826040518263ffffffff1660e01b815260040161147c9190611b8b565b600060405180830381600087803b15801561149657600080fd5b505af11580156114aa573d6000803e3d6000fd5b5050505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036115035780600260008282546114f79190611def565b925050819055506115d6565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561158f578381836040517fe450d38c00000000000000000000000000000000000000000000000000000000815260040161158693929190611d1d565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361161f578060026000828254039250508190555061166c565b806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516116c99190611ad7565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16036117485760006040517fe602df0500000000000000000000000000000000000000000000000000000000815260040161173f9190611b8b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036117ba5760006040517f94280d620000000000000000000000000000000000000000000000000000000081526004016117b19190611b8b565b60405180910390fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080156118a7578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405161189e9190611ad7565b60405180910390a35b50505050565b600080fd5b6000819050919050565b6118c5816118b2565b81146118d057600080fd5b50565b6000813590506118e2816118bc565b92915050565b6000602082840312156118fe576118fd6118ad565b5b600061190c848285016118d3565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561194f578082015181840152602081019050611934565b60008484015250505050565b6000601f19601f8301169050919050565b600061197782611915565b6119818185611920565b9350611991818560208601611931565b61199a8161195b565b840191505092915050565b600060208201905081810360008301526119bf818461196c565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006119f2826119c7565b9050919050565b611a02816119e7565b8114611a0d57600080fd5b50565b600081359050611a1f816119f9565b92915050565b60008060408385031215611a3c57611a3b6118ad565b5b6000611a4a85828601611a10565b9250506020611a5b858286016118d3565b9150509250929050565b60008115159050919050565b611a7a81611a65565b82525050565b6000602082019050611a956000830184611a71565b92915050565b600060208284031215611ab157611ab06118ad565b5b6000611abf84828501611a10565b91505092915050565b611ad1816118b2565b82525050565b6000602082019050611aec6000830184611ac8565b92915050565b600080600060608486031215611b0b57611b0a6118ad565b5b6000611b1986828701611a10565b9350506020611b2a86828701611a10565b9250506040611b3b868287016118d3565b9150509250925092565b600060ff82169050919050565b611b5b81611b45565b82525050565b6000602082019050611b766000830184611b52565b92915050565b611b85816119e7565b82525050565b6000602082019050611ba06000830184611b7c565b92915050565b60008060408385031215611bbd57611bbc6118ad565b5b6000611bcb85828601611a10565b9250506020611bdc85828601611a10565b9150509250929050565b6000604082019050611bfb6000830185611b7c565b611c086020830184611ac8565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680611c5657607f821691505b602082108103611c6957611c68611c0f565b5b50919050565b7f63616e6e6f74206d6f6469667920616c6c6f77206c6973740000000000000000600082015250565b6000611ca5601883611920565b9150611cb082611c6f565b602082019050919050565b60006020820190508181036000830152611cd481611c98565b9050919050565b600081519050611cea816118bc565b92915050565b600060208284031215611d0657611d056118ad565b5b6000611d1484828501611cdb565b91505092915050565b6000606082019050611d326000830186611b7c565b611d3f6020830185611ac8565b611d4c6040830184611ac8565b949350505050565b7f63616e6e6f74207265766f6b65206f776e20726f6c6500000000000000000000600082015250565b6000611d8a601683611920565b9150611d9582611d54565b602082019050919050565b60006020820190508181036000830152611db981611d7d565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611dfa826118b2565b9150611e05836118b2565b9250828201905080821115611e1d57611e1c611dc0565b5b9291505056fea2646970667358221220c27c2a3cd8df9cbc72831c94ef6545feddfe1f5dbb301a61d06809a2a184543464736f6c634300081e0033", } // ERC20NativeMinterTestABI is the input ABI used to generate the binding from. diff --git a/precompile/contracts/nativeminter/nativemintertest/gen_minter_binding.go b/precompile/contracts/nativeminter/nativemintertest/gen_minter_binding.go index 5551fceb7c..03e3d15752 100644 --- a/precompile/contracts/nativeminter/nativemintertest/gen_minter_binding.go +++ b/precompile/contracts/nativeminter/nativemintertest/gen_minter_binding.go @@ -32,7 +32,7 @@ var ( // MinterMetaData contains all meta data concerning the Minter contract. var MinterMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mintdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", - Bin: "0x608060405234801561001057600080fd5b5060405161037c38038061037c833981810160405281019061003291906100db565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610108565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100a88261007d565b9050919050565b6100b88161009d565b81146100c357600080fd5b50565b6000815190506100d5816100af565b92915050565b6000602082840312156100f1576100f0610078565b5b60006100ff848285016100c6565b91505092915050565b610265806101176000396000f3fe60806040526004361061002d5760003560e01c80630356b6cd14610039578063b6b55f251461006257610034565b3661003457005b600080fd5b34801561004557600080fd5b50610060600480360381019061005b91906101d8565b61008b565b005b34801561006e57600080fd5b50610089600480360381019061008491906101d8565b610119565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630356b6cd826040518263ffffffff1660e01b81526004016100e49190610214565b600060405180830381600087803b1580156100fe57600080fd5b505af1158015610112573d6000803e3d6000fd5b5050505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b15801561018157600080fd5b505af1158015610195573d6000803e3d6000fd5b505050505050565b600080fd5b6000819050919050565b6101b5816101a2565b81146101c057600080fd5b50565b6000813590506101d2816101ac565b92915050565b6000602082840312156101ee576101ed61019d565b5b60006101fc848285016101c3565b91505092915050565b61020e816101a2565b82525050565b60006020820190506102296000830184610205565b9291505056fea2646970667358221220604a52a3b491209cf462bf00111878c11d818c0e9a407b9c0b4e4cb3dc7411e964736f6c634300081e0033", + Bin: "0x608060405234801561001057600080fd5b5060405161037c38038061037c833981810160405281019061003291906100db565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610108565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100a88261007d565b9050919050565b6100b88161009d565b81146100c357600080fd5b50565b6000815190506100d5816100af565b92915050565b6000602082840312156100f1576100f0610078565b5b60006100ff848285016100c6565b91505092915050565b610265806101176000396000f3fe60806040526004361061002d5760003560e01c80630356b6cd14610039578063b6b55f251461006257610034565b3661003457005b600080fd5b34801561004557600080fd5b50610060600480360381019061005b91906101d8565b61008b565b005b34801561006e57600080fd5b50610089600480360381019061008491906101d8565b610119565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630356b6cd826040518263ffffffff1660e01b81526004016100e49190610214565b600060405180830381600087803b1580156100fe57600080fd5b505af1158015610112573d6000803e3d6000fd5b5050505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b15801561018157600080fd5b505af1158015610195573d6000803e3d6000fd5b505050505050565b600080fd5b6000819050919050565b6101b5816101a2565b81146101c057600080fd5b50565b6000813590506101d2816101ac565b92915050565b6000602082840312156101ee576101ed61019d565b5b60006101fc848285016101c3565b91505092915050565b61020e816101a2565b82525050565b60006020820190506102296000830184610205565b9291505056fea2646970667358221220e60fd078eaa20604f975ca8e56ecfaf66d2878fd341d77a5c6ba9d1c817692c664736f6c634300081e0033", } // MinterABI is the input ABI used to generate the binding from. diff --git a/precompile/contracts/nativeminter/nativemintertest/solidity/ERC20NativeMinterTest.sol b/precompile/contracts/nativeminter/nativemintertest/solidity/ERC20NativeMinterTest.sol index 7b97a4948e..563e6bdb42 100644 --- a/precompile/contracts/nativeminter/nativemintertest/solidity/ERC20NativeMinterTest.sol +++ b/precompile/contracts/nativeminter/nativemintertest/solidity/ERC20NativeMinterTest.sol @@ -3,8 +3,8 @@ pragma solidity ^0.8.24; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; -import "precompile/allowlist/allowlisttest/AllowList.sol"; -import "precompile/contracts/nativeminter/nativemintertest/INativeMinter.sol"; +import "precompile/allowlist/allowlisttest/solidity/AllowList.sol"; +import "./INativeMinter.sol"; // Designated Blackhole Address address constant BLACKHOLE_ADDRESS = 0x0100000000000000000000000000000000000000; diff --git a/precompile/contracts/nativeminter/nativemintertest/solidity/INativeMinter.sol b/precompile/contracts/nativeminter/nativemintertest/solidity/INativeMinter.sol index 376a872638..5c3aaf836f 100644 --- a/precompile/contracts/nativeminter/nativemintertest/solidity/INativeMinter.sol +++ b/precompile/contracts/nativeminter/nativemintertest/solidity/INativeMinter.sol @@ -1,6 +1,6 @@ //SPDX-License-Identifier: MIT pragma solidity ^0.8.24; -import "precompile/allowlist/allowlisttest/IAllowList.sol"; +import "precompile/allowlist/allowlisttest/solidity/IAllowList.sol"; interface INativeMinter is IAllowList { event NativeCoinMinted(address indexed sender, address indexed recipient, uint256 amount); diff --git a/precompile/contracts/nativeminter/nativemintertest/solidity/Minter.sol b/precompile/contracts/nativeminter/nativemintertest/solidity/Minter.sol index 632324fce2..912380a383 100644 --- a/precompile/contracts/nativeminter/nativemintertest/solidity/Minter.sol +++ b/precompile/contracts/nativeminter/nativemintertest/solidity/Minter.sol @@ -1,7 +1,7 @@ //SPDX-License-Identifier: MIT pragma solidity ^0.8.24; -import "precompile/contracts/nativeminter/nativemintertest/ERC20NativeMinterTest.sol"; +import "./ERC20NativeMinterTest.sol"; // Helper contract to test minting from another contract contract Minter { diff --git a/precompile/contracts/rewardmanager/contract.abi b/precompile/contracts/rewardmanager/contract.abi new file mode 100644 index 0000000000..66029f7ba0 --- /dev/null +++ b/precompile/contracts/rewardmanager/contract.abi @@ -0,0 +1 @@ +[{"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"}] \ No newline at end of file diff --git a/precompile/contracts/warp/contract.abi b/precompile/contracts/warp/contract.abi new file mode 100644 index 0000000000..908d7d1734 --- /dev/null +++ b/precompile/contracts/warp/contract.abi @@ -0,0 +1 @@ +[{"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":"struct WarpBlockHash","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":"struct WarpMessage","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"}] \ No newline at end of file From 5a0ccbbb465af6ba5020254f56b1cb8124f8f1d1 Mon Sep 17 00:00:00 2001 From: Jonathan Oppenheimer Date: Fri, 21 Nov 2025 16:03:20 -0500 Subject: [PATCH 03/23] restore files --- precompile/allowlist/allowlist.abi | 105 ++++++- precompile/contracts/feemanager/contract.abi | 292 +++++++++++++++++- .../contracts/nativeminter/contract.abi | 117 ++++++- .../contracts/rewardmanager/contract.abi | 178 ++++++++++- precompile/contracts/warp/contract.abi | 137 +++++++- 5 files changed, 824 insertions(+), 5 deletions(-) diff --git a/precompile/allowlist/allowlist.abi b/precompile/allowlist/allowlist.abi index 957929d8c3..4e1c4f1fcb 100644 --- a/precompile/allowlist/allowlist.abi +++ b/precompile/allowlist/allowlist.abi @@ -1 +1,104 @@ -[{"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"}] \ No newline at end of file +[ + { + "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" + } +] diff --git a/precompile/contracts/feemanager/contract.abi b/precompile/contracts/feemanager/contract.abi index 1d7b197666..0e49755fbf 100644 --- a/precompile/contracts/feemanager/contract.abi +++ b/precompile/contracts/feemanager/contract.abi @@ -1 +1,291 @@ -[{"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":"struct IFeeManager.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":"struct IFeeManager.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"}] \ No newline at end of file +[ + { + "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": "struct IFeeManager.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": "struct IFeeManager.FeeConfig", + "name": "newFeeConfig", + "type": "tuple" + } + ], + "name": "FeeConfigChanged", + "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" + } +] diff --git a/precompile/contracts/nativeminter/contract.abi b/precompile/contracts/nativeminter/contract.abi index 3c6ee05e8e..49655d790a 100644 --- a/precompile/contracts/nativeminter/contract.abi +++ b/precompile/contracts/nativeminter/contract.abi @@ -1 +1,116 @@ -[{"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"}] \ No newline at end of file +[ + { + "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" + }, + { + "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" + } +] diff --git a/precompile/contracts/rewardmanager/contract.abi b/precompile/contracts/rewardmanager/contract.abi index 66029f7ba0..5b80821de3 100644 --- a/precompile/contracts/rewardmanager/contract.abi +++ b/precompile/contracts/rewardmanager/contract.abi @@ -1 +1,177 @@ -[{"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"}] \ No newline at end of file +[ + { + "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" + }, + { + "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" + } +] diff --git a/precompile/contracts/warp/contract.abi b/precompile/contracts/warp/contract.abi index 908d7d1734..771103ecbc 100644 --- a/precompile/contracts/warp/contract.abi +++ b/precompile/contracts/warp/contract.abi @@ -1 +1,136 @@ -[{"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":"struct WarpBlockHash","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":"struct WarpMessage","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"}] \ No newline at end of file +[ + { + "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": "struct WarpBlockHash", + "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": "struct WarpMessage", + "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" + } +] From ef32f2f0661183262c0727ef4d4cc34f21834e69 Mon Sep 17 00:00:00 2001 From: Jonathan Oppenheimer Date: Fri, 21 Nov 2025 16:11:14 -0500 Subject: [PATCH 04/23] restore name --- .../nativeminter/nativemintertest/compile.go | 6 +- ...ng.go => gen_erc20nativeminter_binding.go} | 632 +++++++++--------- .../nativemintertest/gen_minter_binding.go | 2 +- .../nativemintertest/simulated_test.go | 16 +- ...veMinterTest.sol => ERC20NativeMinter.sol} | 2 +- .../nativemintertest/solidity/Minter.sol | 6 +- .../contracts/testutils/simulated_helpers.go | 1 + 7 files changed, 333 insertions(+), 332 deletions(-) rename precompile/contracts/nativeminter/nativemintertest/{gen_erc20nativemintertest_binding.go => gen_erc20nativeminter_binding.go} (65%) rename precompile/contracts/nativeminter/nativemintertest/solidity/{ERC20NativeMinterTest.sol => ERC20NativeMinter.sol} (97%) diff --git a/precompile/contracts/nativeminter/nativemintertest/compile.go b/precompile/contracts/nativeminter/nativemintertest/compile.go index 5afed2d567..0542383b2d 100644 --- a/precompile/contracts/nativeminter/nativemintertest/compile.go +++ b/precompile/contracts/nativeminter/nativemintertest/compile.go @@ -4,10 +4,10 @@ package nativemintertest // 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/=contracts/lib/openzeppelin-contracts/contracts/ precompile/=precompile/ --evm-version paris solidity/ERC20NativeMinterTest.sol solidity/Minter.sol +//go:generate solc-v0.8.30 -o artifacts --overwrite --abi --bin --base-path ../../../.. @openzeppelin/contracts/=contracts/lib/openzeppelin-contracts/contracts/ precompile/=precompile/ --evm-version paris solidity/ERC20NativeMinter.sol solidity/Minter.sol // Step 2: Generate Go bindings from the compiled artifacts //go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg nativemintertest --type INativeMinter --abi artifacts/INativeMinter.abi --bin artifacts/INativeMinter.bin --out gen_inativeminter_binding.go -//go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg nativemintertest --type ERC20NativeMinterTest --abi artifacts/ERC20NativeMinterTest.abi --bin artifacts/ERC20NativeMinterTest.bin --out gen_erc20nativemintertest_binding.go +//go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg nativemintertest --type ERC20NativeMinter --abi artifacts/ERC20NativeMinter.abi --bin artifacts/ERC20NativeMinter.bin --out gen_erc20nativeminter_binding.go //go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg nativemintertest --type Minter --abi artifacts/Minter.abi --bin artifacts/Minter.bin --out gen_minter_binding.go // Step 3: Replace import paths in generated binding to use subnet-evm instead of libevm -//go:generate sh -c "sed -i.bak -e 's|github.com/ava-labs/libevm/accounts/abi|github.com/ava-labs/subnet-evm/accounts/abi|g' -e 's|github.com/ava-labs/libevm/accounts/abi/bind|github.com/ava-labs/subnet-evm/accounts/abi/bind|g' gen_inativeminter_binding.go gen_erc20nativemintertest_binding.go gen_minter_binding.go && rm -f gen_inativeminter_binding.go.bak gen_erc20nativemintertest_binding.go.bak gen_minter_binding.go.bak" +//go:generate sh -c "sed -i.bak -e 's|github.com/ava-labs/libevm/accounts/abi|github.com/ava-labs/subnet-evm/accounts/abi|g' -e 's|github.com/ava-labs/libevm/accounts/abi/bind|github.com/ava-labs/subnet-evm/accounts/abi/bind|g' gen_inativeminter_binding.go gen_erc20nativeminter_binding.go gen_minter_binding.go && rm -f gen_inativeminter_binding.go.bak gen_erc20nativeminter_binding.go.bak gen_minter_binding.go.bak" diff --git a/precompile/contracts/nativeminter/nativemintertest/gen_erc20nativemintertest_binding.go b/precompile/contracts/nativeminter/nativemintertest/gen_erc20nativeminter_binding.go similarity index 65% rename from precompile/contracts/nativeminter/nativemintertest/gen_erc20nativemintertest_binding.go rename to precompile/contracts/nativeminter/nativemintertest/gen_erc20nativeminter_binding.go index a16851ce14..ab6c0ae796 100644 --- a/precompile/contracts/nativeminter/nativemintertest/gen_erc20nativemintertest_binding.go +++ b/precompile/contracts/nativeminter/nativemintertest/gen_erc20nativeminter_binding.go @@ -29,23 +29,23 @@ var ( _ = abi.ConvertType ) -// ERC20NativeMinterTestMetaData contains all meta data concerning the ERC20NativeMinterTest contract. -var ERC20NativeMinterTestMetaData = &bind.MetaData{ +// ERC20NativeMinterMetaData contains all meta data concerning the ERC20NativeMinter contract. +var ERC20NativeMinterMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nativeMinterPrecompile\",\"type\":\"address\"},{\"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: "0x608060405234801561001057600080fd5b50604051612898380380612898833981810160405281019061003291906105ea565b81336040518060400160405280601681526020017f45524332304e61746976654d696e746572546f6b656e000000000000000000008152506040518060400160405280600481526020017f584d504c0000000000000000000000000000000000000000000000000000000081525081600390816100af9190610870565b5080600490816100bf9190610870565b505050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036101345760006040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260040161012b9190610951565b60405180910390fd5b610143816101de60201b60201c565b5080600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505081600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506101d733826102a460201b60201c565b5050610a30565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036103165760006040517fec442f0500000000000000000000000000000000000000000000000000000000815260040161030d9190610951565b60405180910390fd5b6103286000838361032c60201b60201c565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361037e578060026000828254610372919061099b565b92505081905550610451565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561040a578381836040517fe450d38c000000000000000000000000000000000000000000000000000000008152600401610401939291906109de565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361049a57806002600082825403925050819055506104e7565b806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516105449190610a15565b60405180910390a3505050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061058182610556565b9050919050565b61059181610576565b811461059c57600080fd5b50565b6000815190506105ae81610588565b92915050565b6000819050919050565b6105c7816105b4565b81146105d257600080fd5b50565b6000815190506105e4816105be565b92915050565b6000806040838503121561060157610600610551565b5b600061060f8582860161059f565b9250506020610620858286016105d5565b9150509250929050565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806106ab57607f821691505b6020821081036106be576106bd610664565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026107267fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826106e9565b61073086836106e9565b95508019841693508086168417925050509392505050565b6000819050919050565b600061076d610768610763846105b4565b610748565b6105b4565b9050919050565b6000819050919050565b61078783610752565b61079b61079382610774565b8484546106f6565b825550505050565b600090565b6107b06107a3565b6107bb81848461077e565b505050565b5b818110156107df576107d46000826107a8565b6001810190506107c1565b5050565b601f821115610824576107f5816106c4565b6107fe846106d9565b8101602085101561080d578190505b610821610819856106d9565b8301826107c0565b50505b505050565b600082821c905092915050565b600061084760001984600802610829565b1980831691505092915050565b60006108608383610836565b9150826002028217905092915050565b6108798261062a565b67ffffffffffffffff81111561089257610891610635565b5b61089c8254610693565b6108a78282856107e3565b600060209050601f8311600181146108da57600084156108c8578287015190505b6108d28582610854565b86555061093a565b601f1984166108e8866106c4565b60005b82811015610910578489015182556001820191506020850194506020810190506108eb565b8683101561092d5784890151610929601f891682610836565b8355505b6001600288020188555050505b505050505050565b61094b81610576565b82525050565b60006020820190506109666000830184610942565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006109a6826105b4565b91506109b1836105b4565b92508282019050808211156109c9576109c861096c565b5b92915050565b6109d8816105b4565b82525050565b60006060820190506109f36000830186610942565b610a0060208301856109cf565b610a0d60408301846109cf565b949350505050565b6000602082019050610a2a60008301846109cf565b92915050565b611e5980610a3f6000396000f3fe6080604052600436106101405760003560e01c8063715018a6116100b6578063a9059cbb1161006f578063a9059cbb1461045a578063d0e30db014610497578063d0ebdbe7146104a1578063dd62ed3e146104ca578063f2fde38b14610507578063f3ae24151461053057610140565b8063715018a61461035e57806374a8f103146103755780638da5cb5b1461039e5780639015d371146103c957806395d89b41146104065780639dc29fac1461043157610140565b806323b872dd1161010857806323b872dd1461022a57806324d7806c14610267578063313ce567146102a457806340c10f19146102cf578063704b6c02146102f857806370a082311461032157610140565b80630356b6cd1461014557806306fdde031461016e578063095ea7b3146101995780630aaf7043146101d657806318160ddd146101ff575b600080fd5b34801561015157600080fd5b5061016c600480360381019061016791906118e8565b61056d565b005b34801561017a57600080fd5b50610183610657565b60405161019091906119a5565b60405180910390f35b3480156101a557600080fd5b506101c060048036038101906101bb9190611a25565b6106e9565b6040516101cd9190611a80565b60405180910390f35b3480156101e257600080fd5b506101fd60048036038101906101f89190611a9b565b61070c565b005b34801561020b57600080fd5b50610214610770565b6040516102219190611ad7565b60405180910390f35b34801561023657600080fd5b50610251600480360381019061024c9190611af2565b61077a565b60405161025e9190611a80565b60405180910390f35b34801561027357600080fd5b5061028e60048036038101906102899190611a9b565b6107a9565b60405161029b9190611a80565b60405180910390f35b3480156102b057600080fd5b506102b9610856565b6040516102c69190611b61565b60405180910390f35b3480156102db57600080fd5b506102f660048036038101906102f19190611a25565b61085f565b005b34801561030457600080fd5b5061031f600480360381019061031a9190611a9b565b610875565b005b34801561032d57600080fd5b5061034860048036038101906103439190611a9b565b6108d9565b6040516103559190611ad7565b60405180910390f35b34801561036a57600080fd5b50610373610921565b005b34801561038157600080fd5b5061039c60048036038101906103979190611a9b565b610935565b005b3480156103aa57600080fd5b506103b3610999565b6040516103c09190611b8b565b60405180910390f35b3480156103d557600080fd5b506103f060048036038101906103eb9190611a9b565b6109c3565b6040516103fd9190611a80565b60405180910390f35b34801561041257600080fd5b5061041b610a71565b60405161042891906119a5565b60405180910390f35b34801561043d57600080fd5b5061045860048036038101906104539190611a25565b610b03565b005b34801561046657600080fd5b50610481600480360381019061047c9190611a25565b610b19565b60405161048e9190611a80565b60405180910390f35b61049f610b3c565b005b3480156104ad57600080fd5b506104c860048036038101906104c39190611a9b565b610bf1565b005b3480156104d657600080fd5b506104f160048036038101906104ec9190611ba6565b610c55565b6040516104fe9190611ad7565b60405180910390f35b34801561051357600080fd5b5061052e60048036038101906105299190611a9b565b610cdc565b005b34801561053c57600080fd5b5061055760048036038101906105529190611a9b565b610d62565b6040516105649190611a80565b60405180910390f35b6105773382610e0f565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634f5aaaba33836040518363ffffffff1660e01b81526004016105d4929190611be6565b600060405180830381600087803b1580156105ee57600080fd5b505af1158015610602573d6000803e3d6000fd5b505050503373ffffffffffffffffffffffffffffffffffffffff167f25bedde6c8ebd3a89b719a16299dbfe271c7bffa42fe1ac1a52e15ab0cb767e68260405161064c9190611ad7565b60405180910390a250565b60606003805461066690611c3e565b80601f016020809104026020016040519081016040528092919081815260200182805461069290611c3e565b80156106df5780601f106106b4576101008083540402835291602001916106df565b820191906000526020600020905b8154815290600101906020018083116106c257829003601f168201915b5050505050905090565b6000806106f4610e91565b9050610701818585610e99565b600191505092915050565b610715336107a9565b80610725575061072433610d62565b5b610764576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161075b90611cbb565b60405180910390fd5b61076d81610eab565b50565b6000600254905090565b600080610785610e91565b9050610792858285610f3b565b61079d858585610fd0565b60019150509392505050565b600080600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b81526004016108079190611b8b565b602060405180830381865afa158015610824573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108489190611cf0565b905060028114915050919050565b60006012905090565b6108676110c4565b610871828261114b565b5050565b61087e336107a9565b8061088e575061088d33610d62565b5b6108cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108c490611cbb565b60405180910390fd5b6108d6816111cd565b50565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6109296110c4565b610933600061125d565b565b61093e336107a9565b8061094e575061094d33610d62565b5b61098d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161098490611cbb565b60405180910390fd5b61099681611323565b50565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b8152600401610a219190611b8b565b602060405180830381865afa158015610a3e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a629190611cf0565b90506000811415915050919050565b606060048054610a8090611c3e565b80601f0160208091040260200160405190810160405280929190818152602001828054610aac90611c3e565b8015610af95780601f10610ace57610100808354040283529160200191610af9565b820191906000526020600020905b815481529060010190602001808311610adc57829003601f168201915b5050505050905090565b610b0b6110c4565b610b158282610e0f565b5050565b600080610b24610e91565b9050610b31818585610fd0565b600191505092915050565b73010000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015610b96573d6000803e3d6000fd5b50610ba1333461114b565b3373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c34604051610be79190611ad7565b60405180910390a2565b610bfa336107a9565b80610c0a5750610c0933610d62565b5b610c49576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c4090611cbb565b60405180910390fd5b610c5281611421565b50565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610ce46110c4565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610d565760006040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401610d4d9190611b8b565b60405180910390fd5b610d5f8161125d565b50565b600080600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b8152600401610dc09190611b8b565b602060405180830381865afa158015610ddd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e019190611cf0565b905060038114915050919050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610e815760006040517f96c6fd1e000000000000000000000000000000000000000000000000000000008152600401610e789190611b8b565b60405180910390fd5b610e8d826000836114b1565b5050565b600033905090565b610ea683838360016116d6565b505050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630aaf7043826040518263ffffffff1660e01b8152600401610f069190611b8b565b600060405180830381600087803b158015610f2057600080fd5b505af1158015610f34573d6000803e3d6000fd5b5050505050565b6000610f478484610c55565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811015610fca5781811015610fba578281836040517ffb8f41b2000000000000000000000000000000000000000000000000000000008152600401610fb193929190611d1d565b60405180910390fd5b610fc9848484840360006116d6565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036110425760006040517f96c6fd1e0000000000000000000000000000000000000000000000000000000081526004016110399190611b8b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036110b45760006040517fec442f050000000000000000000000000000000000000000000000000000000081526004016110ab9190611b8b565b60405180910390fd5b6110bf8383836114b1565b505050565b6110cc610e91565b73ffffffffffffffffffffffffffffffffffffffff166110ea610999565b73ffffffffffffffffffffffffffffffffffffffff16146111495761110d610e91565b6040517f118cdaa70000000000000000000000000000000000000000000000000000000081526004016111409190611b8b565b60405180910390fd5b565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036111bd5760006040517fec442f050000000000000000000000000000000000000000000000000000000081526004016111b49190611b8b565b60405180910390fd5b6111c9600083836114b1565b5050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663704b6c02826040518263ffffffff1660e01b81526004016112289190611b8b565b600060405180830381600087803b15801561124257600080fd5b505af1158015611256573d6000803e3d6000fd5b5050505050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b8073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1603611391576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138890611da0565b60405180910390fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638c6bfb3b826040518263ffffffff1660e01b81526004016113ec9190611b8b565b600060405180830381600087803b15801561140657600080fd5b505af115801561141a573d6000803e3d6000fd5b5050505050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0ebdbe7826040518263ffffffff1660e01b815260040161147c9190611b8b565b600060405180830381600087803b15801561149657600080fd5b505af11580156114aa573d6000803e3d6000fd5b5050505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036115035780600260008282546114f79190611def565b925050819055506115d6565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561158f578381836040517fe450d38c00000000000000000000000000000000000000000000000000000000815260040161158693929190611d1d565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361161f578060026000828254039250508190555061166c565b806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516116c99190611ad7565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16036117485760006040517fe602df0500000000000000000000000000000000000000000000000000000000815260040161173f9190611b8b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036117ba5760006040517f94280d620000000000000000000000000000000000000000000000000000000081526004016117b19190611b8b565b60405180910390fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080156118a7578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405161189e9190611ad7565b60405180910390a35b50505050565b600080fd5b6000819050919050565b6118c5816118b2565b81146118d057600080fd5b50565b6000813590506118e2816118bc565b92915050565b6000602082840312156118fe576118fd6118ad565b5b600061190c848285016118d3565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561194f578082015181840152602081019050611934565b60008484015250505050565b6000601f19601f8301169050919050565b600061197782611915565b6119818185611920565b9350611991818560208601611931565b61199a8161195b565b840191505092915050565b600060208201905081810360008301526119bf818461196c565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006119f2826119c7565b9050919050565b611a02816119e7565b8114611a0d57600080fd5b50565b600081359050611a1f816119f9565b92915050565b60008060408385031215611a3c57611a3b6118ad565b5b6000611a4a85828601611a10565b9250506020611a5b858286016118d3565b9150509250929050565b60008115159050919050565b611a7a81611a65565b82525050565b6000602082019050611a956000830184611a71565b92915050565b600060208284031215611ab157611ab06118ad565b5b6000611abf84828501611a10565b91505092915050565b611ad1816118b2565b82525050565b6000602082019050611aec6000830184611ac8565b92915050565b600080600060608486031215611b0b57611b0a6118ad565b5b6000611b1986828701611a10565b9350506020611b2a86828701611a10565b9250506040611b3b868287016118d3565b9150509250925092565b600060ff82169050919050565b611b5b81611b45565b82525050565b6000602082019050611b766000830184611b52565b92915050565b611b85816119e7565b82525050565b6000602082019050611ba06000830184611b7c565b92915050565b60008060408385031215611bbd57611bbc6118ad565b5b6000611bcb85828601611a10565b9250506020611bdc85828601611a10565b9150509250929050565b6000604082019050611bfb6000830185611b7c565b611c086020830184611ac8565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680611c5657607f821691505b602082108103611c6957611c68611c0f565b5b50919050565b7f63616e6e6f74206d6f6469667920616c6c6f77206c6973740000000000000000600082015250565b6000611ca5601883611920565b9150611cb082611c6f565b602082019050919050565b60006020820190508181036000830152611cd481611c98565b9050919050565b600081519050611cea816118bc565b92915050565b600060208284031215611d0657611d056118ad565b5b6000611d1484828501611cdb565b91505092915050565b6000606082019050611d326000830186611b7c565b611d3f6020830185611ac8565b611d4c6040830184611ac8565b949350505050565b7f63616e6e6f74207265766f6b65206f776e20726f6c6500000000000000000000600082015250565b6000611d8a601683611920565b9150611d9582611d54565b602082019050919050565b60006020820190508181036000830152611db981611d7d565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611dfa826118b2565b9150611e05836118b2565b9250828201905080821115611e1d57611e1c611dc0565b5b9291505056fea2646970667358221220c27c2a3cd8df9cbc72831c94ef6545feddfe1f5dbb301a61d06809a2a184543464736f6c634300081e0033", + Bin: "0x608060405234801561001057600080fd5b50604051612898380380612898833981810160405281019061003291906105ea565b81336040518060400160405280601681526020017f45524332304e61746976654d696e746572546f6b656e000000000000000000008152506040518060400160405280600481526020017f584d504c0000000000000000000000000000000000000000000000000000000081525081600390816100af9190610870565b5080600490816100bf9190610870565b505050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036101345760006040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260040161012b9190610951565b60405180910390fd5b610143816101de60201b60201c565b5080600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505081600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506101d733826102a460201b60201c565b5050610a30565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036103165760006040517fec442f0500000000000000000000000000000000000000000000000000000000815260040161030d9190610951565b60405180910390fd5b6103286000838361032c60201b60201c565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361037e578060026000828254610372919061099b565b92505081905550610451565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561040a578381836040517fe450d38c000000000000000000000000000000000000000000000000000000008152600401610401939291906109de565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361049a57806002600082825403925050819055506104e7565b806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516105449190610a15565b60405180910390a3505050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061058182610556565b9050919050565b61059181610576565b811461059c57600080fd5b50565b6000815190506105ae81610588565b92915050565b6000819050919050565b6105c7816105b4565b81146105d257600080fd5b50565b6000815190506105e4816105be565b92915050565b6000806040838503121561060157610600610551565b5b600061060f8582860161059f565b9250506020610620858286016105d5565b9150509250929050565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806106ab57607f821691505b6020821081036106be576106bd610664565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026107267fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826106e9565b61073086836106e9565b95508019841693508086168417925050509392505050565b6000819050919050565b600061076d610768610763846105b4565b610748565b6105b4565b9050919050565b6000819050919050565b61078783610752565b61079b61079382610774565b8484546106f6565b825550505050565b600090565b6107b06107a3565b6107bb81848461077e565b505050565b5b818110156107df576107d46000826107a8565b6001810190506107c1565b5050565b601f821115610824576107f5816106c4565b6107fe846106d9565b8101602085101561080d578190505b610821610819856106d9565b8301826107c0565b50505b505050565b600082821c905092915050565b600061084760001984600802610829565b1980831691505092915050565b60006108608383610836565b9150826002028217905092915050565b6108798261062a565b67ffffffffffffffff81111561089257610891610635565b5b61089c8254610693565b6108a78282856107e3565b600060209050601f8311600181146108da57600084156108c8578287015190505b6108d28582610854565b86555061093a565b601f1984166108e8866106c4565b60005b82811015610910578489015182556001820191506020850194506020810190506108eb565b8683101561092d5784890151610929601f891682610836565b8355505b6001600288020188555050505b505050505050565b61094b81610576565b82525050565b60006020820190506109666000830184610942565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006109a6826105b4565b91506109b1836105b4565b92508282019050808211156109c9576109c861096c565b5b92915050565b6109d8816105b4565b82525050565b60006060820190506109f36000830186610942565b610a0060208301856109cf565b610a0d60408301846109cf565b949350505050565b6000602082019050610a2a60008301846109cf565b92915050565b611e5980610a3f6000396000f3fe6080604052600436106101405760003560e01c8063715018a6116100b6578063a9059cbb1161006f578063a9059cbb1461045a578063d0e30db014610497578063d0ebdbe7146104a1578063dd62ed3e146104ca578063f2fde38b14610507578063f3ae24151461053057610140565b8063715018a61461035e57806374a8f103146103755780638da5cb5b1461039e5780639015d371146103c957806395d89b41146104065780639dc29fac1461043157610140565b806323b872dd1161010857806323b872dd1461022a57806324d7806c14610267578063313ce567146102a457806340c10f19146102cf578063704b6c02146102f857806370a082311461032157610140565b80630356b6cd1461014557806306fdde031461016e578063095ea7b3146101995780630aaf7043146101d657806318160ddd146101ff575b600080fd5b34801561015157600080fd5b5061016c600480360381019061016791906118e8565b61056d565b005b34801561017a57600080fd5b50610183610657565b60405161019091906119a5565b60405180910390f35b3480156101a557600080fd5b506101c060048036038101906101bb9190611a25565b6106e9565b6040516101cd9190611a80565b60405180910390f35b3480156101e257600080fd5b506101fd60048036038101906101f89190611a9b565b61070c565b005b34801561020b57600080fd5b50610214610770565b6040516102219190611ad7565b60405180910390f35b34801561023657600080fd5b50610251600480360381019061024c9190611af2565b61077a565b60405161025e9190611a80565b60405180910390f35b34801561027357600080fd5b5061028e60048036038101906102899190611a9b565b6107a9565b60405161029b9190611a80565b60405180910390f35b3480156102b057600080fd5b506102b9610856565b6040516102c69190611b61565b60405180910390f35b3480156102db57600080fd5b506102f660048036038101906102f19190611a25565b61085f565b005b34801561030457600080fd5b5061031f600480360381019061031a9190611a9b565b610875565b005b34801561032d57600080fd5b5061034860048036038101906103439190611a9b565b6108d9565b6040516103559190611ad7565b60405180910390f35b34801561036a57600080fd5b50610373610921565b005b34801561038157600080fd5b5061039c60048036038101906103979190611a9b565b610935565b005b3480156103aa57600080fd5b506103b3610999565b6040516103c09190611b8b565b60405180910390f35b3480156103d557600080fd5b506103f060048036038101906103eb9190611a9b565b6109c3565b6040516103fd9190611a80565b60405180910390f35b34801561041257600080fd5b5061041b610a71565b60405161042891906119a5565b60405180910390f35b34801561043d57600080fd5b5061045860048036038101906104539190611a25565b610b03565b005b34801561046657600080fd5b50610481600480360381019061047c9190611a25565b610b19565b60405161048e9190611a80565b60405180910390f35b61049f610b3c565b005b3480156104ad57600080fd5b506104c860048036038101906104c39190611a9b565b610bf1565b005b3480156104d657600080fd5b506104f160048036038101906104ec9190611ba6565b610c55565b6040516104fe9190611ad7565b60405180910390f35b34801561051357600080fd5b5061052e60048036038101906105299190611a9b565b610cdc565b005b34801561053c57600080fd5b5061055760048036038101906105529190611a9b565b610d62565b6040516105649190611a80565b60405180910390f35b6105773382610e0f565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634f5aaaba33836040518363ffffffff1660e01b81526004016105d4929190611be6565b600060405180830381600087803b1580156105ee57600080fd5b505af1158015610602573d6000803e3d6000fd5b505050503373ffffffffffffffffffffffffffffffffffffffff167f25bedde6c8ebd3a89b719a16299dbfe271c7bffa42fe1ac1a52e15ab0cb767e68260405161064c9190611ad7565b60405180910390a250565b60606003805461066690611c3e565b80601f016020809104026020016040519081016040528092919081815260200182805461069290611c3e565b80156106df5780601f106106b4576101008083540402835291602001916106df565b820191906000526020600020905b8154815290600101906020018083116106c257829003601f168201915b5050505050905090565b6000806106f4610e91565b9050610701818585610e99565b600191505092915050565b610715336107a9565b80610725575061072433610d62565b5b610764576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161075b90611cbb565b60405180910390fd5b61076d81610eab565b50565b6000600254905090565b600080610785610e91565b9050610792858285610f3b565b61079d858585610fd0565b60019150509392505050565b600080600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b81526004016108079190611b8b565b602060405180830381865afa158015610824573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108489190611cf0565b905060028114915050919050565b60006012905090565b6108676110c4565b610871828261114b565b5050565b61087e336107a9565b8061088e575061088d33610d62565b5b6108cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108c490611cbb565b60405180910390fd5b6108d6816111cd565b50565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6109296110c4565b610933600061125d565b565b61093e336107a9565b8061094e575061094d33610d62565b5b61098d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161098490611cbb565b60405180910390fd5b61099681611323565b50565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b8152600401610a219190611b8b565b602060405180830381865afa158015610a3e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a629190611cf0565b90506000811415915050919050565b606060048054610a8090611c3e565b80601f0160208091040260200160405190810160405280929190818152602001828054610aac90611c3e565b8015610af95780601f10610ace57610100808354040283529160200191610af9565b820191906000526020600020905b815481529060010190602001808311610adc57829003601f168201915b5050505050905090565b610b0b6110c4565b610b158282610e0f565b5050565b600080610b24610e91565b9050610b31818585610fd0565b600191505092915050565b73010000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015610b96573d6000803e3d6000fd5b50610ba1333461114b565b3373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c34604051610be79190611ad7565b60405180910390a2565b610bfa336107a9565b80610c0a5750610c0933610d62565b5b610c49576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c4090611cbb565b60405180910390fd5b610c5281611421565b50565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610ce46110c4565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610d565760006040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401610d4d9190611b8b565b60405180910390fd5b610d5f8161125d565b50565b600080600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b8152600401610dc09190611b8b565b602060405180830381865afa158015610ddd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e019190611cf0565b905060038114915050919050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610e815760006040517f96c6fd1e000000000000000000000000000000000000000000000000000000008152600401610e789190611b8b565b60405180910390fd5b610e8d826000836114b1565b5050565b600033905090565b610ea683838360016116d6565b505050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630aaf7043826040518263ffffffff1660e01b8152600401610f069190611b8b565b600060405180830381600087803b158015610f2057600080fd5b505af1158015610f34573d6000803e3d6000fd5b5050505050565b6000610f478484610c55565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811015610fca5781811015610fba578281836040517ffb8f41b2000000000000000000000000000000000000000000000000000000008152600401610fb193929190611d1d565b60405180910390fd5b610fc9848484840360006116d6565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036110425760006040517f96c6fd1e0000000000000000000000000000000000000000000000000000000081526004016110399190611b8b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036110b45760006040517fec442f050000000000000000000000000000000000000000000000000000000081526004016110ab9190611b8b565b60405180910390fd5b6110bf8383836114b1565b505050565b6110cc610e91565b73ffffffffffffffffffffffffffffffffffffffff166110ea610999565b73ffffffffffffffffffffffffffffffffffffffff16146111495761110d610e91565b6040517f118cdaa70000000000000000000000000000000000000000000000000000000081526004016111409190611b8b565b60405180910390fd5b565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036111bd5760006040517fec442f050000000000000000000000000000000000000000000000000000000081526004016111b49190611b8b565b60405180910390fd5b6111c9600083836114b1565b5050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663704b6c02826040518263ffffffff1660e01b81526004016112289190611b8b565b600060405180830381600087803b15801561124257600080fd5b505af1158015611256573d6000803e3d6000fd5b5050505050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b8073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1603611391576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138890611da0565b60405180910390fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638c6bfb3b826040518263ffffffff1660e01b81526004016113ec9190611b8b565b600060405180830381600087803b15801561140657600080fd5b505af115801561141a573d6000803e3d6000fd5b5050505050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0ebdbe7826040518263ffffffff1660e01b815260040161147c9190611b8b565b600060405180830381600087803b15801561149657600080fd5b505af11580156114aa573d6000803e3d6000fd5b5050505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036115035780600260008282546114f79190611def565b925050819055506115d6565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561158f578381836040517fe450d38c00000000000000000000000000000000000000000000000000000000815260040161158693929190611d1d565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361161f578060026000828254039250508190555061166c565b806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516116c99190611ad7565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16036117485760006040517fe602df0500000000000000000000000000000000000000000000000000000000815260040161173f9190611b8b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036117ba5760006040517f94280d620000000000000000000000000000000000000000000000000000000081526004016117b19190611b8b565b60405180910390fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080156118a7578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405161189e9190611ad7565b60405180910390a35b50505050565b600080fd5b6000819050919050565b6118c5816118b2565b81146118d057600080fd5b50565b6000813590506118e2816118bc565b92915050565b6000602082840312156118fe576118fd6118ad565b5b600061190c848285016118d3565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561194f578082015181840152602081019050611934565b60008484015250505050565b6000601f19601f8301169050919050565b600061197782611915565b6119818185611920565b9350611991818560208601611931565b61199a8161195b565b840191505092915050565b600060208201905081810360008301526119bf818461196c565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006119f2826119c7565b9050919050565b611a02816119e7565b8114611a0d57600080fd5b50565b600081359050611a1f816119f9565b92915050565b60008060408385031215611a3c57611a3b6118ad565b5b6000611a4a85828601611a10565b9250506020611a5b858286016118d3565b9150509250929050565b60008115159050919050565b611a7a81611a65565b82525050565b6000602082019050611a956000830184611a71565b92915050565b600060208284031215611ab157611ab06118ad565b5b6000611abf84828501611a10565b91505092915050565b611ad1816118b2565b82525050565b6000602082019050611aec6000830184611ac8565b92915050565b600080600060608486031215611b0b57611b0a6118ad565b5b6000611b1986828701611a10565b9350506020611b2a86828701611a10565b9250506040611b3b868287016118d3565b9150509250925092565b600060ff82169050919050565b611b5b81611b45565b82525050565b6000602082019050611b766000830184611b52565b92915050565b611b85816119e7565b82525050565b6000602082019050611ba06000830184611b7c565b92915050565b60008060408385031215611bbd57611bbc6118ad565b5b6000611bcb85828601611a10565b9250506020611bdc85828601611a10565b9150509250929050565b6000604082019050611bfb6000830185611b7c565b611c086020830184611ac8565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680611c5657607f821691505b602082108103611c6957611c68611c0f565b5b50919050565b7f63616e6e6f74206d6f6469667920616c6c6f77206c6973740000000000000000600082015250565b6000611ca5601883611920565b9150611cb082611c6f565b602082019050919050565b60006020820190508181036000830152611cd481611c98565b9050919050565b600081519050611cea816118bc565b92915050565b600060208284031215611d0657611d056118ad565b5b6000611d1484828501611cdb565b91505092915050565b6000606082019050611d326000830186611b7c565b611d3f6020830185611ac8565b611d4c6040830184611ac8565b949350505050565b7f63616e6e6f74207265766f6b65206f776e20726f6c6500000000000000000000600082015250565b6000611d8a601683611920565b9150611d9582611d54565b602082019050919050565b60006020820190508181036000830152611db981611d7d565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611dfa826118b2565b9150611e05836118b2565b9250828201905080821115611e1d57611e1c611dc0565b5b9291505056fea2646970667358221220cb094dd1471d39812ad1f5f9b68491f879c9d6a8e916a805b85cb7e3b7f2a6d564736f6c634300081e0033", } -// ERC20NativeMinterTestABI is the input ABI used to generate the binding from. -// Deprecated: Use ERC20NativeMinterTestMetaData.ABI instead. -var ERC20NativeMinterTestABI = ERC20NativeMinterTestMetaData.ABI +// ERC20NativeMinterABI is the input ABI used to generate the binding from. +// Deprecated: Use ERC20NativeMinterMetaData.ABI instead. +var ERC20NativeMinterABI = ERC20NativeMinterMetaData.ABI -// ERC20NativeMinterTestBin is the compiled bytecode used for deploying new contracts. -// Deprecated: Use ERC20NativeMinterTestMetaData.Bin instead. -var ERC20NativeMinterTestBin = ERC20NativeMinterTestMetaData.Bin +// ERC20NativeMinterBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use ERC20NativeMinterMetaData.Bin instead. +var ERC20NativeMinterBin = ERC20NativeMinterMetaData.Bin -// DeployERC20NativeMinterTest deploys a new Ethereum contract, binding an instance of ERC20NativeMinterTest to it. -func DeployERC20NativeMinterTest(auth *bind.TransactOpts, backend bind.ContractBackend, nativeMinterPrecompile common.Address, initSupply *big.Int) (common.Address, *types.Transaction, *ERC20NativeMinterTest, error) { - parsed, err := ERC20NativeMinterTestMetaData.GetAbi() +// DeployERC20NativeMinter deploys a new Ethereum contract, binding an instance of ERC20NativeMinter to it. +func DeployERC20NativeMinter(auth *bind.TransactOpts, backend bind.ContractBackend, nativeMinterPrecompile common.Address, initSupply *big.Int) (common.Address, *types.Transaction, *ERC20NativeMinter, error) { + parsed, err := ERC20NativeMinterMetaData.GetAbi() if err != nil { return common.Address{}, nil, nil, err } @@ -53,111 +53,111 @@ func DeployERC20NativeMinterTest(auth *bind.TransactOpts, backend bind.ContractB return common.Address{}, nil, nil, errors.New("GetABI returned nil") } - address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(ERC20NativeMinterTestBin), backend, nativeMinterPrecompile, initSupply) + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(ERC20NativeMinterBin), backend, nativeMinterPrecompile, initSupply) if err != nil { return common.Address{}, nil, nil, err } - return address, tx, &ERC20NativeMinterTest{ERC20NativeMinterTestCaller: ERC20NativeMinterTestCaller{contract: contract}, ERC20NativeMinterTestTransactor: ERC20NativeMinterTestTransactor{contract: contract}, ERC20NativeMinterTestFilterer: ERC20NativeMinterTestFilterer{contract: contract}}, nil + return address, tx, &ERC20NativeMinter{ERC20NativeMinterCaller: ERC20NativeMinterCaller{contract: contract}, ERC20NativeMinterTransactor: ERC20NativeMinterTransactor{contract: contract}, ERC20NativeMinterFilterer: ERC20NativeMinterFilterer{contract: contract}}, nil } -// ERC20NativeMinterTest is an auto generated Go binding around an Ethereum contract. -type ERC20NativeMinterTest struct { - ERC20NativeMinterTestCaller // Read-only binding to the contract - ERC20NativeMinterTestTransactor // Write-only binding to the contract - ERC20NativeMinterTestFilterer // Log filterer for contract events +// ERC20NativeMinter is an auto generated Go binding around an Ethereum contract. +type ERC20NativeMinter struct { + ERC20NativeMinterCaller // Read-only binding to the contract + ERC20NativeMinterTransactor // Write-only binding to the contract + ERC20NativeMinterFilterer // Log filterer for contract events } -// ERC20NativeMinterTestCaller is an auto generated read-only Go binding around an Ethereum contract. -type ERC20NativeMinterTestCaller struct { +// ERC20NativeMinterCaller is an auto generated read-only Go binding around an Ethereum contract. +type ERC20NativeMinterCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } -// ERC20NativeMinterTestTransactor is an auto generated write-only Go binding around an Ethereum contract. -type ERC20NativeMinterTestTransactor struct { +// ERC20NativeMinterTransactor is an auto generated write-only Go binding around an Ethereum contract. +type ERC20NativeMinterTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } -// ERC20NativeMinterTestFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type ERC20NativeMinterTestFilterer struct { +// ERC20NativeMinterFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type ERC20NativeMinterFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } -// ERC20NativeMinterTestSession is an auto generated Go binding around an Ethereum contract, +// ERC20NativeMinterSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. -type ERC20NativeMinterTestSession struct { - Contract *ERC20NativeMinterTest // 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 +type ERC20NativeMinterSession struct { + Contract *ERC20NativeMinter // 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 } -// ERC20NativeMinterTestCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// ERC20NativeMinterCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. -type ERC20NativeMinterTestCallerSession struct { - Contract *ERC20NativeMinterTestCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session +type ERC20NativeMinterCallerSession struct { + Contract *ERC20NativeMinterCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session } -// ERC20NativeMinterTestTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// ERC20NativeMinterTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. -type ERC20NativeMinterTestTransactorSession struct { - Contract *ERC20NativeMinterTestTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +type ERC20NativeMinterTransactorSession struct { + Contract *ERC20NativeMinterTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } -// ERC20NativeMinterTestRaw is an auto generated low-level Go binding around an Ethereum contract. -type ERC20NativeMinterTestRaw struct { - Contract *ERC20NativeMinterTest // Generic contract binding to access the raw methods on +// ERC20NativeMinterRaw is an auto generated low-level Go binding around an Ethereum contract. +type ERC20NativeMinterRaw struct { + Contract *ERC20NativeMinter // Generic contract binding to access the raw methods on } -// ERC20NativeMinterTestCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type ERC20NativeMinterTestCallerRaw struct { - Contract *ERC20NativeMinterTestCaller // Generic read-only contract binding to access the raw methods on +// ERC20NativeMinterCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type ERC20NativeMinterCallerRaw struct { + Contract *ERC20NativeMinterCaller // Generic read-only contract binding to access the raw methods on } -// ERC20NativeMinterTestTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type ERC20NativeMinterTestTransactorRaw struct { - Contract *ERC20NativeMinterTestTransactor // Generic write-only contract binding to access the raw methods on +// ERC20NativeMinterTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type ERC20NativeMinterTransactorRaw struct { + Contract *ERC20NativeMinterTransactor // Generic write-only contract binding to access the raw methods on } -// NewERC20NativeMinterTest creates a new instance of ERC20NativeMinterTest, bound to a specific deployed contract. -func NewERC20NativeMinterTest(address common.Address, backend bind.ContractBackend) (*ERC20NativeMinterTest, error) { - contract, err := bindERC20NativeMinterTest(address, backend, backend, backend) +// NewERC20NativeMinter creates a new instance of ERC20NativeMinter, bound to a specific deployed contract. +func NewERC20NativeMinter(address common.Address, backend bind.ContractBackend) (*ERC20NativeMinter, error) { + contract, err := bindERC20NativeMinter(address, backend, backend, backend) if err != nil { return nil, err } - return &ERC20NativeMinterTest{ERC20NativeMinterTestCaller: ERC20NativeMinterTestCaller{contract: contract}, ERC20NativeMinterTestTransactor: ERC20NativeMinterTestTransactor{contract: contract}, ERC20NativeMinterTestFilterer: ERC20NativeMinterTestFilterer{contract: contract}}, nil + return &ERC20NativeMinter{ERC20NativeMinterCaller: ERC20NativeMinterCaller{contract: contract}, ERC20NativeMinterTransactor: ERC20NativeMinterTransactor{contract: contract}, ERC20NativeMinterFilterer: ERC20NativeMinterFilterer{contract: contract}}, nil } -// NewERC20NativeMinterTestCaller creates a new read-only instance of ERC20NativeMinterTest, bound to a specific deployed contract. -func NewERC20NativeMinterTestCaller(address common.Address, caller bind.ContractCaller) (*ERC20NativeMinterTestCaller, error) { - contract, err := bindERC20NativeMinterTest(address, caller, nil, nil) +// NewERC20NativeMinterCaller creates a new read-only instance of ERC20NativeMinter, bound to a specific deployed contract. +func NewERC20NativeMinterCaller(address common.Address, caller bind.ContractCaller) (*ERC20NativeMinterCaller, error) { + contract, err := bindERC20NativeMinter(address, caller, nil, nil) if err != nil { return nil, err } - return &ERC20NativeMinterTestCaller{contract: contract}, nil + return &ERC20NativeMinterCaller{contract: contract}, nil } -// NewERC20NativeMinterTestTransactor creates a new write-only instance of ERC20NativeMinterTest, bound to a specific deployed contract. -func NewERC20NativeMinterTestTransactor(address common.Address, transactor bind.ContractTransactor) (*ERC20NativeMinterTestTransactor, error) { - contract, err := bindERC20NativeMinterTest(address, nil, transactor, nil) +// NewERC20NativeMinterTransactor creates a new write-only instance of ERC20NativeMinter, bound to a specific deployed contract. +func NewERC20NativeMinterTransactor(address common.Address, transactor bind.ContractTransactor) (*ERC20NativeMinterTransactor, error) { + contract, err := bindERC20NativeMinter(address, nil, transactor, nil) if err != nil { return nil, err } - return &ERC20NativeMinterTestTransactor{contract: contract}, nil + return &ERC20NativeMinterTransactor{contract: contract}, nil } -// NewERC20NativeMinterTestFilterer creates a new log filterer instance of ERC20NativeMinterTest, bound to a specific deployed contract. -func NewERC20NativeMinterTestFilterer(address common.Address, filterer bind.ContractFilterer) (*ERC20NativeMinterTestFilterer, error) { - contract, err := bindERC20NativeMinterTest(address, nil, nil, filterer) +// NewERC20NativeMinterFilterer creates a new log filterer instance of ERC20NativeMinter, bound to a specific deployed contract. +func NewERC20NativeMinterFilterer(address common.Address, filterer bind.ContractFilterer) (*ERC20NativeMinterFilterer, error) { + contract, err := bindERC20NativeMinter(address, nil, nil, filterer) if err != nil { return nil, err } - return &ERC20NativeMinterTestFilterer{contract: contract}, nil + return &ERC20NativeMinterFilterer{contract: contract}, nil } -// bindERC20NativeMinterTest binds a generic wrapper to an already deployed contract. -func bindERC20NativeMinterTest(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := ERC20NativeMinterTestMetaData.GetAbi() +// bindERC20NativeMinter binds a generic wrapper to an already deployed contract. +func bindERC20NativeMinter(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := ERC20NativeMinterMetaData.GetAbi() if err != nil { return nil, err } @@ -168,46 +168,46 @@ func bindERC20NativeMinterTest(address common.Address, caller bind.ContractCalle // 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 (_ERC20NativeMinterTest *ERC20NativeMinterTestRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _ERC20NativeMinterTest.Contract.ERC20NativeMinterTestCaller.contract.Call(opts, result, method, params...) +func (_ERC20NativeMinter *ERC20NativeMinterRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _ERC20NativeMinter.Contract.ERC20NativeMinterCaller.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 (_ERC20NativeMinterTest *ERC20NativeMinterTestRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _ERC20NativeMinterTest.Contract.ERC20NativeMinterTestTransactor.contract.Transfer(opts) +func (_ERC20NativeMinter *ERC20NativeMinterRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ERC20NativeMinter.Contract.ERC20NativeMinterTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. -func (_ERC20NativeMinterTest *ERC20NativeMinterTestRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _ERC20NativeMinterTest.Contract.ERC20NativeMinterTestTransactor.contract.Transact(opts, method, params...) +func (_ERC20NativeMinter *ERC20NativeMinterRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ERC20NativeMinter.Contract.ERC20NativeMinterTransactor.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 (_ERC20NativeMinterTest *ERC20NativeMinterTestCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _ERC20NativeMinterTest.Contract.contract.Call(opts, result, method, params...) +func (_ERC20NativeMinter *ERC20NativeMinterCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _ERC20NativeMinter.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 (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _ERC20NativeMinterTest.Contract.contract.Transfer(opts) +func (_ERC20NativeMinter *ERC20NativeMinterTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ERC20NativeMinter.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. -func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _ERC20NativeMinterTest.Contract.contract.Transact(opts, method, params...) +func (_ERC20NativeMinter *ERC20NativeMinterTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ERC20NativeMinter.Contract.contract.Transact(opts, method, params...) } // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. // // Solidity: function allowance(address owner, address spender) view returns(uint256) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestCaller) Allowance(opts *bind.CallOpts, owner common.Address, spender common.Address) (*big.Int, error) { +func (_ERC20NativeMinter *ERC20NativeMinterCaller) Allowance(opts *bind.CallOpts, owner common.Address, spender common.Address) (*big.Int, error) { var out []interface{} - err := _ERC20NativeMinterTest.contract.Call(opts, &out, "allowance", owner, spender) + err := _ERC20NativeMinter.contract.Call(opts, &out, "allowance", owner, spender) if err != nil { return *new(*big.Int), err @@ -222,23 +222,23 @@ func (_ERC20NativeMinterTest *ERC20NativeMinterTestCaller) Allowance(opts *bind. // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. // // Solidity: function allowance(address owner, address spender) view returns(uint256) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { - return _ERC20NativeMinterTest.Contract.Allowance(&_ERC20NativeMinterTest.CallOpts, owner, spender) +func (_ERC20NativeMinter *ERC20NativeMinterSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { + return _ERC20NativeMinter.Contract.Allowance(&_ERC20NativeMinter.CallOpts, owner, spender) } // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. // // Solidity: function allowance(address owner, address spender) view returns(uint256) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestCallerSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { - return _ERC20NativeMinterTest.Contract.Allowance(&_ERC20NativeMinterTest.CallOpts, owner, spender) +func (_ERC20NativeMinter *ERC20NativeMinterCallerSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { + return _ERC20NativeMinter.Contract.Allowance(&_ERC20NativeMinter.CallOpts, owner, spender) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address account) view returns(uint256) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestCaller) BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) { +func (_ERC20NativeMinter *ERC20NativeMinterCaller) BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) { var out []interface{} - err := _ERC20NativeMinterTest.contract.Call(opts, &out, "balanceOf", account) + err := _ERC20NativeMinter.contract.Call(opts, &out, "balanceOf", account) if err != nil { return *new(*big.Int), err @@ -253,23 +253,23 @@ func (_ERC20NativeMinterTest *ERC20NativeMinterTestCaller) BalanceOf(opts *bind. // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address account) view returns(uint256) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestSession) BalanceOf(account common.Address) (*big.Int, error) { - return _ERC20NativeMinterTest.Contract.BalanceOf(&_ERC20NativeMinterTest.CallOpts, account) +func (_ERC20NativeMinter *ERC20NativeMinterSession) BalanceOf(account common.Address) (*big.Int, error) { + return _ERC20NativeMinter.Contract.BalanceOf(&_ERC20NativeMinter.CallOpts, account) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address account) view returns(uint256) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestCallerSession) BalanceOf(account common.Address) (*big.Int, error) { - return _ERC20NativeMinterTest.Contract.BalanceOf(&_ERC20NativeMinterTest.CallOpts, account) +func (_ERC20NativeMinter *ERC20NativeMinterCallerSession) BalanceOf(account common.Address) (*big.Int, error) { + return _ERC20NativeMinter.Contract.BalanceOf(&_ERC20NativeMinter.CallOpts, account) } // Decimals is a free data retrieval call binding the contract method 0x313ce567. // // Solidity: function decimals() view returns(uint8) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestCaller) Decimals(opts *bind.CallOpts) (uint8, error) { +func (_ERC20NativeMinter *ERC20NativeMinterCaller) Decimals(opts *bind.CallOpts) (uint8, error) { var out []interface{} - err := _ERC20NativeMinterTest.contract.Call(opts, &out, "decimals") + err := _ERC20NativeMinter.contract.Call(opts, &out, "decimals") if err != nil { return *new(uint8), err @@ -284,23 +284,23 @@ func (_ERC20NativeMinterTest *ERC20NativeMinterTestCaller) Decimals(opts *bind.C // Decimals is a free data retrieval call binding the contract method 0x313ce567. // // Solidity: function decimals() view returns(uint8) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestSession) Decimals() (uint8, error) { - return _ERC20NativeMinterTest.Contract.Decimals(&_ERC20NativeMinterTest.CallOpts) +func (_ERC20NativeMinter *ERC20NativeMinterSession) Decimals() (uint8, error) { + return _ERC20NativeMinter.Contract.Decimals(&_ERC20NativeMinter.CallOpts) } // Decimals is a free data retrieval call binding the contract method 0x313ce567. // // Solidity: function decimals() view returns(uint8) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestCallerSession) Decimals() (uint8, error) { - return _ERC20NativeMinterTest.Contract.Decimals(&_ERC20NativeMinterTest.CallOpts) +func (_ERC20NativeMinter *ERC20NativeMinterCallerSession) Decimals() (uint8, error) { + return _ERC20NativeMinter.Contract.Decimals(&_ERC20NativeMinter.CallOpts) } // IsAdmin is a free data retrieval call binding the contract method 0x24d7806c. // // Solidity: function isAdmin(address addr) view returns(bool) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestCaller) IsAdmin(opts *bind.CallOpts, addr common.Address) (bool, error) { +func (_ERC20NativeMinter *ERC20NativeMinterCaller) IsAdmin(opts *bind.CallOpts, addr common.Address) (bool, error) { var out []interface{} - err := _ERC20NativeMinterTest.contract.Call(opts, &out, "isAdmin", addr) + err := _ERC20NativeMinter.contract.Call(opts, &out, "isAdmin", addr) if err != nil { return *new(bool), err @@ -315,23 +315,23 @@ func (_ERC20NativeMinterTest *ERC20NativeMinterTestCaller) IsAdmin(opts *bind.Ca // IsAdmin is a free data retrieval call binding the contract method 0x24d7806c. // // Solidity: function isAdmin(address addr) view returns(bool) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestSession) IsAdmin(addr common.Address) (bool, error) { - return _ERC20NativeMinterTest.Contract.IsAdmin(&_ERC20NativeMinterTest.CallOpts, addr) +func (_ERC20NativeMinter *ERC20NativeMinterSession) IsAdmin(addr common.Address) (bool, error) { + return _ERC20NativeMinter.Contract.IsAdmin(&_ERC20NativeMinter.CallOpts, addr) } // IsAdmin is a free data retrieval call binding the contract method 0x24d7806c. // // Solidity: function isAdmin(address addr) view returns(bool) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestCallerSession) IsAdmin(addr common.Address) (bool, error) { - return _ERC20NativeMinterTest.Contract.IsAdmin(&_ERC20NativeMinterTest.CallOpts, addr) +func (_ERC20NativeMinter *ERC20NativeMinterCallerSession) IsAdmin(addr common.Address) (bool, error) { + return _ERC20NativeMinter.Contract.IsAdmin(&_ERC20NativeMinter.CallOpts, addr) } // IsEnabled is a free data retrieval call binding the contract method 0x9015d371. // // Solidity: function isEnabled(address addr) view returns(bool) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestCaller) IsEnabled(opts *bind.CallOpts, addr common.Address) (bool, error) { +func (_ERC20NativeMinter *ERC20NativeMinterCaller) IsEnabled(opts *bind.CallOpts, addr common.Address) (bool, error) { var out []interface{} - err := _ERC20NativeMinterTest.contract.Call(opts, &out, "isEnabled", addr) + err := _ERC20NativeMinter.contract.Call(opts, &out, "isEnabled", addr) if err != nil { return *new(bool), err @@ -346,23 +346,23 @@ func (_ERC20NativeMinterTest *ERC20NativeMinterTestCaller) IsEnabled(opts *bind. // IsEnabled is a free data retrieval call binding the contract method 0x9015d371. // // Solidity: function isEnabled(address addr) view returns(bool) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestSession) IsEnabled(addr common.Address) (bool, error) { - return _ERC20NativeMinterTest.Contract.IsEnabled(&_ERC20NativeMinterTest.CallOpts, addr) +func (_ERC20NativeMinter *ERC20NativeMinterSession) IsEnabled(addr common.Address) (bool, error) { + return _ERC20NativeMinter.Contract.IsEnabled(&_ERC20NativeMinter.CallOpts, addr) } // IsEnabled is a free data retrieval call binding the contract method 0x9015d371. // // Solidity: function isEnabled(address addr) view returns(bool) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestCallerSession) IsEnabled(addr common.Address) (bool, error) { - return _ERC20NativeMinterTest.Contract.IsEnabled(&_ERC20NativeMinterTest.CallOpts, addr) +func (_ERC20NativeMinter *ERC20NativeMinterCallerSession) IsEnabled(addr common.Address) (bool, error) { + return _ERC20NativeMinter.Contract.IsEnabled(&_ERC20NativeMinter.CallOpts, addr) } // IsManager is a free data retrieval call binding the contract method 0xf3ae2415. // // Solidity: function isManager(address addr) view returns(bool) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestCaller) IsManager(opts *bind.CallOpts, addr common.Address) (bool, error) { +func (_ERC20NativeMinter *ERC20NativeMinterCaller) IsManager(opts *bind.CallOpts, addr common.Address) (bool, error) { var out []interface{} - err := _ERC20NativeMinterTest.contract.Call(opts, &out, "isManager", addr) + err := _ERC20NativeMinter.contract.Call(opts, &out, "isManager", addr) if err != nil { return *new(bool), err @@ -377,23 +377,23 @@ func (_ERC20NativeMinterTest *ERC20NativeMinterTestCaller) IsManager(opts *bind. // IsManager is a free data retrieval call binding the contract method 0xf3ae2415. // // Solidity: function isManager(address addr) view returns(bool) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestSession) IsManager(addr common.Address) (bool, error) { - return _ERC20NativeMinterTest.Contract.IsManager(&_ERC20NativeMinterTest.CallOpts, addr) +func (_ERC20NativeMinter *ERC20NativeMinterSession) IsManager(addr common.Address) (bool, error) { + return _ERC20NativeMinter.Contract.IsManager(&_ERC20NativeMinter.CallOpts, addr) } // IsManager is a free data retrieval call binding the contract method 0xf3ae2415. // // Solidity: function isManager(address addr) view returns(bool) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestCallerSession) IsManager(addr common.Address) (bool, error) { - return _ERC20NativeMinterTest.Contract.IsManager(&_ERC20NativeMinterTest.CallOpts, addr) +func (_ERC20NativeMinter *ERC20NativeMinterCallerSession) IsManager(addr common.Address) (bool, error) { + return _ERC20NativeMinter.Contract.IsManager(&_ERC20NativeMinter.CallOpts, addr) } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestCaller) Name(opts *bind.CallOpts) (string, error) { +func (_ERC20NativeMinter *ERC20NativeMinterCaller) Name(opts *bind.CallOpts) (string, error) { var out []interface{} - err := _ERC20NativeMinterTest.contract.Call(opts, &out, "name") + err := _ERC20NativeMinter.contract.Call(opts, &out, "name") if err != nil { return *new(string), err @@ -408,23 +408,23 @@ func (_ERC20NativeMinterTest *ERC20NativeMinterTestCaller) Name(opts *bind.CallO // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestSession) Name() (string, error) { - return _ERC20NativeMinterTest.Contract.Name(&_ERC20NativeMinterTest.CallOpts) +func (_ERC20NativeMinter *ERC20NativeMinterSession) Name() (string, error) { + return _ERC20NativeMinter.Contract.Name(&_ERC20NativeMinter.CallOpts) } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestCallerSession) Name() (string, error) { - return _ERC20NativeMinterTest.Contract.Name(&_ERC20NativeMinterTest.CallOpts) +func (_ERC20NativeMinter *ERC20NativeMinterCallerSession) Name() (string, error) { + return _ERC20NativeMinter.Contract.Name(&_ERC20NativeMinter.CallOpts) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestCaller) Owner(opts *bind.CallOpts) (common.Address, error) { +func (_ERC20NativeMinter *ERC20NativeMinterCaller) Owner(opts *bind.CallOpts) (common.Address, error) { var out []interface{} - err := _ERC20NativeMinterTest.contract.Call(opts, &out, "owner") + err := _ERC20NativeMinter.contract.Call(opts, &out, "owner") if err != nil { return *new(common.Address), err @@ -439,23 +439,23 @@ func (_ERC20NativeMinterTest *ERC20NativeMinterTestCaller) Owner(opts *bind.Call // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestSession) Owner() (common.Address, error) { - return _ERC20NativeMinterTest.Contract.Owner(&_ERC20NativeMinterTest.CallOpts) +func (_ERC20NativeMinter *ERC20NativeMinterSession) Owner() (common.Address, error) { + return _ERC20NativeMinter.Contract.Owner(&_ERC20NativeMinter.CallOpts) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestCallerSession) Owner() (common.Address, error) { - return _ERC20NativeMinterTest.Contract.Owner(&_ERC20NativeMinterTest.CallOpts) +func (_ERC20NativeMinter *ERC20NativeMinterCallerSession) Owner() (common.Address, error) { + return _ERC20NativeMinter.Contract.Owner(&_ERC20NativeMinter.CallOpts) } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestCaller) Symbol(opts *bind.CallOpts) (string, error) { +func (_ERC20NativeMinter *ERC20NativeMinterCaller) Symbol(opts *bind.CallOpts) (string, error) { var out []interface{} - err := _ERC20NativeMinterTest.contract.Call(opts, &out, "symbol") + err := _ERC20NativeMinter.contract.Call(opts, &out, "symbol") if err != nil { return *new(string), err @@ -470,23 +470,23 @@ func (_ERC20NativeMinterTest *ERC20NativeMinterTestCaller) Symbol(opts *bind.Cal // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestSession) Symbol() (string, error) { - return _ERC20NativeMinterTest.Contract.Symbol(&_ERC20NativeMinterTest.CallOpts) +func (_ERC20NativeMinter *ERC20NativeMinterSession) Symbol() (string, error) { + return _ERC20NativeMinter.Contract.Symbol(&_ERC20NativeMinter.CallOpts) } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestCallerSession) Symbol() (string, error) { - return _ERC20NativeMinterTest.Contract.Symbol(&_ERC20NativeMinterTest.CallOpts) +func (_ERC20NativeMinter *ERC20NativeMinterCallerSession) Symbol() (string, error) { + return _ERC20NativeMinter.Contract.Symbol(&_ERC20NativeMinter.CallOpts) } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestCaller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { +func (_ERC20NativeMinter *ERC20NativeMinterCaller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} - err := _ERC20NativeMinterTest.contract.Call(opts, &out, "totalSupply") + err := _ERC20NativeMinter.contract.Call(opts, &out, "totalSupply") if err != nil { return *new(*big.Int), err @@ -501,293 +501,293 @@ func (_ERC20NativeMinterTest *ERC20NativeMinterTestCaller) TotalSupply(opts *bin // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestSession) TotalSupply() (*big.Int, error) { - return _ERC20NativeMinterTest.Contract.TotalSupply(&_ERC20NativeMinterTest.CallOpts) +func (_ERC20NativeMinter *ERC20NativeMinterSession) TotalSupply() (*big.Int, error) { + return _ERC20NativeMinter.Contract.TotalSupply(&_ERC20NativeMinter.CallOpts) } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestCallerSession) TotalSupply() (*big.Int, error) { - return _ERC20NativeMinterTest.Contract.TotalSupply(&_ERC20NativeMinterTest.CallOpts) +func (_ERC20NativeMinter *ERC20NativeMinterCallerSession) TotalSupply() (*big.Int, error) { + return _ERC20NativeMinter.Contract.TotalSupply(&_ERC20NativeMinter.CallOpts) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address spender, uint256 value) returns(bool) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactor) Approve(opts *bind.TransactOpts, spender common.Address, value *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinterTest.contract.Transact(opts, "approve", spender, value) +func (_ERC20NativeMinter *ERC20NativeMinterTransactor) Approve(opts *bind.TransactOpts, spender common.Address, value *big.Int) (*types.Transaction, error) { + return _ERC20NativeMinter.contract.Transact(opts, "approve", spender, value) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address spender, uint256 value) returns(bool) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestSession) Approve(spender common.Address, value *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinterTest.Contract.Approve(&_ERC20NativeMinterTest.TransactOpts, spender, value) +func (_ERC20NativeMinter *ERC20NativeMinterSession) Approve(spender common.Address, value *big.Int) (*types.Transaction, error) { + return _ERC20NativeMinter.Contract.Approve(&_ERC20NativeMinter.TransactOpts, spender, value) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address spender, uint256 value) returns(bool) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactorSession) Approve(spender common.Address, value *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinterTest.Contract.Approve(&_ERC20NativeMinterTest.TransactOpts, spender, value) +func (_ERC20NativeMinter *ERC20NativeMinterTransactorSession) Approve(spender common.Address, value *big.Int) (*types.Transaction, error) { + return _ERC20NativeMinter.Contract.Approve(&_ERC20NativeMinter.TransactOpts, spender, value) } // Burn is a paid mutator transaction binding the contract method 0x9dc29fac. // // Solidity: function burn(address from, uint256 amount) returns() -func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactor) Burn(opts *bind.TransactOpts, from common.Address, amount *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinterTest.contract.Transact(opts, "burn", from, amount) +func (_ERC20NativeMinter *ERC20NativeMinterTransactor) Burn(opts *bind.TransactOpts, from common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20NativeMinter.contract.Transact(opts, "burn", from, amount) } // Burn is a paid mutator transaction binding the contract method 0x9dc29fac. // // Solidity: function burn(address from, uint256 amount) returns() -func (_ERC20NativeMinterTest *ERC20NativeMinterTestSession) Burn(from common.Address, amount *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinterTest.Contract.Burn(&_ERC20NativeMinterTest.TransactOpts, from, amount) +func (_ERC20NativeMinter *ERC20NativeMinterSession) Burn(from common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20NativeMinter.Contract.Burn(&_ERC20NativeMinter.TransactOpts, from, amount) } // Burn is a paid mutator transaction binding the contract method 0x9dc29fac. // // Solidity: function burn(address from, uint256 amount) returns() -func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactorSession) Burn(from common.Address, amount *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinterTest.Contract.Burn(&_ERC20NativeMinterTest.TransactOpts, from, amount) +func (_ERC20NativeMinter *ERC20NativeMinterTransactorSession) Burn(from common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20NativeMinter.Contract.Burn(&_ERC20NativeMinter.TransactOpts, from, amount) } // Deposit is a paid mutator transaction binding the contract method 0xd0e30db0. // // Solidity: function deposit() payable returns() -func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactor) Deposit(opts *bind.TransactOpts) (*types.Transaction, error) { - return _ERC20NativeMinterTest.contract.Transact(opts, "deposit") +func (_ERC20NativeMinter *ERC20NativeMinterTransactor) Deposit(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ERC20NativeMinter.contract.Transact(opts, "deposit") } // Deposit is a paid mutator transaction binding the contract method 0xd0e30db0. // // Solidity: function deposit() payable returns() -func (_ERC20NativeMinterTest *ERC20NativeMinterTestSession) Deposit() (*types.Transaction, error) { - return _ERC20NativeMinterTest.Contract.Deposit(&_ERC20NativeMinterTest.TransactOpts) +func (_ERC20NativeMinter *ERC20NativeMinterSession) Deposit() (*types.Transaction, error) { + return _ERC20NativeMinter.Contract.Deposit(&_ERC20NativeMinter.TransactOpts) } // Deposit is a paid mutator transaction binding the contract method 0xd0e30db0. // // Solidity: function deposit() payable returns() -func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactorSession) Deposit() (*types.Transaction, error) { - return _ERC20NativeMinterTest.Contract.Deposit(&_ERC20NativeMinterTest.TransactOpts) +func (_ERC20NativeMinter *ERC20NativeMinterTransactorSession) Deposit() (*types.Transaction, error) { + return _ERC20NativeMinter.Contract.Deposit(&_ERC20NativeMinter.TransactOpts) } // Mint is a paid mutator transaction binding the contract method 0x40c10f19. // // Solidity: function mint(address to, uint256 amount) returns() -func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactor) Mint(opts *bind.TransactOpts, to common.Address, amount *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinterTest.contract.Transact(opts, "mint", to, amount) +func (_ERC20NativeMinter *ERC20NativeMinterTransactor) Mint(opts *bind.TransactOpts, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20NativeMinter.contract.Transact(opts, "mint", to, amount) } // Mint is a paid mutator transaction binding the contract method 0x40c10f19. // // Solidity: function mint(address to, uint256 amount) returns() -func (_ERC20NativeMinterTest *ERC20NativeMinterTestSession) Mint(to common.Address, amount *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinterTest.Contract.Mint(&_ERC20NativeMinterTest.TransactOpts, to, amount) +func (_ERC20NativeMinter *ERC20NativeMinterSession) Mint(to common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20NativeMinter.Contract.Mint(&_ERC20NativeMinter.TransactOpts, to, amount) } // Mint is a paid mutator transaction binding the contract method 0x40c10f19. // // Solidity: function mint(address to, uint256 amount) returns() -func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactorSession) Mint(to common.Address, amount *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinterTest.Contract.Mint(&_ERC20NativeMinterTest.TransactOpts, to, amount) +func (_ERC20NativeMinter *ERC20NativeMinterTransactorSession) Mint(to common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20NativeMinter.Contract.Mint(&_ERC20NativeMinter.TransactOpts, to, amount) } // Mintdraw is a paid mutator transaction binding the contract method 0x0356b6cd. // // Solidity: function mintdraw(uint256 wad) returns() -func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactor) Mintdraw(opts *bind.TransactOpts, wad *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinterTest.contract.Transact(opts, "mintdraw", wad) +func (_ERC20NativeMinter *ERC20NativeMinterTransactor) Mintdraw(opts *bind.TransactOpts, wad *big.Int) (*types.Transaction, error) { + return _ERC20NativeMinter.contract.Transact(opts, "mintdraw", wad) } // Mintdraw is a paid mutator transaction binding the contract method 0x0356b6cd. // // Solidity: function mintdraw(uint256 wad) returns() -func (_ERC20NativeMinterTest *ERC20NativeMinterTestSession) Mintdraw(wad *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinterTest.Contract.Mintdraw(&_ERC20NativeMinterTest.TransactOpts, wad) +func (_ERC20NativeMinter *ERC20NativeMinterSession) Mintdraw(wad *big.Int) (*types.Transaction, error) { + return _ERC20NativeMinter.Contract.Mintdraw(&_ERC20NativeMinter.TransactOpts, wad) } // Mintdraw is a paid mutator transaction binding the contract method 0x0356b6cd. // // Solidity: function mintdraw(uint256 wad) returns() -func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactorSession) Mintdraw(wad *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinterTest.Contract.Mintdraw(&_ERC20NativeMinterTest.TransactOpts, wad) +func (_ERC20NativeMinter *ERC20NativeMinterTransactorSession) Mintdraw(wad *big.Int) (*types.Transaction, error) { + return _ERC20NativeMinter.Contract.Mintdraw(&_ERC20NativeMinter.TransactOpts, wad) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() -func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { - return _ERC20NativeMinterTest.contract.Transact(opts, "renounceOwnership") +func (_ERC20NativeMinter *ERC20NativeMinterTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ERC20NativeMinter.contract.Transact(opts, "renounceOwnership") } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() -func (_ERC20NativeMinterTest *ERC20NativeMinterTestSession) RenounceOwnership() (*types.Transaction, error) { - return _ERC20NativeMinterTest.Contract.RenounceOwnership(&_ERC20NativeMinterTest.TransactOpts) +func (_ERC20NativeMinter *ERC20NativeMinterSession) RenounceOwnership() (*types.Transaction, error) { + return _ERC20NativeMinter.Contract.RenounceOwnership(&_ERC20NativeMinter.TransactOpts) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() -func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactorSession) RenounceOwnership() (*types.Transaction, error) { - return _ERC20NativeMinterTest.Contract.RenounceOwnership(&_ERC20NativeMinterTest.TransactOpts) +func (_ERC20NativeMinter *ERC20NativeMinterTransactorSession) RenounceOwnership() (*types.Transaction, error) { + return _ERC20NativeMinter.Contract.RenounceOwnership(&_ERC20NativeMinter.TransactOpts) } // Revoke is a paid mutator transaction binding the contract method 0x74a8f103. // // Solidity: function revoke(address addr) returns() -func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactor) Revoke(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { - return _ERC20NativeMinterTest.contract.Transact(opts, "revoke", addr) +func (_ERC20NativeMinter *ERC20NativeMinterTransactor) Revoke(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { + return _ERC20NativeMinter.contract.Transact(opts, "revoke", addr) } // Revoke is a paid mutator transaction binding the contract method 0x74a8f103. // // Solidity: function revoke(address addr) returns() -func (_ERC20NativeMinterTest *ERC20NativeMinterTestSession) Revoke(addr common.Address) (*types.Transaction, error) { - return _ERC20NativeMinterTest.Contract.Revoke(&_ERC20NativeMinterTest.TransactOpts, addr) +func (_ERC20NativeMinter *ERC20NativeMinterSession) Revoke(addr common.Address) (*types.Transaction, error) { + return _ERC20NativeMinter.Contract.Revoke(&_ERC20NativeMinter.TransactOpts, addr) } // Revoke is a paid mutator transaction binding the contract method 0x74a8f103. // // Solidity: function revoke(address addr) returns() -func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactorSession) Revoke(addr common.Address) (*types.Transaction, error) { - return _ERC20NativeMinterTest.Contract.Revoke(&_ERC20NativeMinterTest.TransactOpts, addr) +func (_ERC20NativeMinter *ERC20NativeMinterTransactorSession) Revoke(addr common.Address) (*types.Transaction, error) { + return _ERC20NativeMinter.Contract.Revoke(&_ERC20NativeMinter.TransactOpts, addr) } // SetAdmin is a paid mutator transaction binding the contract method 0x704b6c02. // // Solidity: function setAdmin(address addr) returns() -func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactor) SetAdmin(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { - return _ERC20NativeMinterTest.contract.Transact(opts, "setAdmin", addr) +func (_ERC20NativeMinter *ERC20NativeMinterTransactor) SetAdmin(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { + return _ERC20NativeMinter.contract.Transact(opts, "setAdmin", addr) } // SetAdmin is a paid mutator transaction binding the contract method 0x704b6c02. // // Solidity: function setAdmin(address addr) returns() -func (_ERC20NativeMinterTest *ERC20NativeMinterTestSession) SetAdmin(addr common.Address) (*types.Transaction, error) { - return _ERC20NativeMinterTest.Contract.SetAdmin(&_ERC20NativeMinterTest.TransactOpts, addr) +func (_ERC20NativeMinter *ERC20NativeMinterSession) SetAdmin(addr common.Address) (*types.Transaction, error) { + return _ERC20NativeMinter.Contract.SetAdmin(&_ERC20NativeMinter.TransactOpts, addr) } // SetAdmin is a paid mutator transaction binding the contract method 0x704b6c02. // // Solidity: function setAdmin(address addr) returns() -func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactorSession) SetAdmin(addr common.Address) (*types.Transaction, error) { - return _ERC20NativeMinterTest.Contract.SetAdmin(&_ERC20NativeMinterTest.TransactOpts, addr) +func (_ERC20NativeMinter *ERC20NativeMinterTransactorSession) SetAdmin(addr common.Address) (*types.Transaction, error) { + return _ERC20NativeMinter.Contract.SetAdmin(&_ERC20NativeMinter.TransactOpts, addr) } // SetEnabled is a paid mutator transaction binding the contract method 0x0aaf7043. // // Solidity: function setEnabled(address addr) returns() -func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactor) SetEnabled(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { - return _ERC20NativeMinterTest.contract.Transact(opts, "setEnabled", addr) +func (_ERC20NativeMinter *ERC20NativeMinterTransactor) SetEnabled(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { + return _ERC20NativeMinter.contract.Transact(opts, "setEnabled", addr) } // SetEnabled is a paid mutator transaction binding the contract method 0x0aaf7043. // // Solidity: function setEnabled(address addr) returns() -func (_ERC20NativeMinterTest *ERC20NativeMinterTestSession) SetEnabled(addr common.Address) (*types.Transaction, error) { - return _ERC20NativeMinterTest.Contract.SetEnabled(&_ERC20NativeMinterTest.TransactOpts, addr) +func (_ERC20NativeMinter *ERC20NativeMinterSession) SetEnabled(addr common.Address) (*types.Transaction, error) { + return _ERC20NativeMinter.Contract.SetEnabled(&_ERC20NativeMinter.TransactOpts, addr) } // SetEnabled is a paid mutator transaction binding the contract method 0x0aaf7043. // // Solidity: function setEnabled(address addr) returns() -func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactorSession) SetEnabled(addr common.Address) (*types.Transaction, error) { - return _ERC20NativeMinterTest.Contract.SetEnabled(&_ERC20NativeMinterTest.TransactOpts, addr) +func (_ERC20NativeMinter *ERC20NativeMinterTransactorSession) SetEnabled(addr common.Address) (*types.Transaction, error) { + return _ERC20NativeMinter.Contract.SetEnabled(&_ERC20NativeMinter.TransactOpts, addr) } // SetManager is a paid mutator transaction binding the contract method 0xd0ebdbe7. // // Solidity: function setManager(address addr) returns() -func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactor) SetManager(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { - return _ERC20NativeMinterTest.contract.Transact(opts, "setManager", addr) +func (_ERC20NativeMinter *ERC20NativeMinterTransactor) SetManager(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { + return _ERC20NativeMinter.contract.Transact(opts, "setManager", addr) } // SetManager is a paid mutator transaction binding the contract method 0xd0ebdbe7. // // Solidity: function setManager(address addr) returns() -func (_ERC20NativeMinterTest *ERC20NativeMinterTestSession) SetManager(addr common.Address) (*types.Transaction, error) { - return _ERC20NativeMinterTest.Contract.SetManager(&_ERC20NativeMinterTest.TransactOpts, addr) +func (_ERC20NativeMinter *ERC20NativeMinterSession) SetManager(addr common.Address) (*types.Transaction, error) { + return _ERC20NativeMinter.Contract.SetManager(&_ERC20NativeMinter.TransactOpts, addr) } // SetManager is a paid mutator transaction binding the contract method 0xd0ebdbe7. // // Solidity: function setManager(address addr) returns() -func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactorSession) SetManager(addr common.Address) (*types.Transaction, error) { - return _ERC20NativeMinterTest.Contract.SetManager(&_ERC20NativeMinterTest.TransactOpts, addr) +func (_ERC20NativeMinter *ERC20NativeMinterTransactorSession) SetManager(addr common.Address) (*types.Transaction, error) { + return _ERC20NativeMinter.Contract.SetManager(&_ERC20NativeMinter.TransactOpts, addr) } // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. // // Solidity: function transfer(address to, uint256 value) returns(bool) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactor) Transfer(opts *bind.TransactOpts, to common.Address, value *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinterTest.contract.Transact(opts, "transfer", to, value) +func (_ERC20NativeMinter *ERC20NativeMinterTransactor) Transfer(opts *bind.TransactOpts, to common.Address, value *big.Int) (*types.Transaction, error) { + return _ERC20NativeMinter.contract.Transact(opts, "transfer", to, value) } // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. // // Solidity: function transfer(address to, uint256 value) returns(bool) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestSession) Transfer(to common.Address, value *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinterTest.Contract.Transfer(&_ERC20NativeMinterTest.TransactOpts, to, value) +func (_ERC20NativeMinter *ERC20NativeMinterSession) Transfer(to common.Address, value *big.Int) (*types.Transaction, error) { + return _ERC20NativeMinter.Contract.Transfer(&_ERC20NativeMinter.TransactOpts, to, value) } // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. // // Solidity: function transfer(address to, uint256 value) returns(bool) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactorSession) Transfer(to common.Address, value *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinterTest.Contract.Transfer(&_ERC20NativeMinterTest.TransactOpts, to, value) +func (_ERC20NativeMinter *ERC20NativeMinterTransactorSession) Transfer(to common.Address, value *big.Int) (*types.Transaction, error) { + return _ERC20NativeMinter.Contract.Transfer(&_ERC20NativeMinter.TransactOpts, to, value) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 value) returns(bool) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactor) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, value *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinterTest.contract.Transact(opts, "transferFrom", from, to, value) +func (_ERC20NativeMinter *ERC20NativeMinterTransactor) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, value *big.Int) (*types.Transaction, error) { + return _ERC20NativeMinter.contract.Transact(opts, "transferFrom", from, to, value) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 value) returns(bool) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestSession) TransferFrom(from common.Address, to common.Address, value *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinterTest.Contract.TransferFrom(&_ERC20NativeMinterTest.TransactOpts, from, to, value) +func (_ERC20NativeMinter *ERC20NativeMinterSession) TransferFrom(from common.Address, to common.Address, value *big.Int) (*types.Transaction, error) { + return _ERC20NativeMinter.Contract.TransferFrom(&_ERC20NativeMinter.TransactOpts, from, to, value) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 value) returns(bool) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactorSession) TransferFrom(from common.Address, to common.Address, value *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinterTest.Contract.TransferFrom(&_ERC20NativeMinterTest.TransactOpts, from, to, value) +func (_ERC20NativeMinter *ERC20NativeMinterTransactorSession) TransferFrom(from common.Address, to common.Address, value *big.Int) (*types.Transaction, error) { + return _ERC20NativeMinter.Contract.TransferFrom(&_ERC20NativeMinter.TransactOpts, from, to, value) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() -func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { - return _ERC20NativeMinterTest.contract.Transact(opts, "transferOwnership", newOwner) +func (_ERC20NativeMinter *ERC20NativeMinterTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { + return _ERC20NativeMinter.contract.Transact(opts, "transferOwnership", newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() -func (_ERC20NativeMinterTest *ERC20NativeMinterTestSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { - return _ERC20NativeMinterTest.Contract.TransferOwnership(&_ERC20NativeMinterTest.TransactOpts, newOwner) +func (_ERC20NativeMinter *ERC20NativeMinterSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _ERC20NativeMinter.Contract.TransferOwnership(&_ERC20NativeMinter.TransactOpts, newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() -func (_ERC20NativeMinterTest *ERC20NativeMinterTestTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { - return _ERC20NativeMinterTest.Contract.TransferOwnership(&_ERC20NativeMinterTest.TransactOpts, newOwner) +func (_ERC20NativeMinter *ERC20NativeMinterTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _ERC20NativeMinter.Contract.TransferOwnership(&_ERC20NativeMinter.TransactOpts, newOwner) } -// ERC20NativeMinterTestApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the ERC20NativeMinterTest contract. -type ERC20NativeMinterTestApprovalIterator struct { - Event *ERC20NativeMinterTestApproval // Event containing the contract specifics and raw log +// ERC20NativeMinterApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the ERC20NativeMinter contract. +type ERC20NativeMinterApprovalIterator struct { + Event *ERC20NativeMinterApproval // 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 @@ -801,7 +801,7 @@ type ERC20NativeMinterTestApprovalIterator struct { // 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 *ERC20NativeMinterTestApprovalIterator) Next() bool { +func (it *ERC20NativeMinterApprovalIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -810,7 +810,7 @@ func (it *ERC20NativeMinterTestApprovalIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(ERC20NativeMinterTestApproval) + it.Event = new(ERC20NativeMinterApproval) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -825,7 +825,7 @@ func (it *ERC20NativeMinterTestApprovalIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(ERC20NativeMinterTestApproval) + it.Event = new(ERC20NativeMinterApproval) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -841,19 +841,19 @@ func (it *ERC20NativeMinterTestApprovalIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *ERC20NativeMinterTestApprovalIterator) Error() error { +func (it *ERC20NativeMinterApprovalIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *ERC20NativeMinterTestApprovalIterator) Close() error { +func (it *ERC20NativeMinterApprovalIterator) Close() error { it.sub.Unsubscribe() return nil } -// ERC20NativeMinterTestApproval represents a Approval event raised by the ERC20NativeMinterTest contract. -type ERC20NativeMinterTestApproval struct { +// ERC20NativeMinterApproval represents a Approval event raised by the ERC20NativeMinter contract. +type ERC20NativeMinterApproval struct { Owner common.Address Spender common.Address Value *big.Int @@ -863,7 +863,7 @@ type ERC20NativeMinterTestApproval struct { // FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*ERC20NativeMinterTestApprovalIterator, error) { +func (_ERC20NativeMinter *ERC20NativeMinterFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*ERC20NativeMinterApprovalIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { @@ -874,17 +874,17 @@ func (_ERC20NativeMinterTest *ERC20NativeMinterTestFilterer) FilterApproval(opts spenderRule = append(spenderRule, spenderItem) } - logs, sub, err := _ERC20NativeMinterTest.contract.FilterLogs(opts, "Approval", ownerRule, spenderRule) + logs, sub, err := _ERC20NativeMinter.contract.FilterLogs(opts, "Approval", ownerRule, spenderRule) if err != nil { return nil, err } - return &ERC20NativeMinterTestApprovalIterator{contract: _ERC20NativeMinterTest.contract, event: "Approval", logs: logs, sub: sub}, nil + return &ERC20NativeMinterApprovalIterator{contract: _ERC20NativeMinter.contract, event: "Approval", logs: logs, sub: sub}, nil } // WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *ERC20NativeMinterTestApproval, owner []common.Address, spender []common.Address) (event.Subscription, error) { +func (_ERC20NativeMinter *ERC20NativeMinterFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *ERC20NativeMinterApproval, owner []common.Address, spender []common.Address) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { @@ -895,7 +895,7 @@ func (_ERC20NativeMinterTest *ERC20NativeMinterTestFilterer) WatchApproval(opts spenderRule = append(spenderRule, spenderItem) } - logs, sub, err := _ERC20NativeMinterTest.contract.WatchLogs(opts, "Approval", ownerRule, spenderRule) + logs, sub, err := _ERC20NativeMinter.contract.WatchLogs(opts, "Approval", ownerRule, spenderRule) if err != nil { return nil, err } @@ -905,8 +905,8 @@ func (_ERC20NativeMinterTest *ERC20NativeMinterTestFilterer) WatchApproval(opts select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(ERC20NativeMinterTestApproval) - if err := _ERC20NativeMinterTest.contract.UnpackLog(event, "Approval", log); err != nil { + event := new(ERC20NativeMinterApproval) + if err := _ERC20NativeMinter.contract.UnpackLog(event, "Approval", log); err != nil { return err } event.Raw = log @@ -930,18 +930,18 @@ func (_ERC20NativeMinterTest *ERC20NativeMinterTestFilterer) WatchApproval(opts // ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestFilterer) ParseApproval(log types.Log) (*ERC20NativeMinterTestApproval, error) { - event := new(ERC20NativeMinterTestApproval) - if err := _ERC20NativeMinterTest.contract.UnpackLog(event, "Approval", log); err != nil { +func (_ERC20NativeMinter *ERC20NativeMinterFilterer) ParseApproval(log types.Log) (*ERC20NativeMinterApproval, error) { + event := new(ERC20NativeMinterApproval) + if err := _ERC20NativeMinter.contract.UnpackLog(event, "Approval", log); err != nil { return nil, err } event.Raw = log return event, nil } -// ERC20NativeMinterTestDepositIterator is returned from FilterDeposit and is used to iterate over the raw logs and unpacked data for Deposit events raised by the ERC20NativeMinterTest contract. -type ERC20NativeMinterTestDepositIterator struct { - Event *ERC20NativeMinterTestDeposit // Event containing the contract specifics and raw log +// ERC20NativeMinterDepositIterator is returned from FilterDeposit and is used to iterate over the raw logs and unpacked data for Deposit events raised by the ERC20NativeMinter contract. +type ERC20NativeMinterDepositIterator struct { + Event *ERC20NativeMinterDeposit // 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 @@ -955,7 +955,7 @@ type ERC20NativeMinterTestDepositIterator struct { // 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 *ERC20NativeMinterTestDepositIterator) Next() bool { +func (it *ERC20NativeMinterDepositIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -964,7 +964,7 @@ func (it *ERC20NativeMinterTestDepositIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(ERC20NativeMinterTestDeposit) + it.Event = new(ERC20NativeMinterDeposit) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -979,7 +979,7 @@ func (it *ERC20NativeMinterTestDepositIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(ERC20NativeMinterTestDeposit) + it.Event = new(ERC20NativeMinterDeposit) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -995,19 +995,19 @@ func (it *ERC20NativeMinterTestDepositIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *ERC20NativeMinterTestDepositIterator) Error() error { +func (it *ERC20NativeMinterDepositIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *ERC20NativeMinterTestDepositIterator) Close() error { +func (it *ERC20NativeMinterDepositIterator) Close() error { it.sub.Unsubscribe() return nil } -// ERC20NativeMinterTestDeposit represents a Deposit event raised by the ERC20NativeMinterTest contract. -type ERC20NativeMinterTestDeposit struct { +// ERC20NativeMinterDeposit represents a Deposit event raised by the ERC20NativeMinter contract. +type ERC20NativeMinterDeposit struct { Dst common.Address Wad *big.Int Raw types.Log // Blockchain specific contextual infos @@ -1016,31 +1016,31 @@ type ERC20NativeMinterTestDeposit struct { // FilterDeposit is a free log retrieval operation binding the contract event 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c. // // Solidity: event Deposit(address indexed dst, uint256 wad) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestFilterer) FilterDeposit(opts *bind.FilterOpts, dst []common.Address) (*ERC20NativeMinterTestDepositIterator, error) { +func (_ERC20NativeMinter *ERC20NativeMinterFilterer) FilterDeposit(opts *bind.FilterOpts, dst []common.Address) (*ERC20NativeMinterDepositIterator, error) { var dstRule []interface{} for _, dstItem := range dst { dstRule = append(dstRule, dstItem) } - logs, sub, err := _ERC20NativeMinterTest.contract.FilterLogs(opts, "Deposit", dstRule) + logs, sub, err := _ERC20NativeMinter.contract.FilterLogs(opts, "Deposit", dstRule) if err != nil { return nil, err } - return &ERC20NativeMinterTestDepositIterator{contract: _ERC20NativeMinterTest.contract, event: "Deposit", logs: logs, sub: sub}, nil + return &ERC20NativeMinterDepositIterator{contract: _ERC20NativeMinter.contract, event: "Deposit", logs: logs, sub: sub}, nil } // WatchDeposit is a free log subscription operation binding the contract event 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c. // // Solidity: event Deposit(address indexed dst, uint256 wad) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestFilterer) WatchDeposit(opts *bind.WatchOpts, sink chan<- *ERC20NativeMinterTestDeposit, dst []common.Address) (event.Subscription, error) { +func (_ERC20NativeMinter *ERC20NativeMinterFilterer) WatchDeposit(opts *bind.WatchOpts, sink chan<- *ERC20NativeMinterDeposit, dst []common.Address) (event.Subscription, error) { var dstRule []interface{} for _, dstItem := range dst { dstRule = append(dstRule, dstItem) } - logs, sub, err := _ERC20NativeMinterTest.contract.WatchLogs(opts, "Deposit", dstRule) + logs, sub, err := _ERC20NativeMinter.contract.WatchLogs(opts, "Deposit", dstRule) if err != nil { return nil, err } @@ -1050,8 +1050,8 @@ func (_ERC20NativeMinterTest *ERC20NativeMinterTestFilterer) WatchDeposit(opts * select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(ERC20NativeMinterTestDeposit) - if err := _ERC20NativeMinterTest.contract.UnpackLog(event, "Deposit", log); err != nil { + event := new(ERC20NativeMinterDeposit) + if err := _ERC20NativeMinter.contract.UnpackLog(event, "Deposit", log); err != nil { return err } event.Raw = log @@ -1075,18 +1075,18 @@ func (_ERC20NativeMinterTest *ERC20NativeMinterTestFilterer) WatchDeposit(opts * // ParseDeposit is a log parse operation binding the contract event 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c. // // Solidity: event Deposit(address indexed dst, uint256 wad) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestFilterer) ParseDeposit(log types.Log) (*ERC20NativeMinterTestDeposit, error) { - event := new(ERC20NativeMinterTestDeposit) - if err := _ERC20NativeMinterTest.contract.UnpackLog(event, "Deposit", log); err != nil { +func (_ERC20NativeMinter *ERC20NativeMinterFilterer) ParseDeposit(log types.Log) (*ERC20NativeMinterDeposit, error) { + event := new(ERC20NativeMinterDeposit) + if err := _ERC20NativeMinter.contract.UnpackLog(event, "Deposit", log); err != nil { return nil, err } event.Raw = log return event, nil } -// ERC20NativeMinterTestMintdrawalIterator is returned from FilterMintdrawal and is used to iterate over the raw logs and unpacked data for Mintdrawal events raised by the ERC20NativeMinterTest contract. -type ERC20NativeMinterTestMintdrawalIterator struct { - Event *ERC20NativeMinterTestMintdrawal // Event containing the contract specifics and raw log +// ERC20NativeMinterMintdrawalIterator is returned from FilterMintdrawal and is used to iterate over the raw logs and unpacked data for Mintdrawal events raised by the ERC20NativeMinter contract. +type ERC20NativeMinterMintdrawalIterator struct { + Event *ERC20NativeMinterMintdrawal // 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 @@ -1100,7 +1100,7 @@ type ERC20NativeMinterTestMintdrawalIterator struct { // 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 *ERC20NativeMinterTestMintdrawalIterator) Next() bool { +func (it *ERC20NativeMinterMintdrawalIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -1109,7 +1109,7 @@ func (it *ERC20NativeMinterTestMintdrawalIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(ERC20NativeMinterTestMintdrawal) + it.Event = new(ERC20NativeMinterMintdrawal) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1124,7 +1124,7 @@ func (it *ERC20NativeMinterTestMintdrawalIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(ERC20NativeMinterTestMintdrawal) + it.Event = new(ERC20NativeMinterMintdrawal) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1140,19 +1140,19 @@ func (it *ERC20NativeMinterTestMintdrawalIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *ERC20NativeMinterTestMintdrawalIterator) Error() error { +func (it *ERC20NativeMinterMintdrawalIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *ERC20NativeMinterTestMintdrawalIterator) Close() error { +func (it *ERC20NativeMinterMintdrawalIterator) Close() error { it.sub.Unsubscribe() return nil } -// ERC20NativeMinterTestMintdrawal represents a Mintdrawal event raised by the ERC20NativeMinterTest contract. -type ERC20NativeMinterTestMintdrawal struct { +// ERC20NativeMinterMintdrawal represents a Mintdrawal event raised by the ERC20NativeMinter contract. +type ERC20NativeMinterMintdrawal struct { Src common.Address Wad *big.Int Raw types.Log // Blockchain specific contextual infos @@ -1161,31 +1161,31 @@ type ERC20NativeMinterTestMintdrawal struct { // FilterMintdrawal is a free log retrieval operation binding the contract event 0x25bedde6c8ebd3a89b719a16299dbfe271c7bffa42fe1ac1a52e15ab0cb767e6. // // Solidity: event Mintdrawal(address indexed src, uint256 wad) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestFilterer) FilterMintdrawal(opts *bind.FilterOpts, src []common.Address) (*ERC20NativeMinterTestMintdrawalIterator, error) { +func (_ERC20NativeMinter *ERC20NativeMinterFilterer) FilterMintdrawal(opts *bind.FilterOpts, src []common.Address) (*ERC20NativeMinterMintdrawalIterator, error) { var srcRule []interface{} for _, srcItem := range src { srcRule = append(srcRule, srcItem) } - logs, sub, err := _ERC20NativeMinterTest.contract.FilterLogs(opts, "Mintdrawal", srcRule) + logs, sub, err := _ERC20NativeMinter.contract.FilterLogs(opts, "Mintdrawal", srcRule) if err != nil { return nil, err } - return &ERC20NativeMinterTestMintdrawalIterator{contract: _ERC20NativeMinterTest.contract, event: "Mintdrawal", logs: logs, sub: sub}, nil + return &ERC20NativeMinterMintdrawalIterator{contract: _ERC20NativeMinter.contract, event: "Mintdrawal", logs: logs, sub: sub}, nil } // WatchMintdrawal is a free log subscription operation binding the contract event 0x25bedde6c8ebd3a89b719a16299dbfe271c7bffa42fe1ac1a52e15ab0cb767e6. // // Solidity: event Mintdrawal(address indexed src, uint256 wad) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestFilterer) WatchMintdrawal(opts *bind.WatchOpts, sink chan<- *ERC20NativeMinterTestMintdrawal, src []common.Address) (event.Subscription, error) { +func (_ERC20NativeMinter *ERC20NativeMinterFilterer) WatchMintdrawal(opts *bind.WatchOpts, sink chan<- *ERC20NativeMinterMintdrawal, src []common.Address) (event.Subscription, error) { var srcRule []interface{} for _, srcItem := range src { srcRule = append(srcRule, srcItem) } - logs, sub, err := _ERC20NativeMinterTest.contract.WatchLogs(opts, "Mintdrawal", srcRule) + logs, sub, err := _ERC20NativeMinter.contract.WatchLogs(opts, "Mintdrawal", srcRule) if err != nil { return nil, err } @@ -1195,8 +1195,8 @@ func (_ERC20NativeMinterTest *ERC20NativeMinterTestFilterer) WatchMintdrawal(opt select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(ERC20NativeMinterTestMintdrawal) - if err := _ERC20NativeMinterTest.contract.UnpackLog(event, "Mintdrawal", log); err != nil { + event := new(ERC20NativeMinterMintdrawal) + if err := _ERC20NativeMinter.contract.UnpackLog(event, "Mintdrawal", log); err != nil { return err } event.Raw = log @@ -1220,18 +1220,18 @@ func (_ERC20NativeMinterTest *ERC20NativeMinterTestFilterer) WatchMintdrawal(opt // ParseMintdrawal is a log parse operation binding the contract event 0x25bedde6c8ebd3a89b719a16299dbfe271c7bffa42fe1ac1a52e15ab0cb767e6. // // Solidity: event Mintdrawal(address indexed src, uint256 wad) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestFilterer) ParseMintdrawal(log types.Log) (*ERC20NativeMinterTestMintdrawal, error) { - event := new(ERC20NativeMinterTestMintdrawal) - if err := _ERC20NativeMinterTest.contract.UnpackLog(event, "Mintdrawal", log); err != nil { +func (_ERC20NativeMinter *ERC20NativeMinterFilterer) ParseMintdrawal(log types.Log) (*ERC20NativeMinterMintdrawal, error) { + event := new(ERC20NativeMinterMintdrawal) + if err := _ERC20NativeMinter.contract.UnpackLog(event, "Mintdrawal", log); err != nil { return nil, err } event.Raw = log return event, nil } -// ERC20NativeMinterTestOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the ERC20NativeMinterTest contract. -type ERC20NativeMinterTestOwnershipTransferredIterator struct { - Event *ERC20NativeMinterTestOwnershipTransferred // Event containing the contract specifics and raw log +// ERC20NativeMinterOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the ERC20NativeMinter contract. +type ERC20NativeMinterOwnershipTransferredIterator struct { + Event *ERC20NativeMinterOwnershipTransferred // 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 @@ -1245,7 +1245,7 @@ type ERC20NativeMinterTestOwnershipTransferredIterator struct { // 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 *ERC20NativeMinterTestOwnershipTransferredIterator) Next() bool { +func (it *ERC20NativeMinterOwnershipTransferredIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -1254,7 +1254,7 @@ func (it *ERC20NativeMinterTestOwnershipTransferredIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(ERC20NativeMinterTestOwnershipTransferred) + it.Event = new(ERC20NativeMinterOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1269,7 +1269,7 @@ func (it *ERC20NativeMinterTestOwnershipTransferredIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(ERC20NativeMinterTestOwnershipTransferred) + it.Event = new(ERC20NativeMinterOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1285,19 +1285,19 @@ func (it *ERC20NativeMinterTestOwnershipTransferredIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *ERC20NativeMinterTestOwnershipTransferredIterator) Error() error { +func (it *ERC20NativeMinterOwnershipTransferredIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *ERC20NativeMinterTestOwnershipTransferredIterator) Close() error { +func (it *ERC20NativeMinterOwnershipTransferredIterator) Close() error { it.sub.Unsubscribe() return nil } -// ERC20NativeMinterTestOwnershipTransferred represents a OwnershipTransferred event raised by the ERC20NativeMinterTest contract. -type ERC20NativeMinterTestOwnershipTransferred struct { +// ERC20NativeMinterOwnershipTransferred represents a OwnershipTransferred event raised by the ERC20NativeMinter contract. +type ERC20NativeMinterOwnershipTransferred struct { PreviousOwner common.Address NewOwner common.Address Raw types.Log // Blockchain specific contextual infos @@ -1306,7 +1306,7 @@ type ERC20NativeMinterTestOwnershipTransferred struct { // FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*ERC20NativeMinterTestOwnershipTransferredIterator, error) { +func (_ERC20NativeMinter *ERC20NativeMinterFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*ERC20NativeMinterOwnershipTransferredIterator, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { @@ -1317,17 +1317,17 @@ func (_ERC20NativeMinterTest *ERC20NativeMinterTestFilterer) FilterOwnershipTran newOwnerRule = append(newOwnerRule, newOwnerItem) } - logs, sub, err := _ERC20NativeMinterTest.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + logs, sub, err := _ERC20NativeMinter.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } - return &ERC20NativeMinterTestOwnershipTransferredIterator{contract: _ERC20NativeMinterTest.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil + return &ERC20NativeMinterOwnershipTransferredIterator{contract: _ERC20NativeMinter.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil } // WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *ERC20NativeMinterTestOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { +func (_ERC20NativeMinter *ERC20NativeMinterFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *ERC20NativeMinterOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { @@ -1338,7 +1338,7 @@ func (_ERC20NativeMinterTest *ERC20NativeMinterTestFilterer) WatchOwnershipTrans newOwnerRule = append(newOwnerRule, newOwnerItem) } - logs, sub, err := _ERC20NativeMinterTest.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + logs, sub, err := _ERC20NativeMinter.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } @@ -1348,8 +1348,8 @@ func (_ERC20NativeMinterTest *ERC20NativeMinterTestFilterer) WatchOwnershipTrans select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(ERC20NativeMinterTestOwnershipTransferred) - if err := _ERC20NativeMinterTest.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + event := new(ERC20NativeMinterOwnershipTransferred) + if err := _ERC20NativeMinter.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return err } event.Raw = log @@ -1373,18 +1373,18 @@ func (_ERC20NativeMinterTest *ERC20NativeMinterTestFilterer) WatchOwnershipTrans // ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestFilterer) ParseOwnershipTransferred(log types.Log) (*ERC20NativeMinterTestOwnershipTransferred, error) { - event := new(ERC20NativeMinterTestOwnershipTransferred) - if err := _ERC20NativeMinterTest.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { +func (_ERC20NativeMinter *ERC20NativeMinterFilterer) ParseOwnershipTransferred(log types.Log) (*ERC20NativeMinterOwnershipTransferred, error) { + event := new(ERC20NativeMinterOwnershipTransferred) + if err := _ERC20NativeMinter.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return nil, err } event.Raw = log return event, nil } -// ERC20NativeMinterTestTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the ERC20NativeMinterTest contract. -type ERC20NativeMinterTestTransferIterator struct { - Event *ERC20NativeMinterTestTransfer // Event containing the contract specifics and raw log +// ERC20NativeMinterTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the ERC20NativeMinter contract. +type ERC20NativeMinterTransferIterator struct { + Event *ERC20NativeMinterTransfer // 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 @@ -1398,7 +1398,7 @@ type ERC20NativeMinterTestTransferIterator struct { // 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 *ERC20NativeMinterTestTransferIterator) Next() bool { +func (it *ERC20NativeMinterTransferIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -1407,7 +1407,7 @@ func (it *ERC20NativeMinterTestTransferIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(ERC20NativeMinterTestTransfer) + it.Event = new(ERC20NativeMinterTransfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1422,7 +1422,7 @@ func (it *ERC20NativeMinterTestTransferIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(ERC20NativeMinterTestTransfer) + it.Event = new(ERC20NativeMinterTransfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1438,19 +1438,19 @@ func (it *ERC20NativeMinterTestTransferIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *ERC20NativeMinterTestTransferIterator) Error() error { +func (it *ERC20NativeMinterTransferIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *ERC20NativeMinterTestTransferIterator) Close() error { +func (it *ERC20NativeMinterTransferIterator) Close() error { it.sub.Unsubscribe() return nil } -// ERC20NativeMinterTestTransfer represents a Transfer event raised by the ERC20NativeMinterTest contract. -type ERC20NativeMinterTestTransfer struct { +// ERC20NativeMinterTransfer represents a Transfer event raised by the ERC20NativeMinter contract. +type ERC20NativeMinterTransfer struct { From common.Address To common.Address Value *big.Int @@ -1460,7 +1460,7 @@ type ERC20NativeMinterTestTransfer struct { // FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 value) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestFilterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*ERC20NativeMinterTestTransferIterator, error) { +func (_ERC20NativeMinter *ERC20NativeMinterFilterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*ERC20NativeMinterTransferIterator, error) { var fromRule []interface{} for _, fromItem := range from { @@ -1471,17 +1471,17 @@ func (_ERC20NativeMinterTest *ERC20NativeMinterTestFilterer) FilterTransfer(opts toRule = append(toRule, toItem) } - logs, sub, err := _ERC20NativeMinterTest.contract.FilterLogs(opts, "Transfer", fromRule, toRule) + logs, sub, err := _ERC20NativeMinter.contract.FilterLogs(opts, "Transfer", fromRule, toRule) if err != nil { return nil, err } - return &ERC20NativeMinterTestTransferIterator{contract: _ERC20NativeMinterTest.contract, event: "Transfer", logs: logs, sub: sub}, nil + return &ERC20NativeMinterTransferIterator{contract: _ERC20NativeMinter.contract, event: "Transfer", logs: logs, sub: sub}, nil } // WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 value) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *ERC20NativeMinterTestTransfer, from []common.Address, to []common.Address) (event.Subscription, error) { +func (_ERC20NativeMinter *ERC20NativeMinterFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *ERC20NativeMinterTransfer, from []common.Address, to []common.Address) (event.Subscription, error) { var fromRule []interface{} for _, fromItem := range from { @@ -1492,7 +1492,7 @@ func (_ERC20NativeMinterTest *ERC20NativeMinterTestFilterer) WatchTransfer(opts toRule = append(toRule, toItem) } - logs, sub, err := _ERC20NativeMinterTest.contract.WatchLogs(opts, "Transfer", fromRule, toRule) + logs, sub, err := _ERC20NativeMinter.contract.WatchLogs(opts, "Transfer", fromRule, toRule) if err != nil { return nil, err } @@ -1502,8 +1502,8 @@ func (_ERC20NativeMinterTest *ERC20NativeMinterTestFilterer) WatchTransfer(opts select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(ERC20NativeMinterTestTransfer) - if err := _ERC20NativeMinterTest.contract.UnpackLog(event, "Transfer", log); err != nil { + event := new(ERC20NativeMinterTransfer) + if err := _ERC20NativeMinter.contract.UnpackLog(event, "Transfer", log); err != nil { return err } event.Raw = log @@ -1527,9 +1527,9 @@ func (_ERC20NativeMinterTest *ERC20NativeMinterTestFilterer) WatchTransfer(opts // ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 value) -func (_ERC20NativeMinterTest *ERC20NativeMinterTestFilterer) ParseTransfer(log types.Log) (*ERC20NativeMinterTestTransfer, error) { - event := new(ERC20NativeMinterTestTransfer) - if err := _ERC20NativeMinterTest.contract.UnpackLog(event, "Transfer", log); err != nil { +func (_ERC20NativeMinter *ERC20NativeMinterFilterer) ParseTransfer(log types.Log) (*ERC20NativeMinterTransfer, error) { + event := new(ERC20NativeMinterTransfer) + if err := _ERC20NativeMinter.contract.UnpackLog(event, "Transfer", log); err != nil { return nil, err } event.Raw = log diff --git a/precompile/contracts/nativeminter/nativemintertest/gen_minter_binding.go b/precompile/contracts/nativeminter/nativemintertest/gen_minter_binding.go index 03e3d15752..f0227316cc 100644 --- a/precompile/contracts/nativeminter/nativemintertest/gen_minter_binding.go +++ b/precompile/contracts/nativeminter/nativemintertest/gen_minter_binding.go @@ -32,7 +32,7 @@ var ( // MinterMetaData contains all meta data concerning the Minter contract. var MinterMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mintdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", - Bin: "0x608060405234801561001057600080fd5b5060405161037c38038061037c833981810160405281019061003291906100db565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610108565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100a88261007d565b9050919050565b6100b88161009d565b81146100c357600080fd5b50565b6000815190506100d5816100af565b92915050565b6000602082840312156100f1576100f0610078565b5b60006100ff848285016100c6565b91505092915050565b610265806101176000396000f3fe60806040526004361061002d5760003560e01c80630356b6cd14610039578063b6b55f251461006257610034565b3661003457005b600080fd5b34801561004557600080fd5b50610060600480360381019061005b91906101d8565b61008b565b005b34801561006e57600080fd5b50610089600480360381019061008491906101d8565b610119565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630356b6cd826040518263ffffffff1660e01b81526004016100e49190610214565b600060405180830381600087803b1580156100fe57600080fd5b505af1158015610112573d6000803e3d6000fd5b5050505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b15801561018157600080fd5b505af1158015610195573d6000803e3d6000fd5b505050505050565b600080fd5b6000819050919050565b6101b5816101a2565b81146101c057600080fd5b50565b6000813590506101d2816101ac565b92915050565b6000602082840312156101ee576101ed61019d565b5b60006101fc848285016101c3565b91505092915050565b61020e816101a2565b82525050565b60006020820190506102296000830184610205565b9291505056fea2646970667358221220e60fd078eaa20604f975ca8e56ecfaf66d2878fd341d77a5c6ba9d1c817692c664736f6c634300081e0033", + Bin: "0x608060405234801561001057600080fd5b5060405161037c38038061037c833981810160405281019061003291906100db565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610108565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100a88261007d565b9050919050565b6100b88161009d565b81146100c357600080fd5b50565b6000815190506100d5816100af565b92915050565b6000602082840312156100f1576100f0610078565b5b60006100ff848285016100c6565b91505092915050565b610265806101176000396000f3fe60806040526004361061002d5760003560e01c80630356b6cd14610039578063b6b55f251461006257610034565b3661003457005b600080fd5b34801561004557600080fd5b50610060600480360381019061005b91906101d8565b61008b565b005b34801561006e57600080fd5b50610089600480360381019061008491906101d8565b610119565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630356b6cd826040518263ffffffff1660e01b81526004016100e49190610214565b600060405180830381600087803b1580156100fe57600080fd5b505af1158015610112573d6000803e3d6000fd5b5050505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b15801561018157600080fd5b505af1158015610195573d6000803e3d6000fd5b505050505050565b600080fd5b6000819050919050565b6101b5816101a2565b81146101c057600080fd5b50565b6000813590506101d2816101ac565b92915050565b6000602082840312156101ee576101ed61019d565b5b60006101fc848285016101c3565b91505092915050565b61020e816101a2565b82525050565b60006020820190506102296000830184610205565b9291505056fea2646970667358221220773276ad1f4e87dd87066bd36a6ac4dad0fe6dc63e870d90347c0b9ae62a4a5664736f6c634300081e0033", } // MinterABI is the input ABI used to generate the binding from. diff --git a/precompile/contracts/nativeminter/nativemintertest/simulated_test.go b/precompile/contracts/nativeminter/nativemintertest/simulated_test.go index e67a24239a..5974ef3013 100644 --- a/precompile/contracts/nativeminter/nativemintertest/simulated_test.go +++ b/precompile/contracts/nativeminter/nativemintertest/simulated_test.go @@ -62,9 +62,9 @@ func newBackendWithNativeMinter(t *testing.T) *sim.Backend { // Helper functions to reduce test boilerplate -func deployERC20NativeMinterTest(t *testing.T, b *sim.Backend, auth *bind.TransactOpts, initSupply *big.Int) (common.Address, *ERC20NativeMinterTest) { +func deployERC20NativeMinter(t *testing.T, b *sim.Backend, auth *bind.TransactOpts, initSupply *big.Int) (common.Address, *ERC20NativeMinter) { t.Helper() - addr, tx, contract, err := DeployERC20NativeMinterTest(auth, b.Client(), nativeminter.ContractAddress, initSupply) + addr, tx, contract, err := DeployERC20NativeMinter(auth, b.Client(), nativeminter.ContractAddress, initSupply) require.NoError(t, err) testutils.WaitReceiptSuccessful(t, b, tx) return addr, contract @@ -108,7 +108,7 @@ func TestNativeMinter(t *testing.T) { { name: "contract should not be able to mintdraw", test: func(t *testing.T, backend *sim.Backend, nativeMinter *INativeMinter) { - tokenAddr, token := deployERC20NativeMinterTest(t, backend, admin, initSupply) + tokenAddr, token := deployERC20NativeMinter(t, backend, admin, initSupply) verifyRole(t, nativeMinter, tokenAddr, allowlist.NoRole) @@ -120,7 +120,7 @@ func TestNativeMinter(t *testing.T) { { name: "should be added to minter list", test: func(t *testing.T, backend *sim.Backend, nativeMinter *INativeMinter) { - tokenAddr, _ := deployERC20NativeMinterTest(t, backend, admin, initSupply) + tokenAddr, _ := deployERC20NativeMinter(t, backend, admin, initSupply) verifyRole(t, nativeMinter, tokenAddr, allowlist.NoRole) @@ -132,7 +132,7 @@ func TestNativeMinter(t *testing.T) { { name: "admin should mintdraw", test: func(t *testing.T, backend *sim.Backend, nativeMinter *INativeMinter) { - tokenAddr, token := deployERC20NativeMinterTest(t, backend, admin, initSupply) + tokenAddr, token := deployERC20NativeMinter(t, backend, admin, initSupply) setAsEnabled(t, backend, nativeMinter, admin, tokenAddr) @@ -155,7 +155,7 @@ func TestNativeMinter(t *testing.T) { { name: "minter should not mintdraw without tokens", test: func(t *testing.T, backend *sim.Backend, nativeMinter *INativeMinter) { - tokenAddr, token := deployERC20NativeMinterTest(t, backend, admin, initSupply) + tokenAddr, token := deployERC20NativeMinter(t, backend, admin, initSupply) minterAddr, minter := deployMinter(t, backend, admin, tokenAddr) setAsEnabled(t, backend, nativeMinter, admin, tokenAddr) @@ -173,7 +173,7 @@ func TestNativeMinter(t *testing.T) { { name: "should deposit for minter", test: func(t *testing.T, backend *sim.Backend, nativeMinter *INativeMinter) { - tokenAddr, token := deployERC20NativeMinterTest(t, backend, admin, initSupply) + tokenAddr, token := deployERC20NativeMinter(t, backend, admin, initSupply) minterAddr, minter := deployMinter(t, backend, admin, tokenAddr) setAsEnabled(t, backend, nativeMinter, admin, tokenAddr) @@ -209,7 +209,7 @@ func TestNativeMinter(t *testing.T) { { name: "minter should mintdraw", test: func(t *testing.T, backend *sim.Backend, nativeMinter *INativeMinter) { - tokenAddr, token := deployERC20NativeMinterTest(t, backend, admin, initSupply) + tokenAddr, token := deployERC20NativeMinter(t, backend, admin, initSupply) minterAddr, minter := deployMinter(t, backend, admin, tokenAddr) setAsEnabled(t, backend, nativeMinter, admin, tokenAddr) diff --git a/precompile/contracts/nativeminter/nativemintertest/solidity/ERC20NativeMinterTest.sol b/precompile/contracts/nativeminter/nativemintertest/solidity/ERC20NativeMinter.sol similarity index 97% rename from precompile/contracts/nativeminter/nativemintertest/solidity/ERC20NativeMinterTest.sol rename to precompile/contracts/nativeminter/nativemintertest/solidity/ERC20NativeMinter.sol index 563e6bdb42..88ab657d58 100644 --- a/precompile/contracts/nativeminter/nativemintertest/solidity/ERC20NativeMinterTest.sol +++ b/precompile/contracts/nativeminter/nativemintertest/solidity/ERC20NativeMinter.sol @@ -9,7 +9,7 @@ import "./INativeMinter.sol"; // Designated Blackhole Address address constant BLACKHOLE_ADDRESS = 0x0100000000000000000000000000000000000000; -contract ERC20NativeMinterTest is ERC20, Ownable, AllowList { +contract ERC20NativeMinter is ERC20, Ownable, AllowList { string private constant TOKEN_NAME = "ERC20NativeMinterToken"; string private constant TOKEN_SYMBOL = "XMPL"; diff --git a/precompile/contracts/nativeminter/nativemintertest/solidity/Minter.sol b/precompile/contracts/nativeminter/nativemintertest/solidity/Minter.sol index 912380a383..ec9845401d 100644 --- a/precompile/contracts/nativeminter/nativemintertest/solidity/Minter.sol +++ b/precompile/contracts/nativeminter/nativemintertest/solidity/Minter.sol @@ -1,14 +1,14 @@ //SPDX-License-Identifier: MIT pragma solidity ^0.8.24; -import "./ERC20NativeMinterTest.sol"; +import "./ERC20NativeMinter.sol"; // Helper contract to test minting from another contract contract Minter { - ERC20NativeMinterTest token; + ERC20NativeMinter token; constructor(address tokenAddress) { - token = ERC20NativeMinterTest(tokenAddress); + token = ERC20NativeMinter(tokenAddress); } function mintdraw(uint amount) external { diff --git a/precompile/contracts/testutils/simulated_helpers.go b/precompile/contracts/testutils/simulated_helpers.go index a94c0dabdc..739a4b4134 100644 --- a/precompile/contracts/testutils/simulated_helpers.go +++ b/precompile/contracts/testutils/simulated_helpers.go @@ -12,6 +12,7 @@ import ( "github.com/stretchr/testify/require" "github.com/ava-labs/subnet-evm/accounts/abi/bind" + sim "github.com/ava-labs/subnet-evm/ethclient/simulated" ) From 3359ca9eed0b2bd691b36d6ac8845af0d8c086ca Mon Sep 17 00:00:00 2001 From: Jonathan Oppenheimer Date: Fri, 21 Nov 2025 16:20:21 -0500 Subject: [PATCH 05/23] remove from compile --- contracts/contracts/compile.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/contracts/compile.go b/contracts/contracts/compile.go index d2ccda7dbe..eab992c376 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 . @openzeppelin/contracts/=../node_modules/@openzeppelin/contracts/ AllowList.sol ERC20NativeMinter.sol ExampleFeeManager.sol ExampleRewardManager.sol ExampleTxAllowList.sol ExampleWarp.sol +//go:generate solc-v0.8.30 -o ../artifacts --overwrite --abi --bin --base-path . @openzeppelin/contracts/=../node_modules/@openzeppelin/contracts/ AllowList.sol ExampleFeeManager.sol ExampleRewardManager.sol ExampleTxAllowList.sol ExampleWarp.sol // Step 2: Generate Go bindings from the compiled artifacts //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/gen_allowlist.go From 6a0d4b89efa6e2716c46d3e74077e34b291446ac Mon Sep 17 00:00:00 2001 From: Jonathan Oppenheimer Date: Fri, 21 Nov 2025 16:27:36 -0500 Subject: [PATCH 06/23] add submodules --- .github/workflows/ci.yml | 4 ++ contracts/contracts/ERC20NativeMinter.sol | 59 +++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 contracts/contracts/ERC20NativeMinter.sol diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dedde8e1a5..6a1d5c7796 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,6 +16,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + submodules: recursive - uses: actions/setup-go@v5 with: go-version-file: "go.mod" @@ -45,6 +47,8 @@ jobs: os: [macos-latest, ubuntu-22.04, ubuntu-latest] steps: - uses: actions/checkout@v4 + with: + submodules: recursive - uses: actions/setup-go@v5 with: go-version-file: "go.mod" diff --git a/contracts/contracts/ERC20NativeMinter.sol b/contracts/contracts/ERC20NativeMinter.sol new file mode 100644 index 0000000000..34fb231fc9 --- /dev/null +++ b/contracts/contracts/ERC20NativeMinter.sol @@ -0,0 +1,59 @@ +//SPDX-License-Identifier: MIT +pragma solidity ^0.8.24; + +import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; +import "./AllowList.sol"; +import "./interfaces/INativeMinter.sol"; + +// Precompiled Native Minter Contract Address +address constant MINTER_ADDRESS = 0x0200000000000000000000000000000000000001; +// Designated Blackhole Address +address constant BLACKHOLE_ADDRESS = 0x0100000000000000000000000000000000000000; + +contract ERC20NativeMinter is ERC20, AllowList { + string private constant TOKEN_NAME = "ERC20NativeMinterToken"; + string private constant TOKEN_SYMBOL = "XMPL"; + + INativeMinter nativeMinter = INativeMinter(MINTER_ADDRESS); + + event Deposit(address indexed dst, uint256 wad); + event Mintdrawal(address indexed src, uint256 wad); + + constructor(uint256 initSupply) ERC20(TOKEN_NAME, TOKEN_SYMBOL) AllowList(MINTER_ADDRESS) { + // Mints INIT_SUPPLY to owner + _mint(_msgSender(), initSupply); + } + + // Mints [amount] number of ERC20 token to [to] address. + function mint(address to, uint256 amount) external onlyOwner { + _mint(to, amount); + } + + // Burns [amount] number of ERC20 token from [from] address. + function burn(address from, uint256 amount) external onlyOwner { + _burn(from, amount); + } + + // Swaps [amount] number of ERC20 token for native coin. + function mintdraw(uint256 wad) external { + // Burn ERC20 token first. + _burn(_msgSender(), wad); + // Mints [amount] number of native coins (gas coin) to [msg.sender] address. + // Calls NativeMinter precompile through INativeMinter interface. + nativeMinter.mintNativeCoin(_msgSender(), wad); + emit Mintdrawal(_msgSender(), wad); + } + + // Swaps [amount] number of native gas coins for ERC20 tokens. + function deposit() external payable { + // Burn native token by sending to BLACKHOLE_ADDRESS + payable(BLACKHOLE_ADDRESS).transfer(msg.value); + // Mint ERC20 token. + _mint(_msgSender(), msg.value); + emit Deposit(_msgSender(), msg.value); + } + + function decimals() public view virtual override returns (uint8) { + return 18; + } +} From f88e5b2c3c50edc3a82bf6e2818138bcd3644352 Mon Sep 17 00:00:00 2001 From: Jonathan Oppenheimer Date: Fri, 21 Nov 2025 16:27:57 -0500 Subject: [PATCH 07/23] remove old contract --- contracts/contracts/ERC20NativeMinter.sol | 59 ----------------------- 1 file changed, 59 deletions(-) delete mode 100644 contracts/contracts/ERC20NativeMinter.sol diff --git a/contracts/contracts/ERC20NativeMinter.sol b/contracts/contracts/ERC20NativeMinter.sol deleted file mode 100644 index 34fb231fc9..0000000000 --- a/contracts/contracts/ERC20NativeMinter.sol +++ /dev/null @@ -1,59 +0,0 @@ -//SPDX-License-Identifier: MIT -pragma solidity ^0.8.24; - -import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; -import "./AllowList.sol"; -import "./interfaces/INativeMinter.sol"; - -// Precompiled Native Minter Contract Address -address constant MINTER_ADDRESS = 0x0200000000000000000000000000000000000001; -// Designated Blackhole Address -address constant BLACKHOLE_ADDRESS = 0x0100000000000000000000000000000000000000; - -contract ERC20NativeMinter is ERC20, AllowList { - string private constant TOKEN_NAME = "ERC20NativeMinterToken"; - string private constant TOKEN_SYMBOL = "XMPL"; - - INativeMinter nativeMinter = INativeMinter(MINTER_ADDRESS); - - event Deposit(address indexed dst, uint256 wad); - event Mintdrawal(address indexed src, uint256 wad); - - constructor(uint256 initSupply) ERC20(TOKEN_NAME, TOKEN_SYMBOL) AllowList(MINTER_ADDRESS) { - // Mints INIT_SUPPLY to owner - _mint(_msgSender(), initSupply); - } - - // Mints [amount] number of ERC20 token to [to] address. - function mint(address to, uint256 amount) external onlyOwner { - _mint(to, amount); - } - - // Burns [amount] number of ERC20 token from [from] address. - function burn(address from, uint256 amount) external onlyOwner { - _burn(from, amount); - } - - // Swaps [amount] number of ERC20 token for native coin. - function mintdraw(uint256 wad) external { - // Burn ERC20 token first. - _burn(_msgSender(), wad); - // Mints [amount] number of native coins (gas coin) to [msg.sender] address. - // Calls NativeMinter precompile through INativeMinter interface. - nativeMinter.mintNativeCoin(_msgSender(), wad); - emit Mintdrawal(_msgSender(), wad); - } - - // Swaps [amount] number of native gas coins for ERC20 tokens. - function deposit() external payable { - // Burn native token by sending to BLACKHOLE_ADDRESS - payable(BLACKHOLE_ADDRESS).transfer(msg.value); - // Mint ERC20 token. - _mint(_msgSender(), msg.value); - emit Deposit(_msgSender(), msg.value); - } - - function decimals() public view virtual override returns (uint8) { - return 18; - } -} From 2db12819e3205018605979f5469faec8b10b9ec6 Mon Sep 17 00:00:00 2001 From: Jonathan Oppenheimer Date: Fri, 21 Nov 2025 16:35:05 -0500 Subject: [PATCH 08/23] shell-check modificaiton --- scripts/shellcheck.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/shellcheck.sh b/scripts/shellcheck.sh index f57b853362..e2a0420c04 100755 --- a/scripts/shellcheck.sh +++ b/scripts/shellcheck.sh @@ -5,11 +5,13 @@ set -euo pipefail VERSION="v0.9.0" # Scripts that are sourced from upstream and not maintained in this repo will not be shellchecked. -# Also ignore the local avalanchego clone. +# Also ignore the local avalanchego clone, git submodules, and node_modules. IGNORED_FILES=" cmd/evm/transition-test.sh metrics/validate.sh avalanchego/* + contracts/lib/* + contracts/node_modules/* " function get_version { From 561029d002fbe1557c2c00a15cf5c516175e969d Mon Sep 17 00:00:00 2001 From: Jonathan Oppenheimer Date: Mon, 24 Nov 2025 12:42:52 -0500 Subject: [PATCH 09/23] test: remove openzeppelin and erc20 tests --- .../deployerallowlisttest/simulated_test.go | 22 +- .../nativeminter/nativemintertest/compile.go | 7 +- .../gen_erc20nativeminter_binding.go | 1537 ----------------- .../nativemintertest/gen_minter_binding.go | 266 --- .../gen_nativemintertest_binding.go | 245 +++ .../nativemintertest/simulated_test.go | 154 +- .../solidity/ERC20NativeMinter.sol | 63 - .../nativemintertest/solidity/Minter.sol | 25 - .../solidity/NativeMinterTest.sol | 21 + 9 files changed, 323 insertions(+), 2017 deletions(-) delete mode 100644 precompile/contracts/nativeminter/nativemintertest/gen_erc20nativeminter_binding.go delete mode 100644 precompile/contracts/nativeminter/nativemintertest/gen_minter_binding.go create mode 100644 precompile/contracts/nativeminter/nativemintertest/gen_nativemintertest_binding.go delete mode 100644 precompile/contracts/nativeminter/nativemintertest/solidity/ERC20NativeMinter.sol delete mode 100644 precompile/contracts/nativeminter/nativemintertest/solidity/Minter.sol create mode 100644 precompile/contracts/nativeminter/nativemintertest/solidity/NativeMinterTest.sol diff --git a/precompile/contracts/deployerallowlist/deployerallowlisttest/simulated_test.go b/precompile/contracts/deployerallowlist/deployerallowlisttest/simulated_test.go index 9f772838d8..81c908cee0 100644 --- a/precompile/contracts/deployerallowlist/deployerallowlisttest/simulated_test.go +++ b/precompile/contracts/deployerallowlist/deployerallowlisttest/simulated_test.go @@ -63,7 +63,7 @@ func newBackendWithDeployerAllowList(t *testing.T) *sim.Backend { // Helper functions to reduce test boilerplate -func deployAllowListTestContract(t *testing.T, b *sim.Backend, auth *bind.TransactOpts) (common.Address, *allowlisttest.AllowListTest) { +func deployAllowListTest(t *testing.T, b *sim.Backend, auth *bind.TransactOpts) (common.Address, *allowlisttest.AllowListTest) { t.Helper() addr, tx, contract, err := allowlisttest.DeployAllowListTest(auth, b.Client(), deployerallowlist.ContractAddress) require.NoError(t, err) @@ -105,14 +105,14 @@ func TestDeployerAllowList(t *testing.T) { { name: "should verify new address has no role", test: func(t *testing.T, backend *sim.Backend, allowList *allowlisttest.IAllowList) { - allowListTestAddr, _ := deployAllowListTestContract(t, backend, admin) + allowListTestAddr, _ := deployAllowListTest(t, backend, admin) verifyRole(t, allowList, allowListTestAddr, allowlist.NoRole) }, }, { name: "should verify contract correctly reports admin status", test: func(t *testing.T, backend *sim.Backend, allowList *allowlisttest.IAllowList) { - allowListTestAddr, allowListTest := deployAllowListTestContract(t, backend, admin) + allowListTestAddr, allowListTest := deployAllowListTest(t, backend, admin) verifyRole(t, allowList, allowListTestAddr, allowlist.NoRole) @@ -130,7 +130,7 @@ func TestDeployerAllowList(t *testing.T) { test: func(t *testing.T, backend *sim.Backend, allowList *allowlisttest.IAllowList) { verifyRole(t, allowList, unprivilegedAddress, allowlist.NoRole) - _, allowListTest := deployAllowListTestContract(t, backend, admin) + _, allowListTest := deployAllowListTest(t, backend, admin) // Try to deploy via unprivileged user - should fail _, err := allowListTest.DeployContract(unprivileged) @@ -141,7 +141,7 @@ func TestDeployerAllowList(t *testing.T) { { name: "should allow admin to add contract as admin via precompile", test: func(t *testing.T, backend *sim.Backend, allowList *allowlisttest.IAllowList) { - allowListTestAddr, allowListTest := deployAllowListTestContract(t, backend, admin) + allowListTestAddr, allowListTest := deployAllowListTest(t, backend, admin) verifyRole(t, allowList, allowListTestAddr, allowlist.NoRole) setAsAdmin(t, backend, allowList, admin, allowListTestAddr) @@ -155,8 +155,8 @@ func TestDeployerAllowList(t *testing.T) { { name: "should allow admin to add deployer via contract", test: func(t *testing.T, backend *sim.Backend, allowList *allowlisttest.IAllowList) { - allowListTestAddr, allowListTest := deployAllowListTestContract(t, backend, admin) - otherContractAddr, _ := deployAllowListTestContract(t, backend, admin) + allowListTestAddr, allowListTest := deployAllowListTest(t, backend, admin) + otherContractAddr, _ := deployAllowListTest(t, backend, admin) verifyRole(t, allowList, allowListTestAddr, allowlist.NoRole) setAsAdmin(t, backend, allowList, admin, allowListTestAddr) @@ -175,8 +175,8 @@ func TestDeployerAllowList(t *testing.T) { { name: "should allow enabled address to deploy contracts", test: func(t *testing.T, backend *sim.Backend, allowList *allowlisttest.IAllowList) { - allowListTestAddr, allowListTest := deployAllowListTestContract(t, backend, admin) - deployerContractAddr, deployerContract := deployAllowListTestContract(t, backend, admin) + allowListTestAddr, allowListTest := deployAllowListTest(t, backend, admin) + deployerContractAddr, deployerContract := deployAllowListTest(t, backend, admin) setAsAdmin(t, backend, allowList, admin, allowListTestAddr) @@ -196,8 +196,8 @@ func TestDeployerAllowList(t *testing.T) { { name: "should allow admin to revoke deployer", test: func(t *testing.T, backend *sim.Backend, allowList *allowlisttest.IAllowList) { - allowListTestAddr, allowListTest := deployAllowListTestContract(t, backend, admin) - deployerContractAddr, _ := deployAllowListTestContract(t, backend, admin) + allowListTestAddr, allowListTest := deployAllowListTest(t, backend, admin) + deployerContractAddr, _ := deployAllowListTest(t, backend, admin) setAsAdmin(t, backend, allowList, admin, allowListTestAddr) diff --git a/precompile/contracts/nativeminter/nativemintertest/compile.go b/precompile/contracts/nativeminter/nativemintertest/compile.go index 0542383b2d..24be253786 100644 --- a/precompile/contracts/nativeminter/nativemintertest/compile.go +++ b/precompile/contracts/nativeminter/nativemintertest/compile.go @@ -4,10 +4,9 @@ package nativemintertest // 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/=contracts/lib/openzeppelin-contracts/contracts/ precompile/=precompile/ --evm-version paris solidity/ERC20NativeMinter.sol solidity/Minter.sol +//go:generate solc-v0.8.30 -o artifacts --overwrite --abi --bin --base-path ../../../.. precompile/=precompile/ --evm-version paris solidity/NativeMinterTest.sol // Step 2: Generate Go bindings from the compiled artifacts //go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg nativemintertest --type INativeMinter --abi artifacts/INativeMinter.abi --bin artifacts/INativeMinter.bin --out gen_inativeminter_binding.go -//go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg nativemintertest --type ERC20NativeMinter --abi artifacts/ERC20NativeMinter.abi --bin artifacts/ERC20NativeMinter.bin --out gen_erc20nativeminter_binding.go -//go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg nativemintertest --type Minter --abi artifacts/Minter.abi --bin artifacts/Minter.bin --out gen_minter_binding.go +//go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg nativemintertest --type NativeMinterTest --abi artifacts/NativeMinterTest.abi --bin artifacts/NativeMinterTest.bin --out gen_nativemintertest_binding.go // Step 3: Replace import paths in generated binding to use subnet-evm instead of libevm -//go:generate sh -c "sed -i.bak -e 's|github.com/ava-labs/libevm/accounts/abi|github.com/ava-labs/subnet-evm/accounts/abi|g' -e 's|github.com/ava-labs/libevm/accounts/abi/bind|github.com/ava-labs/subnet-evm/accounts/abi/bind|g' gen_inativeminter_binding.go gen_erc20nativeminter_binding.go gen_minter_binding.go && rm -f gen_inativeminter_binding.go.bak gen_erc20nativeminter_binding.go.bak gen_minter_binding.go.bak" +//go:generate sh -c "sed -i.bak -e 's|github.com/ava-labs/libevm/accounts/abi|github.com/ava-labs/subnet-evm/accounts/abi|g' -e 's|github.com/ava-labs/libevm/accounts/abi/bind|github.com/ava-labs/subnet-evm/accounts/abi/bind|g' gen_inativeminter_binding.go gen_nativemintertest_binding.go && rm -f gen_inativeminter_binding.go.bak gen_nativemintertest_binding.go.bak" diff --git a/precompile/contracts/nativeminter/nativemintertest/gen_erc20nativeminter_binding.go b/precompile/contracts/nativeminter/nativemintertest/gen_erc20nativeminter_binding.go deleted file mode 100644 index ab6c0ae796..0000000000 --- a/precompile/contracts/nativeminter/nativemintertest/gen_erc20nativeminter_binding.go +++ /dev/null @@ -1,1537 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package nativemintertest - -import ( - "errors" - "math/big" - "strings" - - ethereum "github.com/ava-labs/libevm" - "github.com/ava-labs/subnet-evm/accounts/abi" - "github.com/ava-labs/subnet-evm/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 -) - -// ERC20NativeMinterMetaData contains all meta data concerning the ERC20NativeMinter contract. -var ERC20NativeMinterMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nativeMinterPrecompile\",\"type\":\"address\"},{\"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: "0x608060405234801561001057600080fd5b50604051612898380380612898833981810160405281019061003291906105ea565b81336040518060400160405280601681526020017f45524332304e61746976654d696e746572546f6b656e000000000000000000008152506040518060400160405280600481526020017f584d504c0000000000000000000000000000000000000000000000000000000081525081600390816100af9190610870565b5080600490816100bf9190610870565b505050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036101345760006040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260040161012b9190610951565b60405180910390fd5b610143816101de60201b60201c565b5080600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505081600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506101d733826102a460201b60201c565b5050610a30565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036103165760006040517fec442f0500000000000000000000000000000000000000000000000000000000815260040161030d9190610951565b60405180910390fd5b6103286000838361032c60201b60201c565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361037e578060026000828254610372919061099b565b92505081905550610451565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561040a578381836040517fe450d38c000000000000000000000000000000000000000000000000000000008152600401610401939291906109de565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361049a57806002600082825403925050819055506104e7565b806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516105449190610a15565b60405180910390a3505050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061058182610556565b9050919050565b61059181610576565b811461059c57600080fd5b50565b6000815190506105ae81610588565b92915050565b6000819050919050565b6105c7816105b4565b81146105d257600080fd5b50565b6000815190506105e4816105be565b92915050565b6000806040838503121561060157610600610551565b5b600061060f8582860161059f565b9250506020610620858286016105d5565b9150509250929050565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806106ab57607f821691505b6020821081036106be576106bd610664565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026107267fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826106e9565b61073086836106e9565b95508019841693508086168417925050509392505050565b6000819050919050565b600061076d610768610763846105b4565b610748565b6105b4565b9050919050565b6000819050919050565b61078783610752565b61079b61079382610774565b8484546106f6565b825550505050565b600090565b6107b06107a3565b6107bb81848461077e565b505050565b5b818110156107df576107d46000826107a8565b6001810190506107c1565b5050565b601f821115610824576107f5816106c4565b6107fe846106d9565b8101602085101561080d578190505b610821610819856106d9565b8301826107c0565b50505b505050565b600082821c905092915050565b600061084760001984600802610829565b1980831691505092915050565b60006108608383610836565b9150826002028217905092915050565b6108798261062a565b67ffffffffffffffff81111561089257610891610635565b5b61089c8254610693565b6108a78282856107e3565b600060209050601f8311600181146108da57600084156108c8578287015190505b6108d28582610854565b86555061093a565b601f1984166108e8866106c4565b60005b82811015610910578489015182556001820191506020850194506020810190506108eb565b8683101561092d5784890151610929601f891682610836565b8355505b6001600288020188555050505b505050505050565b61094b81610576565b82525050565b60006020820190506109666000830184610942565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006109a6826105b4565b91506109b1836105b4565b92508282019050808211156109c9576109c861096c565b5b92915050565b6109d8816105b4565b82525050565b60006060820190506109f36000830186610942565b610a0060208301856109cf565b610a0d60408301846109cf565b949350505050565b6000602082019050610a2a60008301846109cf565b92915050565b611e5980610a3f6000396000f3fe6080604052600436106101405760003560e01c8063715018a6116100b6578063a9059cbb1161006f578063a9059cbb1461045a578063d0e30db014610497578063d0ebdbe7146104a1578063dd62ed3e146104ca578063f2fde38b14610507578063f3ae24151461053057610140565b8063715018a61461035e57806374a8f103146103755780638da5cb5b1461039e5780639015d371146103c957806395d89b41146104065780639dc29fac1461043157610140565b806323b872dd1161010857806323b872dd1461022a57806324d7806c14610267578063313ce567146102a457806340c10f19146102cf578063704b6c02146102f857806370a082311461032157610140565b80630356b6cd1461014557806306fdde031461016e578063095ea7b3146101995780630aaf7043146101d657806318160ddd146101ff575b600080fd5b34801561015157600080fd5b5061016c600480360381019061016791906118e8565b61056d565b005b34801561017a57600080fd5b50610183610657565b60405161019091906119a5565b60405180910390f35b3480156101a557600080fd5b506101c060048036038101906101bb9190611a25565b6106e9565b6040516101cd9190611a80565b60405180910390f35b3480156101e257600080fd5b506101fd60048036038101906101f89190611a9b565b61070c565b005b34801561020b57600080fd5b50610214610770565b6040516102219190611ad7565b60405180910390f35b34801561023657600080fd5b50610251600480360381019061024c9190611af2565b61077a565b60405161025e9190611a80565b60405180910390f35b34801561027357600080fd5b5061028e60048036038101906102899190611a9b565b6107a9565b60405161029b9190611a80565b60405180910390f35b3480156102b057600080fd5b506102b9610856565b6040516102c69190611b61565b60405180910390f35b3480156102db57600080fd5b506102f660048036038101906102f19190611a25565b61085f565b005b34801561030457600080fd5b5061031f600480360381019061031a9190611a9b565b610875565b005b34801561032d57600080fd5b5061034860048036038101906103439190611a9b565b6108d9565b6040516103559190611ad7565b60405180910390f35b34801561036a57600080fd5b50610373610921565b005b34801561038157600080fd5b5061039c60048036038101906103979190611a9b565b610935565b005b3480156103aa57600080fd5b506103b3610999565b6040516103c09190611b8b565b60405180910390f35b3480156103d557600080fd5b506103f060048036038101906103eb9190611a9b565b6109c3565b6040516103fd9190611a80565b60405180910390f35b34801561041257600080fd5b5061041b610a71565b60405161042891906119a5565b60405180910390f35b34801561043d57600080fd5b5061045860048036038101906104539190611a25565b610b03565b005b34801561046657600080fd5b50610481600480360381019061047c9190611a25565b610b19565b60405161048e9190611a80565b60405180910390f35b61049f610b3c565b005b3480156104ad57600080fd5b506104c860048036038101906104c39190611a9b565b610bf1565b005b3480156104d657600080fd5b506104f160048036038101906104ec9190611ba6565b610c55565b6040516104fe9190611ad7565b60405180910390f35b34801561051357600080fd5b5061052e60048036038101906105299190611a9b565b610cdc565b005b34801561053c57600080fd5b5061055760048036038101906105529190611a9b565b610d62565b6040516105649190611a80565b60405180910390f35b6105773382610e0f565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634f5aaaba33836040518363ffffffff1660e01b81526004016105d4929190611be6565b600060405180830381600087803b1580156105ee57600080fd5b505af1158015610602573d6000803e3d6000fd5b505050503373ffffffffffffffffffffffffffffffffffffffff167f25bedde6c8ebd3a89b719a16299dbfe271c7bffa42fe1ac1a52e15ab0cb767e68260405161064c9190611ad7565b60405180910390a250565b60606003805461066690611c3e565b80601f016020809104026020016040519081016040528092919081815260200182805461069290611c3e565b80156106df5780601f106106b4576101008083540402835291602001916106df565b820191906000526020600020905b8154815290600101906020018083116106c257829003601f168201915b5050505050905090565b6000806106f4610e91565b9050610701818585610e99565b600191505092915050565b610715336107a9565b80610725575061072433610d62565b5b610764576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161075b90611cbb565b60405180910390fd5b61076d81610eab565b50565b6000600254905090565b600080610785610e91565b9050610792858285610f3b565b61079d858585610fd0565b60019150509392505050565b600080600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b81526004016108079190611b8b565b602060405180830381865afa158015610824573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108489190611cf0565b905060028114915050919050565b60006012905090565b6108676110c4565b610871828261114b565b5050565b61087e336107a9565b8061088e575061088d33610d62565b5b6108cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108c490611cbb565b60405180910390fd5b6108d6816111cd565b50565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6109296110c4565b610933600061125d565b565b61093e336107a9565b8061094e575061094d33610d62565b5b61098d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161098490611cbb565b60405180910390fd5b61099681611323565b50565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b8152600401610a219190611b8b565b602060405180830381865afa158015610a3e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a629190611cf0565b90506000811415915050919050565b606060048054610a8090611c3e565b80601f0160208091040260200160405190810160405280929190818152602001828054610aac90611c3e565b8015610af95780601f10610ace57610100808354040283529160200191610af9565b820191906000526020600020905b815481529060010190602001808311610adc57829003601f168201915b5050505050905090565b610b0b6110c4565b610b158282610e0f565b5050565b600080610b24610e91565b9050610b31818585610fd0565b600191505092915050565b73010000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015610b96573d6000803e3d6000fd5b50610ba1333461114b565b3373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c34604051610be79190611ad7565b60405180910390a2565b610bfa336107a9565b80610c0a5750610c0933610d62565b5b610c49576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c4090611cbb565b60405180910390fd5b610c5281611421565b50565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610ce46110c4565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610d565760006040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401610d4d9190611b8b565b60405180910390fd5b610d5f8161125d565b50565b600080600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b8152600401610dc09190611b8b565b602060405180830381865afa158015610ddd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e019190611cf0565b905060038114915050919050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610e815760006040517f96c6fd1e000000000000000000000000000000000000000000000000000000008152600401610e789190611b8b565b60405180910390fd5b610e8d826000836114b1565b5050565b600033905090565b610ea683838360016116d6565b505050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630aaf7043826040518263ffffffff1660e01b8152600401610f069190611b8b565b600060405180830381600087803b158015610f2057600080fd5b505af1158015610f34573d6000803e3d6000fd5b5050505050565b6000610f478484610c55565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811015610fca5781811015610fba578281836040517ffb8f41b2000000000000000000000000000000000000000000000000000000008152600401610fb193929190611d1d565b60405180910390fd5b610fc9848484840360006116d6565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036110425760006040517f96c6fd1e0000000000000000000000000000000000000000000000000000000081526004016110399190611b8b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036110b45760006040517fec442f050000000000000000000000000000000000000000000000000000000081526004016110ab9190611b8b565b60405180910390fd5b6110bf8383836114b1565b505050565b6110cc610e91565b73ffffffffffffffffffffffffffffffffffffffff166110ea610999565b73ffffffffffffffffffffffffffffffffffffffff16146111495761110d610e91565b6040517f118cdaa70000000000000000000000000000000000000000000000000000000081526004016111409190611b8b565b60405180910390fd5b565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036111bd5760006040517fec442f050000000000000000000000000000000000000000000000000000000081526004016111b49190611b8b565b60405180910390fd5b6111c9600083836114b1565b5050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663704b6c02826040518263ffffffff1660e01b81526004016112289190611b8b565b600060405180830381600087803b15801561124257600080fd5b505af1158015611256573d6000803e3d6000fd5b5050505050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b8073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1603611391576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138890611da0565b60405180910390fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638c6bfb3b826040518263ffffffff1660e01b81526004016113ec9190611b8b565b600060405180830381600087803b15801561140657600080fd5b505af115801561141a573d6000803e3d6000fd5b5050505050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0ebdbe7826040518263ffffffff1660e01b815260040161147c9190611b8b565b600060405180830381600087803b15801561149657600080fd5b505af11580156114aa573d6000803e3d6000fd5b5050505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036115035780600260008282546114f79190611def565b925050819055506115d6565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561158f578381836040517fe450d38c00000000000000000000000000000000000000000000000000000000815260040161158693929190611d1d565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361161f578060026000828254039250508190555061166c565b806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516116c99190611ad7565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16036117485760006040517fe602df0500000000000000000000000000000000000000000000000000000000815260040161173f9190611b8b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036117ba5760006040517f94280d620000000000000000000000000000000000000000000000000000000081526004016117b19190611b8b565b60405180910390fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080156118a7578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405161189e9190611ad7565b60405180910390a35b50505050565b600080fd5b6000819050919050565b6118c5816118b2565b81146118d057600080fd5b50565b6000813590506118e2816118bc565b92915050565b6000602082840312156118fe576118fd6118ad565b5b600061190c848285016118d3565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561194f578082015181840152602081019050611934565b60008484015250505050565b6000601f19601f8301169050919050565b600061197782611915565b6119818185611920565b9350611991818560208601611931565b61199a8161195b565b840191505092915050565b600060208201905081810360008301526119bf818461196c565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006119f2826119c7565b9050919050565b611a02816119e7565b8114611a0d57600080fd5b50565b600081359050611a1f816119f9565b92915050565b60008060408385031215611a3c57611a3b6118ad565b5b6000611a4a85828601611a10565b9250506020611a5b858286016118d3565b9150509250929050565b60008115159050919050565b611a7a81611a65565b82525050565b6000602082019050611a956000830184611a71565b92915050565b600060208284031215611ab157611ab06118ad565b5b6000611abf84828501611a10565b91505092915050565b611ad1816118b2565b82525050565b6000602082019050611aec6000830184611ac8565b92915050565b600080600060608486031215611b0b57611b0a6118ad565b5b6000611b1986828701611a10565b9350506020611b2a86828701611a10565b9250506040611b3b868287016118d3565b9150509250925092565b600060ff82169050919050565b611b5b81611b45565b82525050565b6000602082019050611b766000830184611b52565b92915050565b611b85816119e7565b82525050565b6000602082019050611ba06000830184611b7c565b92915050565b60008060408385031215611bbd57611bbc6118ad565b5b6000611bcb85828601611a10565b9250506020611bdc85828601611a10565b9150509250929050565b6000604082019050611bfb6000830185611b7c565b611c086020830184611ac8565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680611c5657607f821691505b602082108103611c6957611c68611c0f565b5b50919050565b7f63616e6e6f74206d6f6469667920616c6c6f77206c6973740000000000000000600082015250565b6000611ca5601883611920565b9150611cb082611c6f565b602082019050919050565b60006020820190508181036000830152611cd481611c98565b9050919050565b600081519050611cea816118bc565b92915050565b600060208284031215611d0657611d056118ad565b5b6000611d1484828501611cdb565b91505092915050565b6000606082019050611d326000830186611b7c565b611d3f6020830185611ac8565b611d4c6040830184611ac8565b949350505050565b7f63616e6e6f74207265766f6b65206f776e20726f6c6500000000000000000000600082015250565b6000611d8a601683611920565b9150611d9582611d54565b602082019050919050565b60006020820190508181036000830152611db981611d7d565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611dfa826118b2565b9150611e05836118b2565b9250828201905080821115611e1d57611e1c611dc0565b5b9291505056fea2646970667358221220cb094dd1471d39812ad1f5f9b68491f879c9d6a8e916a805b85cb7e3b7f2a6d564736f6c634300081e0033", -} - -// ERC20NativeMinterABI is the input ABI used to generate the binding from. -// Deprecated: Use ERC20NativeMinterMetaData.ABI instead. -var ERC20NativeMinterABI = ERC20NativeMinterMetaData.ABI - -// ERC20NativeMinterBin is the compiled bytecode used for deploying new contracts. -// Deprecated: Use ERC20NativeMinterMetaData.Bin instead. -var ERC20NativeMinterBin = ERC20NativeMinterMetaData.Bin - -// DeployERC20NativeMinter deploys a new Ethereum contract, binding an instance of ERC20NativeMinter to it. -func DeployERC20NativeMinter(auth *bind.TransactOpts, backend bind.ContractBackend, nativeMinterPrecompile common.Address, initSupply *big.Int) (common.Address, *types.Transaction, *ERC20NativeMinter, error) { - parsed, err := ERC20NativeMinterMetaData.GetAbi() - if err != nil { - return common.Address{}, nil, nil, err - } - if parsed == nil { - return common.Address{}, nil, nil, errors.New("GetABI returned nil") - } - - address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(ERC20NativeMinterBin), backend, nativeMinterPrecompile, initSupply) - if err != nil { - return common.Address{}, nil, nil, err - } - return address, tx, &ERC20NativeMinter{ERC20NativeMinterCaller: ERC20NativeMinterCaller{contract: contract}, ERC20NativeMinterTransactor: ERC20NativeMinterTransactor{contract: contract}, ERC20NativeMinterFilterer: ERC20NativeMinterFilterer{contract: contract}}, nil -} - -// ERC20NativeMinter is an auto generated Go binding around an Ethereum contract. -type ERC20NativeMinter struct { - ERC20NativeMinterCaller // Read-only binding to the contract - ERC20NativeMinterTransactor // Write-only binding to the contract - ERC20NativeMinterFilterer // Log filterer for contract events -} - -// ERC20NativeMinterCaller is an auto generated read-only Go binding around an Ethereum contract. -type ERC20NativeMinterCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// ERC20NativeMinterTransactor is an auto generated write-only Go binding around an Ethereum contract. -type ERC20NativeMinterTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// ERC20NativeMinterFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type ERC20NativeMinterFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// ERC20NativeMinterSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type ERC20NativeMinterSession struct { - Contract *ERC20NativeMinter // 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 -} - -// ERC20NativeMinterCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type ERC20NativeMinterCallerSession struct { - Contract *ERC20NativeMinterCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// ERC20NativeMinterTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type ERC20NativeMinterTransactorSession struct { - Contract *ERC20NativeMinterTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// ERC20NativeMinterRaw is an auto generated low-level Go binding around an Ethereum contract. -type ERC20NativeMinterRaw struct { - Contract *ERC20NativeMinter // Generic contract binding to access the raw methods on -} - -// ERC20NativeMinterCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type ERC20NativeMinterCallerRaw struct { - Contract *ERC20NativeMinterCaller // Generic read-only contract binding to access the raw methods on -} - -// ERC20NativeMinterTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type ERC20NativeMinterTransactorRaw struct { - Contract *ERC20NativeMinterTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewERC20NativeMinter creates a new instance of ERC20NativeMinter, bound to a specific deployed contract. -func NewERC20NativeMinter(address common.Address, backend bind.ContractBackend) (*ERC20NativeMinter, error) { - contract, err := bindERC20NativeMinter(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &ERC20NativeMinter{ERC20NativeMinterCaller: ERC20NativeMinterCaller{contract: contract}, ERC20NativeMinterTransactor: ERC20NativeMinterTransactor{contract: contract}, ERC20NativeMinterFilterer: ERC20NativeMinterFilterer{contract: contract}}, nil -} - -// NewERC20NativeMinterCaller creates a new read-only instance of ERC20NativeMinter, bound to a specific deployed contract. -func NewERC20NativeMinterCaller(address common.Address, caller bind.ContractCaller) (*ERC20NativeMinterCaller, error) { - contract, err := bindERC20NativeMinter(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &ERC20NativeMinterCaller{contract: contract}, nil -} - -// NewERC20NativeMinterTransactor creates a new write-only instance of ERC20NativeMinter, bound to a specific deployed contract. -func NewERC20NativeMinterTransactor(address common.Address, transactor bind.ContractTransactor) (*ERC20NativeMinterTransactor, error) { - contract, err := bindERC20NativeMinter(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &ERC20NativeMinterTransactor{contract: contract}, nil -} - -// NewERC20NativeMinterFilterer creates a new log filterer instance of ERC20NativeMinter, bound to a specific deployed contract. -func NewERC20NativeMinterFilterer(address common.Address, filterer bind.ContractFilterer) (*ERC20NativeMinterFilterer, error) { - contract, err := bindERC20NativeMinter(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &ERC20NativeMinterFilterer{contract: contract}, nil -} - -// bindERC20NativeMinter binds a generic wrapper to an already deployed contract. -func bindERC20NativeMinter(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := ERC20NativeMinterMetaData.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 (_ERC20NativeMinter *ERC20NativeMinterRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _ERC20NativeMinter.Contract.ERC20NativeMinterCaller.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 (_ERC20NativeMinter *ERC20NativeMinterRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.ERC20NativeMinterTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_ERC20NativeMinter *ERC20NativeMinterRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.ERC20NativeMinterTransactor.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 (_ERC20NativeMinter *ERC20NativeMinterCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _ERC20NativeMinter.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 (_ERC20NativeMinter *ERC20NativeMinterTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_ERC20NativeMinter *ERC20NativeMinterTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.contract.Transact(opts, method, params...) -} - -// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. -// -// Solidity: function allowance(address owner, address spender) view returns(uint256) -func (_ERC20NativeMinter *ERC20NativeMinterCaller) Allowance(opts *bind.CallOpts, owner common.Address, spender common.Address) (*big.Int, error) { - var out []interface{} - err := _ERC20NativeMinter.contract.Call(opts, &out, "allowance", owner, spender) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. -// -// Solidity: function allowance(address owner, address spender) view returns(uint256) -func (_ERC20NativeMinter *ERC20NativeMinterSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { - return _ERC20NativeMinter.Contract.Allowance(&_ERC20NativeMinter.CallOpts, owner, spender) -} - -// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. -// -// Solidity: function allowance(address owner, address spender) view returns(uint256) -func (_ERC20NativeMinter *ERC20NativeMinterCallerSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { - return _ERC20NativeMinter.Contract.Allowance(&_ERC20NativeMinter.CallOpts, owner, spender) -} - -// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. -// -// Solidity: function balanceOf(address account) view returns(uint256) -func (_ERC20NativeMinter *ERC20NativeMinterCaller) BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) { - var out []interface{} - err := _ERC20NativeMinter.contract.Call(opts, &out, "balanceOf", account) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. -// -// Solidity: function balanceOf(address account) view returns(uint256) -func (_ERC20NativeMinter *ERC20NativeMinterSession) BalanceOf(account common.Address) (*big.Int, error) { - return _ERC20NativeMinter.Contract.BalanceOf(&_ERC20NativeMinter.CallOpts, account) -} - -// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. -// -// Solidity: function balanceOf(address account) view returns(uint256) -func (_ERC20NativeMinter *ERC20NativeMinterCallerSession) BalanceOf(account common.Address) (*big.Int, error) { - return _ERC20NativeMinter.Contract.BalanceOf(&_ERC20NativeMinter.CallOpts, account) -} - -// Decimals is a free data retrieval call binding the contract method 0x313ce567. -// -// Solidity: function decimals() view returns(uint8) -func (_ERC20NativeMinter *ERC20NativeMinterCaller) Decimals(opts *bind.CallOpts) (uint8, error) { - var out []interface{} - err := _ERC20NativeMinter.contract.Call(opts, &out, "decimals") - - if err != nil { - return *new(uint8), err - } - - out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) - - return out0, err - -} - -// Decimals is a free data retrieval call binding the contract method 0x313ce567. -// -// Solidity: function decimals() view returns(uint8) -func (_ERC20NativeMinter *ERC20NativeMinterSession) Decimals() (uint8, error) { - return _ERC20NativeMinter.Contract.Decimals(&_ERC20NativeMinter.CallOpts) -} - -// Decimals is a free data retrieval call binding the contract method 0x313ce567. -// -// Solidity: function decimals() view returns(uint8) -func (_ERC20NativeMinter *ERC20NativeMinterCallerSession) Decimals() (uint8, error) { - return _ERC20NativeMinter.Contract.Decimals(&_ERC20NativeMinter.CallOpts) -} - -// IsAdmin is a free data retrieval call binding the contract method 0x24d7806c. -// -// Solidity: function isAdmin(address addr) view returns(bool) -func (_ERC20NativeMinter *ERC20NativeMinterCaller) IsAdmin(opts *bind.CallOpts, addr common.Address) (bool, error) { - var out []interface{} - err := _ERC20NativeMinter.contract.Call(opts, &out, "isAdmin", addr) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// IsAdmin is a free data retrieval call binding the contract method 0x24d7806c. -// -// Solidity: function isAdmin(address addr) view returns(bool) -func (_ERC20NativeMinter *ERC20NativeMinterSession) IsAdmin(addr common.Address) (bool, error) { - return _ERC20NativeMinter.Contract.IsAdmin(&_ERC20NativeMinter.CallOpts, addr) -} - -// IsAdmin is a free data retrieval call binding the contract method 0x24d7806c. -// -// Solidity: function isAdmin(address addr) view returns(bool) -func (_ERC20NativeMinter *ERC20NativeMinterCallerSession) IsAdmin(addr common.Address) (bool, error) { - return _ERC20NativeMinter.Contract.IsAdmin(&_ERC20NativeMinter.CallOpts, addr) -} - -// IsEnabled is a free data retrieval call binding the contract method 0x9015d371. -// -// Solidity: function isEnabled(address addr) view returns(bool) -func (_ERC20NativeMinter *ERC20NativeMinterCaller) IsEnabled(opts *bind.CallOpts, addr common.Address) (bool, error) { - var out []interface{} - err := _ERC20NativeMinter.contract.Call(opts, &out, "isEnabled", addr) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// IsEnabled is a free data retrieval call binding the contract method 0x9015d371. -// -// Solidity: function isEnabled(address addr) view returns(bool) -func (_ERC20NativeMinter *ERC20NativeMinterSession) IsEnabled(addr common.Address) (bool, error) { - return _ERC20NativeMinter.Contract.IsEnabled(&_ERC20NativeMinter.CallOpts, addr) -} - -// IsEnabled is a free data retrieval call binding the contract method 0x9015d371. -// -// Solidity: function isEnabled(address addr) view returns(bool) -func (_ERC20NativeMinter *ERC20NativeMinterCallerSession) IsEnabled(addr common.Address) (bool, error) { - return _ERC20NativeMinter.Contract.IsEnabled(&_ERC20NativeMinter.CallOpts, addr) -} - -// IsManager is a free data retrieval call binding the contract method 0xf3ae2415. -// -// Solidity: function isManager(address addr) view returns(bool) -func (_ERC20NativeMinter *ERC20NativeMinterCaller) IsManager(opts *bind.CallOpts, addr common.Address) (bool, error) { - var out []interface{} - err := _ERC20NativeMinter.contract.Call(opts, &out, "isManager", addr) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// IsManager is a free data retrieval call binding the contract method 0xf3ae2415. -// -// Solidity: function isManager(address addr) view returns(bool) -func (_ERC20NativeMinter *ERC20NativeMinterSession) IsManager(addr common.Address) (bool, error) { - return _ERC20NativeMinter.Contract.IsManager(&_ERC20NativeMinter.CallOpts, addr) -} - -// IsManager is a free data retrieval call binding the contract method 0xf3ae2415. -// -// Solidity: function isManager(address addr) view returns(bool) -func (_ERC20NativeMinter *ERC20NativeMinterCallerSession) IsManager(addr common.Address) (bool, error) { - return _ERC20NativeMinter.Contract.IsManager(&_ERC20NativeMinter.CallOpts, addr) -} - -// Name is a free data retrieval call binding the contract method 0x06fdde03. -// -// Solidity: function name() view returns(string) -func (_ERC20NativeMinter *ERC20NativeMinterCaller) Name(opts *bind.CallOpts) (string, error) { - var out []interface{} - err := _ERC20NativeMinter.contract.Call(opts, &out, "name") - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -// Name is a free data retrieval call binding the contract method 0x06fdde03. -// -// Solidity: function name() view returns(string) -func (_ERC20NativeMinter *ERC20NativeMinterSession) Name() (string, error) { - return _ERC20NativeMinter.Contract.Name(&_ERC20NativeMinter.CallOpts) -} - -// Name is a free data retrieval call binding the contract method 0x06fdde03. -// -// Solidity: function name() view returns(string) -func (_ERC20NativeMinter *ERC20NativeMinterCallerSession) Name() (string, error) { - return _ERC20NativeMinter.Contract.Name(&_ERC20NativeMinter.CallOpts) -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_ERC20NativeMinter *ERC20NativeMinterCaller) Owner(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _ERC20NativeMinter.contract.Call(opts, &out, "owner") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_ERC20NativeMinter *ERC20NativeMinterSession) Owner() (common.Address, error) { - return _ERC20NativeMinter.Contract.Owner(&_ERC20NativeMinter.CallOpts) -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_ERC20NativeMinter *ERC20NativeMinterCallerSession) Owner() (common.Address, error) { - return _ERC20NativeMinter.Contract.Owner(&_ERC20NativeMinter.CallOpts) -} - -// Symbol is a free data retrieval call binding the contract method 0x95d89b41. -// -// Solidity: function symbol() view returns(string) -func (_ERC20NativeMinter *ERC20NativeMinterCaller) Symbol(opts *bind.CallOpts) (string, error) { - var out []interface{} - err := _ERC20NativeMinter.contract.Call(opts, &out, "symbol") - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -// Symbol is a free data retrieval call binding the contract method 0x95d89b41. -// -// Solidity: function symbol() view returns(string) -func (_ERC20NativeMinter *ERC20NativeMinterSession) Symbol() (string, error) { - return _ERC20NativeMinter.Contract.Symbol(&_ERC20NativeMinter.CallOpts) -} - -// Symbol is a free data retrieval call binding the contract method 0x95d89b41. -// -// Solidity: function symbol() view returns(string) -func (_ERC20NativeMinter *ERC20NativeMinterCallerSession) Symbol() (string, error) { - return _ERC20NativeMinter.Contract.Symbol(&_ERC20NativeMinter.CallOpts) -} - -// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. -// -// Solidity: function totalSupply() view returns(uint256) -func (_ERC20NativeMinter *ERC20NativeMinterCaller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _ERC20NativeMinter.contract.Call(opts, &out, "totalSupply") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. -// -// Solidity: function totalSupply() view returns(uint256) -func (_ERC20NativeMinter *ERC20NativeMinterSession) TotalSupply() (*big.Int, error) { - return _ERC20NativeMinter.Contract.TotalSupply(&_ERC20NativeMinter.CallOpts) -} - -// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. -// -// Solidity: function totalSupply() view returns(uint256) -func (_ERC20NativeMinter *ERC20NativeMinterCallerSession) TotalSupply() (*big.Int, error) { - return _ERC20NativeMinter.Contract.TotalSupply(&_ERC20NativeMinter.CallOpts) -} - -// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. -// -// Solidity: function approve(address spender, uint256 value) returns(bool) -func (_ERC20NativeMinter *ERC20NativeMinterTransactor) Approve(opts *bind.TransactOpts, spender common.Address, value *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinter.contract.Transact(opts, "approve", spender, value) -} - -// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. -// -// Solidity: function approve(address spender, uint256 value) returns(bool) -func (_ERC20NativeMinter *ERC20NativeMinterSession) Approve(spender common.Address, value *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.Approve(&_ERC20NativeMinter.TransactOpts, spender, value) -} - -// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. -// -// Solidity: function approve(address spender, uint256 value) returns(bool) -func (_ERC20NativeMinter *ERC20NativeMinterTransactorSession) Approve(spender common.Address, value *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.Approve(&_ERC20NativeMinter.TransactOpts, spender, value) -} - -// Burn is a paid mutator transaction binding the contract method 0x9dc29fac. -// -// Solidity: function burn(address from, uint256 amount) returns() -func (_ERC20NativeMinter *ERC20NativeMinterTransactor) Burn(opts *bind.TransactOpts, from common.Address, amount *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinter.contract.Transact(opts, "burn", from, amount) -} - -// Burn is a paid mutator transaction binding the contract method 0x9dc29fac. -// -// Solidity: function burn(address from, uint256 amount) returns() -func (_ERC20NativeMinter *ERC20NativeMinterSession) Burn(from common.Address, amount *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.Burn(&_ERC20NativeMinter.TransactOpts, from, amount) -} - -// Burn is a paid mutator transaction binding the contract method 0x9dc29fac. -// -// Solidity: function burn(address from, uint256 amount) returns() -func (_ERC20NativeMinter *ERC20NativeMinterTransactorSession) Burn(from common.Address, amount *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.Burn(&_ERC20NativeMinter.TransactOpts, from, amount) -} - -// Deposit is a paid mutator transaction binding the contract method 0xd0e30db0. -// -// Solidity: function deposit() payable returns() -func (_ERC20NativeMinter *ERC20NativeMinterTransactor) Deposit(opts *bind.TransactOpts) (*types.Transaction, error) { - return _ERC20NativeMinter.contract.Transact(opts, "deposit") -} - -// Deposit is a paid mutator transaction binding the contract method 0xd0e30db0. -// -// Solidity: function deposit() payable returns() -func (_ERC20NativeMinter *ERC20NativeMinterSession) Deposit() (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.Deposit(&_ERC20NativeMinter.TransactOpts) -} - -// Deposit is a paid mutator transaction binding the contract method 0xd0e30db0. -// -// Solidity: function deposit() payable returns() -func (_ERC20NativeMinter *ERC20NativeMinterTransactorSession) Deposit() (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.Deposit(&_ERC20NativeMinter.TransactOpts) -} - -// Mint is a paid mutator transaction binding the contract method 0x40c10f19. -// -// Solidity: function mint(address to, uint256 amount) returns() -func (_ERC20NativeMinter *ERC20NativeMinterTransactor) Mint(opts *bind.TransactOpts, to common.Address, amount *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinter.contract.Transact(opts, "mint", to, amount) -} - -// Mint is a paid mutator transaction binding the contract method 0x40c10f19. -// -// Solidity: function mint(address to, uint256 amount) returns() -func (_ERC20NativeMinter *ERC20NativeMinterSession) Mint(to common.Address, amount *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.Mint(&_ERC20NativeMinter.TransactOpts, to, amount) -} - -// Mint is a paid mutator transaction binding the contract method 0x40c10f19. -// -// Solidity: function mint(address to, uint256 amount) returns() -func (_ERC20NativeMinter *ERC20NativeMinterTransactorSession) Mint(to common.Address, amount *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.Mint(&_ERC20NativeMinter.TransactOpts, to, amount) -} - -// Mintdraw is a paid mutator transaction binding the contract method 0x0356b6cd. -// -// Solidity: function mintdraw(uint256 wad) returns() -func (_ERC20NativeMinter *ERC20NativeMinterTransactor) Mintdraw(opts *bind.TransactOpts, wad *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinter.contract.Transact(opts, "mintdraw", wad) -} - -// Mintdraw is a paid mutator transaction binding the contract method 0x0356b6cd. -// -// Solidity: function mintdraw(uint256 wad) returns() -func (_ERC20NativeMinter *ERC20NativeMinterSession) Mintdraw(wad *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.Mintdraw(&_ERC20NativeMinter.TransactOpts, wad) -} - -// Mintdraw is a paid mutator transaction binding the contract method 0x0356b6cd. -// -// Solidity: function mintdraw(uint256 wad) returns() -func (_ERC20NativeMinter *ERC20NativeMinterTransactorSession) Mintdraw(wad *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.Mintdraw(&_ERC20NativeMinter.TransactOpts, wad) -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_ERC20NativeMinter *ERC20NativeMinterTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { - return _ERC20NativeMinter.contract.Transact(opts, "renounceOwnership") -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_ERC20NativeMinter *ERC20NativeMinterSession) RenounceOwnership() (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.RenounceOwnership(&_ERC20NativeMinter.TransactOpts) -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_ERC20NativeMinter *ERC20NativeMinterTransactorSession) RenounceOwnership() (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.RenounceOwnership(&_ERC20NativeMinter.TransactOpts) -} - -// Revoke is a paid mutator transaction binding the contract method 0x74a8f103. -// -// Solidity: function revoke(address addr) returns() -func (_ERC20NativeMinter *ERC20NativeMinterTransactor) Revoke(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { - return _ERC20NativeMinter.contract.Transact(opts, "revoke", addr) -} - -// Revoke is a paid mutator transaction binding the contract method 0x74a8f103. -// -// Solidity: function revoke(address addr) returns() -func (_ERC20NativeMinter *ERC20NativeMinterSession) Revoke(addr common.Address) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.Revoke(&_ERC20NativeMinter.TransactOpts, addr) -} - -// Revoke is a paid mutator transaction binding the contract method 0x74a8f103. -// -// Solidity: function revoke(address addr) returns() -func (_ERC20NativeMinter *ERC20NativeMinterTransactorSession) Revoke(addr common.Address) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.Revoke(&_ERC20NativeMinter.TransactOpts, addr) -} - -// SetAdmin is a paid mutator transaction binding the contract method 0x704b6c02. -// -// Solidity: function setAdmin(address addr) returns() -func (_ERC20NativeMinter *ERC20NativeMinterTransactor) SetAdmin(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { - return _ERC20NativeMinter.contract.Transact(opts, "setAdmin", addr) -} - -// SetAdmin is a paid mutator transaction binding the contract method 0x704b6c02. -// -// Solidity: function setAdmin(address addr) returns() -func (_ERC20NativeMinter *ERC20NativeMinterSession) SetAdmin(addr common.Address) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.SetAdmin(&_ERC20NativeMinter.TransactOpts, addr) -} - -// SetAdmin is a paid mutator transaction binding the contract method 0x704b6c02. -// -// Solidity: function setAdmin(address addr) returns() -func (_ERC20NativeMinter *ERC20NativeMinterTransactorSession) SetAdmin(addr common.Address) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.SetAdmin(&_ERC20NativeMinter.TransactOpts, addr) -} - -// SetEnabled is a paid mutator transaction binding the contract method 0x0aaf7043. -// -// Solidity: function setEnabled(address addr) returns() -func (_ERC20NativeMinter *ERC20NativeMinterTransactor) SetEnabled(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { - return _ERC20NativeMinter.contract.Transact(opts, "setEnabled", addr) -} - -// SetEnabled is a paid mutator transaction binding the contract method 0x0aaf7043. -// -// Solidity: function setEnabled(address addr) returns() -func (_ERC20NativeMinter *ERC20NativeMinterSession) SetEnabled(addr common.Address) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.SetEnabled(&_ERC20NativeMinter.TransactOpts, addr) -} - -// SetEnabled is a paid mutator transaction binding the contract method 0x0aaf7043. -// -// Solidity: function setEnabled(address addr) returns() -func (_ERC20NativeMinter *ERC20NativeMinterTransactorSession) SetEnabled(addr common.Address) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.SetEnabled(&_ERC20NativeMinter.TransactOpts, addr) -} - -// SetManager is a paid mutator transaction binding the contract method 0xd0ebdbe7. -// -// Solidity: function setManager(address addr) returns() -func (_ERC20NativeMinter *ERC20NativeMinterTransactor) SetManager(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { - return _ERC20NativeMinter.contract.Transact(opts, "setManager", addr) -} - -// SetManager is a paid mutator transaction binding the contract method 0xd0ebdbe7. -// -// Solidity: function setManager(address addr) returns() -func (_ERC20NativeMinter *ERC20NativeMinterSession) SetManager(addr common.Address) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.SetManager(&_ERC20NativeMinter.TransactOpts, addr) -} - -// SetManager is a paid mutator transaction binding the contract method 0xd0ebdbe7. -// -// Solidity: function setManager(address addr) returns() -func (_ERC20NativeMinter *ERC20NativeMinterTransactorSession) SetManager(addr common.Address) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.SetManager(&_ERC20NativeMinter.TransactOpts, addr) -} - -// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. -// -// Solidity: function transfer(address to, uint256 value) returns(bool) -func (_ERC20NativeMinter *ERC20NativeMinterTransactor) Transfer(opts *bind.TransactOpts, to common.Address, value *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinter.contract.Transact(opts, "transfer", to, value) -} - -// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. -// -// Solidity: function transfer(address to, uint256 value) returns(bool) -func (_ERC20NativeMinter *ERC20NativeMinterSession) Transfer(to common.Address, value *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.Transfer(&_ERC20NativeMinter.TransactOpts, to, value) -} - -// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. -// -// Solidity: function transfer(address to, uint256 value) returns(bool) -func (_ERC20NativeMinter *ERC20NativeMinterTransactorSession) Transfer(to common.Address, value *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.Transfer(&_ERC20NativeMinter.TransactOpts, to, value) -} - -// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. -// -// Solidity: function transferFrom(address from, address to, uint256 value) returns(bool) -func (_ERC20NativeMinter *ERC20NativeMinterTransactor) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, value *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinter.contract.Transact(opts, "transferFrom", from, to, value) -} - -// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. -// -// Solidity: function transferFrom(address from, address to, uint256 value) returns(bool) -func (_ERC20NativeMinter *ERC20NativeMinterSession) TransferFrom(from common.Address, to common.Address, value *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.TransferFrom(&_ERC20NativeMinter.TransactOpts, from, to, value) -} - -// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. -// -// Solidity: function transferFrom(address from, address to, uint256 value) returns(bool) -func (_ERC20NativeMinter *ERC20NativeMinterTransactorSession) TransferFrom(from common.Address, to common.Address, value *big.Int) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.TransferFrom(&_ERC20NativeMinter.TransactOpts, from, to, value) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_ERC20NativeMinter *ERC20NativeMinterTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { - return _ERC20NativeMinter.contract.Transact(opts, "transferOwnership", newOwner) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_ERC20NativeMinter *ERC20NativeMinterSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.TransferOwnership(&_ERC20NativeMinter.TransactOpts, newOwner) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_ERC20NativeMinter *ERC20NativeMinterTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { - return _ERC20NativeMinter.Contract.TransferOwnership(&_ERC20NativeMinter.TransactOpts, newOwner) -} - -// ERC20NativeMinterApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the ERC20NativeMinter contract. -type ERC20NativeMinterApprovalIterator struct { - Event *ERC20NativeMinterApproval // 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 *ERC20NativeMinterApprovalIterator) 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(ERC20NativeMinterApproval) - 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(ERC20NativeMinterApproval) - 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 *ERC20NativeMinterApprovalIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *ERC20NativeMinterApprovalIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// ERC20NativeMinterApproval represents a Approval event raised by the ERC20NativeMinter contract. -type ERC20NativeMinterApproval struct { - Owner common.Address - Spender common.Address - Value *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. -// -// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) -func (_ERC20NativeMinter *ERC20NativeMinterFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*ERC20NativeMinterApprovalIterator, error) { - - var ownerRule []interface{} - for _, ownerItem := range owner { - ownerRule = append(ownerRule, ownerItem) - } - var spenderRule []interface{} - for _, spenderItem := range spender { - spenderRule = append(spenderRule, spenderItem) - } - - logs, sub, err := _ERC20NativeMinter.contract.FilterLogs(opts, "Approval", ownerRule, spenderRule) - if err != nil { - return nil, err - } - return &ERC20NativeMinterApprovalIterator{contract: _ERC20NativeMinter.contract, event: "Approval", logs: logs, sub: sub}, nil -} - -// WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. -// -// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) -func (_ERC20NativeMinter *ERC20NativeMinterFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *ERC20NativeMinterApproval, owner []common.Address, spender []common.Address) (event.Subscription, error) { - - var ownerRule []interface{} - for _, ownerItem := range owner { - ownerRule = append(ownerRule, ownerItem) - } - var spenderRule []interface{} - for _, spenderItem := range spender { - spenderRule = append(spenderRule, spenderItem) - } - - logs, sub, err := _ERC20NativeMinter.contract.WatchLogs(opts, "Approval", ownerRule, spenderRule) - 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(ERC20NativeMinterApproval) - if err := _ERC20NativeMinter.contract.UnpackLog(event, "Approval", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. -// -// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) -func (_ERC20NativeMinter *ERC20NativeMinterFilterer) ParseApproval(log types.Log) (*ERC20NativeMinterApproval, error) { - event := new(ERC20NativeMinterApproval) - if err := _ERC20NativeMinter.contract.UnpackLog(event, "Approval", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// ERC20NativeMinterDepositIterator is returned from FilterDeposit and is used to iterate over the raw logs and unpacked data for Deposit events raised by the ERC20NativeMinter contract. -type ERC20NativeMinterDepositIterator struct { - Event *ERC20NativeMinterDeposit // 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 *ERC20NativeMinterDepositIterator) 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(ERC20NativeMinterDeposit) - 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(ERC20NativeMinterDeposit) - 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 *ERC20NativeMinterDepositIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *ERC20NativeMinterDepositIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// ERC20NativeMinterDeposit represents a Deposit event raised by the ERC20NativeMinter contract. -type ERC20NativeMinterDeposit struct { - Dst common.Address - Wad *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterDeposit is a free log retrieval operation binding the contract event 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c. -// -// Solidity: event Deposit(address indexed dst, uint256 wad) -func (_ERC20NativeMinter *ERC20NativeMinterFilterer) FilterDeposit(opts *bind.FilterOpts, dst []common.Address) (*ERC20NativeMinterDepositIterator, error) { - - var dstRule []interface{} - for _, dstItem := range dst { - dstRule = append(dstRule, dstItem) - } - - logs, sub, err := _ERC20NativeMinter.contract.FilterLogs(opts, "Deposit", dstRule) - if err != nil { - return nil, err - } - return &ERC20NativeMinterDepositIterator{contract: _ERC20NativeMinter.contract, event: "Deposit", logs: logs, sub: sub}, nil -} - -// WatchDeposit is a free log subscription operation binding the contract event 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c. -// -// Solidity: event Deposit(address indexed dst, uint256 wad) -func (_ERC20NativeMinter *ERC20NativeMinterFilterer) WatchDeposit(opts *bind.WatchOpts, sink chan<- *ERC20NativeMinterDeposit, dst []common.Address) (event.Subscription, error) { - - var dstRule []interface{} - for _, dstItem := range dst { - dstRule = append(dstRule, dstItem) - } - - logs, sub, err := _ERC20NativeMinter.contract.WatchLogs(opts, "Deposit", dstRule) - 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(ERC20NativeMinterDeposit) - if err := _ERC20NativeMinter.contract.UnpackLog(event, "Deposit", 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 -} - -// ParseDeposit is a log parse operation binding the contract event 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c. -// -// Solidity: event Deposit(address indexed dst, uint256 wad) -func (_ERC20NativeMinter *ERC20NativeMinterFilterer) ParseDeposit(log types.Log) (*ERC20NativeMinterDeposit, error) { - event := new(ERC20NativeMinterDeposit) - if err := _ERC20NativeMinter.contract.UnpackLog(event, "Deposit", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// ERC20NativeMinterMintdrawalIterator is returned from FilterMintdrawal and is used to iterate over the raw logs and unpacked data for Mintdrawal events raised by the ERC20NativeMinter contract. -type ERC20NativeMinterMintdrawalIterator struct { - Event *ERC20NativeMinterMintdrawal // 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 *ERC20NativeMinterMintdrawalIterator) 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(ERC20NativeMinterMintdrawal) - 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(ERC20NativeMinterMintdrawal) - 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 *ERC20NativeMinterMintdrawalIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *ERC20NativeMinterMintdrawalIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// ERC20NativeMinterMintdrawal represents a Mintdrawal event raised by the ERC20NativeMinter contract. -type ERC20NativeMinterMintdrawal struct { - Src common.Address - Wad *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterMintdrawal is a free log retrieval operation binding the contract event 0x25bedde6c8ebd3a89b719a16299dbfe271c7bffa42fe1ac1a52e15ab0cb767e6. -// -// Solidity: event Mintdrawal(address indexed src, uint256 wad) -func (_ERC20NativeMinter *ERC20NativeMinterFilterer) FilterMintdrawal(opts *bind.FilterOpts, src []common.Address) (*ERC20NativeMinterMintdrawalIterator, error) { - - var srcRule []interface{} - for _, srcItem := range src { - srcRule = append(srcRule, srcItem) - } - - logs, sub, err := _ERC20NativeMinter.contract.FilterLogs(opts, "Mintdrawal", srcRule) - if err != nil { - return nil, err - } - return &ERC20NativeMinterMintdrawalIterator{contract: _ERC20NativeMinter.contract, event: "Mintdrawal", logs: logs, sub: sub}, nil -} - -// WatchMintdrawal is a free log subscription operation binding the contract event 0x25bedde6c8ebd3a89b719a16299dbfe271c7bffa42fe1ac1a52e15ab0cb767e6. -// -// Solidity: event Mintdrawal(address indexed src, uint256 wad) -func (_ERC20NativeMinter *ERC20NativeMinterFilterer) WatchMintdrawal(opts *bind.WatchOpts, sink chan<- *ERC20NativeMinterMintdrawal, src []common.Address) (event.Subscription, error) { - - var srcRule []interface{} - for _, srcItem := range src { - srcRule = append(srcRule, srcItem) - } - - logs, sub, err := _ERC20NativeMinter.contract.WatchLogs(opts, "Mintdrawal", srcRule) - 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(ERC20NativeMinterMintdrawal) - if err := _ERC20NativeMinter.contract.UnpackLog(event, "Mintdrawal", 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 -} - -// ParseMintdrawal is a log parse operation binding the contract event 0x25bedde6c8ebd3a89b719a16299dbfe271c7bffa42fe1ac1a52e15ab0cb767e6. -// -// Solidity: event Mintdrawal(address indexed src, uint256 wad) -func (_ERC20NativeMinter *ERC20NativeMinterFilterer) ParseMintdrawal(log types.Log) (*ERC20NativeMinterMintdrawal, error) { - event := new(ERC20NativeMinterMintdrawal) - if err := _ERC20NativeMinter.contract.UnpackLog(event, "Mintdrawal", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// ERC20NativeMinterOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the ERC20NativeMinter contract. -type ERC20NativeMinterOwnershipTransferredIterator struct { - Event *ERC20NativeMinterOwnershipTransferred // 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 *ERC20NativeMinterOwnershipTransferredIterator) 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(ERC20NativeMinterOwnershipTransferred) - 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(ERC20NativeMinterOwnershipTransferred) - 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 *ERC20NativeMinterOwnershipTransferredIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *ERC20NativeMinterOwnershipTransferredIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// ERC20NativeMinterOwnershipTransferred represents a OwnershipTransferred event raised by the ERC20NativeMinter contract. -type ERC20NativeMinterOwnershipTransferred struct { - PreviousOwner common.Address - NewOwner common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_ERC20NativeMinter *ERC20NativeMinterFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*ERC20NativeMinterOwnershipTransferredIterator, error) { - - var previousOwnerRule []interface{} - for _, previousOwnerItem := range previousOwner { - previousOwnerRule = append(previousOwnerRule, previousOwnerItem) - } - var newOwnerRule []interface{} - for _, newOwnerItem := range newOwner { - newOwnerRule = append(newOwnerRule, newOwnerItem) - } - - logs, sub, err := _ERC20NativeMinter.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) - if err != nil { - return nil, err - } - return &ERC20NativeMinterOwnershipTransferredIterator{contract: _ERC20NativeMinter.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil -} - -// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_ERC20NativeMinter *ERC20NativeMinterFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *ERC20NativeMinterOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { - - var previousOwnerRule []interface{} - for _, previousOwnerItem := range previousOwner { - previousOwnerRule = append(previousOwnerRule, previousOwnerItem) - } - var newOwnerRule []interface{} - for _, newOwnerItem := range newOwner { - newOwnerRule = append(newOwnerRule, newOwnerItem) - } - - logs, sub, err := _ERC20NativeMinter.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(ERC20NativeMinterOwnershipTransferred) - if err := _ERC20NativeMinter.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_ERC20NativeMinter *ERC20NativeMinterFilterer) ParseOwnershipTransferred(log types.Log) (*ERC20NativeMinterOwnershipTransferred, error) { - event := new(ERC20NativeMinterOwnershipTransferred) - if err := _ERC20NativeMinter.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// ERC20NativeMinterTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the ERC20NativeMinter contract. -type ERC20NativeMinterTransferIterator struct { - Event *ERC20NativeMinterTransfer // 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 *ERC20NativeMinterTransferIterator) 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(ERC20NativeMinterTransfer) - 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(ERC20NativeMinterTransfer) - 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 *ERC20NativeMinterTransferIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *ERC20NativeMinterTransferIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// ERC20NativeMinterTransfer represents a Transfer event raised by the ERC20NativeMinter contract. -type ERC20NativeMinterTransfer struct { - From common.Address - To common.Address - Value *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. -// -// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) -func (_ERC20NativeMinter *ERC20NativeMinterFilterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*ERC20NativeMinterTransferIterator, error) { - - var fromRule []interface{} - for _, fromItem := range from { - fromRule = append(fromRule, fromItem) - } - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - - logs, sub, err := _ERC20NativeMinter.contract.FilterLogs(opts, "Transfer", fromRule, toRule) - if err != nil { - return nil, err - } - return &ERC20NativeMinterTransferIterator{contract: _ERC20NativeMinter.contract, event: "Transfer", logs: logs, sub: sub}, nil -} - -// WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. -// -// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) -func (_ERC20NativeMinter *ERC20NativeMinterFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *ERC20NativeMinterTransfer, from []common.Address, to []common.Address) (event.Subscription, error) { - - var fromRule []interface{} - for _, fromItem := range from { - fromRule = append(fromRule, fromItem) - } - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - - logs, sub, err := _ERC20NativeMinter.contract.WatchLogs(opts, "Transfer", fromRule, toRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(ERC20NativeMinterTransfer) - if err := _ERC20NativeMinter.contract.UnpackLog(event, "Transfer", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. -// -// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) -func (_ERC20NativeMinter *ERC20NativeMinterFilterer) ParseTransfer(log types.Log) (*ERC20NativeMinterTransfer, error) { - event := new(ERC20NativeMinterTransfer) - if err := _ERC20NativeMinter.contract.UnpackLog(event, "Transfer", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} diff --git a/precompile/contracts/nativeminter/nativemintertest/gen_minter_binding.go b/precompile/contracts/nativeminter/nativemintertest/gen_minter_binding.go deleted file mode 100644 index f0227316cc..0000000000 --- a/precompile/contracts/nativeminter/nativemintertest/gen_minter_binding.go +++ /dev/null @@ -1,266 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package nativemintertest - -import ( - "errors" - "math/big" - "strings" - - ethereum "github.com/ava-labs/libevm" - "github.com/ava-labs/subnet-evm/accounts/abi" - "github.com/ava-labs/subnet-evm/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 -) - -// MinterMetaData contains all meta data concerning the Minter contract. -var MinterMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mintdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", - Bin: "0x608060405234801561001057600080fd5b5060405161037c38038061037c833981810160405281019061003291906100db565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610108565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100a88261007d565b9050919050565b6100b88161009d565b81146100c357600080fd5b50565b6000815190506100d5816100af565b92915050565b6000602082840312156100f1576100f0610078565b5b60006100ff848285016100c6565b91505092915050565b610265806101176000396000f3fe60806040526004361061002d5760003560e01c80630356b6cd14610039578063b6b55f251461006257610034565b3661003457005b600080fd5b34801561004557600080fd5b50610060600480360381019061005b91906101d8565b61008b565b005b34801561006e57600080fd5b50610089600480360381019061008491906101d8565b610119565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630356b6cd826040518263ffffffff1660e01b81526004016100e49190610214565b600060405180830381600087803b1580156100fe57600080fd5b505af1158015610112573d6000803e3d6000fd5b5050505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b15801561018157600080fd5b505af1158015610195573d6000803e3d6000fd5b505050505050565b600080fd5b6000819050919050565b6101b5816101a2565b81146101c057600080fd5b50565b6000813590506101d2816101ac565b92915050565b6000602082840312156101ee576101ed61019d565b5b60006101fc848285016101c3565b91505092915050565b61020e816101a2565b82525050565b60006020820190506102296000830184610205565b9291505056fea2646970667358221220773276ad1f4e87dd87066bd36a6ac4dad0fe6dc63e870d90347c0b9ae62a4a5664736f6c634300081e0033", -} - -// MinterABI is the input ABI used to generate the binding from. -// Deprecated: Use MinterMetaData.ABI instead. -var MinterABI = MinterMetaData.ABI - -// MinterBin is the compiled bytecode used for deploying new contracts. -// Deprecated: Use MinterMetaData.Bin instead. -var MinterBin = MinterMetaData.Bin - -// DeployMinter deploys a new Ethereum contract, binding an instance of Minter to it. -func DeployMinter(auth *bind.TransactOpts, backend bind.ContractBackend, tokenAddress common.Address) (common.Address, *types.Transaction, *Minter, error) { - parsed, err := MinterMetaData.GetAbi() - if err != nil { - return common.Address{}, nil, nil, err - } - if parsed == nil { - return common.Address{}, nil, nil, errors.New("GetABI returned nil") - } - - address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(MinterBin), backend, tokenAddress) - if err != nil { - return common.Address{}, nil, nil, err - } - return address, tx, &Minter{MinterCaller: MinterCaller{contract: contract}, MinterTransactor: MinterTransactor{contract: contract}, MinterFilterer: MinterFilterer{contract: contract}}, nil -} - -// Minter is an auto generated Go binding around an Ethereum contract. -type Minter struct { - MinterCaller // Read-only binding to the contract - MinterTransactor // Write-only binding to the contract - MinterFilterer // Log filterer for contract events -} - -// MinterCaller is an auto generated read-only Go binding around an Ethereum contract. -type MinterCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// MinterTransactor is an auto generated write-only Go binding around an Ethereum contract. -type MinterTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// MinterFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type MinterFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// MinterSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type MinterSession struct { - Contract *Minter // 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 -} - -// MinterCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type MinterCallerSession struct { - Contract *MinterCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// MinterTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type MinterTransactorSession struct { - Contract *MinterTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// MinterRaw is an auto generated low-level Go binding around an Ethereum contract. -type MinterRaw struct { - Contract *Minter // Generic contract binding to access the raw methods on -} - -// MinterCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type MinterCallerRaw struct { - Contract *MinterCaller // Generic read-only contract binding to access the raw methods on -} - -// MinterTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type MinterTransactorRaw struct { - Contract *MinterTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewMinter creates a new instance of Minter, bound to a specific deployed contract. -func NewMinter(address common.Address, backend bind.ContractBackend) (*Minter, error) { - contract, err := bindMinter(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &Minter{MinterCaller: MinterCaller{contract: contract}, MinterTransactor: MinterTransactor{contract: contract}, MinterFilterer: MinterFilterer{contract: contract}}, nil -} - -// NewMinterCaller creates a new read-only instance of Minter, bound to a specific deployed contract. -func NewMinterCaller(address common.Address, caller bind.ContractCaller) (*MinterCaller, error) { - contract, err := bindMinter(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &MinterCaller{contract: contract}, nil -} - -// NewMinterTransactor creates a new write-only instance of Minter, bound to a specific deployed contract. -func NewMinterTransactor(address common.Address, transactor bind.ContractTransactor) (*MinterTransactor, error) { - contract, err := bindMinter(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &MinterTransactor{contract: contract}, nil -} - -// NewMinterFilterer creates a new log filterer instance of Minter, bound to a specific deployed contract. -func NewMinterFilterer(address common.Address, filterer bind.ContractFilterer) (*MinterFilterer, error) { - contract, err := bindMinter(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &MinterFilterer{contract: contract}, nil -} - -// bindMinter binds a generic wrapper to an already deployed contract. -func bindMinter(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := MinterMetaData.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 (_Minter *MinterRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _Minter.Contract.MinterCaller.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 (_Minter *MinterRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Minter.Contract.MinterTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Minter *MinterRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Minter.Contract.MinterTransactor.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 (_Minter *MinterCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _Minter.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 (_Minter *MinterTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Minter.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Minter *MinterTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Minter.Contract.contract.Transact(opts, method, params...) -} - -// Deposit is a paid mutator transaction binding the contract method 0xb6b55f25. -// -// Solidity: function deposit(uint256 value) returns() -func (_Minter *MinterTransactor) Deposit(opts *bind.TransactOpts, value *big.Int) (*types.Transaction, error) { - return _Minter.contract.Transact(opts, "deposit", value) -} - -// Deposit is a paid mutator transaction binding the contract method 0xb6b55f25. -// -// Solidity: function deposit(uint256 value) returns() -func (_Minter *MinterSession) Deposit(value *big.Int) (*types.Transaction, error) { - return _Minter.Contract.Deposit(&_Minter.TransactOpts, value) -} - -// Deposit is a paid mutator transaction binding the contract method 0xb6b55f25. -// -// Solidity: function deposit(uint256 value) returns() -func (_Minter *MinterTransactorSession) Deposit(value *big.Int) (*types.Transaction, error) { - return _Minter.Contract.Deposit(&_Minter.TransactOpts, value) -} - -// Mintdraw is a paid mutator transaction binding the contract method 0x0356b6cd. -// -// Solidity: function mintdraw(uint256 amount) returns() -func (_Minter *MinterTransactor) Mintdraw(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) { - return _Minter.contract.Transact(opts, "mintdraw", amount) -} - -// Mintdraw is a paid mutator transaction binding the contract method 0x0356b6cd. -// -// Solidity: function mintdraw(uint256 amount) returns() -func (_Minter *MinterSession) Mintdraw(amount *big.Int) (*types.Transaction, error) { - return _Minter.Contract.Mintdraw(&_Minter.TransactOpts, amount) -} - -// Mintdraw is a paid mutator transaction binding the contract method 0x0356b6cd. -// -// Solidity: function mintdraw(uint256 amount) returns() -func (_Minter *MinterTransactorSession) Mintdraw(amount *big.Int) (*types.Transaction, error) { - return _Minter.Contract.Mintdraw(&_Minter.TransactOpts, amount) -} - -// Receive is a paid mutator transaction binding the contract receive function. -// -// Solidity: receive() payable returns() -func (_Minter *MinterTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Minter.contract.RawTransact(opts, nil) // calldata is disallowed for receive function -} - -// Receive is a paid mutator transaction binding the contract receive function. -// -// Solidity: receive() payable returns() -func (_Minter *MinterSession) Receive() (*types.Transaction, error) { - return _Minter.Contract.Receive(&_Minter.TransactOpts) -} - -// Receive is a paid mutator transaction binding the contract receive function. -// -// Solidity: receive() payable returns() -func (_Minter *MinterTransactorSession) Receive() (*types.Transaction, error) { - return _Minter.Contract.Receive(&_Minter.TransactOpts) -} diff --git a/precompile/contracts/nativeminter/nativemintertest/gen_nativemintertest_binding.go b/precompile/contracts/nativeminter/nativemintertest/gen_nativemintertest_binding.go new file mode 100644 index 0000000000..2a730b4479 --- /dev/null +++ b/precompile/contracts/nativeminter/nativemintertest/gen_nativemintertest_binding.go @@ -0,0 +1,245 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package nativemintertest + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ava-labs/libevm" + "github.com/ava-labs/subnet-evm/accounts/abi" + "github.com/ava-labs/subnet-evm/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 +) + +// NativeMinterTestMetaData contains all meta data concerning the NativeMinterTest contract. +var NativeMinterTestMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nativeMinterPrecompile\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mintNativeCoin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", + Bin: "0x608060405234801561001057600080fd5b50604051610355380380610355833981810160405281019061003291906100db565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610108565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100a88261007d565b9050919050565b6100b88161009d565b81146100c357600080fd5b50565b6000815190506100d5816100af565b92915050565b6000602082840312156100f1576100f0610078565b5b60006100ff848285016100c6565b91505092915050565b61023e806101176000396000f3fe6080604052600436106100225760003560e01c80634f5aaaba1461002e57610029565b3661002957005b600080fd5b34801561003a57600080fd5b5061005560048036038101906100509190610181565b610057565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634f5aaaba83836040518363ffffffff1660e01b81526004016100b29291906101df565b600060405180830381600087803b1580156100cc57600080fd5b505af11580156100e0573d6000803e3d6000fd5b505050505050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610118826100ed565b9050919050565b6101288161010d565b811461013357600080fd5b50565b6000813590506101458161011f565b92915050565b6000819050919050565b61015e8161014b565b811461016957600080fd5b50565b60008135905061017b81610155565b92915050565b60008060408385031215610198576101976100e8565b5b60006101a685828601610136565b92505060206101b78582860161016c565b9150509250929050565b6101ca8161010d565b82525050565b6101d98161014b565b82525050565b60006040820190506101f460008301856101c1565b61020160208301846101d0565b939250505056fea2646970667358221220d8815e6e2ef5f9f594d8ca3800c6e2022c21c6ba5da974f0b81a27b74cea21f364736f6c634300081e0033", +} + +// NativeMinterTestABI is the input ABI used to generate the binding from. +// Deprecated: Use NativeMinterTestMetaData.ABI instead. +var NativeMinterTestABI = NativeMinterTestMetaData.ABI + +// NativeMinterTestBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use NativeMinterTestMetaData.Bin instead. +var NativeMinterTestBin = NativeMinterTestMetaData.Bin + +// DeployNativeMinterTest deploys a new Ethereum contract, binding an instance of NativeMinterTest to it. +func DeployNativeMinterTest(auth *bind.TransactOpts, backend bind.ContractBackend, nativeMinterPrecompile common.Address) (common.Address, *types.Transaction, *NativeMinterTest, error) { + parsed, err := NativeMinterTestMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(NativeMinterTestBin), backend, nativeMinterPrecompile) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &NativeMinterTest{NativeMinterTestCaller: NativeMinterTestCaller{contract: contract}, NativeMinterTestTransactor: NativeMinterTestTransactor{contract: contract}, NativeMinterTestFilterer: NativeMinterTestFilterer{contract: contract}}, nil +} + +// NativeMinterTest is an auto generated Go binding around an Ethereum contract. +type NativeMinterTest struct { + NativeMinterTestCaller // Read-only binding to the contract + NativeMinterTestTransactor // Write-only binding to the contract + NativeMinterTestFilterer // Log filterer for contract events +} + +// NativeMinterTestCaller is an auto generated read-only Go binding around an Ethereum contract. +type NativeMinterTestCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// NativeMinterTestTransactor is an auto generated write-only Go binding around an Ethereum contract. +type NativeMinterTestTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// NativeMinterTestFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type NativeMinterTestFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// NativeMinterTestSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type NativeMinterTestSession struct { + Contract *NativeMinterTest // 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 +} + +// NativeMinterTestCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type NativeMinterTestCallerSession struct { + Contract *NativeMinterTestCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// NativeMinterTestTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type NativeMinterTestTransactorSession struct { + Contract *NativeMinterTestTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// NativeMinterTestRaw is an auto generated low-level Go binding around an Ethereum contract. +type NativeMinterTestRaw struct { + Contract *NativeMinterTest // Generic contract binding to access the raw methods on +} + +// NativeMinterTestCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type NativeMinterTestCallerRaw struct { + Contract *NativeMinterTestCaller // Generic read-only contract binding to access the raw methods on +} + +// NativeMinterTestTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type NativeMinterTestTransactorRaw struct { + Contract *NativeMinterTestTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewNativeMinterTest creates a new instance of NativeMinterTest, bound to a specific deployed contract. +func NewNativeMinterTest(address common.Address, backend bind.ContractBackend) (*NativeMinterTest, error) { + contract, err := bindNativeMinterTest(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &NativeMinterTest{NativeMinterTestCaller: NativeMinterTestCaller{contract: contract}, NativeMinterTestTransactor: NativeMinterTestTransactor{contract: contract}, NativeMinterTestFilterer: NativeMinterTestFilterer{contract: contract}}, nil +} + +// NewNativeMinterTestCaller creates a new read-only instance of NativeMinterTest, bound to a specific deployed contract. +func NewNativeMinterTestCaller(address common.Address, caller bind.ContractCaller) (*NativeMinterTestCaller, error) { + contract, err := bindNativeMinterTest(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &NativeMinterTestCaller{contract: contract}, nil +} + +// NewNativeMinterTestTransactor creates a new write-only instance of NativeMinterTest, bound to a specific deployed contract. +func NewNativeMinterTestTransactor(address common.Address, transactor bind.ContractTransactor) (*NativeMinterTestTransactor, error) { + contract, err := bindNativeMinterTest(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &NativeMinterTestTransactor{contract: contract}, nil +} + +// NewNativeMinterTestFilterer creates a new log filterer instance of NativeMinterTest, bound to a specific deployed contract. +func NewNativeMinterTestFilterer(address common.Address, filterer bind.ContractFilterer) (*NativeMinterTestFilterer, error) { + contract, err := bindNativeMinterTest(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &NativeMinterTestFilterer{contract: contract}, nil +} + +// bindNativeMinterTest binds a generic wrapper to an already deployed contract. +func bindNativeMinterTest(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := NativeMinterTestMetaData.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 (_NativeMinterTest *NativeMinterTestRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _NativeMinterTest.Contract.NativeMinterTestCaller.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 (_NativeMinterTest *NativeMinterTestRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _NativeMinterTest.Contract.NativeMinterTestTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_NativeMinterTest *NativeMinterTestRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _NativeMinterTest.Contract.NativeMinterTestTransactor.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 (_NativeMinterTest *NativeMinterTestCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _NativeMinterTest.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 (_NativeMinterTest *NativeMinterTestTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _NativeMinterTest.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_NativeMinterTest *NativeMinterTestTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _NativeMinterTest.Contract.contract.Transact(opts, method, params...) +} + +// MintNativeCoin is a paid mutator transaction binding the contract method 0x4f5aaaba. +// +// Solidity: function mintNativeCoin(address addr, uint256 amount) returns() +func (_NativeMinterTest *NativeMinterTestTransactor) MintNativeCoin(opts *bind.TransactOpts, addr common.Address, amount *big.Int) (*types.Transaction, error) { + return _NativeMinterTest.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 (_NativeMinterTest *NativeMinterTestSession) MintNativeCoin(addr common.Address, amount *big.Int) (*types.Transaction, error) { + return _NativeMinterTest.Contract.MintNativeCoin(&_NativeMinterTest.TransactOpts, addr, amount) +} + +// MintNativeCoin is a paid mutator transaction binding the contract method 0x4f5aaaba. +// +// Solidity: function mintNativeCoin(address addr, uint256 amount) returns() +func (_NativeMinterTest *NativeMinterTestTransactorSession) MintNativeCoin(addr common.Address, amount *big.Int) (*types.Transaction, error) { + return _NativeMinterTest.Contract.MintNativeCoin(&_NativeMinterTest.TransactOpts, addr, amount) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_NativeMinterTest *NativeMinterTestTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { + return _NativeMinterTest.contract.RawTransact(opts, nil) // calldata is disallowed for receive function +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_NativeMinterTest *NativeMinterTestSession) Receive() (*types.Transaction, error) { + return _NativeMinterTest.Contract.Receive(&_NativeMinterTest.TransactOpts) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_NativeMinterTest *NativeMinterTestTransactorSession) Receive() (*types.Transaction, error) { + return _NativeMinterTest.Contract.Receive(&_NativeMinterTest.TransactOpts) +} diff --git a/precompile/contracts/nativeminter/nativemintertest/simulated_test.go b/precompile/contracts/nativeminter/nativemintertest/simulated_test.go index 5974ef3013..acb372c29e 100644 --- a/precompile/contracts/nativeminter/nativemintertest/simulated_test.go +++ b/precompile/contracts/nativeminter/nativemintertest/simulated_test.go @@ -62,17 +62,9 @@ func newBackendWithNativeMinter(t *testing.T) *sim.Backend { // Helper functions to reduce test boilerplate -func deployERC20NativeMinter(t *testing.T, b *sim.Backend, auth *bind.TransactOpts, initSupply *big.Int) (common.Address, *ERC20NativeMinter) { +func deployNativeMinterTest(t *testing.T, b *sim.Backend, auth *bind.TransactOpts) (common.Address, *NativeMinterTest) { t.Helper() - addr, tx, contract, err := DeployERC20NativeMinter(auth, b.Client(), nativeminter.ContractAddress, initSupply) - require.NoError(t, err) - testutils.WaitReceiptSuccessful(t, b, tx) - return addr, contract -} - -func deployMinter(t *testing.T, b *sim.Backend, auth *bind.TransactOpts, tokenAddress common.Address) (common.Address, *Minter) { - t.Helper() - addr, tx, contract, err := DeployMinter(auth, b.Client(), tokenAddress) + addr, tx, contract, err := DeployNativeMinterTest(auth, b.Client(), nativeminter.ContractAddress) require.NoError(t, err) testutils.WaitReceiptSuccessful(t, b, tx) return addr, contract @@ -95,8 +87,8 @@ func setAsEnabled(t *testing.T, b *sim.Backend, nativeMinter *INativeMinter, aut func TestNativeMinter(t *testing.T) { chainID := big.NewInt(1337) admin := testutils.NewAuth(t, adminKey, chainID) + unprivileged := testutils.NewAuth(t, unprivilegedKey, chainID) - initSupply := big.NewInt(1000) amount := big.NewInt(100) type testCase struct { @@ -106,142 +98,82 @@ func TestNativeMinter(t *testing.T) { testCases := []testCase{ { - name: "contract should not be able to mintdraw", + name: "admin can mint directly", test: func(t *testing.T, backend *sim.Backend, nativeMinter *INativeMinter) { - tokenAddr, token := deployERC20NativeMinter(t, backend, admin, initSupply) - - verifyRole(t, nativeMinter, tokenAddr, allowlist.NoRole) - - // Try to mintdraw - should fail because token contract is not enabled - _, err := token.Mintdraw(admin, amount) - require.ErrorContains(t, err, vm.ErrExecutionReverted.Error()) - }, - }, - { - name: "should be added to minter list", - test: func(t *testing.T, backend *sim.Backend, nativeMinter *INativeMinter) { - tokenAddr, _ := deployERC20NativeMinter(t, backend, admin, initSupply) - - verifyRole(t, nativeMinter, tokenAddr, allowlist.NoRole) - - setAsEnabled(t, backend, nativeMinter, admin, tokenAddr) - - verifyRole(t, nativeMinter, tokenAddr, allowlist.EnabledRole) - }, - }, - { - name: "admin should mintdraw", - test: func(t *testing.T, backend *sim.Backend, nativeMinter *INativeMinter) { - tokenAddr, token := deployERC20NativeMinter(t, backend, admin, initSupply) - - setAsEnabled(t, backend, nativeMinter, admin, tokenAddr) + testAddr := common.HexToAddress("0x1234567890123456789012345678901234567890") - // Get initial token balance (admin has the tokens) - initialTokenBalance, err := token.BalanceOf(nil, adminAddress) + initialBalance, err := backend.Client().BalanceAt(t.Context(), testAddr, nil) require.NoError(t, err) - // Perform mintdraw - burns admin's ERC20 tokens and mints native coins to admin - tx, err := token.Mintdraw(admin, amount) + // Admin mints native coins directly to testAddr + tx, err := nativeMinter.MintNativeCoin(admin, testAddr, amount) require.NoError(t, err) testutils.WaitReceiptSuccessful(t, backend, tx) - // Verify ERC20 token balance decreased by exactly the amount - finalTokenBalance, err := token.BalanceOf(nil, adminAddress) + // Verify balance increased + finalBalance, err := backend.Client().BalanceAt(t.Context(), testAddr, nil) require.NoError(t, err) - expectedTokenBalance := new(big.Int).Sub(initialTokenBalance, amount) - require.Zero(t, expectedTokenBalance.Cmp(finalTokenBalance), "ERC20 balance should have decreased by amount") + expectedBalance := new(big.Int).Add(initialBalance, amount) + require.Zero(t, expectedBalance.Cmp(finalBalance), "balance should have increased by amount") }, }, { - name: "minter should not mintdraw without tokens", + name: "unprivileged user cannot mint directly", test: func(t *testing.T, backend *sim.Backend, nativeMinter *INativeMinter) { - tokenAddr, token := deployERC20NativeMinter(t, backend, admin, initSupply) - minterAddr, minter := deployMinter(t, backend, admin, tokenAddr) + testAddr := common.HexToAddress("0x1234567890123456789012345678901234567890") - setAsEnabled(t, backend, nativeMinter, admin, tokenAddr) - - // Verify minter has no ERC20 tokens - initialTokenBalance, err := token.BalanceOf(nil, minterAddr) - require.NoError(t, err) - require.Zero(t, initialTokenBalance.Cmp(big.NewInt(0)), "minter should have no ERC20 tokens") - - // Try to mintdraw - should fail because minter has no ERC20 tokens to burn - _, err = minter.Mintdraw(admin, amount) + // Unprivileged user tries to mint - should fail + _, err := nativeMinter.MintNativeCoin(unprivileged, testAddr, amount) require.Error(t, err) }, }, { - name: "should deposit for minter", + name: "contract without permission cannot mint", test: func(t *testing.T, backend *sim.Backend, nativeMinter *INativeMinter) { - tokenAddr, token := deployERC20NativeMinter(t, backend, admin, initSupply) - minterAddr, minter := deployMinter(t, backend, admin, tokenAddr) + testContractAddr, testContract := deployNativeMinterTest(t, backend, admin) - setAsEnabled(t, backend, nativeMinter, admin, tokenAddr) + verifyRole(t, nativeMinter, testContractAddr, allowlist.NoRole) - // Mint native coins to minter address - tx, err := nativeMinter.MintNativeCoin(admin, minterAddr, amount) - require.NoError(t, err) - testutils.WaitReceipt(t, backend, tx) + testAddr := common.HexToAddress("0x1234567890123456789012345678901234567890") - // Get initial balances - initialTokenBalance, err := token.BalanceOf(nil, minterAddr) - require.NoError(t, err) - initialNativeBalance, err := backend.Client().BalanceAt(t.Context(), minterAddr, nil) - require.NoError(t, err) + // Contract tries to mint and then should revert because it's not enabled + _, err := testContract.MintNativeCoin(admin, testAddr, amount) + require.ErrorContains(t, err, vm.ErrExecutionReverted.Error()) + }, + }, + { + name: "contract can be added to allow list", + test: func(t *testing.T, backend *sim.Backend, nativeMinter *INativeMinter) { + testContractAddr, _ := deployNativeMinterTest(t, backend, admin) - // Deposit (convert native coin to ERC20 token) - tx, err = minter.Deposit(admin, amount) - require.NoError(t, err) - testutils.WaitReceiptSuccessful(t, backend, tx) + verifyRole(t, nativeMinter, testContractAddr, allowlist.NoRole) - // Verify balances changed correctly - finalTokenBalance, err := token.BalanceOf(nil, minterAddr) - require.NoError(t, err) - expectedTokenBalance := new(big.Int).Add(initialTokenBalance, amount) - require.Equal(t, expectedTokenBalance, finalTokenBalance) + setAsEnabled(t, backend, nativeMinter, admin, testContractAddr) - finalNativeBalance, err := backend.Client().BalanceAt(t.Context(), minterAddr, nil) - require.NoError(t, err) - expectedNativeBalance := new(big.Int).Sub(initialNativeBalance, amount) - require.Equal(t, expectedNativeBalance, finalNativeBalance) + verifyRole(t, nativeMinter, testContractAddr, allowlist.EnabledRole) }, }, { - name: "minter should mintdraw", + name: "enabled contract can mint", test: func(t *testing.T, backend *sim.Backend, nativeMinter *INativeMinter) { - tokenAddr, token := deployERC20NativeMinter(t, backend, admin, initSupply) - minterAddr, minter := deployMinter(t, backend, admin, tokenAddr) - - setAsEnabled(t, backend, nativeMinter, admin, tokenAddr) + testContractAddr, testContract := deployNativeMinterTest(t, backend, admin) + testAddr := common.HexToAddress("0x1234567890123456789012345678901234567890") - // Verify minter starts with no native balance - initialNativeBalance, err := backend.Client().BalanceAt(t.Context(), minterAddr, nil) - require.NoError(t, err) - require.Zero(t, initialNativeBalance.Cmp(big.NewInt(0)), "minter should start with no native balance") - - // Mint ERC20 tokens to minter - tx, err := token.Mint(admin, minterAddr, amount) - require.NoError(t, err) - testutils.WaitReceipt(t, backend, tx) + setAsEnabled(t, backend, nativeMinter, admin, testContractAddr) - // Verify minter received tokens - initialTokenBalance, err := token.BalanceOf(nil, minterAddr) + initialBalance, err := backend.Client().BalanceAt(t.Context(), testAddr, nil) require.NoError(t, err) - require.Zero(t, amount.Cmp(initialTokenBalance), "minter should have received ERC20 tokens") - // Mintdraw (convert ERC20 token to native coin) - tx, err = minter.Mintdraw(admin, amount) + // Enabled contract mints native coins + tx, err := testContract.MintNativeCoin(admin, testAddr, amount) require.NoError(t, err) testutils.WaitReceiptSuccessful(t, backend, tx) - // Verify final balances - finalTokenBalance, err := token.BalanceOf(nil, minterAddr) - require.NoError(t, err) - require.Zero(t, finalTokenBalance.Cmp(big.NewInt(0)), "minter should have no ERC20 tokens left") - - finalNativeBalance, err := backend.Client().BalanceAt(t.Context(), minterAddr, nil) + // Verify balance increased + finalBalance, err := backend.Client().BalanceAt(t.Context(), testAddr, nil) require.NoError(t, err) - require.Zero(t, amount.Cmp(finalNativeBalance), "minter should have received native coins") + expectedBalance := new(big.Int).Add(initialBalance, amount) + require.Zero(t, expectedBalance.Cmp(finalBalance), "balance should have increased by amount") }, }, } diff --git a/precompile/contracts/nativeminter/nativemintertest/solidity/ERC20NativeMinter.sol b/precompile/contracts/nativeminter/nativemintertest/solidity/ERC20NativeMinter.sol deleted file mode 100644 index 88ab657d58..0000000000 --- a/precompile/contracts/nativeminter/nativemintertest/solidity/ERC20NativeMinter.sol +++ /dev/null @@ -1,63 +0,0 @@ -//SPDX-License-Identifier: MIT -pragma solidity ^0.8.24; - -import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; -import "@openzeppelin/contracts/access/Ownable.sol"; -import "precompile/allowlist/allowlisttest/solidity/AllowList.sol"; -import "./INativeMinter.sol"; - -// Designated Blackhole Address -address constant BLACKHOLE_ADDRESS = 0x0100000000000000000000000000000000000000; - -contract ERC20NativeMinter is ERC20, Ownable, AllowList { - string private constant TOKEN_NAME = "ERC20NativeMinterToken"; - string private constant TOKEN_SYMBOL = "XMPL"; - - INativeMinter nativeMinter; - - event Deposit(address indexed dst, uint256 wad); - event Mintdrawal(address indexed src, uint256 wad); - - constructor(address nativeMinterPrecompile, uint256 initSupply) - ERC20(TOKEN_NAME, TOKEN_SYMBOL) - Ownable(msg.sender) - AllowList(nativeMinterPrecompile) - { - nativeMinter = INativeMinter(nativeMinterPrecompile); - // Mints init supply to msg.sender - _mint(msg.sender, initSupply); - } - - // Mints [amount] number of ERC20 token to [to] address. - function mint(address to, uint256 amount) external onlyOwner { - _mint(to, amount); - } - - // Burns [amount] number of ERC20 token from [from] address. - function burn(address from, uint256 amount) external onlyOwner { - _burn(from, amount); - } - - // Swaps [amount] number of ERC20 token for native coin. - function mintdraw(uint256 wad) external { - // Burn ERC20 token first. - _burn(msg.sender, wad); - // Mints [amount] number of native coins (gas coin) to [msg.sender] address. - // Calls NativeMinter precompile through INativeMinter interface. - nativeMinter.mintNativeCoin(msg.sender, wad); - emit Mintdrawal(msg.sender, wad); - } - - // Swaps [amount] number of native gas coins for ERC20 tokens. - function deposit() external payable { - // Burn native token by sending to BLACKHOLE_ADDRESS - payable(BLACKHOLE_ADDRESS).transfer(msg.value); - // Mint ERC20 token. - _mint(msg.sender, msg.value); - emit Deposit(msg.sender, msg.value); - } - - function decimals() public view virtual override returns (uint8) { - return 18; - } -} diff --git a/precompile/contracts/nativeminter/nativemintertest/solidity/Minter.sol b/precompile/contracts/nativeminter/nativemintertest/solidity/Minter.sol deleted file mode 100644 index ec9845401d..0000000000 --- a/precompile/contracts/nativeminter/nativemintertest/solidity/Minter.sol +++ /dev/null @@ -1,25 +0,0 @@ -//SPDX-License-Identifier: MIT -pragma solidity ^0.8.24; - -import "./ERC20NativeMinter.sol"; - -// Helper contract to test minting from another contract -contract Minter { - ERC20NativeMinter token; - - constructor(address tokenAddress) { - token = ERC20NativeMinter(tokenAddress); - } - - function mintdraw(uint amount) external { - token.mintdraw(amount); - } - - function deposit(uint value) external { - token.deposit{value: value}(); - } - - // Allow the contract to receive ETH - receive() external payable {} -} - diff --git a/precompile/contracts/nativeminter/nativemintertest/solidity/NativeMinterTest.sol b/precompile/contracts/nativeminter/nativemintertest/solidity/NativeMinterTest.sol new file mode 100644 index 0000000000..7220cf35b4 --- /dev/null +++ b/precompile/contracts/nativeminter/nativemintertest/solidity/NativeMinterTest.sol @@ -0,0 +1,21 @@ +//SPDX-License-Identifier: MIT +pragma solidity ^0.8.24; + +import "./INativeMinter.sol"; + +contract NativeMinterTest { + INativeMinter private nativeMinter; + + constructor(address nativeMinterPrecompile) { + nativeMinter = INativeMinter(nativeMinterPrecompile); + } + + // Calls the mintNativeCoin function on the precompile + function mintNativeCoin(address addr, uint256 amount) external { + nativeMinter.mintNativeCoin(addr, amount); + } + + // Allows this contract to receive native coins + receive() external payable {} +} + From 679e30e6331192893ff99d99444ee6a3f6d11821 Mon Sep 17 00:00:00 2001 From: Jonathan Oppenheimer Date: Mon, 24 Nov 2025 16:02:51 -0500 Subject: [PATCH 10/23] test: remove openzeppelin --- .github/workflows/ci.yml | 4 ---- .gitmodules | 4 ---- contracts/contracts/compile.go | 14 -------------- contracts/lib/openzeppelin-contracts | 1 - .../nativemintertest/simulated_test.go | 2 +- 5 files changed, 1 insertion(+), 24 deletions(-) delete mode 100644 .gitmodules delete mode 100644 contracts/contracts/compile.go delete mode 160000 contracts/lib/openzeppelin-contracts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6a1d5c7796..dedde8e1a5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,8 +16,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - with: - submodules: recursive - uses: actions/setup-go@v5 with: go-version-file: "go.mod" @@ -47,8 +45,6 @@ jobs: os: [macos-latest, ubuntu-22.04, ubuntu-latest] steps: - uses: actions/checkout@v4 - with: - submodules: recursive - uses: actions/setup-go@v5 with: go-version-file: "go.mod" diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 86167ad4d5..0000000000 --- a/.gitmodules +++ /dev/null @@ -1,4 +0,0 @@ -[submodule "contracts/lib/openzeppelin-contracts"] - path = contracts/lib/openzeppelin-contracts - url = https://github.com/OpenZeppelin/openzeppelin-contracts.git - branch = v5.4.0 diff --git a/contracts/contracts/compile.go b/contracts/contracts/compile.go deleted file mode 100644 index eab992c376..0000000000 --- a/contracts/contracts/compile.go +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - -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 ExampleFeeManager.sol ExampleRewardManager.sol ExampleTxAllowList.sol ExampleWarp.sol - -// Step 2: Generate Go bindings from the compiled artifacts -//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/gen_allowlist.go -//go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg bindings --type ExampleFeeManager --abi ../artifacts/ExampleFeeManager.abi --bin ../artifacts/ExampleFeeManager.bin --out ../bindings/gen_examplefeemanager.go -//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/gen_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/gen_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/gen_examplewarp.go diff --git a/contracts/lib/openzeppelin-contracts b/contracts/lib/openzeppelin-contracts deleted file mode 160000 index c64a1edb67..0000000000 --- a/contracts/lib/openzeppelin-contracts +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c64a1edb67b6e3f4a15cca8909c9482ad33a02b0 diff --git a/precompile/contracts/nativeminter/nativemintertest/simulated_test.go b/precompile/contracts/nativeminter/nativemintertest/simulated_test.go index acb372c29e..266c38eaf9 100644 --- a/precompile/contracts/nativeminter/nativemintertest/simulated_test.go +++ b/precompile/contracts/nativeminter/nativemintertest/simulated_test.go @@ -119,7 +119,7 @@ func TestNativeMinter(t *testing.T) { }, { name: "unprivileged user cannot mint directly", - test: func(t *testing.T, backend *sim.Backend, nativeMinter *INativeMinter) { + test: func(t *testing.T, _ *sim.Backend, nativeMinter *INativeMinter) { testAddr := common.HexToAddress("0x1234567890123456789012345678901234567890") // Unprivileged user tries to mint - should fail From 4225a1abb07d13fb6e9a756f24357ce314b60c1c Mon Sep 17 00:00:00 2001 From: Jonathan Oppenheimer Date: Mon, 24 Nov 2025 16:05:14 -0500 Subject: [PATCH 11/23] test: remove old compile from CI --- Taskfile.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Taskfile.yml b/Taskfile.yml index ffc67bd0db..de8ca8c54c 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -147,16 +147,14 @@ tasks: desc: Run golangci-lint with auto-fix where possible cmd: ./scripts/lint_fix.sh + # todo(JonathanOppenheimer): remove this task once we have migrated to the new contract testing framework setup-contracts: desc: Set up contracts by compiling Solidity contracts and generating Go bindings dir: ./contracts cmds: - # Keep npm/Hardhat compilation for existing TypeScript tests (Phase 2-3 migration) - cmd: npm ci - cmd: npx hardhat clean - cmd: npx hardhat compile - # New: Compile contracts with solc and generate Go bindings - - cmd: go generate ./... shellcheck: desc: Run shellcheck static analysis on all shell scripts with version management From d42393a29d4e515d8521aedddd2111d51ac438db Mon Sep 17 00:00:00 2001 From: Jonathan Oppenheimer Date: Mon, 24 Nov 2025 17:05:47 -0500 Subject: [PATCH 12/23] test: define allowlist helpers --- .../deployerallowlisttest/simulated_test.go | 48 +++++--------- .../gen_nativemintertest_binding.go | 2 +- .../nativemintertest/simulated_test.go | 31 +++------ .../contracts/testutils/allowlist_helpers.go | 66 +++++++++++++++++++ 4 files changed, 91 insertions(+), 56 deletions(-) create mode 100644 precompile/contracts/testutils/allowlist_helpers.go diff --git a/precompile/contracts/deployerallowlist/deployerallowlisttest/simulated_test.go b/precompile/contracts/deployerallowlist/deployerallowlisttest/simulated_test.go index 81c908cee0..77d323f737 100644 --- a/precompile/contracts/deployerallowlist/deployerallowlisttest/simulated_test.go +++ b/precompile/contracts/deployerallowlist/deployerallowlisttest/simulated_test.go @@ -46,8 +46,6 @@ func TestMain(m *testing.M) { func newBackendWithDeployerAllowList(t *testing.T) *sim.Backend { t.Helper() chainCfg := params.Copy(params.TestChainConfig) - // Match the simulated backend chain ID used for signing (1337). - chainCfg.ChainID = big.NewInt(1337) // Enable ContractDeployerAllowList at genesis with admin set to adminAddress. params.GetExtra(&chainCfg).GenesisPrecompiles = extras.Precompiles{ deployerallowlist.ConfigKey: deployerallowlist.NewConfig(utils.NewUint64(0), []common.Address{adminAddress}, nil, nil), @@ -71,22 +69,8 @@ func deployAllowListTest(t *testing.T, b *sim.Backend, auth *bind.TransactOpts) return addr, contract } -func verifyRole(t *testing.T, allowList *allowlisttest.IAllowList, address common.Address, expectedRole allowlist.Role) { - t.Helper() - role, err := allowList.ReadAllowList(nil, address) - require.NoError(t, err) - require.Equal(t, expectedRole.Big(), role) -} - -func setAsAdmin(t *testing.T, b *sim.Backend, allowList *allowlisttest.IAllowList, auth *bind.TransactOpts, address common.Address) { - t.Helper() - tx, err := allowList.SetAdmin(auth, address) - require.NoError(t, err) - testutils.WaitReceiptSuccessful(t, b, tx) -} - func TestDeployerAllowList(t *testing.T) { - chainID := big.NewInt(1337) + chainID := params.TestChainConfig.ChainID admin := testutils.NewAuth(t, adminKey, chainID) unprivileged := testutils.NewAuth(t, unprivilegedKey, chainID) @@ -99,14 +83,14 @@ func TestDeployerAllowList(t *testing.T) { { name: "should verify sender is admin", test: func(t *testing.T, _ *sim.Backend, allowList *allowlisttest.IAllowList) { - verifyRole(t, allowList, adminAddress, allowlist.AdminRole) + testutils.VerifyRole(t, allowList, adminAddress, allowlist.AdminRole) }, }, { name: "should verify new address has no role", test: func(t *testing.T, backend *sim.Backend, allowList *allowlisttest.IAllowList) { allowListTestAddr, _ := deployAllowListTest(t, backend, admin) - verifyRole(t, allowList, allowListTestAddr, allowlist.NoRole) + testutils.VerifyRole(t, allowList, allowListTestAddr, allowlist.NoRole) }, }, { @@ -114,7 +98,7 @@ func TestDeployerAllowList(t *testing.T) { test: func(t *testing.T, backend *sim.Backend, allowList *allowlisttest.IAllowList) { allowListTestAddr, allowListTest := deployAllowListTest(t, backend, admin) - verifyRole(t, allowList, allowListTestAddr, allowlist.NoRole) + testutils.VerifyRole(t, allowList, allowListTestAddr, allowlist.NoRole) isAdmin, err := allowListTest.IsAdmin(nil, allowListTestAddr) require.NoError(t, err) @@ -128,7 +112,7 @@ func TestDeployerAllowList(t *testing.T) { { name: "should not let address with no role deploy contracts", test: func(t *testing.T, backend *sim.Backend, allowList *allowlisttest.IAllowList) { - verifyRole(t, allowList, unprivilegedAddress, allowlist.NoRole) + testutils.VerifyRole(t, allowList, unprivilegedAddress, allowlist.NoRole) _, allowListTest := deployAllowListTest(t, backend, admin) @@ -143,9 +127,9 @@ func TestDeployerAllowList(t *testing.T) { test: func(t *testing.T, backend *sim.Backend, allowList *allowlisttest.IAllowList) { allowListTestAddr, allowListTest := deployAllowListTest(t, backend, admin) - verifyRole(t, allowList, allowListTestAddr, allowlist.NoRole) - setAsAdmin(t, backend, allowList, admin, allowListTestAddr) - verifyRole(t, allowList, allowListTestAddr, allowlist.AdminRole) + testutils.VerifyRole(t, allowList, allowListTestAddr, allowlist.NoRole) + testutils.SetAsAdmin(t, backend, allowList, admin, allowListTestAddr) + testutils.VerifyRole(t, allowList, allowListTestAddr, allowlist.AdminRole) isAdmin, err := allowListTest.IsAdmin(nil, allowListTestAddr) require.NoError(t, err) @@ -158,9 +142,9 @@ func TestDeployerAllowList(t *testing.T) { allowListTestAddr, allowListTest := deployAllowListTest(t, backend, admin) otherContractAddr, _ := deployAllowListTest(t, backend, admin) - verifyRole(t, allowList, allowListTestAddr, allowlist.NoRole) - setAsAdmin(t, backend, allowList, admin, allowListTestAddr) - verifyRole(t, allowList, allowListTestAddr, allowlist.AdminRole) + testutils.VerifyRole(t, allowList, allowListTestAddr, allowlist.NoRole) + testutils.SetAsAdmin(t, backend, allowList, admin, allowListTestAddr) + testutils.VerifyRole(t, allowList, allowListTestAddr, allowlist.AdminRole) tx, err := allowListTest.SetEnabled(admin, otherContractAddr) require.NoError(t, err) @@ -169,7 +153,7 @@ func TestDeployerAllowList(t *testing.T) { isEnabled, err := allowListTest.IsEnabled(nil, otherContractAddr) require.NoError(t, err) require.True(t, isEnabled) - verifyRole(t, allowList, otherContractAddr, allowlist.EnabledRole) + testutils.VerifyRole(t, allowList, otherContractAddr, allowlist.EnabledRole) }, }, { @@ -178,7 +162,7 @@ func TestDeployerAllowList(t *testing.T) { allowListTestAddr, allowListTest := deployAllowListTest(t, backend, admin) deployerContractAddr, deployerContract := deployAllowListTest(t, backend, admin) - setAsAdmin(t, backend, allowList, admin, allowListTestAddr) + testutils.SetAsAdmin(t, backend, allowList, admin, allowListTestAddr) tx, err := allowListTest.SetEnabled(admin, deployerContractAddr) require.NoError(t, err) @@ -199,7 +183,7 @@ func TestDeployerAllowList(t *testing.T) { allowListTestAddr, allowListTest := deployAllowListTest(t, backend, admin) deployerContractAddr, _ := deployAllowListTest(t, backend, admin) - setAsAdmin(t, backend, allowList, admin, allowListTestAddr) + testutils.SetAsAdmin(t, backend, allowList, admin, allowListTestAddr) tx, err := allowListTest.SetEnabled(admin, deployerContractAddr) require.NoError(t, err) @@ -213,7 +197,7 @@ func TestDeployerAllowList(t *testing.T) { require.NoError(t, err) testutils.WaitReceipt(t, backend, tx) - verifyRole(t, allowList, deployerContractAddr, allowlist.NoRole) + testutils.VerifyRole(t, allowList, deployerContractAddr, allowlist.NoRole) }, }, } @@ -232,7 +216,7 @@ func TestDeployerAllowList(t *testing.T) { } func TestIAllowList_Events(t *testing.T) { - chainID := big.NewInt(1337) + chainID := params.TestChainConfig.ChainID admin := testutils.NewAuth(t, adminKey, chainID) testKey, _ := crypto.GenerateKey() testAddress := crypto.PubkeyToAddress(testKey.PublicKey) diff --git a/precompile/contracts/nativeminter/nativemintertest/gen_nativemintertest_binding.go b/precompile/contracts/nativeminter/nativemintertest/gen_nativemintertest_binding.go index 2a730b4479..98676aeb43 100644 --- a/precompile/contracts/nativeminter/nativemintertest/gen_nativemintertest_binding.go +++ b/precompile/contracts/nativeminter/nativemintertest/gen_nativemintertest_binding.go @@ -32,7 +32,7 @@ var ( // NativeMinterTestMetaData contains all meta data concerning the NativeMinterTest contract. var NativeMinterTestMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nativeMinterPrecompile\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mintNativeCoin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", - Bin: "0x608060405234801561001057600080fd5b50604051610355380380610355833981810160405281019061003291906100db565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610108565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100a88261007d565b9050919050565b6100b88161009d565b81146100c357600080fd5b50565b6000815190506100d5816100af565b92915050565b6000602082840312156100f1576100f0610078565b5b60006100ff848285016100c6565b91505092915050565b61023e806101176000396000f3fe6080604052600436106100225760003560e01c80634f5aaaba1461002e57610029565b3661002957005b600080fd5b34801561003a57600080fd5b5061005560048036038101906100509190610181565b610057565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634f5aaaba83836040518363ffffffff1660e01b81526004016100b29291906101df565b600060405180830381600087803b1580156100cc57600080fd5b505af11580156100e0573d6000803e3d6000fd5b505050505050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610118826100ed565b9050919050565b6101288161010d565b811461013357600080fd5b50565b6000813590506101458161011f565b92915050565b6000819050919050565b61015e8161014b565b811461016957600080fd5b50565b60008135905061017b81610155565b92915050565b60008060408385031215610198576101976100e8565b5b60006101a685828601610136565b92505060206101b78582860161016c565b9150509250929050565b6101ca8161010d565b82525050565b6101d98161014b565b82525050565b60006040820190506101f460008301856101c1565b61020160208301846101d0565b939250505056fea2646970667358221220d8815e6e2ef5f9f594d8ca3800c6e2022c21c6ba5da974f0b81a27b74cea21f364736f6c634300081e0033", + Bin: "0x608060405234801561001057600080fd5b50604051610355380380610355833981810160405281019061003291906100db565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610108565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100a88261007d565b9050919050565b6100b88161009d565b81146100c357600080fd5b50565b6000815190506100d5816100af565b92915050565b6000602082840312156100f1576100f0610078565b5b60006100ff848285016100c6565b91505092915050565b61023e806101176000396000f3fe6080604052600436106100225760003560e01c80634f5aaaba1461002e57610029565b3661002957005b600080fd5b34801561003a57600080fd5b5061005560048036038101906100509190610181565b610057565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634f5aaaba83836040518363ffffffff1660e01b81526004016100b29291906101df565b600060405180830381600087803b1580156100cc57600080fd5b505af11580156100e0573d6000803e3d6000fd5b505050505050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610118826100ed565b9050919050565b6101288161010d565b811461013357600080fd5b50565b6000813590506101458161011f565b92915050565b6000819050919050565b61015e8161014b565b811461016957600080fd5b50565b60008135905061017b81610155565b92915050565b60008060408385031215610198576101976100e8565b5b60006101a685828601610136565b92505060206101b78582860161016c565b9150509250929050565b6101ca8161010d565b82525050565b6101d98161014b565b82525050565b60006040820190506101f460008301856101c1565b61020160208301846101d0565b939250505056fea26469706673582212203bde89427787c32352347fa2c7c7a5261492c6a54e09d952c008accdbaf4c47764736f6c634300081e0033", } // NativeMinterTestABI is the input ABI used to generate the binding from. diff --git a/precompile/contracts/nativeminter/nativemintertest/simulated_test.go b/precompile/contracts/nativeminter/nativemintertest/simulated_test.go index 266c38eaf9..a7e928c73d 100644 --- a/precompile/contracts/nativeminter/nativemintertest/simulated_test.go +++ b/precompile/contracts/nativeminter/nativemintertest/simulated_test.go @@ -45,8 +45,7 @@ func TestMain(m *testing.M) { func newBackendWithNativeMinter(t *testing.T) *sim.Backend { t.Helper() chainCfg := params.Copy(params.TestChainConfig) - // Match the simulated backend chain ID used for signing (1337). - chainCfg.ChainID = big.NewInt(1337) + // Enable ContractNativeMinter at genesis with admin set to adminAddress. params.GetExtra(&chainCfg).GenesisPrecompiles = extras.Precompiles{ nativeminter.ConfigKey: nativeminter.NewConfig(utils.NewUint64(0), []common.Address{adminAddress}, nil, nil, nil), @@ -70,22 +69,8 @@ func deployNativeMinterTest(t *testing.T, b *sim.Backend, auth *bind.TransactOpt return addr, contract } -func verifyRole(t *testing.T, nativeMinter *INativeMinter, address common.Address, expectedRole allowlist.Role) { - t.Helper() - role, err := nativeMinter.ReadAllowList(nil, address) - require.NoError(t, err) - require.Equal(t, expectedRole.Big(), role) -} - -func setAsEnabled(t *testing.T, b *sim.Backend, nativeMinter *INativeMinter, auth *bind.TransactOpts, address common.Address) { - t.Helper() - tx, err := nativeMinter.SetEnabled(auth, address) - require.NoError(t, err) - testutils.WaitReceiptSuccessful(t, b, tx) -} - func TestNativeMinter(t *testing.T) { - chainID := big.NewInt(1337) + chainID := params.TestChainConfig.ChainID admin := testutils.NewAuth(t, adminKey, chainID) unprivileged := testutils.NewAuth(t, unprivilegedKey, chainID) @@ -132,7 +117,7 @@ func TestNativeMinter(t *testing.T) { test: func(t *testing.T, backend *sim.Backend, nativeMinter *INativeMinter) { testContractAddr, testContract := deployNativeMinterTest(t, backend, admin) - verifyRole(t, nativeMinter, testContractAddr, allowlist.NoRole) + testutils.VerifyRole(t, nativeMinter, testContractAddr, allowlist.NoRole) testAddr := common.HexToAddress("0x1234567890123456789012345678901234567890") @@ -146,11 +131,11 @@ func TestNativeMinter(t *testing.T) { test: func(t *testing.T, backend *sim.Backend, nativeMinter *INativeMinter) { testContractAddr, _ := deployNativeMinterTest(t, backend, admin) - verifyRole(t, nativeMinter, testContractAddr, allowlist.NoRole) + testutils.VerifyRole(t, nativeMinter, testContractAddr, allowlist.NoRole) - setAsEnabled(t, backend, nativeMinter, admin, testContractAddr) + testutils.SetAsEnabled(t, backend, nativeMinter, admin, testContractAddr) - verifyRole(t, nativeMinter, testContractAddr, allowlist.EnabledRole) + testutils.VerifyRole(t, nativeMinter, testContractAddr, allowlist.EnabledRole) }, }, { @@ -159,7 +144,7 @@ func TestNativeMinter(t *testing.T) { testContractAddr, testContract := deployNativeMinterTest(t, backend, admin) testAddr := common.HexToAddress("0x1234567890123456789012345678901234567890") - setAsEnabled(t, backend, nativeMinter, admin, testContractAddr) + testutils.SetAsEnabled(t, backend, nativeMinter, admin, testContractAddr) initialBalance, err := backend.Client().BalanceAt(t.Context(), testAddr, nil) require.NoError(t, err) @@ -192,7 +177,7 @@ func TestNativeMinter(t *testing.T) { } func TestINativeMinter_Events(t *testing.T) { - chainID := big.NewInt(1337) + chainID := params.TestChainConfig.ChainID admin := testutils.NewAuth(t, adminKey, chainID) testKey, _ := crypto.GenerateKey() testAddress := crypto.PubkeyToAddress(testKey.PublicKey) diff --git a/precompile/contracts/testutils/allowlist_helpers.go b/precompile/contracts/testutils/allowlist_helpers.go new file mode 100644 index 0000000000..67105d1e06 --- /dev/null +++ b/precompile/contracts/testutils/allowlist_helpers.go @@ -0,0 +1,66 @@ +package testutils + +import ( + "math/big" + "testing" + + "github.com/ava-labs/libevm/common" + "github.com/ava-labs/libevm/core/types" + "github.com/ava-labs/subnet-evm/accounts/abi/bind" + "github.com/ava-labs/subnet-evm/precompile/allowlist" + "github.com/stretchr/testify/require" + + sim "github.com/ava-labs/subnet-evm/ethclient/simulated" +) + +// All precompiles that use the AllowList pattern extend IAllowList in Solidity, so their Go bindings +// will autoamatically have these 5 methods and implement the AllowListContract interface. + +// Defining this interface allows the helper functions to work with any precompile that uses the AllowList pattern. +type AllowListContract interface { + ReadAllowList(opts *bind.CallOpts, addr common.Address) (*big.Int, error) + SetEnabled(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) + SetAdmin(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) + SetManager(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) + SetNone(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) +} + +// VerifyRole checks that the given address has the expected role in the allow list. +func VerifyRole(t *testing.T, contract AllowListContract, address common.Address, expectedRole allowlist.Role) { + t.Helper() + role, err := contract.ReadAllowList(nil, address) + require.NoError(t, err) + require.Equal(t, expectedRole.Big(), role) +} + +// SetAsEnabled sets the given address as Enabled in the allow list. +func SetAsEnabled(t *testing.T, b *sim.Backend, contract AllowListContract, auth *bind.TransactOpts, address common.Address) { + t.Helper() + tx, err := contract.SetEnabled(auth, address) + require.NoError(t, err) + WaitReceiptSuccessful(t, b, tx) +} + +// SetAsAdmin sets the given address as Admin in the allow list. +func SetAsAdmin(t *testing.T, b *sim.Backend, contract AllowListContract, auth *bind.TransactOpts, address common.Address) { + t.Helper() + tx, err := contract.SetAdmin(auth, address) + require.NoError(t, err) + WaitReceiptSuccessful(t, b, tx) +} + +// SetAsManager sets the given address as Manager in the allow list. +func SetAsManager(t *testing.T, b *sim.Backend, contract AllowListContract, auth *bind.TransactOpts, address common.Address) { + t.Helper() + tx, err := contract.SetManager(auth, address) + require.NoError(t, err) + WaitReceiptSuccessful(t, b, tx) +} + +// SetAsNone revokes the role of the given address in the allow list. +func SetAsNone(t *testing.T, b *sim.Backend, contract AllowListContract, auth *bind.TransactOpts, address common.Address) { + t.Helper() + tx, err := contract.SetNone(auth, address) + require.NoError(t, err) + WaitReceiptSuccessful(t, b, tx) +} From e0d7787886d2778a82ad506bf84349eae82560a2 Mon Sep 17 00:00:00 2001 From: Jonathan Oppenheimer Date: Mon, 24 Nov 2025 17:10:33 -0500 Subject: [PATCH 13/23] test: get rid of solidity folder --- .../allowlist/allowlisttest/{solidity => }/AllowList.sol | 0 .../allowlist/allowlisttest/{solidity => }/AllowListTest.sol | 0 .../allowlist/allowlisttest/{solidity => }/IAllowList.sol | 0 precompile/allowlist/allowlisttest/compile.go | 2 +- .../nativemintertest/{solidity => }/INativeMinter.sol | 0 .../nativemintertest/{solidity => }/NativeMinterTest.sol | 0 precompile/contracts/nativeminter/nativemintertest/compile.go | 2 +- precompile/contracts/testutils/allowlist_helpers.go | 3 +-- 8 files changed, 3 insertions(+), 4 deletions(-) rename precompile/allowlist/allowlisttest/{solidity => }/AllowList.sol (100%) rename precompile/allowlist/allowlisttest/{solidity => }/AllowListTest.sol (100%) rename precompile/allowlist/allowlisttest/{solidity => }/IAllowList.sol (100%) rename precompile/contracts/nativeminter/nativemintertest/{solidity => }/INativeMinter.sol (100%) rename precompile/contracts/nativeminter/nativemintertest/{solidity => }/NativeMinterTest.sol (100%) diff --git a/precompile/allowlist/allowlisttest/solidity/AllowList.sol b/precompile/allowlist/allowlisttest/AllowList.sol similarity index 100% rename from precompile/allowlist/allowlisttest/solidity/AllowList.sol rename to precompile/allowlist/allowlisttest/AllowList.sol diff --git a/precompile/allowlist/allowlisttest/solidity/AllowListTest.sol b/precompile/allowlist/allowlisttest/AllowListTest.sol similarity index 100% rename from precompile/allowlist/allowlisttest/solidity/AllowListTest.sol rename to precompile/allowlist/allowlisttest/AllowListTest.sol diff --git a/precompile/allowlist/allowlisttest/solidity/IAllowList.sol b/precompile/allowlist/allowlisttest/IAllowList.sol similarity index 100% rename from precompile/allowlist/allowlisttest/solidity/IAllowList.sol rename to precompile/allowlist/allowlisttest/IAllowList.sol diff --git a/precompile/allowlist/allowlisttest/compile.go b/precompile/allowlist/allowlisttest/compile.go index ebb5f5dc2c..20d3012ae3 100644 --- a/precompile/allowlist/allowlisttest/compile.go +++ b/precompile/allowlist/allowlisttest/compile.go @@ -4,7 +4,7 @@ package allowlisttest // Step 1: Compile Solidity contracts to generate ABI and bin files -//go:generate solc-v0.8.30 -o artifacts --overwrite --abi --bin --base-path . precompile/=../../ --evm-version paris solidity/AllowListTest.sol +//go:generate solc-v0.8.30 -o artifacts --overwrite --abi --bin --base-path . precompile/=../../ --evm-version paris AllowListTest.sol // Step 2: Generate Go bindings from the compiled artifacts //go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg allowlisttest --type IAllowList --abi artifacts/IAllowList.abi --bin artifacts/IAllowList.bin --out gen_allowlist_binding.go //go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg allowlisttest --type AllowListTest --abi artifacts/AllowListTest.abi --bin artifacts/AllowListTest.bin --out gen_allowlisttest_binding.go diff --git a/precompile/contracts/nativeminter/nativemintertest/solidity/INativeMinter.sol b/precompile/contracts/nativeminter/nativemintertest/INativeMinter.sol similarity index 100% rename from precompile/contracts/nativeminter/nativemintertest/solidity/INativeMinter.sol rename to precompile/contracts/nativeminter/nativemintertest/INativeMinter.sol diff --git a/precompile/contracts/nativeminter/nativemintertest/solidity/NativeMinterTest.sol b/precompile/contracts/nativeminter/nativemintertest/NativeMinterTest.sol similarity index 100% rename from precompile/contracts/nativeminter/nativemintertest/solidity/NativeMinterTest.sol rename to precompile/contracts/nativeminter/nativemintertest/NativeMinterTest.sol diff --git a/precompile/contracts/nativeminter/nativemintertest/compile.go b/precompile/contracts/nativeminter/nativemintertest/compile.go index 24be253786..2276dc318d 100644 --- a/precompile/contracts/nativeminter/nativemintertest/compile.go +++ b/precompile/contracts/nativeminter/nativemintertest/compile.go @@ -4,7 +4,7 @@ package nativemintertest // Step 1: Compile Solidity contracts to generate ABI and bin files -//go:generate solc-v0.8.30 -o artifacts --overwrite --abi --bin --base-path ../../../.. precompile/=precompile/ --evm-version paris solidity/NativeMinterTest.sol +//go:generate solc-v0.8.30 -o artifacts --overwrite --abi --bin --base-path ../../../.. precompile/=precompile/ --evm-version paris NativeMinterTest.sol // Step 2: Generate Go bindings from the compiled artifacts //go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg nativemintertest --type INativeMinter --abi artifacts/INativeMinter.abi --bin artifacts/INativeMinter.bin --out gen_inativeminter_binding.go //go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg nativemintertest --type NativeMinterTest --abi artifacts/NativeMinterTest.abi --bin artifacts/NativeMinterTest.bin --out gen_nativemintertest_binding.go diff --git a/precompile/contracts/testutils/allowlist_helpers.go b/precompile/contracts/testutils/allowlist_helpers.go index 67105d1e06..474e88c566 100644 --- a/precompile/contracts/testutils/allowlist_helpers.go +++ b/precompile/contracts/testutils/allowlist_helpers.go @@ -14,8 +14,7 @@ import ( ) // All precompiles that use the AllowList pattern extend IAllowList in Solidity, so their Go bindings -// will autoamatically have these 5 methods and implement the AllowListContract interface. - +// will automatically have these 5 methods and implement the AllowListContract interface. // Defining this interface allows the helper functions to work with any precompile that uses the AllowList pattern. type AllowListContract interface { ReadAllowList(opts *bind.CallOpts, addr common.Address) (*big.Int, error) From 56bf03c40602a1339c41787ac2cd842f41e6e567 Mon Sep 17 00:00:00 2001 From: Jonathan Oppenheimer Date: Mon, 24 Nov 2025 17:11:44 -0500 Subject: [PATCH 14/23] chore: regenerate bindings --- precompile/allowlist/allowlisttest/gen_allowlisttest_binding.go | 2 +- .../contracts/nativeminter/nativemintertest/INativeMinter.sol | 2 +- .../nativemintertest/gen_nativemintertest_binding.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/precompile/allowlist/allowlisttest/gen_allowlisttest_binding.go b/precompile/allowlist/allowlisttest/gen_allowlisttest_binding.go index 9fb9c352ae..6857532b26 100644 --- a/precompile/allowlist/allowlisttest/gen_allowlisttest_binding.go +++ b/precompile/allowlist/allowlisttest/gen_allowlisttest_binding.go @@ -32,7 +32,7 @@ var ( // AllowListTestMetaData contains all meta data concerning the AllowListTest contract. var AllowListTestMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"precompileAddr\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"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\":[{\"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\"}]", - Bin: "0x608060405234801561001057600080fd5b50604051610bee380380610bee833981810160405281019061003291906100dd565b80806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505061010a565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100aa8261007f565b9050919050565b6100ba8161009f565b81146100c557600080fd5b50565b6000815190506100d7816100b1565b92915050565b6000602082840312156100f3576100f261007a565b5b6000610101848285016100c8565b91505092915050565b610ad5806101196000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c806374a8f1031161005b57806374a8f103146100ff5780639015d3711461011b578063d0ebdbe71461014b578063f3ae24151461016757610088565b80630aaf70431461008d57806324d7806c146100a95780636cd5c39b146100d9578063704b6c02146100e3575b600080fd5b6100a760048036038101906100a2919061086a565b610197565b005b6100c360048036038101906100be919061086a565b6101fb565b6040516100d091906108b2565b60405180910390f35b6100e16102a6565b005b6100fd60048036038101906100f8919061086a565b6102d2565b005b6101196004803603810190610114919061086a565b610336565b005b6101356004803603810190610130919061086a565b61039a565b60405161014291906108b2565b60405180910390f35b6101656004803603810190610160919061086a565b610446565b005b610181600480360381019061017c919061086a565b6104aa565b60405161018e91906108b2565b60405180910390f35b6101a0336101fb565b806101b057506101af336104aa565b5b6101ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101e69061092a565b60405180910390fd5b6101f881610555565b50565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b81526004016102579190610959565b602060405180830381865afa158015610274573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061029891906109aa565b905060028114915050919050565b6040516102b2906107fb565b604051809103906000f0801580156102ce573d6000803e3d6000fd5b5050565b6102db336101fb565b806102eb57506102ea336104aa565b5b61032a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103219061092a565b60405180910390fd5b610333816105e3565b50565b61033f336101fb565b8061034f575061034e336104aa565b5b61038e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103859061092a565b60405180910390fd5b61039781610671565b50565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b81526004016103f69190610959565b602060405180830381865afa158015610413573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061043791906109aa565b90506000811415915050919050565b61044f336101fb565b8061045f575061045e336104aa565b5b61049e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104959061092a565b60405180910390fd5b6104a78161076d565b50565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b81526004016105069190610959565b602060405180830381865afa158015610523573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054791906109aa565b905060038114915050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630aaf7043826040518263ffffffff1660e01b81526004016105ae9190610959565b600060405180830381600087803b1580156105c857600080fd5b505af11580156105dc573d6000803e3d6000fd5b5050505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663704b6c02826040518263ffffffff1660e01b815260040161063c9190610959565b600060405180830381600087803b15801561065657600080fd5b505af115801561066a573d6000803e3d6000fd5b5050505050565b8073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16036106df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d690610a23565b60405180910390fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638c6bfb3b826040518263ffffffff1660e01b81526004016107389190610959565b600060405180830381600087803b15801561075257600080fd5b505af1158015610766573d6000803e3d6000fd5b5050505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0ebdbe7826040518263ffffffff1660e01b81526004016107c69190610959565b600060405180830381600087803b1580156107e057600080fd5b505af11580156107f4573d6000803e3d6000fd5b5050505050565b605c80610a4483390190565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006108378261080c565b9050919050565b6108478161082c565b811461085257600080fd5b50565b6000813590506108648161083e565b92915050565b6000602082840312156108805761087f610807565b5b600061088e84828501610855565b91505092915050565b60008115159050919050565b6108ac81610897565b82525050565b60006020820190506108c760008301846108a3565b92915050565b600082825260208201905092915050565b7f63616e6e6f74206d6f6469667920616c6c6f77206c6973740000000000000000600082015250565b60006109146018836108cd565b915061091f826108de565b602082019050919050565b6000602082019050818103600083015261094381610907565b9050919050565b6109538161082c565b82525050565b600060208201905061096e600083018461094a565b92915050565b6000819050919050565b61098781610974565b811461099257600080fd5b50565b6000815190506109a48161097e565b92915050565b6000602082840312156109c0576109bf610807565b5b60006109ce84828501610995565b91505092915050565b7f63616e6e6f74207265766f6b65206f776e20726f6c6500000000000000000000600082015250565b6000610a0d6016836108cd565b9150610a18826109d7565b602082019050919050565b60006020820190508181036000830152610a3c81610a00565b905091905056fe6080604052348015600f57600080fd5b50603f80601d6000396000f3fe6080604052600080fdfea26469706673582212207d4b4c070c77654d2f96919d97077b901f3fa4e9510d8ed7d01405863db347f364736f6c634300081e0033a2646970667358221220bdf4f63fd052facd332f269a12bea50b742de223c13ee9a5f705f3199b1fd4e764736f6c634300081e0033", + Bin: "0x608060405234801561001057600080fd5b50604051610bee380380610bee833981810160405281019061003291906100dd565b80806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505061010a565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100aa8261007f565b9050919050565b6100ba8161009f565b81146100c557600080fd5b50565b6000815190506100d7816100b1565b92915050565b6000602082840312156100f3576100f261007a565b5b6000610101848285016100c8565b91505092915050565b610ad5806101196000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c806374a8f1031161005b57806374a8f103146100ff5780639015d3711461011b578063d0ebdbe71461014b578063f3ae24151461016757610088565b80630aaf70431461008d57806324d7806c146100a95780636cd5c39b146100d9578063704b6c02146100e3575b600080fd5b6100a760048036038101906100a2919061086a565b610197565b005b6100c360048036038101906100be919061086a565b6101fb565b6040516100d091906108b2565b60405180910390f35b6100e16102a6565b005b6100fd60048036038101906100f8919061086a565b6102d2565b005b6101196004803603810190610114919061086a565b610336565b005b6101356004803603810190610130919061086a565b61039a565b60405161014291906108b2565b60405180910390f35b6101656004803603810190610160919061086a565b610446565b005b610181600480360381019061017c919061086a565b6104aa565b60405161018e91906108b2565b60405180910390f35b6101a0336101fb565b806101b057506101af336104aa565b5b6101ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101e69061092a565b60405180910390fd5b6101f881610555565b50565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b81526004016102579190610959565b602060405180830381865afa158015610274573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061029891906109aa565b905060028114915050919050565b6040516102b2906107fb565b604051809103906000f0801580156102ce573d6000803e3d6000fd5b5050565b6102db336101fb565b806102eb57506102ea336104aa565b5b61032a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103219061092a565b60405180910390fd5b610333816105e3565b50565b61033f336101fb565b8061034f575061034e336104aa565b5b61038e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103859061092a565b60405180910390fd5b61039781610671565b50565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b81526004016103f69190610959565b602060405180830381865afa158015610413573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061043791906109aa565b90506000811415915050919050565b61044f336101fb565b8061045f575061045e336104aa565b5b61049e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104959061092a565b60405180910390fd5b6104a78161076d565b50565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b81526004016105069190610959565b602060405180830381865afa158015610523573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054791906109aa565b905060038114915050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630aaf7043826040518263ffffffff1660e01b81526004016105ae9190610959565b600060405180830381600087803b1580156105c857600080fd5b505af11580156105dc573d6000803e3d6000fd5b5050505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663704b6c02826040518263ffffffff1660e01b815260040161063c9190610959565b600060405180830381600087803b15801561065657600080fd5b505af115801561066a573d6000803e3d6000fd5b5050505050565b8073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16036106df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d690610a23565b60405180910390fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638c6bfb3b826040518263ffffffff1660e01b81526004016107389190610959565b600060405180830381600087803b15801561075257600080fd5b505af1158015610766573d6000803e3d6000fd5b5050505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0ebdbe7826040518263ffffffff1660e01b81526004016107c69190610959565b600060405180830381600087803b1580156107e057600080fd5b505af11580156107f4573d6000803e3d6000fd5b5050505050565b605c80610a4483390190565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006108378261080c565b9050919050565b6108478161082c565b811461085257600080fd5b50565b6000813590506108648161083e565b92915050565b6000602082840312156108805761087f610807565b5b600061088e84828501610855565b91505092915050565b60008115159050919050565b6108ac81610897565b82525050565b60006020820190506108c760008301846108a3565b92915050565b600082825260208201905092915050565b7f63616e6e6f74206d6f6469667920616c6c6f77206c6973740000000000000000600082015250565b60006109146018836108cd565b915061091f826108de565b602082019050919050565b6000602082019050818103600083015261094381610907565b9050919050565b6109538161082c565b82525050565b600060208201905061096e600083018461094a565b92915050565b6000819050919050565b61098781610974565b811461099257600080fd5b50565b6000815190506109a48161097e565b92915050565b6000602082840312156109c0576109bf610807565b5b60006109ce84828501610995565b91505092915050565b7f63616e6e6f74207265766f6b65206f776e20726f6c6500000000000000000000600082015250565b6000610a0d6016836108cd565b9150610a18826109d7565b602082019050919050565b60006020820190508181036000830152610a3c81610a00565b905091905056fe6080604052348015600f57600080fd5b50603f80601d6000396000f3fe6080604052600080fdfea264697066735822122055297e1e9d230363789a0572b7737f74ad8e041097aa4d40f2e8f4eb0e61e79564736f6c634300081e0033a26469706673582212204ce314f66cf3cc469215e50f938efffc0006fbcbf551f23680e7a1f99daa55dd64736f6c634300081e0033", } // AllowListTestABI is the input ABI used to generate the binding from. diff --git a/precompile/contracts/nativeminter/nativemintertest/INativeMinter.sol b/precompile/contracts/nativeminter/nativemintertest/INativeMinter.sol index 5c3aaf836f..376a872638 100644 --- a/precompile/contracts/nativeminter/nativemintertest/INativeMinter.sol +++ b/precompile/contracts/nativeminter/nativemintertest/INativeMinter.sol @@ -1,6 +1,6 @@ //SPDX-License-Identifier: MIT pragma solidity ^0.8.24; -import "precompile/allowlist/allowlisttest/solidity/IAllowList.sol"; +import "precompile/allowlist/allowlisttest/IAllowList.sol"; interface INativeMinter is IAllowList { event NativeCoinMinted(address indexed sender, address indexed recipient, uint256 amount); diff --git a/precompile/contracts/nativeminter/nativemintertest/gen_nativemintertest_binding.go b/precompile/contracts/nativeminter/nativemintertest/gen_nativemintertest_binding.go index 98676aeb43..5ca47ffad7 100644 --- a/precompile/contracts/nativeminter/nativemintertest/gen_nativemintertest_binding.go +++ b/precompile/contracts/nativeminter/nativemintertest/gen_nativemintertest_binding.go @@ -32,7 +32,7 @@ var ( // NativeMinterTestMetaData contains all meta data concerning the NativeMinterTest contract. var NativeMinterTestMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nativeMinterPrecompile\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mintNativeCoin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", - Bin: "0x608060405234801561001057600080fd5b50604051610355380380610355833981810160405281019061003291906100db565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610108565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100a88261007d565b9050919050565b6100b88161009d565b81146100c357600080fd5b50565b6000815190506100d5816100af565b92915050565b6000602082840312156100f1576100f0610078565b5b60006100ff848285016100c6565b91505092915050565b61023e806101176000396000f3fe6080604052600436106100225760003560e01c80634f5aaaba1461002e57610029565b3661002957005b600080fd5b34801561003a57600080fd5b5061005560048036038101906100509190610181565b610057565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634f5aaaba83836040518363ffffffff1660e01b81526004016100b29291906101df565b600060405180830381600087803b1580156100cc57600080fd5b505af11580156100e0573d6000803e3d6000fd5b505050505050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610118826100ed565b9050919050565b6101288161010d565b811461013357600080fd5b50565b6000813590506101458161011f565b92915050565b6000819050919050565b61015e8161014b565b811461016957600080fd5b50565b60008135905061017b81610155565b92915050565b60008060408385031215610198576101976100e8565b5b60006101a685828601610136565b92505060206101b78582860161016c565b9150509250929050565b6101ca8161010d565b82525050565b6101d98161014b565b82525050565b60006040820190506101f460008301856101c1565b61020160208301846101d0565b939250505056fea26469706673582212203bde89427787c32352347fa2c7c7a5261492c6a54e09d952c008accdbaf4c47764736f6c634300081e0033", + Bin: "0x608060405234801561001057600080fd5b50604051610355380380610355833981810160405281019061003291906100db565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610108565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100a88261007d565b9050919050565b6100b88161009d565b81146100c357600080fd5b50565b6000815190506100d5816100af565b92915050565b6000602082840312156100f1576100f0610078565b5b60006100ff848285016100c6565b91505092915050565b61023e806101176000396000f3fe6080604052600436106100225760003560e01c80634f5aaaba1461002e57610029565b3661002957005b600080fd5b34801561003a57600080fd5b5061005560048036038101906100509190610181565b610057565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634f5aaaba83836040518363ffffffff1660e01b81526004016100b29291906101df565b600060405180830381600087803b1580156100cc57600080fd5b505af11580156100e0573d6000803e3d6000fd5b505050505050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610118826100ed565b9050919050565b6101288161010d565b811461013357600080fd5b50565b6000813590506101458161011f565b92915050565b6000819050919050565b61015e8161014b565b811461016957600080fd5b50565b60008135905061017b81610155565b92915050565b60008060408385031215610198576101976100e8565b5b60006101a685828601610136565b92505060206101b78582860161016c565b9150509250929050565b6101ca8161010d565b82525050565b6101d98161014b565b82525050565b60006040820190506101f460008301856101c1565b61020160208301846101d0565b939250505056fea26469706673582212206e879e9d2b7c685853fbe0c2f9b58ba8143aa591e0de8ca323e44034842231e464736f6c634300081e0033", } // NativeMinterTestABI is the input ABI used to generate the binding from. From a92488338208ec59adcd640a22564d1c8a6dfbd9 Mon Sep 17 00:00:00 2001 From: Jonathan Oppenheimer Date: Mon, 24 Nov 2025 17:16:16 -0500 Subject: [PATCH 15/23] chore: lint --- precompile/contracts/testutils/allowlist_helpers.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/precompile/contracts/testutils/allowlist_helpers.go b/precompile/contracts/testutils/allowlist_helpers.go index 474e88c566..59cf52e3a9 100644 --- a/precompile/contracts/testutils/allowlist_helpers.go +++ b/precompile/contracts/testutils/allowlist_helpers.go @@ -6,9 +6,10 @@ import ( "github.com/ava-labs/libevm/common" "github.com/ava-labs/libevm/core/types" + "github.com/stretchr/testify/require" + "github.com/ava-labs/subnet-evm/accounts/abi/bind" "github.com/ava-labs/subnet-evm/precompile/allowlist" - "github.com/stretchr/testify/require" sim "github.com/ava-labs/subnet-evm/ethclient/simulated" ) From e33233f1cac6f8fa0d230a4245e754be9329d67f Mon Sep 17 00:00:00 2001 From: Jonathan Oppenheimer Date: Mon, 24 Nov 2025 17:20:42 -0500 Subject: [PATCH 16/23] chore: license header --- precompile/contracts/testutils/allowlist_helpers.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/precompile/contracts/testutils/allowlist_helpers.go b/precompile/contracts/testutils/allowlist_helpers.go index 59cf52e3a9..3a2a25f3a1 100644 --- a/precompile/contracts/testutils/allowlist_helpers.go +++ b/precompile/contracts/testutils/allowlist_helpers.go @@ -1,3 +1,6 @@ +// Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved. +// See the file LICENSE for licensing terms. + package testutils import ( From 7deeb4e3b544caa0e8ceafe8cd99e28ecead5843 Mon Sep 17 00:00:00 2001 From: Ceyhun Onur Date: Wed, 26 Nov 2025 14:25:26 +0300 Subject: [PATCH 17/23] restructure test folders --- .../{allowlisttest => }/allowlist_test.go | 5 +- .../{ => bindings}/AllowList.sol | 0 .../{ => bindings}/AllowListTest.sol | 0 .../{ => bindings}/IAllowList.sol | 0 .../allowlisttest/{ => bindings}/compile.go | 2 +- .../{ => bindings}/gen_allowlist_binding.go | 10 +- .../gen_allowlisttest_binding.go | 12 +- .../{allowlisttest => }/config_test.go | 7 +- .../config_test.go | 2 +- .../contract_test.go | 2 +- .../simulated_test.go | 112 +++++++++--------- .../{nativemintertest => }/config_test.go | 2 +- .../{nativemintertest => }/contract_test.go | 2 +- .../{ => bindings}/INativeMinter.sol | 0 .../{ => bindings}/NativeMinterTest.sol | 0 .../{ => bindings}/compile.go | 2 +- .../gen_inativeminter_binding.go | 12 +- .../gen_nativemintertest_binding.go | 6 +- .../{nativemintertest => }/simulated_test.go | 23 ++-- 19 files changed, 93 insertions(+), 106 deletions(-) rename precompile/allowlist/{allowlisttest => }/allowlist_test.go (91%) rename precompile/allowlist/allowlisttest/{ => bindings}/AllowList.sol (100%) rename precompile/allowlist/allowlisttest/{ => bindings}/AllowListTest.sol (100%) rename precompile/allowlist/allowlisttest/{ => bindings}/IAllowList.sol (100%) rename precompile/allowlist/allowlisttest/{ => bindings}/compile.go (98%) rename precompile/allowlist/allowlisttest/{ => bindings}/gen_allowlist_binding.go (99%) rename precompile/allowlist/allowlisttest/{ => bindings}/gen_allowlisttest_binding.go (99%) rename precompile/allowlist/{allowlisttest => }/config_test.go (69%) rename precompile/contracts/deployerallowlist/{deployerallowlisttest => }/config_test.go (98%) rename precompile/contracts/deployerallowlist/{deployerallowlisttest => }/contract_test.go (93%) rename precompile/contracts/deployerallowlist/{deployerallowlisttest => }/simulated_test.go (65%) rename precompile/contracts/nativeminter/{nativemintertest => }/config_test.go (99%) rename precompile/contracts/nativeminter/{nativemintertest => }/contract_test.go (99%) rename precompile/contracts/nativeminter/nativemintertest/{ => bindings}/INativeMinter.sol (100%) rename precompile/contracts/nativeminter/nativemintertest/{ => bindings}/NativeMinterTest.sol (100%) rename precompile/contracts/nativeminter/nativemintertest/{ => bindings}/compile.go (98%) rename precompile/contracts/nativeminter/nativemintertest/{ => bindings}/gen_inativeminter_binding.go (99%) rename precompile/contracts/nativeminter/nativemintertest/{ => bindings}/gen_nativemintertest_binding.go (99%) rename precompile/contracts/nativeminter/{nativemintertest => }/simulated_test.go (89%) diff --git a/precompile/allowlist/allowlisttest/allowlist_test.go b/precompile/allowlist/allowlist_test.go similarity index 91% rename from precompile/allowlist/allowlisttest/allowlist_test.go rename to precompile/allowlist/allowlist_test.go index 1caad6053b..0c7bd19950 100644 --- a/precompile/allowlist/allowlisttest/allowlist_test.go +++ b/precompile/allowlist/allowlist_test.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. -package allowlisttest +package allowlist_test import ( "testing" @@ -9,6 +9,7 @@ import ( "github.com/ava-labs/libevm/common" "github.com/ava-labs/subnet-evm/precompile/allowlist" + "github.com/ava-labs/subnet-evm/precompile/allowlist/allowlisttest" "github.com/ava-labs/subnet-evm/precompile/contract" "github.com/ava-labs/subnet-evm/precompile/modules" "github.com/ava-labs/subnet-evm/precompile/precompileconfig" @@ -63,5 +64,5 @@ func TestAllowListRun(t *testing.T) { Configurator: &dummyConfigurator{}, ConfigKey: "dummy", } - RunPrecompileWithAllowListTests(t, dummyModule, nil) + allowlisttest.RunPrecompileWithAllowListTests(t, dummyModule, nil) } diff --git a/precompile/allowlist/allowlisttest/AllowList.sol b/precompile/allowlist/allowlisttest/bindings/AllowList.sol similarity index 100% rename from precompile/allowlist/allowlisttest/AllowList.sol rename to precompile/allowlist/allowlisttest/bindings/AllowList.sol diff --git a/precompile/allowlist/allowlisttest/AllowListTest.sol b/precompile/allowlist/allowlisttest/bindings/AllowListTest.sol similarity index 100% rename from precompile/allowlist/allowlisttest/AllowListTest.sol rename to precompile/allowlist/allowlisttest/bindings/AllowListTest.sol diff --git a/precompile/allowlist/allowlisttest/IAllowList.sol b/precompile/allowlist/allowlisttest/bindings/IAllowList.sol similarity index 100% rename from precompile/allowlist/allowlisttest/IAllowList.sol rename to precompile/allowlist/allowlisttest/bindings/IAllowList.sol diff --git a/precompile/allowlist/allowlisttest/compile.go b/precompile/allowlist/allowlisttest/bindings/compile.go similarity index 98% rename from precompile/allowlist/allowlisttest/compile.go rename to precompile/allowlist/allowlisttest/bindings/compile.go index 20d3012ae3..51ea59a968 100644 --- a/precompile/allowlist/allowlisttest/compile.go +++ b/precompile/allowlist/allowlisttest/bindings/compile.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. -package allowlisttest +package bindings // Step 1: Compile Solidity contracts to generate ABI and bin files //go:generate solc-v0.8.30 -o artifacts --overwrite --abi --bin --base-path . precompile/=../../ --evm-version paris AllowListTest.sol diff --git a/precompile/allowlist/allowlisttest/gen_allowlist_binding.go b/precompile/allowlist/allowlisttest/bindings/gen_allowlist_binding.go similarity index 99% rename from precompile/allowlist/allowlisttest/gen_allowlist_binding.go rename to precompile/allowlist/allowlisttest/bindings/gen_allowlist_binding.go index 7b09e6358b..e8d1e60bbf 100644 --- a/precompile/allowlist/allowlisttest/gen_allowlist_binding.go +++ b/precompile/allowlist/allowlisttest/bindings/gen_allowlist_binding.go @@ -1,7 +1,7 @@ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. -package allowlisttest +package bindings import ( "errors" @@ -9,11 +9,11 @@ import ( "strings" ethereum "github.com/ava-labs/libevm" - "github.com/ava-labs/subnet-evm/accounts/abi" - "github.com/ava-labs/subnet-evm/accounts/abi/bind" "github.com/ava-labs/libevm/common" "github.com/ava-labs/libevm/core/types" "github.com/ava-labs/libevm/event" + "github.com/ava-labs/subnet-evm/accounts/abi" + "github.com/ava-labs/subnet-evm/accounts/abi/bind" ) // Reference imports to suppress errors if they are not otherwise used. @@ -186,7 +186,6 @@ func (_IAllowList *IAllowListTransactorRaw) Transact(opts *bind.TransactOpts, me 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 } @@ -194,7 +193,6 @@ func (_IAllowList *IAllowListCaller) ReadAllowList(opts *bind.CallOpts, addr com 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. @@ -375,7 +373,6 @@ type IAllowListRoleSet struct { // // 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) @@ -400,7 +397,6 @@ func (_IAllowList *IAllowListFilterer) FilterRoleSet(opts *bind.FilterOpts, role // // 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) diff --git a/precompile/allowlist/allowlisttest/gen_allowlisttest_binding.go b/precompile/allowlist/allowlisttest/bindings/gen_allowlisttest_binding.go similarity index 99% rename from precompile/allowlist/allowlisttest/gen_allowlisttest_binding.go rename to precompile/allowlist/allowlisttest/bindings/gen_allowlisttest_binding.go index 6857532b26..8938b0d7d2 100644 --- a/precompile/allowlist/allowlisttest/gen_allowlisttest_binding.go +++ b/precompile/allowlist/allowlisttest/bindings/gen_allowlisttest_binding.go @@ -1,7 +1,7 @@ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. -package allowlisttest +package bindings import ( "errors" @@ -9,11 +9,11 @@ import ( "strings" ethereum "github.com/ava-labs/libevm" - "github.com/ava-labs/subnet-evm/accounts/abi" - "github.com/ava-labs/subnet-evm/accounts/abi/bind" "github.com/ava-labs/libevm/common" "github.com/ava-labs/libevm/core/types" "github.com/ava-labs/libevm/event" + "github.com/ava-labs/subnet-evm/accounts/abi" + "github.com/ava-labs/subnet-evm/accounts/abi/bind" ) // Reference imports to suppress errors if they are not otherwise used. @@ -208,7 +208,6 @@ func (_AllowListTest *AllowListTestTransactorRaw) Transact(opts *bind.TransactOp func (_AllowListTest *AllowListTestCaller) IsAdmin(opts *bind.CallOpts, addr common.Address) (bool, error) { var out []interface{} err := _AllowListTest.contract.Call(opts, &out, "isAdmin", addr) - if err != nil { return *new(bool), err } @@ -216,7 +215,6 @@ func (_AllowListTest *AllowListTestCaller) IsAdmin(opts *bind.CallOpts, addr com out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err - } // IsAdmin is a free data retrieval call binding the contract method 0x24d7806c. @@ -239,7 +237,6 @@ func (_AllowListTest *AllowListTestCallerSession) IsAdmin(addr common.Address) ( func (_AllowListTest *AllowListTestCaller) IsEnabled(opts *bind.CallOpts, addr common.Address) (bool, error) { var out []interface{} err := _AllowListTest.contract.Call(opts, &out, "isEnabled", addr) - if err != nil { return *new(bool), err } @@ -247,7 +244,6 @@ func (_AllowListTest *AllowListTestCaller) IsEnabled(opts *bind.CallOpts, addr c out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err - } // IsEnabled is a free data retrieval call binding the contract method 0x9015d371. @@ -270,7 +266,6 @@ func (_AllowListTest *AllowListTestCallerSession) IsEnabled(addr common.Address) func (_AllowListTest *AllowListTestCaller) IsManager(opts *bind.CallOpts, addr common.Address) (bool, error) { var out []interface{} err := _AllowListTest.contract.Call(opts, &out, "isManager", addr) - if err != nil { return *new(bool), err } @@ -278,7 +273,6 @@ func (_AllowListTest *AllowListTestCaller) IsManager(opts *bind.CallOpts, addr c out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err - } // IsManager is a free data retrieval call binding the contract method 0xf3ae2415. diff --git a/precompile/allowlist/allowlisttest/config_test.go b/precompile/allowlist/config_test.go similarity index 69% rename from precompile/allowlist/allowlisttest/config_test.go rename to precompile/allowlist/config_test.go index 544ead9de1..29a057f9e8 100644 --- a/precompile/allowlist/allowlisttest/config_test.go +++ b/precompile/allowlist/config_test.go @@ -1,12 +1,13 @@ // Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. -package allowlisttest +package allowlist_test import ( "testing" "github.com/ava-labs/subnet-evm/precompile/allowlist" + "github.com/ava-labs/subnet-evm/precompile/allowlist/allowlisttest" "github.com/ava-labs/subnet-evm/precompile/modules" ) @@ -18,9 +19,9 @@ var testModule = modules.Module{ } func TestVerifyAllowlist(t *testing.T) { - RunPrecompileWithAllowListTests(t, testModule, nil) + allowlisttest.RunPrecompileWithAllowListTests(t, testModule, nil) } func TestEqualAllowList(t *testing.T) { - EqualPrecompileWithAllowListTests(t, testModule, nil) + allowlisttest.EqualPrecompileWithAllowListTests(t, testModule, nil) } diff --git a/precompile/contracts/deployerallowlist/deployerallowlisttest/config_test.go b/precompile/contracts/deployerallowlist/config_test.go similarity index 98% rename from precompile/contracts/deployerallowlist/deployerallowlisttest/config_test.go rename to precompile/contracts/deployerallowlist/config_test.go index 0bad959a4a..6dc731b904 100644 --- a/precompile/contracts/deployerallowlist/deployerallowlisttest/config_test.go +++ b/precompile/contracts/deployerallowlist/config_test.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. -package deployerallowlisttest +package deployerallowlist_test import ( "testing" diff --git a/precompile/contracts/deployerallowlist/deployerallowlisttest/contract_test.go b/precompile/contracts/deployerallowlist/contract_test.go similarity index 93% rename from precompile/contracts/deployerallowlist/deployerallowlisttest/contract_test.go rename to precompile/contracts/deployerallowlist/contract_test.go index cdbd234451..4807ede717 100644 --- a/precompile/contracts/deployerallowlist/deployerallowlisttest/contract_test.go +++ b/precompile/contracts/deployerallowlist/contract_test.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. -package deployerallowlisttest +package deployerallowlist_test import ( "testing" diff --git a/precompile/contracts/deployerallowlist/deployerallowlisttest/simulated_test.go b/precompile/contracts/deployerallowlist/simulated_test.go similarity index 65% rename from precompile/contracts/deployerallowlist/deployerallowlisttest/simulated_test.go rename to precompile/contracts/deployerallowlist/simulated_test.go index 77d323f737..3886145b1b 100644 --- a/precompile/contracts/deployerallowlist/deployerallowlisttest/simulated_test.go +++ b/precompile/contracts/deployerallowlist/simulated_test.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. -package deployerallowlisttest +package deployerallowlist_test import ( "math/big" @@ -19,7 +19,7 @@ import ( "github.com/ava-labs/subnet-evm/params/extras" "github.com/ava-labs/subnet-evm/plugin/evm/customtypes" "github.com/ava-labs/subnet-evm/precompile/allowlist" - "github.com/ava-labs/subnet-evm/precompile/allowlist/allowlisttest" + allowlistbindings "github.com/ava-labs/subnet-evm/precompile/allowlist/allowlisttest/bindings" "github.com/ava-labs/subnet-evm/precompile/contracts/deployerallowlist" "github.com/ava-labs/subnet-evm/precompile/contracts/testutils" "github.com/ava-labs/subnet-evm/utils" @@ -61,9 +61,9 @@ func newBackendWithDeployerAllowList(t *testing.T) *sim.Backend { // Helper functions to reduce test boilerplate -func deployAllowListTest(t *testing.T, b *sim.Backend, auth *bind.TransactOpts) (common.Address, *allowlisttest.AllowListTest) { +func deployallowlistbindings(t *testing.T, b *sim.Backend, auth *bind.TransactOpts) (common.Address, *allowlistbindings.AllowListTest) { t.Helper() - addr, tx, contract, err := allowlisttest.DeployAllowListTest(auth, b.Client(), deployerallowlist.ContractAddress) + addr, tx, contract, err := allowlistbindings.DeployAllowListTest(auth, b.Client(), deployerallowlist.ContractAddress) require.NoError(t, err) testutils.WaitReceiptSuccessful(t, b, tx) return addr, contract @@ -76,81 +76,81 @@ func TestDeployerAllowList(t *testing.T) { type testCase struct { name string - test func(t *testing.T, backend *sim.Backend, precompileIntf *allowlisttest.IAllowList) + test func(t *testing.T, backend *sim.Backend, precompileIntf *allowlistbindings.IAllowList) } testCases := []testCase{ { name: "should verify sender is admin", - test: func(t *testing.T, _ *sim.Backend, allowList *allowlisttest.IAllowList) { + test: func(t *testing.T, _ *sim.Backend, allowList *allowlistbindings.IAllowList) { testutils.VerifyRole(t, allowList, adminAddress, allowlist.AdminRole) }, }, { name: "should verify new address has no role", - test: func(t *testing.T, backend *sim.Backend, allowList *allowlisttest.IAllowList) { - allowListTestAddr, _ := deployAllowListTest(t, backend, admin) - testutils.VerifyRole(t, allowList, allowListTestAddr, allowlist.NoRole) + test: func(t *testing.T, backend *sim.Backend, allowList *allowlistbindings.IAllowList) { + allowlistbindingsAddr, _ := deployallowlistbindings(t, backend, admin) + testutils.VerifyRole(t, allowList, allowlistbindingsAddr, allowlist.NoRole) }, }, { name: "should verify contract correctly reports admin status", - test: func(t *testing.T, backend *sim.Backend, allowList *allowlisttest.IAllowList) { - allowListTestAddr, allowListTest := deployAllowListTest(t, backend, admin) + test: func(t *testing.T, backend *sim.Backend, allowList *allowlistbindings.IAllowList) { + allowlistbindingsAddr, allowlistbindings := deployallowlistbindings(t, backend, admin) - testutils.VerifyRole(t, allowList, allowListTestAddr, allowlist.NoRole) + testutils.VerifyRole(t, allowList, allowlistbindingsAddr, allowlist.NoRole) - isAdmin, err := allowListTest.IsAdmin(nil, allowListTestAddr) + isAdmin, err := allowlistbindings.IsAdmin(nil, allowlistbindingsAddr) require.NoError(t, err) require.False(t, isAdmin) - isAdmin, err = allowListTest.IsAdmin(nil, adminAddress) + isAdmin, err = allowlistbindings.IsAdmin(nil, adminAddress) require.NoError(t, err) require.True(t, isAdmin) }, }, { name: "should not let address with no role deploy contracts", - test: func(t *testing.T, backend *sim.Backend, allowList *allowlisttest.IAllowList) { + test: func(t *testing.T, backend *sim.Backend, allowList *allowlistbindings.IAllowList) { testutils.VerifyRole(t, allowList, unprivilegedAddress, allowlist.NoRole) - _, allowListTest := deployAllowListTest(t, backend, admin) + _, allowlistbindings := deployallowlistbindings(t, backend, admin) // Try to deploy via unprivileged user - should fail - _, err := allowListTest.DeployContract(unprivileged) + _, err := allowlistbindings.DeployContract(unprivileged) // The error returned is a JSON Error rather than the vm.ErrExecutionReverted error require.ErrorContains(t, err, vm.ErrExecutionReverted.Error()) }, }, { name: "should allow admin to add contract as admin via precompile", - test: func(t *testing.T, backend *sim.Backend, allowList *allowlisttest.IAllowList) { - allowListTestAddr, allowListTest := deployAllowListTest(t, backend, admin) + test: func(t *testing.T, backend *sim.Backend, allowList *allowlistbindings.IAllowList) { + allowlistbindingsAddr, allowlistbindings := deployallowlistbindings(t, backend, admin) - testutils.VerifyRole(t, allowList, allowListTestAddr, allowlist.NoRole) - testutils.SetAsAdmin(t, backend, allowList, admin, allowListTestAddr) - testutils.VerifyRole(t, allowList, allowListTestAddr, allowlist.AdminRole) + testutils.VerifyRole(t, allowList, allowlistbindingsAddr, allowlist.NoRole) + testutils.SetAsAdmin(t, backend, allowList, admin, allowlistbindingsAddr) + testutils.VerifyRole(t, allowList, allowlistbindingsAddr, allowlist.AdminRole) - isAdmin, err := allowListTest.IsAdmin(nil, allowListTestAddr) + isAdmin, err := allowlistbindings.IsAdmin(nil, allowlistbindingsAddr) require.NoError(t, err) require.True(t, isAdmin) }, }, { name: "should allow admin to add deployer via contract", - test: func(t *testing.T, backend *sim.Backend, allowList *allowlisttest.IAllowList) { - allowListTestAddr, allowListTest := deployAllowListTest(t, backend, admin) - otherContractAddr, _ := deployAllowListTest(t, backend, admin) + test: func(t *testing.T, backend *sim.Backend, allowList *allowlistbindings.IAllowList) { + allowlistbindingsAddr, allowlistbindings := deployallowlistbindings(t, backend, admin) + otherContractAddr, _ := deployallowlistbindings(t, backend, admin) - testutils.VerifyRole(t, allowList, allowListTestAddr, allowlist.NoRole) - testutils.SetAsAdmin(t, backend, allowList, admin, allowListTestAddr) - testutils.VerifyRole(t, allowList, allowListTestAddr, allowlist.AdminRole) + testutils.VerifyRole(t, allowList, allowlistbindingsAddr, allowlist.NoRole) + testutils.SetAsAdmin(t, backend, allowList, admin, allowlistbindingsAddr) + testutils.VerifyRole(t, allowList, allowlistbindingsAddr, allowlist.AdminRole) - tx, err := allowListTest.SetEnabled(admin, otherContractAddr) + tx, err := allowlistbindings.SetEnabled(admin, otherContractAddr) require.NoError(t, err) testutils.WaitReceipt(t, backend, tx) - isEnabled, err := allowListTest.IsEnabled(nil, otherContractAddr) + isEnabled, err := allowlistbindings.IsEnabled(nil, otherContractAddr) require.NoError(t, err) require.True(t, isEnabled) testutils.VerifyRole(t, allowList, otherContractAddr, allowlist.EnabledRole) @@ -158,17 +158,17 @@ func TestDeployerAllowList(t *testing.T) { }, { name: "should allow enabled address to deploy contracts", - test: func(t *testing.T, backend *sim.Backend, allowList *allowlisttest.IAllowList) { - allowListTestAddr, allowListTest := deployAllowListTest(t, backend, admin) - deployerContractAddr, deployerContract := deployAllowListTest(t, backend, admin) + test: func(t *testing.T, backend *sim.Backend, allowList *allowlistbindings.IAllowList) { + allowlistbindingsAddr, allowlistbindings := deployallowlistbindings(t, backend, admin) + deployerContractAddr, deployerContract := deployallowlistbindings(t, backend, admin) - testutils.SetAsAdmin(t, backend, allowList, admin, allowListTestAddr) + testutils.SetAsAdmin(t, backend, allowList, admin, allowlistbindingsAddr) - tx, err := allowListTest.SetEnabled(admin, deployerContractAddr) + tx, err := allowlistbindings.SetEnabled(admin, deployerContractAddr) require.NoError(t, err) testutils.WaitReceipt(t, backend, tx) - isEnabled, err := allowListTest.IsEnabled(nil, deployerContractAddr) + isEnabled, err := allowlistbindings.IsEnabled(nil, deployerContractAddr) require.NoError(t, err) require.True(t, isEnabled) @@ -179,21 +179,21 @@ func TestDeployerAllowList(t *testing.T) { }, { name: "should allow admin to revoke deployer", - test: func(t *testing.T, backend *sim.Backend, allowList *allowlisttest.IAllowList) { - allowListTestAddr, allowListTest := deployAllowListTest(t, backend, admin) - deployerContractAddr, _ := deployAllowListTest(t, backend, admin) + test: func(t *testing.T, backend *sim.Backend, allowList *allowlistbindings.IAllowList) { + allowlistbindingsAddr, allowlistbindings := deployallowlistbindings(t, backend, admin) + deployerContractAddr, _ := deployallowlistbindings(t, backend, admin) - testutils.SetAsAdmin(t, backend, allowList, admin, allowListTestAddr) + testutils.SetAsAdmin(t, backend, allowList, admin, allowlistbindingsAddr) - tx, err := allowListTest.SetEnabled(admin, deployerContractAddr) + tx, err := allowlistbindings.SetEnabled(admin, deployerContractAddr) require.NoError(t, err) testutils.WaitReceipt(t, backend, tx) - isEnabled, err := allowListTest.IsEnabled(nil, deployerContractAddr) + isEnabled, err := allowlistbindings.IsEnabled(nil, deployerContractAddr) require.NoError(t, err) require.True(t, isEnabled) - tx, err = allowListTest.Revoke(admin, deployerContractAddr) + tx, err = allowlistbindings.Revoke(admin, deployerContractAddr) require.NoError(t, err) testutils.WaitReceipt(t, backend, tx) @@ -207,7 +207,7 @@ func TestDeployerAllowList(t *testing.T) { backend := newBackendWithDeployerAllowList(t) defer backend.Close() - allowList, err := allowlisttest.NewIAllowList(deployerallowlist.ContractAddress, backend.Client()) + allowList, err := allowlistbindings.NewIAllowList(deployerallowlist.ContractAddress, backend.Client()) require.NoError(t, err) tc.test(t, backend, allowList) @@ -223,19 +223,19 @@ func TestIAllowList_Events(t *testing.T) { type testCase struct { name string - testRun func(*allowlisttest.IAllowList, *bind.TransactOpts, *sim.Backend, *testing.T, common.Address) - expectedEvents []allowlisttest.IAllowListRoleSet + testRun func(*allowlistbindings.IAllowList, *bind.TransactOpts, *sim.Backend, *testing.T, common.Address) + expectedEvents []allowlistbindings.IAllowListRoleSet } testCases := []testCase{ { name: "should emit event after set admin", - testRun: func(allowList *allowlisttest.IAllowList, auth *bind.TransactOpts, backend *sim.Backend, t *testing.T, addr common.Address) { + testRun: func(allowList *allowlistbindings.IAllowList, auth *bind.TransactOpts, backend *sim.Backend, t *testing.T, addr common.Address) { tx, err := allowList.SetAdmin(auth, addr) require.NoError(t, err) testutils.WaitReceipt(t, backend, tx) }, - expectedEvents: []allowlisttest.IAllowListRoleSet{ + expectedEvents: []allowlistbindings.IAllowListRoleSet{ { Role: allowlist.AdminRole.Big(), Account: testAddress, @@ -246,12 +246,12 @@ func TestIAllowList_Events(t *testing.T) { }, { name: "should emit event after set manager", - testRun: func(allowList *allowlisttest.IAllowList, auth *bind.TransactOpts, backend *sim.Backend, t *testing.T, addr common.Address) { + testRun: func(allowList *allowlistbindings.IAllowList, auth *bind.TransactOpts, backend *sim.Backend, t *testing.T, addr common.Address) { tx, err := allowList.SetManager(auth, addr) require.NoError(t, err) testutils.WaitReceipt(t, backend, tx) }, - expectedEvents: []allowlisttest.IAllowListRoleSet{ + expectedEvents: []allowlistbindings.IAllowListRoleSet{ { Role: allowlist.ManagerRole.Big(), Account: testAddress, @@ -262,12 +262,12 @@ func TestIAllowList_Events(t *testing.T) { }, { name: "should emit event after set enabled", - testRun: func(allowList *allowlisttest.IAllowList, auth *bind.TransactOpts, backend *sim.Backend, t *testing.T, addr common.Address) { + testRun: func(allowList *allowlistbindings.IAllowList, auth *bind.TransactOpts, backend *sim.Backend, t *testing.T, addr common.Address) { tx, err := allowList.SetEnabled(auth, addr) require.NoError(t, err) testutils.WaitReceipt(t, backend, tx) }, - expectedEvents: []allowlisttest.IAllowListRoleSet{ + expectedEvents: []allowlistbindings.IAllowListRoleSet{ { Role: allowlist.EnabledRole.Big(), Account: testAddress, @@ -278,7 +278,7 @@ func TestIAllowList_Events(t *testing.T) { }, { name: "should emit event after set none", - testRun: func(allowList *allowlisttest.IAllowList, auth *bind.TransactOpts, backend *sim.Backend, t *testing.T, addr common.Address) { + testRun: func(allowList *allowlistbindings.IAllowList, auth *bind.TransactOpts, backend *sim.Backend, t *testing.T, addr common.Address) { // First set the address to Enabled so we can test setting it to None tx, err := allowList.SetEnabled(auth, addr) require.NoError(t, err) @@ -288,7 +288,7 @@ func TestIAllowList_Events(t *testing.T) { require.NoError(t, err) testutils.WaitReceipt(t, backend, tx) }, - expectedEvents: []allowlisttest.IAllowListRoleSet{ + expectedEvents: []allowlistbindings.IAllowListRoleSet{ { Role: allowlist.EnabledRole.Big(), Account: testAddress, @@ -312,7 +312,7 @@ func TestIAllowList_Events(t *testing.T) { backend := newBackendWithDeployerAllowList(t) defer backend.Close() - allowList, err := allowlisttest.NewIAllowList(deployerallowlist.ContractAddress, backend.Client()) + allowList, err := allowlistbindings.NewIAllowList(deployerallowlist.ContractAddress, backend.Client()) require.NoError(err) tc.testRun(allowList, admin, backend, t, testAddress) diff --git a/precompile/contracts/nativeminter/nativemintertest/config_test.go b/precompile/contracts/nativeminter/config_test.go similarity index 99% rename from precompile/contracts/nativeminter/nativemintertest/config_test.go rename to precompile/contracts/nativeminter/config_test.go index 322d1dd814..7472585c04 100644 --- a/precompile/contracts/nativeminter/nativemintertest/config_test.go +++ b/precompile/contracts/nativeminter/config_test.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. -package nativemintertest +package nativeminter_test import ( "testing" diff --git a/precompile/contracts/nativeminter/nativemintertest/contract_test.go b/precompile/contracts/nativeminter/contract_test.go similarity index 99% rename from precompile/contracts/nativeminter/nativemintertest/contract_test.go rename to precompile/contracts/nativeminter/contract_test.go index 074eb273f9..ee731e8612 100644 --- a/precompile/contracts/nativeminter/nativemintertest/contract_test.go +++ b/precompile/contracts/nativeminter/contract_test.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. -package nativemintertest +package nativeminter_test import ( "math/big" diff --git a/precompile/contracts/nativeminter/nativemintertest/INativeMinter.sol b/precompile/contracts/nativeminter/nativemintertest/bindings/INativeMinter.sol similarity index 100% rename from precompile/contracts/nativeminter/nativemintertest/INativeMinter.sol rename to precompile/contracts/nativeminter/nativemintertest/bindings/INativeMinter.sol diff --git a/precompile/contracts/nativeminter/nativemintertest/NativeMinterTest.sol b/precompile/contracts/nativeminter/nativemintertest/bindings/NativeMinterTest.sol similarity index 100% rename from precompile/contracts/nativeminter/nativemintertest/NativeMinterTest.sol rename to precompile/contracts/nativeminter/nativemintertest/bindings/NativeMinterTest.sol diff --git a/precompile/contracts/nativeminter/nativemintertest/compile.go b/precompile/contracts/nativeminter/nativemintertest/bindings/compile.go similarity index 98% rename from precompile/contracts/nativeminter/nativemintertest/compile.go rename to precompile/contracts/nativeminter/nativemintertest/bindings/compile.go index 2276dc318d..6a713f9480 100644 --- a/precompile/contracts/nativeminter/nativemintertest/compile.go +++ b/precompile/contracts/nativeminter/nativemintertest/bindings/compile.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. -package nativemintertest +package bindings // Step 1: Compile Solidity contracts to generate ABI and bin files //go:generate solc-v0.8.30 -o artifacts --overwrite --abi --bin --base-path ../../../.. precompile/=precompile/ --evm-version paris NativeMinterTest.sol diff --git a/precompile/contracts/nativeminter/nativemintertest/gen_inativeminter_binding.go b/precompile/contracts/nativeminter/nativemintertest/bindings/gen_inativeminter_binding.go similarity index 99% rename from precompile/contracts/nativeminter/nativemintertest/gen_inativeminter_binding.go rename to precompile/contracts/nativeminter/nativemintertest/bindings/gen_inativeminter_binding.go index 85cfc1386e..025acca2fd 100644 --- a/precompile/contracts/nativeminter/nativemintertest/gen_inativeminter_binding.go +++ b/precompile/contracts/nativeminter/nativemintertest/bindings/gen_inativeminter_binding.go @@ -1,7 +1,7 @@ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. -package nativemintertest +package bindings import ( "errors" @@ -9,11 +9,11 @@ import ( "strings" ethereum "github.com/ava-labs/libevm" - "github.com/ava-labs/subnet-evm/accounts/abi" - "github.com/ava-labs/subnet-evm/accounts/abi/bind" "github.com/ava-labs/libevm/common" "github.com/ava-labs/libevm/core/types" "github.com/ava-labs/libevm/event" + "github.com/ava-labs/subnet-evm/accounts/abi" + "github.com/ava-labs/subnet-evm/accounts/abi/bind" ) // Reference imports to suppress errors if they are not otherwise used. @@ -186,7 +186,6 @@ func (_INativeMinter *INativeMinterTransactorRaw) Transact(opts *bind.TransactOp 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 } @@ -194,7 +193,6 @@ func (_INativeMinter *INativeMinterCaller) ReadAllowList(opts *bind.CallOpts, ad 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. @@ -395,7 +393,6 @@ type INativeMinterNativeCoinMinted struct { // // 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) @@ -416,7 +413,6 @@ func (_INativeMinter *INativeMinterFilterer) FilterNativeCoinMinted(opts *bind.F // // 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) @@ -550,7 +546,6 @@ type INativeMinterRoleSet struct { // // 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) @@ -575,7 +570,6 @@ func (_INativeMinter *INativeMinterFilterer) FilterRoleSet(opts *bind.FilterOpts // // 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) diff --git a/precompile/contracts/nativeminter/nativemintertest/gen_nativemintertest_binding.go b/precompile/contracts/nativeminter/nativemintertest/bindings/gen_nativemintertest_binding.go similarity index 99% rename from precompile/contracts/nativeminter/nativemintertest/gen_nativemintertest_binding.go rename to precompile/contracts/nativeminter/nativemintertest/bindings/gen_nativemintertest_binding.go index 5ca47ffad7..91a9f9b669 100644 --- a/precompile/contracts/nativeminter/nativemintertest/gen_nativemintertest_binding.go +++ b/precompile/contracts/nativeminter/nativemintertest/bindings/gen_nativemintertest_binding.go @@ -1,7 +1,7 @@ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. -package nativemintertest +package bindings import ( "errors" @@ -9,11 +9,11 @@ import ( "strings" ethereum "github.com/ava-labs/libevm" - "github.com/ava-labs/subnet-evm/accounts/abi" - "github.com/ava-labs/subnet-evm/accounts/abi/bind" "github.com/ava-labs/libevm/common" "github.com/ava-labs/libevm/core/types" "github.com/ava-labs/libevm/event" + "github.com/ava-labs/subnet-evm/accounts/abi" + "github.com/ava-labs/subnet-evm/accounts/abi/bind" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/precompile/contracts/nativeminter/nativemintertest/simulated_test.go b/precompile/contracts/nativeminter/simulated_test.go similarity index 89% rename from precompile/contracts/nativeminter/nativemintertest/simulated_test.go rename to precompile/contracts/nativeminter/simulated_test.go index a7e928c73d..bc4f89e3e2 100644 --- a/precompile/contracts/nativeminter/nativemintertest/simulated_test.go +++ b/precompile/contracts/nativeminter/simulated_test.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. -package nativemintertest +package nativeminter_test import ( "math/big" @@ -20,6 +20,7 @@ import ( "github.com/ava-labs/subnet-evm/plugin/evm/customtypes" "github.com/ava-labs/subnet-evm/precompile/allowlist" "github.com/ava-labs/subnet-evm/precompile/contracts/nativeminter" + nativeminterbindings "github.com/ava-labs/subnet-evm/precompile/contracts/nativeminter/nativemintertest/bindings" "github.com/ava-labs/subnet-evm/precompile/contracts/testutils" "github.com/ava-labs/subnet-evm/utils" @@ -61,9 +62,9 @@ func newBackendWithNativeMinter(t *testing.T) *sim.Backend { // Helper functions to reduce test boilerplate -func deployNativeMinterTest(t *testing.T, b *sim.Backend, auth *bind.TransactOpts) (common.Address, *NativeMinterTest) { +func deployNativeMinterTest(t *testing.T, b *sim.Backend, auth *bind.TransactOpts) (common.Address, *nativeminterbindings.NativeMinterTest) { t.Helper() - addr, tx, contract, err := DeployNativeMinterTest(auth, b.Client(), nativeminter.ContractAddress) + addr, tx, contract, err := nativeminterbindings.DeployNativeMinterTest(auth, b.Client(), nativeminter.ContractAddress) require.NoError(t, err) testutils.WaitReceiptSuccessful(t, b, tx) return addr, contract @@ -78,13 +79,13 @@ func TestNativeMinter(t *testing.T) { type testCase struct { name string - test func(t *testing.T, backend *sim.Backend, nativeMinterIntf *INativeMinter) + test func(t *testing.T, backend *sim.Backend, nativeMinterIntf *nativeminterbindings.INativeMinter) } testCases := []testCase{ { name: "admin can mint directly", - test: func(t *testing.T, backend *sim.Backend, nativeMinter *INativeMinter) { + test: func(t *testing.T, backend *sim.Backend, nativeMinter *nativeminterbindings.INativeMinter) { testAddr := common.HexToAddress("0x1234567890123456789012345678901234567890") initialBalance, err := backend.Client().BalanceAt(t.Context(), testAddr, nil) @@ -104,7 +105,7 @@ func TestNativeMinter(t *testing.T) { }, { name: "unprivileged user cannot mint directly", - test: func(t *testing.T, _ *sim.Backend, nativeMinter *INativeMinter) { + test: func(t *testing.T, _ *sim.Backend, nativeMinter *nativeminterbindings.INativeMinter) { testAddr := common.HexToAddress("0x1234567890123456789012345678901234567890") // Unprivileged user tries to mint - should fail @@ -114,7 +115,7 @@ func TestNativeMinter(t *testing.T) { }, { name: "contract without permission cannot mint", - test: func(t *testing.T, backend *sim.Backend, nativeMinter *INativeMinter) { + test: func(t *testing.T, backend *sim.Backend, nativeMinter *nativeminterbindings.INativeMinter) { testContractAddr, testContract := deployNativeMinterTest(t, backend, admin) testutils.VerifyRole(t, nativeMinter, testContractAddr, allowlist.NoRole) @@ -128,7 +129,7 @@ func TestNativeMinter(t *testing.T) { }, { name: "contract can be added to allow list", - test: func(t *testing.T, backend *sim.Backend, nativeMinter *INativeMinter) { + test: func(t *testing.T, backend *sim.Backend, nativeMinter *nativeminterbindings.INativeMinter) { testContractAddr, _ := deployNativeMinterTest(t, backend, admin) testutils.VerifyRole(t, nativeMinter, testContractAddr, allowlist.NoRole) @@ -140,7 +141,7 @@ func TestNativeMinter(t *testing.T) { }, { name: "enabled contract can mint", - test: func(t *testing.T, backend *sim.Backend, nativeMinter *INativeMinter) { + test: func(t *testing.T, backend *sim.Backend, nativeMinter *nativeminterbindings.INativeMinter) { testContractAddr, testContract := deployNativeMinterTest(t, backend, admin) testAddr := common.HexToAddress("0x1234567890123456789012345678901234567890") @@ -168,7 +169,7 @@ func TestNativeMinter(t *testing.T) { backend := newBackendWithNativeMinter(t) defer backend.Close() - nativeMinter, err := NewINativeMinter(nativeminter.ContractAddress, backend.Client()) + nativeMinter, err := nativeminterbindings.NewINativeMinter(nativeminter.ContractAddress, backend.Client()) require.NoError(t, err) tc.test(t, backend, nativeMinter) @@ -185,7 +186,7 @@ func TestINativeMinter_Events(t *testing.T) { backend := newBackendWithNativeMinter(t) defer backend.Close() - nativeMinter, err := NewINativeMinter(nativeminter.ContractAddress, backend.Client()) + nativeMinter, err := nativeminterbindings.NewINativeMinter(nativeminter.ContractAddress, backend.Client()) require.NoError(t, err) t.Run("should emit NativeCoinMinted event", func(t *testing.T) { From 89b2cde711f332ba67a4ac4b634c3221ed96d635 Mon Sep 17 00:00:00 2001 From: Ceyhun Onur Date: Wed, 26 Nov 2025 14:39:40 +0300 Subject: [PATCH 18/23] fix linter --- precompile/contracts/deployerallowlist/simulated_test.go | 2 +- precompile/contracts/nativeminter/simulated_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/precompile/contracts/deployerallowlist/simulated_test.go b/precompile/contracts/deployerallowlist/simulated_test.go index 3886145b1b..10cca45dfb 100644 --- a/precompile/contracts/deployerallowlist/simulated_test.go +++ b/precompile/contracts/deployerallowlist/simulated_test.go @@ -19,12 +19,12 @@ import ( "github.com/ava-labs/subnet-evm/params/extras" "github.com/ava-labs/subnet-evm/plugin/evm/customtypes" "github.com/ava-labs/subnet-evm/precompile/allowlist" - allowlistbindings "github.com/ava-labs/subnet-evm/precompile/allowlist/allowlisttest/bindings" "github.com/ava-labs/subnet-evm/precompile/contracts/deployerallowlist" "github.com/ava-labs/subnet-evm/precompile/contracts/testutils" "github.com/ava-labs/subnet-evm/utils" sim "github.com/ava-labs/subnet-evm/ethclient/simulated" + allowlistbindings "github.com/ava-labs/subnet-evm/precompile/allowlist/allowlisttest/bindings" ) var ( diff --git a/precompile/contracts/nativeminter/simulated_test.go b/precompile/contracts/nativeminter/simulated_test.go index bc4f89e3e2..e915319853 100644 --- a/precompile/contracts/nativeminter/simulated_test.go +++ b/precompile/contracts/nativeminter/simulated_test.go @@ -20,11 +20,11 @@ import ( "github.com/ava-labs/subnet-evm/plugin/evm/customtypes" "github.com/ava-labs/subnet-evm/precompile/allowlist" "github.com/ava-labs/subnet-evm/precompile/contracts/nativeminter" - nativeminterbindings "github.com/ava-labs/subnet-evm/precompile/contracts/nativeminter/nativemintertest/bindings" "github.com/ava-labs/subnet-evm/precompile/contracts/testutils" "github.com/ava-labs/subnet-evm/utils" sim "github.com/ava-labs/subnet-evm/ethclient/simulated" + nativeminterbindings "github.com/ava-labs/subnet-evm/precompile/contracts/nativeminter/nativemintertest/bindings" ) var ( From 2bb0ca64d69df8fc4ccfb0184b8ee33cbc29ce0e Mon Sep 17 00:00:00 2001 From: Ceyhun Onur Date: Wed, 26 Nov 2025 15:01:30 +0300 Subject: [PATCH 19/23] fix compiles --- precompile/allowlist/allowlisttest/bindings/compile.go | 4 ++-- .../nativemintertest/bindings/INativeMinter.sol | 2 +- .../nativeminter/nativemintertest/bindings/compile.go | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/precompile/allowlist/allowlisttest/bindings/compile.go b/precompile/allowlist/allowlisttest/bindings/compile.go index 51ea59a968..6aa0654b6c 100644 --- a/precompile/allowlist/allowlisttest/bindings/compile.go +++ b/precompile/allowlist/allowlisttest/bindings/compile.go @@ -6,7 +6,7 @@ package bindings // Step 1: Compile Solidity contracts to generate ABI and bin files //go:generate solc-v0.8.30 -o artifacts --overwrite --abi --bin --base-path . precompile/=../../ --evm-version paris AllowListTest.sol // Step 2: Generate Go bindings from the compiled artifacts -//go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg allowlisttest --type IAllowList --abi artifacts/IAllowList.abi --bin artifacts/IAllowList.bin --out gen_allowlist_binding.go -//go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg allowlisttest --type AllowListTest --abi artifacts/AllowListTest.abi --bin artifacts/AllowListTest.bin --out gen_allowlisttest_binding.go +//go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg bindings --type IAllowList --abi artifacts/IAllowList.abi --bin artifacts/IAllowList.bin --out gen_allowlist_binding.go +//go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg bindings --type AllowListTest --abi artifacts/AllowListTest.abi --bin artifacts/AllowListTest.bin --out gen_allowlisttest_binding.go // Step 3: Replace import paths in generated binding to use subnet-evm instead of libevm //go:generate sh -c "sed -i.bak -e 's|github.com/ava-labs/libevm/accounts/abi|github.com/ava-labs/subnet-evm/accounts/abi|g' -e 's|github.com/ava-labs/libevm/accounts/abi/bind|github.com/ava-labs/subnet-evm/accounts/abi/bind|g' gen_allowlist_binding.go gen_allowlisttest_binding.go && rm -f gen_allowlist_binding.go.bak gen_allowlisttest_binding.go.bak" diff --git a/precompile/contracts/nativeminter/nativemintertest/bindings/INativeMinter.sol b/precompile/contracts/nativeminter/nativemintertest/bindings/INativeMinter.sol index 376a872638..7fd63a55c9 100644 --- a/precompile/contracts/nativeminter/nativemintertest/bindings/INativeMinter.sol +++ b/precompile/contracts/nativeminter/nativemintertest/bindings/INativeMinter.sol @@ -1,6 +1,6 @@ //SPDX-License-Identifier: MIT pragma solidity ^0.8.24; -import "precompile/allowlist/allowlisttest/IAllowList.sol"; +import "precompile/allowlist/allowlisttest/bindings/IAllowList.sol"; interface INativeMinter is IAllowList { event NativeCoinMinted(address indexed sender, address indexed recipient, uint256 amount); diff --git a/precompile/contracts/nativeminter/nativemintertest/bindings/compile.go b/precompile/contracts/nativeminter/nativemintertest/bindings/compile.go index 6a713f9480..a6b791fcc8 100644 --- a/precompile/contracts/nativeminter/nativemintertest/bindings/compile.go +++ b/precompile/contracts/nativeminter/nativemintertest/bindings/compile.go @@ -4,9 +4,9 @@ package bindings // Step 1: Compile Solidity contracts to generate ABI and bin files -//go:generate solc-v0.8.30 -o artifacts --overwrite --abi --bin --base-path ../../../.. precompile/=precompile/ --evm-version paris NativeMinterTest.sol +//go:generate solc-v0.8.30 -o artifacts --overwrite --abi --bin --base-path ../../../../.. precompile/=precompile/ --evm-version paris NativeMinterTest.sol // Step 2: Generate Go bindings from the compiled artifacts -//go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg nativemintertest --type INativeMinter --abi artifacts/INativeMinter.abi --bin artifacts/INativeMinter.bin --out gen_inativeminter_binding.go -//go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg nativemintertest --type NativeMinterTest --abi artifacts/NativeMinterTest.abi --bin artifacts/NativeMinterTest.bin --out gen_nativemintertest_binding.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 gen_inativeminter_binding.go +//go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg bindings --type NativeMinterTest --abi artifacts/NativeMinterTest.abi --bin artifacts/NativeMinterTest.bin --out gen_nativemintertest_binding.go // Step 3: Replace import paths in generated binding to use subnet-evm instead of libevm //go:generate sh -c "sed -i.bak -e 's|github.com/ava-labs/libevm/accounts/abi|github.com/ava-labs/subnet-evm/accounts/abi|g' -e 's|github.com/ava-labs/libevm/accounts/abi/bind|github.com/ava-labs/subnet-evm/accounts/abi/bind|g' gen_inativeminter_binding.go gen_nativemintertest_binding.go && rm -f gen_inativeminter_binding.go.bak gen_nativemintertest_binding.go.bak" From 83fa482ba77b3a04d2bb75ebae6d2e3b47d75e52 Mon Sep 17 00:00:00 2001 From: Ceyhun Onur Date: Wed, 26 Nov 2025 15:08:41 +0300 Subject: [PATCH 20/23] regen bindings --- .../allowlisttest/bindings/gen_allowlist_binding.go | 8 ++++++-- .../bindings/gen_allowlisttest_binding.go | 10 ++++++++-- .../bindings/gen_inativeminter_binding.go | 10 ++++++++-- .../bindings/gen_nativemintertest_binding.go | 6 +++--- 4 files changed, 25 insertions(+), 9 deletions(-) diff --git a/precompile/allowlist/allowlisttest/bindings/gen_allowlist_binding.go b/precompile/allowlist/allowlisttest/bindings/gen_allowlist_binding.go index e8d1e60bbf..7f318a0c07 100644 --- a/precompile/allowlist/allowlisttest/bindings/gen_allowlist_binding.go +++ b/precompile/allowlist/allowlisttest/bindings/gen_allowlist_binding.go @@ -9,11 +9,11 @@ import ( "strings" ethereum "github.com/ava-labs/libevm" + "github.com/ava-labs/subnet-evm/accounts/abi" + "github.com/ava-labs/subnet-evm/accounts/abi/bind" "github.com/ava-labs/libevm/common" "github.com/ava-labs/libevm/core/types" "github.com/ava-labs/libevm/event" - "github.com/ava-labs/subnet-evm/accounts/abi" - "github.com/ava-labs/subnet-evm/accounts/abi/bind" ) // Reference imports to suppress errors if they are not otherwise used. @@ -186,6 +186,7 @@ func (_IAllowList *IAllowListTransactorRaw) Transact(opts *bind.TransactOpts, me 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 } @@ -193,6 +194,7 @@ func (_IAllowList *IAllowListCaller) ReadAllowList(opts *bind.CallOpts, addr com 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. @@ -373,6 +375,7 @@ type IAllowListRoleSet struct { // // 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) @@ -397,6 +400,7 @@ func (_IAllowList *IAllowListFilterer) FilterRoleSet(opts *bind.FilterOpts, role // // 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) diff --git a/precompile/allowlist/allowlisttest/bindings/gen_allowlisttest_binding.go b/precompile/allowlist/allowlisttest/bindings/gen_allowlisttest_binding.go index 8938b0d7d2..d4a169501e 100644 --- a/precompile/allowlist/allowlisttest/bindings/gen_allowlisttest_binding.go +++ b/precompile/allowlist/allowlisttest/bindings/gen_allowlisttest_binding.go @@ -9,11 +9,11 @@ import ( "strings" ethereum "github.com/ava-labs/libevm" + "github.com/ava-labs/subnet-evm/accounts/abi" + "github.com/ava-labs/subnet-evm/accounts/abi/bind" "github.com/ava-labs/libevm/common" "github.com/ava-labs/libevm/core/types" "github.com/ava-labs/libevm/event" - "github.com/ava-labs/subnet-evm/accounts/abi" - "github.com/ava-labs/subnet-evm/accounts/abi/bind" ) // Reference imports to suppress errors if they are not otherwise used. @@ -208,6 +208,7 @@ func (_AllowListTest *AllowListTestTransactorRaw) Transact(opts *bind.TransactOp func (_AllowListTest *AllowListTestCaller) IsAdmin(opts *bind.CallOpts, addr common.Address) (bool, error) { var out []interface{} err := _AllowListTest.contract.Call(opts, &out, "isAdmin", addr) + if err != nil { return *new(bool), err } @@ -215,6 +216,7 @@ func (_AllowListTest *AllowListTestCaller) IsAdmin(opts *bind.CallOpts, addr com out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err + } // IsAdmin is a free data retrieval call binding the contract method 0x24d7806c. @@ -237,6 +239,7 @@ func (_AllowListTest *AllowListTestCallerSession) IsAdmin(addr common.Address) ( func (_AllowListTest *AllowListTestCaller) IsEnabled(opts *bind.CallOpts, addr common.Address) (bool, error) { var out []interface{} err := _AllowListTest.contract.Call(opts, &out, "isEnabled", addr) + if err != nil { return *new(bool), err } @@ -244,6 +247,7 @@ func (_AllowListTest *AllowListTestCaller) IsEnabled(opts *bind.CallOpts, addr c out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err + } // IsEnabled is a free data retrieval call binding the contract method 0x9015d371. @@ -266,6 +270,7 @@ func (_AllowListTest *AllowListTestCallerSession) IsEnabled(addr common.Address) func (_AllowListTest *AllowListTestCaller) IsManager(opts *bind.CallOpts, addr common.Address) (bool, error) { var out []interface{} err := _AllowListTest.contract.Call(opts, &out, "isManager", addr) + if err != nil { return *new(bool), err } @@ -273,6 +278,7 @@ func (_AllowListTest *AllowListTestCaller) IsManager(opts *bind.CallOpts, addr c out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err + } // IsManager is a free data retrieval call binding the contract method 0xf3ae2415. diff --git a/precompile/contracts/nativeminter/nativemintertest/bindings/gen_inativeminter_binding.go b/precompile/contracts/nativeminter/nativemintertest/bindings/gen_inativeminter_binding.go index 025acca2fd..6a1b88a40e 100644 --- a/precompile/contracts/nativeminter/nativemintertest/bindings/gen_inativeminter_binding.go +++ b/precompile/contracts/nativeminter/nativemintertest/bindings/gen_inativeminter_binding.go @@ -9,11 +9,11 @@ import ( "strings" ethereum "github.com/ava-labs/libevm" + "github.com/ava-labs/subnet-evm/accounts/abi" + "github.com/ava-labs/subnet-evm/accounts/abi/bind" "github.com/ava-labs/libevm/common" "github.com/ava-labs/libevm/core/types" "github.com/ava-labs/libevm/event" - "github.com/ava-labs/subnet-evm/accounts/abi" - "github.com/ava-labs/subnet-evm/accounts/abi/bind" ) // Reference imports to suppress errors if they are not otherwise used. @@ -186,6 +186,7 @@ func (_INativeMinter *INativeMinterTransactorRaw) Transact(opts *bind.TransactOp 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 } @@ -193,6 +194,7 @@ func (_INativeMinter *INativeMinterCaller) ReadAllowList(opts *bind.CallOpts, ad 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. @@ -393,6 +395,7 @@ type INativeMinterNativeCoinMinted struct { // // 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) @@ -413,6 +416,7 @@ func (_INativeMinter *INativeMinterFilterer) FilterNativeCoinMinted(opts *bind.F // // 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) @@ -546,6 +550,7 @@ type INativeMinterRoleSet struct { // // 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) @@ -570,6 +575,7 @@ func (_INativeMinter *INativeMinterFilterer) FilterRoleSet(opts *bind.FilterOpts // // 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) diff --git a/precompile/contracts/nativeminter/nativemintertest/bindings/gen_nativemintertest_binding.go b/precompile/contracts/nativeminter/nativemintertest/bindings/gen_nativemintertest_binding.go index 91a9f9b669..6d68d19bbd 100644 --- a/precompile/contracts/nativeminter/nativemintertest/bindings/gen_nativemintertest_binding.go +++ b/precompile/contracts/nativeminter/nativemintertest/bindings/gen_nativemintertest_binding.go @@ -9,11 +9,11 @@ import ( "strings" ethereum "github.com/ava-labs/libevm" + "github.com/ava-labs/subnet-evm/accounts/abi" + "github.com/ava-labs/subnet-evm/accounts/abi/bind" "github.com/ava-labs/libevm/common" "github.com/ava-labs/libevm/core/types" "github.com/ava-labs/libevm/event" - "github.com/ava-labs/subnet-evm/accounts/abi" - "github.com/ava-labs/subnet-evm/accounts/abi/bind" ) // Reference imports to suppress errors if they are not otherwise used. @@ -32,7 +32,7 @@ var ( // NativeMinterTestMetaData contains all meta data concerning the NativeMinterTest contract. var NativeMinterTestMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nativeMinterPrecompile\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mintNativeCoin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", - Bin: "0x608060405234801561001057600080fd5b50604051610355380380610355833981810160405281019061003291906100db565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610108565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100a88261007d565b9050919050565b6100b88161009d565b81146100c357600080fd5b50565b6000815190506100d5816100af565b92915050565b6000602082840312156100f1576100f0610078565b5b60006100ff848285016100c6565b91505092915050565b61023e806101176000396000f3fe6080604052600436106100225760003560e01c80634f5aaaba1461002e57610029565b3661002957005b600080fd5b34801561003a57600080fd5b5061005560048036038101906100509190610181565b610057565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634f5aaaba83836040518363ffffffff1660e01b81526004016100b29291906101df565b600060405180830381600087803b1580156100cc57600080fd5b505af11580156100e0573d6000803e3d6000fd5b505050505050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610118826100ed565b9050919050565b6101288161010d565b811461013357600080fd5b50565b6000813590506101458161011f565b92915050565b6000819050919050565b61015e8161014b565b811461016957600080fd5b50565b60008135905061017b81610155565b92915050565b60008060408385031215610198576101976100e8565b5b60006101a685828601610136565b92505060206101b78582860161016c565b9150509250929050565b6101ca8161010d565b82525050565b6101d98161014b565b82525050565b60006040820190506101f460008301856101c1565b61020160208301846101d0565b939250505056fea26469706673582212206e879e9d2b7c685853fbe0c2f9b58ba8143aa591e0de8ca323e44034842231e464736f6c634300081e0033", + Bin: "0x608060405234801561001057600080fd5b50604051610355380380610355833981810160405281019061003291906100db565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610108565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100a88261007d565b9050919050565b6100b88161009d565b81146100c357600080fd5b50565b6000815190506100d5816100af565b92915050565b6000602082840312156100f1576100f0610078565b5b60006100ff848285016100c6565b91505092915050565b61023e806101176000396000f3fe6080604052600436106100225760003560e01c80634f5aaaba1461002e57610029565b3661002957005b600080fd5b34801561003a57600080fd5b5061005560048036038101906100509190610181565b610057565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634f5aaaba83836040518363ffffffff1660e01b81526004016100b29291906101df565b600060405180830381600087803b1580156100cc57600080fd5b505af11580156100e0573d6000803e3d6000fd5b505050505050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610118826100ed565b9050919050565b6101288161010d565b811461013357600080fd5b50565b6000813590506101458161011f565b92915050565b6000819050919050565b61015e8161014b565b811461016957600080fd5b50565b60008135905061017b81610155565b92915050565b60008060408385031215610198576101976100e8565b5b60006101a685828601610136565b92505060206101b78582860161016c565b9150509250929050565b6101ca8161010d565b82525050565b6101d98161014b565b82525050565b60006040820190506101f460008301856101c1565b61020160208301846101d0565b939250505056fea264697066735822122015e7ba7848e540abe7669436e9631d564fdabb8aa8f73116cc6ce8bff34ee7e764736f6c634300081e0033", } // NativeMinterTestABI is the input ABI used to generate the binding from. From becd14524f83e7adad99dcf526f6eb5aee39421e Mon Sep 17 00:00:00 2001 From: Jonathan Oppenheimer Date: Mon, 1 Dec 2025 10:01:00 -0500 Subject: [PATCH 21/23] test: change to cancun for compile --- precompile/allowlist/allowlisttest/bindings/compile.go | 2 +- .../allowlisttest/bindings/gen_allowlisttest_binding.go | 2 +- .../contracts/nativeminter/nativemintertest/bindings/compile.go | 2 +- .../nativemintertest/bindings/gen_nativemintertest_binding.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/precompile/allowlist/allowlisttest/bindings/compile.go b/precompile/allowlist/allowlisttest/bindings/compile.go index 6aa0654b6c..abdadb4e86 100644 --- a/precompile/allowlist/allowlisttest/bindings/compile.go +++ b/precompile/allowlist/allowlisttest/bindings/compile.go @@ -4,7 +4,7 @@ package bindings // Step 1: Compile Solidity contracts to generate ABI and bin files -//go:generate solc-v0.8.30 -o artifacts --overwrite --abi --bin --base-path . precompile/=../../ --evm-version paris AllowListTest.sol +//go:generate solc-v0.8.30 -o artifacts --overwrite --abi --bin --base-path . precompile/=../../ --evm-version cancun AllowListTest.sol // Step 2: Generate Go bindings from the compiled artifacts //go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg bindings --type IAllowList --abi artifacts/IAllowList.abi --bin artifacts/IAllowList.bin --out gen_allowlist_binding.go //go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg bindings --type AllowListTest --abi artifacts/AllowListTest.abi --bin artifacts/AllowListTest.bin --out gen_allowlisttest_binding.go diff --git a/precompile/allowlist/allowlisttest/bindings/gen_allowlisttest_binding.go b/precompile/allowlist/allowlisttest/bindings/gen_allowlisttest_binding.go index d4a169501e..4ce13be5dd 100644 --- a/precompile/allowlist/allowlisttest/bindings/gen_allowlisttest_binding.go +++ b/precompile/allowlist/allowlisttest/bindings/gen_allowlisttest_binding.go @@ -32,7 +32,7 @@ var ( // AllowListTestMetaData contains all meta data concerning the AllowListTest contract. var AllowListTestMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"precompileAddr\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"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\":[{\"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\"}]", - Bin: "0x608060405234801561001057600080fd5b50604051610bee380380610bee833981810160405281019061003291906100dd565b80806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505061010a565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100aa8261007f565b9050919050565b6100ba8161009f565b81146100c557600080fd5b50565b6000815190506100d7816100b1565b92915050565b6000602082840312156100f3576100f261007a565b5b6000610101848285016100c8565b91505092915050565b610ad5806101196000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c806374a8f1031161005b57806374a8f103146100ff5780639015d3711461011b578063d0ebdbe71461014b578063f3ae24151461016757610088565b80630aaf70431461008d57806324d7806c146100a95780636cd5c39b146100d9578063704b6c02146100e3575b600080fd5b6100a760048036038101906100a2919061086a565b610197565b005b6100c360048036038101906100be919061086a565b6101fb565b6040516100d091906108b2565b60405180910390f35b6100e16102a6565b005b6100fd60048036038101906100f8919061086a565b6102d2565b005b6101196004803603810190610114919061086a565b610336565b005b6101356004803603810190610130919061086a565b61039a565b60405161014291906108b2565b60405180910390f35b6101656004803603810190610160919061086a565b610446565b005b610181600480360381019061017c919061086a565b6104aa565b60405161018e91906108b2565b60405180910390f35b6101a0336101fb565b806101b057506101af336104aa565b5b6101ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101e69061092a565b60405180910390fd5b6101f881610555565b50565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b81526004016102579190610959565b602060405180830381865afa158015610274573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061029891906109aa565b905060028114915050919050565b6040516102b2906107fb565b604051809103906000f0801580156102ce573d6000803e3d6000fd5b5050565b6102db336101fb565b806102eb57506102ea336104aa565b5b61032a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103219061092a565b60405180910390fd5b610333816105e3565b50565b61033f336101fb565b8061034f575061034e336104aa565b5b61038e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103859061092a565b60405180910390fd5b61039781610671565b50565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b81526004016103f69190610959565b602060405180830381865afa158015610413573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061043791906109aa565b90506000811415915050919050565b61044f336101fb565b8061045f575061045e336104aa565b5b61049e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104959061092a565b60405180910390fd5b6104a78161076d565b50565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b81526004016105069190610959565b602060405180830381865afa158015610523573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054791906109aa565b905060038114915050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630aaf7043826040518263ffffffff1660e01b81526004016105ae9190610959565b600060405180830381600087803b1580156105c857600080fd5b505af11580156105dc573d6000803e3d6000fd5b5050505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663704b6c02826040518263ffffffff1660e01b815260040161063c9190610959565b600060405180830381600087803b15801561065657600080fd5b505af115801561066a573d6000803e3d6000fd5b5050505050565b8073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16036106df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d690610a23565b60405180910390fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638c6bfb3b826040518263ffffffff1660e01b81526004016107389190610959565b600060405180830381600087803b15801561075257600080fd5b505af1158015610766573d6000803e3d6000fd5b5050505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0ebdbe7826040518263ffffffff1660e01b81526004016107c69190610959565b600060405180830381600087803b1580156107e057600080fd5b505af11580156107f4573d6000803e3d6000fd5b5050505050565b605c80610a4483390190565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006108378261080c565b9050919050565b6108478161082c565b811461085257600080fd5b50565b6000813590506108648161083e565b92915050565b6000602082840312156108805761087f610807565b5b600061088e84828501610855565b91505092915050565b60008115159050919050565b6108ac81610897565b82525050565b60006020820190506108c760008301846108a3565b92915050565b600082825260208201905092915050565b7f63616e6e6f74206d6f6469667920616c6c6f77206c6973740000000000000000600082015250565b60006109146018836108cd565b915061091f826108de565b602082019050919050565b6000602082019050818103600083015261094381610907565b9050919050565b6109538161082c565b82525050565b600060208201905061096e600083018461094a565b92915050565b6000819050919050565b61098781610974565b811461099257600080fd5b50565b6000815190506109a48161097e565b92915050565b6000602082840312156109c0576109bf610807565b5b60006109ce84828501610995565b91505092915050565b7f63616e6e6f74207265766f6b65206f776e20726f6c6500000000000000000000600082015250565b6000610a0d6016836108cd565b9150610a18826109d7565b602082019050919050565b60006020820190508181036000830152610a3c81610a00565b905091905056fe6080604052348015600f57600080fd5b50603f80601d6000396000f3fe6080604052600080fdfea264697066735822122055297e1e9d230363789a0572b7737f74ad8e041097aa4d40f2e8f4eb0e61e79564736f6c634300081e0033a26469706673582212204ce314f66cf3cc469215e50f938efffc0006fbcbf551f23680e7a1f99daa55dd64736f6c634300081e0033", + Bin: "0x608060405234801561000f575f5ffd5b50604051610ba1380380610ba1833981810160405281019061003191906100d6565b80805f5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050610101565b5f5ffd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100a58261007c565b9050919050565b6100b58161009b565b81146100bf575f5ffd5b50565b5f815190506100d0816100ac565b92915050565b5f602082840312156100eb576100ea610078565b5b5f6100f8848285016100c2565b91505092915050565b610a938061010e5f395ff3fe608060405234801561000f575f5ffd5b5060043610610086575f3560e01c806374a8f1031161005957806374a8f103146100fc5780639015d37114610118578063d0ebdbe714610148578063f3ae24151461016457610086565b80630aaf70431461008a57806324d7806c146100a65780636cd5c39b146100d6578063704b6c02146100e0575b5f5ffd5b6100a4600480360381019061009f9190610841565b610194565b005b6100c060048036038101906100bb9190610841565b6101f8565b6040516100cd9190610886565b60405180910390f35b6100de6102a0565b005b6100fa60048036038101906100f59190610841565b6102c9565b005b61011660048036038101906101119190610841565b61032d565b005b610132600480360381019061012d9190610841565b610391565b60405161013f9190610886565b60405180910390f35b610162600480360381019061015d9190610841565b610439565b005b61017e60048036038101906101799190610841565b61049d565b60405161018b9190610886565b60405180910390f35b61019d336101f8565b806101ad57506101ac3361049d565b5b6101ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101e3906108f9565b60405180910390fd5b6101f581610545565b50565b5f5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b81526004016102539190610926565b602060405180830381865afa15801561026e573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906102929190610972565b905060028114915050919050565b6040516102ac906107d7565b604051809103905ff0801580156102c5573d5f5f3e3d5ffd5b5050565b6102d2336101f8565b806102e257506102e13361049d565b5b610321576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610318906108f9565b60405180910390fd5b61032a816105ce565b50565b610336336101f8565b8061034657506103453361049d565b5b610385576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161037c906108f9565b60405180910390fd5b61038e81610657565b50565b5f5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b81526004016103ec9190610926565b602060405180830381865afa158015610407573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061042b9190610972565b90505f811415915050919050565b610442336101f8565b8061045257506104513361049d565b5b610491576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610488906108f9565b60405180910390fd5b61049a8161074e565b50565b5f5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb54dae1846040518263ffffffff1660e01b81526004016104f89190610926565b602060405180830381865afa158015610513573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105379190610972565b905060038114915050919050565b5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630aaf7043826040518263ffffffff1660e01b815260040161059e9190610926565b5f604051808303815f87803b1580156105b5575f5ffd5b505af11580156105c7573d5f5f3e3d5ffd5b5050505050565b5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663704b6c02826040518263ffffffff1660e01b81526004016106279190610926565b5f604051808303815f87803b15801561063e575f5ffd5b505af1158015610650573d5f5f3e3d5ffd5b5050505050565b8073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16036106c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106bc906109e7565b60405180910390fd5b5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638c6bfb3b826040518263ffffffff1660e01b815260040161071e9190610926565b5f604051808303815f87803b158015610735575f5ffd5b505af1158015610747573d5f5f3e3d5ffd5b5050505050565b5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0ebdbe7826040518263ffffffff1660e01b81526004016107a79190610926565b5f604051808303815f87803b1580156107be575f5ffd5b505af11580156107d0573d5f5f3e3d5ffd5b5050505050565b605880610a0683390190565b5f5ffd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610810826107e7565b9050919050565b61082081610806565b811461082a575f5ffd5b50565b5f8135905061083b81610817565b92915050565b5f60208284031215610856576108556107e3565b5b5f6108638482850161082d565b91505092915050565b5f8115159050919050565b6108808161086c565b82525050565b5f6020820190506108995f830184610877565b92915050565b5f82825260208201905092915050565b7f63616e6e6f74206d6f6469667920616c6c6f77206c69737400000000000000005f82015250565b5f6108e360188361089f565b91506108ee826108af565b602082019050919050565b5f6020820190508181035f830152610910816108d7565b9050919050565b61092081610806565b82525050565b5f6020820190506109395f830184610917565b92915050565b5f819050919050565b6109518161093f565b811461095b575f5ffd5b50565b5f8151905061096c81610948565b92915050565b5f60208284031215610987576109866107e3565b5b5f6109948482850161095e565b91505092915050565b7f63616e6e6f74207265766f6b65206f776e20726f6c65000000000000000000005f82015250565b5f6109d160168361089f565b91506109dc8261099d565b602082019050919050565b5f6020820190508181035f8301526109fe816109c5565b905091905056fe6080604052348015600e575f5ffd5b50603e80601a5f395ff3fe60806040525f5ffdfea2646970667358221220a6f35569427acc58ad5367cdacdafc7cbf00ed36744b876fba3bd8433689c4a564736f6c634300081e0033a2646970667358221220b9610a9e66cd5a3a7c0ccc575d7228dff9f3846ffc78cf4eccd34dd152f9297664736f6c634300081e0033", } // AllowListTestABI is the input ABI used to generate the binding from. diff --git a/precompile/contracts/nativeminter/nativemintertest/bindings/compile.go b/precompile/contracts/nativeminter/nativemintertest/bindings/compile.go index a6b791fcc8..d62e697717 100644 --- a/precompile/contracts/nativeminter/nativemintertest/bindings/compile.go +++ b/precompile/contracts/nativeminter/nativemintertest/bindings/compile.go @@ -4,7 +4,7 @@ package bindings // Step 1: Compile Solidity contracts to generate ABI and bin files -//go:generate solc-v0.8.30 -o artifacts --overwrite --abi --bin --base-path ../../../../.. precompile/=precompile/ --evm-version paris NativeMinterTest.sol +//go:generate solc-v0.8.30 -o artifacts --overwrite --abi --bin --base-path ../../../../.. precompile/=precompile/ --evm-version cancun NativeMinterTest.sol // Step 2: Generate Go bindings from the compiled artifacts //go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg bindings --type INativeMinter --abi artifacts/INativeMinter.abi --bin artifacts/INativeMinter.bin --out gen_inativeminter_binding.go //go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg bindings --type NativeMinterTest --abi artifacts/NativeMinterTest.abi --bin artifacts/NativeMinterTest.bin --out gen_nativemintertest_binding.go diff --git a/precompile/contracts/nativeminter/nativemintertest/bindings/gen_nativemintertest_binding.go b/precompile/contracts/nativeminter/nativemintertest/bindings/gen_nativemintertest_binding.go index 6d68d19bbd..696d206166 100644 --- a/precompile/contracts/nativeminter/nativemintertest/bindings/gen_nativemintertest_binding.go +++ b/precompile/contracts/nativeminter/nativemintertest/bindings/gen_nativemintertest_binding.go @@ -32,7 +32,7 @@ var ( // NativeMinterTestMetaData contains all meta data concerning the NativeMinterTest contract. var NativeMinterTestMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nativeMinterPrecompile\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mintNativeCoin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", - Bin: "0x608060405234801561001057600080fd5b50604051610355380380610355833981810160405281019061003291906100db565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610108565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100a88261007d565b9050919050565b6100b88161009d565b81146100c357600080fd5b50565b6000815190506100d5816100af565b92915050565b6000602082840312156100f1576100f0610078565b5b60006100ff848285016100c6565b91505092915050565b61023e806101176000396000f3fe6080604052600436106100225760003560e01c80634f5aaaba1461002e57610029565b3661002957005b600080fd5b34801561003a57600080fd5b5061005560048036038101906100509190610181565b610057565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634f5aaaba83836040518363ffffffff1660e01b81526004016100b29291906101df565b600060405180830381600087803b1580156100cc57600080fd5b505af11580156100e0573d6000803e3d6000fd5b505050505050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610118826100ed565b9050919050565b6101288161010d565b811461013357600080fd5b50565b6000813590506101458161011f565b92915050565b6000819050919050565b61015e8161014b565b811461016957600080fd5b50565b60008135905061017b81610155565b92915050565b60008060408385031215610198576101976100e8565b5b60006101a685828601610136565b92505060206101b78582860161016c565b9150509250929050565b6101ca8161010d565b82525050565b6101d98161014b565b82525050565b60006040820190506101f460008301856101c1565b61020160208301846101d0565b939250505056fea264697066735822122015e7ba7848e540abe7669436e9631d564fdabb8aa8f73116cc6ce8bff34ee7e764736f6c634300081e0033", + Bin: "0x608060405234801561000f575f5ffd5b50604051610336380380610336833981810160405281019061003191906100d4565b805f5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100ff565b5f5ffd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100a38261007a565b9050919050565b6100b381610099565b81146100bd575f5ffd5b50565b5f815190506100ce816100aa565b92915050565b5f602082840312156100e9576100e8610076565b5b5f6100f6848285016100c0565b91505092915050565b61022a8061010c5f395ff3fe608060405260043610610021575f3560e01c80634f5aaaba1461002c57610028565b3661002857005b5f5ffd5b348015610037575f5ffd5b50610052600480360381019061004d9190610171565b610054565b005b5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634f5aaaba83836040518363ffffffff1660e01b81526004016100af9291906101cd565b5f604051808303815f87803b1580156100c6575f5ffd5b505af11580156100d8573d5f5f3e3d5ffd5b505050505050565b5f5ffd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61010d826100e4565b9050919050565b61011d81610103565b8114610127575f5ffd5b50565b5f8135905061013881610114565b92915050565b5f819050919050565b6101508161013e565b811461015a575f5ffd5b50565b5f8135905061016b81610147565b92915050565b5f5f60408385031215610187576101866100e0565b5b5f6101948582860161012a565b92505060206101a58582860161015d565b9150509250929050565b6101b881610103565b82525050565b6101c78161013e565b82525050565b5f6040820190506101e05f8301856101af565b6101ed60208301846101be565b939250505056fea264697066735822122022a495ab74b25db78e2d373ef8499eee646e53fb4eb515ac693575252359c1ae64736f6c634300081e0033", } // NativeMinterTestABI is the input ABI used to generate the binding from. From 7f4e0b9dd979c4cfd9b626724f7b8ee9a75b60c2 Mon Sep 17 00:00:00 2001 From: Jonathan Oppenheimer Date: Mon, 1 Dec 2025 12:03:37 -0500 Subject: [PATCH 22/23] chore: revert name changes --- .../deployerallowlist/simulated_test.go | 64 +++++++++---------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/precompile/contracts/deployerallowlist/simulated_test.go b/precompile/contracts/deployerallowlist/simulated_test.go index 10cca45dfb..5284d76e8d 100644 --- a/precompile/contracts/deployerallowlist/simulated_test.go +++ b/precompile/contracts/deployerallowlist/simulated_test.go @@ -61,7 +61,7 @@ func newBackendWithDeployerAllowList(t *testing.T) *sim.Backend { // Helper functions to reduce test boilerplate -func deployallowlistbindings(t *testing.T, b *sim.Backend, auth *bind.TransactOpts) (common.Address, *allowlistbindings.AllowListTest) { +func deployAllowListTest(t *testing.T, b *sim.Backend, auth *bind.TransactOpts) (common.Address, *allowlistbindings.AllowListTest) { t.Helper() addr, tx, contract, err := allowlistbindings.DeployAllowListTest(auth, b.Client(), deployerallowlist.ContractAddress) require.NoError(t, err) @@ -89,22 +89,22 @@ func TestDeployerAllowList(t *testing.T) { { name: "should verify new address has no role", test: func(t *testing.T, backend *sim.Backend, allowList *allowlistbindings.IAllowList) { - allowlistbindingsAddr, _ := deployallowlistbindings(t, backend, admin) - testutils.VerifyRole(t, allowList, allowlistbindingsAddr, allowlist.NoRole) + allowListTestAddr, _ := deployAllowListTest(t, backend, admin) + testutils.VerifyRole(t, allowList, allowListTestAddr, allowlist.NoRole) }, }, { name: "should verify contract correctly reports admin status", test: func(t *testing.T, backend *sim.Backend, allowList *allowlistbindings.IAllowList) { - allowlistbindingsAddr, allowlistbindings := deployallowlistbindings(t, backend, admin) + allowListTestAddr, allowListTest := deployAllowListTest(t, backend, admin) - testutils.VerifyRole(t, allowList, allowlistbindingsAddr, allowlist.NoRole) + testutils.VerifyRole(t, allowList, allowListTestAddr, allowlist.NoRole) - isAdmin, err := allowlistbindings.IsAdmin(nil, allowlistbindingsAddr) + isAdmin, err := allowListTest.IsAdmin(nil, allowListTestAddr) require.NoError(t, err) require.False(t, isAdmin) - isAdmin, err = allowlistbindings.IsAdmin(nil, adminAddress) + isAdmin, err = allowListTest.IsAdmin(nil, adminAddress) require.NoError(t, err) require.True(t, isAdmin) }, @@ -114,10 +114,10 @@ func TestDeployerAllowList(t *testing.T) { test: func(t *testing.T, backend *sim.Backend, allowList *allowlistbindings.IAllowList) { testutils.VerifyRole(t, allowList, unprivilegedAddress, allowlist.NoRole) - _, allowlistbindings := deployallowlistbindings(t, backend, admin) + _, allowListTest := deployAllowListTest(t, backend, admin) // Try to deploy via unprivileged user - should fail - _, err := allowlistbindings.DeployContract(unprivileged) + _, err := allowListTest.DeployContract(unprivileged) // The error returned is a JSON Error rather than the vm.ErrExecutionReverted error require.ErrorContains(t, err, vm.ErrExecutionReverted.Error()) }, @@ -125,13 +125,13 @@ func TestDeployerAllowList(t *testing.T) { { name: "should allow admin to add contract as admin via precompile", test: func(t *testing.T, backend *sim.Backend, allowList *allowlistbindings.IAllowList) { - allowlistbindingsAddr, allowlistbindings := deployallowlistbindings(t, backend, admin) + allowListTestAddr, allowListTest := deployAllowListTest(t, backend, admin) - testutils.VerifyRole(t, allowList, allowlistbindingsAddr, allowlist.NoRole) - testutils.SetAsAdmin(t, backend, allowList, admin, allowlistbindingsAddr) - testutils.VerifyRole(t, allowList, allowlistbindingsAddr, allowlist.AdminRole) + testutils.VerifyRole(t, allowList, allowListTestAddr, allowlist.NoRole) + testutils.SetAsAdmin(t, backend, allowList, admin, allowListTestAddr) + testutils.VerifyRole(t, allowList, allowListTestAddr, allowlist.AdminRole) - isAdmin, err := allowlistbindings.IsAdmin(nil, allowlistbindingsAddr) + isAdmin, err := allowListTest.IsAdmin(nil, allowListTestAddr) require.NoError(t, err) require.True(t, isAdmin) }, @@ -139,18 +139,18 @@ func TestDeployerAllowList(t *testing.T) { { name: "should allow admin to add deployer via contract", test: func(t *testing.T, backend *sim.Backend, allowList *allowlistbindings.IAllowList) { - allowlistbindingsAddr, allowlistbindings := deployallowlistbindings(t, backend, admin) - otherContractAddr, _ := deployallowlistbindings(t, backend, admin) + allowListTestAddr, allowListTest := deployAllowListTest(t, backend, admin) + otherContractAddr, _ := deployAllowListTest(t, backend, admin) - testutils.VerifyRole(t, allowList, allowlistbindingsAddr, allowlist.NoRole) - testutils.SetAsAdmin(t, backend, allowList, admin, allowlistbindingsAddr) - testutils.VerifyRole(t, allowList, allowlistbindingsAddr, allowlist.AdminRole) + testutils.VerifyRole(t, allowList, allowListTestAddr, allowlist.NoRole) + testutils.SetAsAdmin(t, backend, allowList, admin, allowListTestAddr) + testutils.VerifyRole(t, allowList, allowListTestAddr, allowlist.AdminRole) - tx, err := allowlistbindings.SetEnabled(admin, otherContractAddr) + tx, err := allowListTest.SetEnabled(admin, otherContractAddr) require.NoError(t, err) testutils.WaitReceipt(t, backend, tx) - isEnabled, err := allowlistbindings.IsEnabled(nil, otherContractAddr) + isEnabled, err := allowListTest.IsEnabled(nil, otherContractAddr) require.NoError(t, err) require.True(t, isEnabled) testutils.VerifyRole(t, allowList, otherContractAddr, allowlist.EnabledRole) @@ -159,16 +159,16 @@ func TestDeployerAllowList(t *testing.T) { { name: "should allow enabled address to deploy contracts", test: func(t *testing.T, backend *sim.Backend, allowList *allowlistbindings.IAllowList) { - allowlistbindingsAddr, allowlistbindings := deployallowlistbindings(t, backend, admin) - deployerContractAddr, deployerContract := deployallowlistbindings(t, backend, admin) + allowListTestAddr, allowListTest := deployAllowListTest(t, backend, admin) + deployerContractAddr, deployerContract := deployAllowListTest(t, backend, admin) - testutils.SetAsAdmin(t, backend, allowList, admin, allowlistbindingsAddr) + testutils.SetAsAdmin(t, backend, allowList, admin, allowListTestAddr) - tx, err := allowlistbindings.SetEnabled(admin, deployerContractAddr) + tx, err := allowListTest.SetEnabled(admin, deployerContractAddr) require.NoError(t, err) testutils.WaitReceipt(t, backend, tx) - isEnabled, err := allowlistbindings.IsEnabled(nil, deployerContractAddr) + isEnabled, err := allowListTest.IsEnabled(nil, deployerContractAddr) require.NoError(t, err) require.True(t, isEnabled) @@ -180,20 +180,20 @@ func TestDeployerAllowList(t *testing.T) { { name: "should allow admin to revoke deployer", test: func(t *testing.T, backend *sim.Backend, allowList *allowlistbindings.IAllowList) { - allowlistbindingsAddr, allowlistbindings := deployallowlistbindings(t, backend, admin) - deployerContractAddr, _ := deployallowlistbindings(t, backend, admin) + allowListTestAddr, allowListTest := deployAllowListTest(t, backend, admin) + deployerContractAddr, _ := deployAllowListTest(t, backend, admin) - testutils.SetAsAdmin(t, backend, allowList, admin, allowlistbindingsAddr) + testutils.SetAsAdmin(t, backend, allowList, admin, allowListTestAddr) - tx, err := allowlistbindings.SetEnabled(admin, deployerContractAddr) + tx, err := allowListTest.SetEnabled(admin, deployerContractAddr) require.NoError(t, err) testutils.WaitReceipt(t, backend, tx) - isEnabled, err := allowlistbindings.IsEnabled(nil, deployerContractAddr) + isEnabled, err := allowListTest.IsEnabled(nil, deployerContractAddr) require.NoError(t, err) require.True(t, isEnabled) - tx, err = allowlistbindings.Revoke(admin, deployerContractAddr) + tx, err = allowListTest.Revoke(admin, deployerContractAddr) require.NoError(t, err) testutils.WaitReceipt(t, backend, tx) From d5789324daf51a55838ec5288a3c58231a93f6bd Mon Sep 17 00:00:00 2001 From: Jonathan Oppenheimer Date: Mon, 1 Dec 2025 12:36:13 -0500 Subject: [PATCH 23/23] test: break import cycle --- .../allowlisttest/test_allowlist_helpers.go} | 11 +- .../deployerallowlist/simulated_test.go | 29 +-- .../contracts/feemanager/config_test.go | 31 +-- .../contracts/feemanager/contract_test.go | 170 ++++++++-------- .../contracts/feemanager/unpack_pack_test.go | 1 + .../contracts/nativeminter/simulated_test.go | 11 +- .../contracts/rewardmanager/config_test.go | 33 ++-- .../contracts/rewardmanager/contract_test.go | 181 +++++++++--------- .../contracts/txallowlist/config_test.go | 19 +- .../contracts/txallowlist/contract_test.go | 5 +- 10 files changed, 245 insertions(+), 246 deletions(-) rename precompile/{contracts/testutils/allowlist_helpers.go => allowlist/allowlisttest/test_allowlist_helpers.go} (91%) diff --git a/precompile/contracts/testutils/allowlist_helpers.go b/precompile/allowlist/allowlisttest/test_allowlist_helpers.go similarity index 91% rename from precompile/contracts/testutils/allowlist_helpers.go rename to precompile/allowlist/allowlisttest/test_allowlist_helpers.go index 3a2a25f3a1..f9e5891e07 100644 --- a/precompile/contracts/testutils/allowlist_helpers.go +++ b/precompile/allowlist/allowlisttest/test_allowlist_helpers.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. -package testutils +package allowlisttest import ( "math/big" @@ -13,6 +13,7 @@ import ( "github.com/ava-labs/subnet-evm/accounts/abi/bind" "github.com/ava-labs/subnet-evm/precompile/allowlist" + "github.com/ava-labs/subnet-evm/precompile/contracts/testutils" sim "github.com/ava-labs/subnet-evm/ethclient/simulated" ) @@ -41,7 +42,7 @@ func SetAsEnabled(t *testing.T, b *sim.Backend, contract AllowListContract, auth t.Helper() tx, err := contract.SetEnabled(auth, address) require.NoError(t, err) - WaitReceiptSuccessful(t, b, tx) + testutils.WaitReceiptSuccessful(t, b, tx) } // SetAsAdmin sets the given address as Admin in the allow list. @@ -49,7 +50,7 @@ func SetAsAdmin(t *testing.T, b *sim.Backend, contract AllowListContract, auth * t.Helper() tx, err := contract.SetAdmin(auth, address) require.NoError(t, err) - WaitReceiptSuccessful(t, b, tx) + testutils.WaitReceiptSuccessful(t, b, tx) } // SetAsManager sets the given address as Manager in the allow list. @@ -57,7 +58,7 @@ func SetAsManager(t *testing.T, b *sim.Backend, contract AllowListContract, auth t.Helper() tx, err := contract.SetManager(auth, address) require.NoError(t, err) - WaitReceiptSuccessful(t, b, tx) + testutils.WaitReceiptSuccessful(t, b, tx) } // SetAsNone revokes the role of the given address in the allow list. @@ -65,5 +66,5 @@ func SetAsNone(t *testing.T, b *sim.Backend, contract AllowListContract, auth *b t.Helper() tx, err := contract.SetNone(auth, address) require.NoError(t, err) - WaitReceiptSuccessful(t, b, tx) + testutils.WaitReceiptSuccessful(t, b, tx) } diff --git a/precompile/contracts/deployerallowlist/simulated_test.go b/precompile/contracts/deployerallowlist/simulated_test.go index 5284d76e8d..fbc08ed87e 100644 --- a/precompile/contracts/deployerallowlist/simulated_test.go +++ b/precompile/contracts/deployerallowlist/simulated_test.go @@ -19,6 +19,7 @@ import ( "github.com/ava-labs/subnet-evm/params/extras" "github.com/ava-labs/subnet-evm/plugin/evm/customtypes" "github.com/ava-labs/subnet-evm/precompile/allowlist" + "github.com/ava-labs/subnet-evm/precompile/allowlist/allowlisttest" "github.com/ava-labs/subnet-evm/precompile/contracts/deployerallowlist" "github.com/ava-labs/subnet-evm/precompile/contracts/testutils" "github.com/ava-labs/subnet-evm/utils" @@ -83,14 +84,14 @@ func TestDeployerAllowList(t *testing.T) { { name: "should verify sender is admin", test: func(t *testing.T, _ *sim.Backend, allowList *allowlistbindings.IAllowList) { - testutils.VerifyRole(t, allowList, adminAddress, allowlist.AdminRole) + allowlisttest.VerifyRole(t, allowList, adminAddress, allowlist.AdminRole) }, }, { name: "should verify new address has no role", test: func(t *testing.T, backend *sim.Backend, allowList *allowlistbindings.IAllowList) { allowListTestAddr, _ := deployAllowListTest(t, backend, admin) - testutils.VerifyRole(t, allowList, allowListTestAddr, allowlist.NoRole) + allowlisttest.VerifyRole(t, allowList, allowListTestAddr, allowlist.NoRole) }, }, { @@ -98,7 +99,7 @@ func TestDeployerAllowList(t *testing.T) { test: func(t *testing.T, backend *sim.Backend, allowList *allowlistbindings.IAllowList) { allowListTestAddr, allowListTest := deployAllowListTest(t, backend, admin) - testutils.VerifyRole(t, allowList, allowListTestAddr, allowlist.NoRole) + allowlisttest.VerifyRole(t, allowList, allowListTestAddr, allowlist.NoRole) isAdmin, err := allowListTest.IsAdmin(nil, allowListTestAddr) require.NoError(t, err) @@ -112,7 +113,7 @@ func TestDeployerAllowList(t *testing.T) { { name: "should not let address with no role deploy contracts", test: func(t *testing.T, backend *sim.Backend, allowList *allowlistbindings.IAllowList) { - testutils.VerifyRole(t, allowList, unprivilegedAddress, allowlist.NoRole) + allowlisttest.VerifyRole(t, allowList, unprivilegedAddress, allowlist.NoRole) _, allowListTest := deployAllowListTest(t, backend, admin) @@ -127,9 +128,9 @@ func TestDeployerAllowList(t *testing.T) { test: func(t *testing.T, backend *sim.Backend, allowList *allowlistbindings.IAllowList) { allowListTestAddr, allowListTest := deployAllowListTest(t, backend, admin) - testutils.VerifyRole(t, allowList, allowListTestAddr, allowlist.NoRole) - testutils.SetAsAdmin(t, backend, allowList, admin, allowListTestAddr) - testutils.VerifyRole(t, allowList, allowListTestAddr, allowlist.AdminRole) + allowlisttest.VerifyRole(t, allowList, allowListTestAddr, allowlist.NoRole) + allowlisttest.SetAsAdmin(t, backend, allowList, admin, allowListTestAddr) + allowlisttest.VerifyRole(t, allowList, allowListTestAddr, allowlist.AdminRole) isAdmin, err := allowListTest.IsAdmin(nil, allowListTestAddr) require.NoError(t, err) @@ -142,9 +143,9 @@ func TestDeployerAllowList(t *testing.T) { allowListTestAddr, allowListTest := deployAllowListTest(t, backend, admin) otherContractAddr, _ := deployAllowListTest(t, backend, admin) - testutils.VerifyRole(t, allowList, allowListTestAddr, allowlist.NoRole) - testutils.SetAsAdmin(t, backend, allowList, admin, allowListTestAddr) - testutils.VerifyRole(t, allowList, allowListTestAddr, allowlist.AdminRole) + allowlisttest.VerifyRole(t, allowList, allowListTestAddr, allowlist.NoRole) + allowlisttest.SetAsAdmin(t, backend, allowList, admin, allowListTestAddr) + allowlisttest.VerifyRole(t, allowList, allowListTestAddr, allowlist.AdminRole) tx, err := allowListTest.SetEnabled(admin, otherContractAddr) require.NoError(t, err) @@ -153,7 +154,7 @@ func TestDeployerAllowList(t *testing.T) { isEnabled, err := allowListTest.IsEnabled(nil, otherContractAddr) require.NoError(t, err) require.True(t, isEnabled) - testutils.VerifyRole(t, allowList, otherContractAddr, allowlist.EnabledRole) + allowlisttest.VerifyRole(t, allowList, otherContractAddr, allowlist.EnabledRole) }, }, { @@ -162,7 +163,7 @@ func TestDeployerAllowList(t *testing.T) { allowListTestAddr, allowListTest := deployAllowListTest(t, backend, admin) deployerContractAddr, deployerContract := deployAllowListTest(t, backend, admin) - testutils.SetAsAdmin(t, backend, allowList, admin, allowListTestAddr) + allowlisttest.SetAsAdmin(t, backend, allowList, admin, allowListTestAddr) tx, err := allowListTest.SetEnabled(admin, deployerContractAddr) require.NoError(t, err) @@ -183,7 +184,7 @@ func TestDeployerAllowList(t *testing.T) { allowListTestAddr, allowListTest := deployAllowListTest(t, backend, admin) deployerContractAddr, _ := deployAllowListTest(t, backend, admin) - testutils.SetAsAdmin(t, backend, allowList, admin, allowListTestAddr) + allowlisttest.SetAsAdmin(t, backend, allowList, admin, allowListTestAddr) tx, err := allowListTest.SetEnabled(admin, deployerContractAddr) require.NoError(t, err) @@ -197,7 +198,7 @@ func TestDeployerAllowList(t *testing.T) { require.NoError(t, err) testutils.WaitReceipt(t, backend, tx) - testutils.VerifyRole(t, allowList, deployerContractAddr, allowlist.NoRole) + allowlisttest.VerifyRole(t, allowList, deployerContractAddr, allowlist.NoRole) }, }, } diff --git a/precompile/contracts/feemanager/config_test.go b/precompile/contracts/feemanager/config_test.go index c0e1062dd0..170faf47fd 100644 --- a/precompile/contracts/feemanager/config_test.go +++ b/precompile/contracts/feemanager/config_test.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. -package feemanager +package feemanager_test import ( "math/big" @@ -12,6 +12,7 @@ import ( "github.com/ava-labs/subnet-evm/commontype" "github.com/ava-labs/subnet-evm/precompile/allowlist/allowlisttest" + "github.com/ava-labs/subnet-evm/precompile/contracts/feemanager" "github.com/ava-labs/subnet-evm/precompile/precompileconfig" "github.com/ava-labs/subnet-evm/precompile/precompiletest" "github.com/ava-labs/subnet-evm/utils" @@ -36,15 +37,15 @@ func TestVerify(t *testing.T) { invalidFeeConfig.GasLimit = big.NewInt(0) tests := map[string]precompiletest.ConfigVerifyTest{ "invalid initial fee manager config": { - Config: NewConfig(utils.NewUint64(3), admins, nil, nil, &invalidFeeConfig), + Config: feemanager.NewConfig(utils.NewUint64(3), admins, nil, nil, &invalidFeeConfig), ExpectedError: "gasLimit = 0 cannot be less than or equal to 0", }, "nil initial fee manager config": { - Config: NewConfig(utils.NewUint64(3), admins, nil, nil, &commontype.FeeConfig{}), + Config: feemanager.NewConfig(utils.NewUint64(3), admins, nil, nil, &commontype.FeeConfig{}), ExpectedError: "gasLimit cannot be nil", }, } - allowlisttest.VerifyPrecompileWithAllowListTests(t, Module, tests) + allowlisttest.VerifyPrecompileWithAllowListTests(t, feemanager.Module, tests) } func TestEqual(t *testing.T) { @@ -52,28 +53,28 @@ func TestEqual(t *testing.T) { enableds := []common.Address{allowlisttest.TestEnabledAddr} tests := map[string]precompiletest.ConfigEqualTest{ "non-nil config and nil other": { - Config: NewConfig(utils.NewUint64(3), admins, enableds, nil, nil), + Config: feemanager.NewConfig(utils.NewUint64(3), admins, enableds, nil, nil), Other: nil, Expected: false, }, "different type": { - Config: NewConfig(utils.NewUint64(3), admins, enableds, nil, nil), + Config: feemanager.NewConfig(utils.NewUint64(3), admins, enableds, nil, nil), Other: precompileconfig.NewMockConfig(gomock.NewController(t)), Expected: false, }, "different timestamp": { - Config: NewConfig(utils.NewUint64(3), admins, nil, nil, nil), - Other: NewConfig(utils.NewUint64(4), admins, nil, nil, nil), + Config: feemanager.NewConfig(utils.NewUint64(3), admins, nil, nil, nil), + Other: feemanager.NewConfig(utils.NewUint64(4), admins, nil, nil, nil), Expected: false, }, "non-nil initial config and nil initial config": { - Config: NewConfig(utils.NewUint64(3), admins, nil, nil, &validFeeConfig), - Other: NewConfig(utils.NewUint64(3), admins, nil, nil, nil), + Config: feemanager.NewConfig(utils.NewUint64(3), admins, nil, nil, &validFeeConfig), + Other: feemanager.NewConfig(utils.NewUint64(3), admins, nil, nil, nil), Expected: false, }, "different initial config": { - Config: NewConfig(utils.NewUint64(3), admins, nil, nil, &validFeeConfig), - Other: NewConfig(utils.NewUint64(3), admins, nil, nil, + Config: feemanager.NewConfig(utils.NewUint64(3), admins, nil, nil, &validFeeConfig), + Other: feemanager.NewConfig(utils.NewUint64(3), admins, nil, nil, func() *commontype.FeeConfig { c := validFeeConfig c.GasLimit = big.NewInt(123) @@ -82,10 +83,10 @@ func TestEqual(t *testing.T) { Expected: false, }, "same config": { - Config: NewConfig(utils.NewUint64(3), admins, nil, nil, &validFeeConfig), - Other: NewConfig(utils.NewUint64(3), admins, nil, nil, &validFeeConfig), + Config: feemanager.NewConfig(utils.NewUint64(3), admins, nil, nil, &validFeeConfig), + Other: feemanager.NewConfig(utils.NewUint64(3), admins, nil, nil, &validFeeConfig), Expected: true, }, } - allowlisttest.EqualPrecompileWithAllowListTests(t, Module, tests) + allowlisttest.EqualPrecompileWithAllowListTests(t, feemanager.Module, tests) } diff --git a/precompile/contracts/feemanager/contract_test.go b/precompile/contracts/feemanager/contract_test.go index fe1dc67bfc..0dbad29244 100644 --- a/precompile/contracts/feemanager/contract_test.go +++ b/precompile/contracts/feemanager/contract_test.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. -package feemanager +package feemanager_test import ( "math/big" @@ -16,6 +16,7 @@ import ( "github.com/ava-labs/subnet-evm/core/extstate" "github.com/ava-labs/subnet-evm/precompile/allowlist/allowlisttest" "github.com/ava-labs/subnet-evm/precompile/contract" + "github.com/ava-labs/subnet-evm/precompile/contracts/feemanager" "github.com/ava-labs/subnet-evm/precompile/precompileconfig" "github.com/ava-labs/subnet-evm/precompile/precompiletest" @@ -34,18 +35,7 @@ var ( MaxBlockGasCost: big.NewInt(2000000000000000000), BlockGasCostStep: big.NewInt(1000000000000000000), } - testFeeConfig = commontype.FeeConfig{ - GasLimit: big.NewInt(8_000_000), - TargetBlockRate: 2, // in seconds - - MinBaseFee: big.NewInt(25_000_000_000), - TargetGas: big.NewInt(15_000_000), - BaseFeeChangeDenominator: big.NewInt(36), - - MinBlockGasCost: big.NewInt(0), - MaxBlockGasCost: big.NewInt(1_000_000), - BlockGasCostStep: big.NewInt(200_000), - } + testFeeConfig = commontype.ValidTestFeeConfig zeroFeeConfig = commontype.FeeConfig{ GasLimit: new(big.Int), MinBaseFee: new(big.Int), @@ -61,32 +51,32 @@ var ( { Name: "set_config_from_no_role_fails", Caller: allowlisttest.TestNoRoleAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(feemanager.Module.Address), InputFn: func(t testing.TB) []byte { - input, err := PackSetFeeConfig(testFeeConfig) + input, err := feemanager.PackSetFeeConfig(testFeeConfig) require.NoError(t, err) return input }, - SuppliedGas: SetFeeConfigGasCost, + SuppliedGas: feemanager.SetFeeConfigGasCost, ReadOnly: false, - ExpectedErr: ErrCannotChangeFee.Error(), + ExpectedErr: feemanager.ErrCannotChangeFee.Error(), }, { Name: "set_config_from_enabled_address_succeeds_and_emits_logs", Caller: allowlisttest.TestEnabledAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(feemanager.Module.Address), InputFn: func(t testing.TB) []byte { - input, err := PackSetFeeConfig(testFeeConfig) + input, err := feemanager.PackSetFeeConfig(testFeeConfig) require.NoError(t, err) return input }, - SuppliedGas: SetFeeConfigGasCost + FeeConfigChangedEventGasCost, + SuppliedGas: feemanager.SetFeeConfigGasCost + feemanager.FeeConfigChangedEventGasCost, ReadOnly: false, ExpectedRes: []byte{}, AfterHook: func(t testing.TB, state *extstate.StateDB) { - feeConfig := GetStoredFeeConfig(state) + feeConfig := feemanager.GetStoredFeeConfig(state) require.Equal(t, testFeeConfig, feeConfig) logs := state.Logs() @@ -96,18 +86,18 @@ var ( { Name: "set_config_from_manager_succeeds", Caller: allowlisttest.TestManagerAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(feemanager.Module.Address), InputFn: func(t testing.TB) []byte { - input, err := PackSetFeeConfig(testFeeConfig) + input, err := feemanager.PackSetFeeConfig(testFeeConfig) require.NoError(t, err) return input }, - SuppliedGas: SetFeeConfigGasCost + FeeConfigChangedEventGasCost, + SuppliedGas: feemanager.SetFeeConfigGasCost + feemanager.FeeConfigChangedEventGasCost, ReadOnly: false, ExpectedRes: []byte{}, AfterHook: func(t testing.TB, state *extstate.StateDB) { - feeConfig := GetStoredFeeConfig(state) + feeConfig := feemanager.GetStoredFeeConfig(state) require.Equal(t, testFeeConfig, feeConfig) logs := state.Logs() @@ -117,37 +107,37 @@ var ( { Name: "set_invalid_config_from_enabled_address", Caller: allowlisttest.TestEnabledAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(feemanager.Module.Address), InputFn: func(t testing.TB) []byte { feeConfig := testFeeConfig feeConfig.MinBlockGasCost = new(big.Int).Mul(feeConfig.MaxBlockGasCost, common.Big2) - input, err := PackSetFeeConfig(feeConfig) + input, err := feemanager.PackSetFeeConfig(feeConfig) require.NoError(t, err) return input }, - SuppliedGas: SetFeeConfigGasCost + FeeConfigChangedEventGasCost, + SuppliedGas: feemanager.SetFeeConfigGasCost + feemanager.FeeConfigChangedEventGasCost, ReadOnly: false, - Config: &Config{ + Config: &feemanager.Config{ InitialFeeConfig: &testFeeConfig, }, ExpectedErr: "cannot be greater than maxBlockGasCost", AfterHook: func(t testing.TB, state *extstate.StateDB) { - feeConfig := GetStoredFeeConfig(state) + feeConfig := feemanager.GetStoredFeeConfig(state) require.Equal(t, testFeeConfig, feeConfig) }, }, { Name: "set_config_from_admin_address", Caller: allowlisttest.TestAdminAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(feemanager.Module.Address), InputFn: func(t testing.TB) []byte { - input, err := PackSetFeeConfig(testFeeConfig) + input, err := feemanager.PackSetFeeConfig(testFeeConfig) require.NoError(t, err) return input }, - SuppliedGas: SetFeeConfigGasCost + FeeConfigChangedEventGasCost, + SuppliedGas: feemanager.SetFeeConfigGasCost + feemanager.FeeConfigChangedEventGasCost, ReadOnly: false, ExpectedRes: []byte{}, SetupBlockContext: func(mbc *contract.MockBlockContext) { @@ -155,9 +145,9 @@ var ( mbc.EXPECT().Timestamp().Return(uint64(0)).AnyTimes() }, AfterHook: func(t testing.TB, state *extstate.StateDB) { - feeConfig := GetStoredFeeConfig(state) + feeConfig := feemanager.GetStoredFeeConfig(state) require.Equal(t, testFeeConfig, feeConfig) - lastChangedAt := GetFeeConfigLastChangedAt(state) + lastChangedAt := feemanager.GetFeeConfigLastChangedAt(state) require.Equal(t, testBlockNumber, lastChangedAt) logs := state.Logs() @@ -170,27 +160,27 @@ var ( BeforeHook: func(t testing.TB, state *extstate.StateDB) { blockContext := contract.NewMockBlockContext(gomock.NewController(t)) blockContext.EXPECT().Number().Return(big.NewInt(6)).Times(1) - allowlisttest.SetDefaultRoles(Module.Address)(t, state) - require.NoError(t, StoreFeeConfig(state, testFeeConfig, blockContext)) + allowlisttest.SetDefaultRoles(feemanager.Module.Address)(t, state) + require.NoError(t, feemanager.StoreFeeConfig(state, testFeeConfig, blockContext)) }, InputFn: func(t testing.TB) []byte { - input, err := PackGetFeeConfig() + input, err := feemanager.PackGetFeeConfig() require.NoError(t, err) return input }, - SuppliedGas: GetFeeConfigGasCost, + SuppliedGas: feemanager.GetFeeConfigGasCost, ReadOnly: true, ExpectedRes: func() []byte { - res, err := PackGetFeeConfigOutput(testFeeConfig) + res, err := feemanager.PackGetFeeConfigOutput(testFeeConfig) if err != nil { panic(err) } return res }(), AfterHook: func(t testing.TB, state *extstate.StateDB) { - feeConfig := GetStoredFeeConfig(state) - lastChangedAt := GetFeeConfigLastChangedAt(state) + feeConfig := feemanager.GetStoredFeeConfig(state) + lastChangedAt := feemanager.GetFeeConfigLastChangedAt(state) require.Equal(t, testFeeConfig, feeConfig) require.Equal(t, big.NewInt(6), lastChangedAt) }, @@ -198,20 +188,20 @@ var ( { Name: "get_initial_fee_config", Caller: allowlisttest.TestNoRoleAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(feemanager.Module.Address), InputFn: func(t testing.TB) []byte { - input, err := PackGetFeeConfig() + input, err := feemanager.PackGetFeeConfig() require.NoError(t, err) return input }, - SuppliedGas: GetFeeConfigGasCost, + SuppliedGas: feemanager.GetFeeConfigGasCost, ReadOnly: true, - Config: &Config{ + Config: &feemanager.Config{ InitialFeeConfig: &testFeeConfig, }, ExpectedRes: func() []byte { - res, err := PackGetFeeConfigOutput(testFeeConfig) + res, err := feemanager.PackGetFeeConfigOutput(testFeeConfig) if err != nil { panic(err) } @@ -221,8 +211,8 @@ var ( mbc.EXPECT().Number().Return(testBlockNumber) }, AfterHook: func(t testing.TB, state *extstate.StateDB) { - feeConfig := GetStoredFeeConfig(state) - lastChangedAt := GetFeeConfigLastChangedAt(state) + feeConfig := feemanager.GetStoredFeeConfig(state) + lastChangedAt := feemanager.GetFeeConfigLastChangedAt(state) require.Equal(t, testFeeConfig, feeConfig) require.Equal(t, testBlockNumber, lastChangedAt) }, @@ -233,27 +223,27 @@ var ( BeforeHook: func(t testing.TB, state *extstate.StateDB) { blockContext := contract.NewMockBlockContext(gomock.NewController(t)) blockContext.EXPECT().Number().Return(testBlockNumber).Times(1) - allowlisttest.SetDefaultRoles(Module.Address)(t, state) - require.NoError(t, StoreFeeConfig(state, testFeeConfig, blockContext)) + allowlisttest.SetDefaultRoles(feemanager.Module.Address)(t, state) + require.NoError(t, feemanager.StoreFeeConfig(state, testFeeConfig, blockContext)) }, InputFn: func(t testing.TB) []byte { - input, err := PackGetFeeConfigLastChangedAt() + input, err := feemanager.PackGetFeeConfigLastChangedAt() require.NoError(t, err) return input }, - SuppliedGas: GetLastChangedAtGasCost, + SuppliedGas: feemanager.GetLastChangedAtGasCost, ReadOnly: true, ExpectedRes: func() []byte { - res, err := PackGetFeeConfigLastChangedAtOutput(testBlockNumber) + res, err := feemanager.PackGetFeeConfigLastChangedAtOutput(testBlockNumber) if err != nil { panic(err) } return res }(), AfterHook: func(t testing.TB, state *extstate.StateDB) { - feeConfig := GetStoredFeeConfig(state) - lastChangedAt := GetFeeConfigLastChangedAt(state) + feeConfig := feemanager.GetStoredFeeConfig(state) + lastChangedAt := feemanager.GetFeeConfigLastChangedAt(state) require.Equal(t, testFeeConfig, feeConfig) require.Equal(t, testBlockNumber, lastChangedAt) }, @@ -261,65 +251,65 @@ var ( { Name: "readOnly_setFeeConfig_with_noRole_fails", Caller: allowlisttest.TestNoRoleAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(feemanager.Module.Address), InputFn: func(t testing.TB) []byte { - input, err := PackSetFeeConfig(testFeeConfig) + input, err := feemanager.PackSetFeeConfig(testFeeConfig) require.NoError(t, err) return input }, - SuppliedGas: SetFeeConfigGasCost, + SuppliedGas: feemanager.SetFeeConfigGasCost, ReadOnly: true, ExpectedErr: vm.ErrWriteProtection.Error(), }, { Name: "readOnly_setFeeConfig_with_allow_role_fails", Caller: allowlisttest.TestEnabledAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(feemanager.Module.Address), InputFn: func(t testing.TB) []byte { - input, err := PackSetFeeConfig(testFeeConfig) + input, err := feemanager.PackSetFeeConfig(testFeeConfig) require.NoError(t, err) return input }, - SuppliedGas: SetFeeConfigGasCost, + SuppliedGas: feemanager.SetFeeConfigGasCost, ReadOnly: true, ExpectedErr: vm.ErrWriteProtection.Error(), }, { Name: "readOnly_setFeeConfig_with_admin_role_fails", Caller: allowlisttest.TestAdminAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(feemanager.Module.Address), InputFn: func(t testing.TB) []byte { - input, err := PackSetFeeConfig(testFeeConfig) + input, err := feemanager.PackSetFeeConfig(testFeeConfig) require.NoError(t, err) return input }, - SuppliedGas: SetFeeConfigGasCost, + SuppliedGas: feemanager.SetFeeConfigGasCost, ReadOnly: true, ExpectedErr: vm.ErrWriteProtection.Error(), }, { Name: "insufficient_gas_setFeeConfig_from_admin", Caller: allowlisttest.TestAdminAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(feemanager.Module.Address), InputFn: func(t testing.TB) []byte { - input, err := PackSetFeeConfig(testFeeConfig) + input, err := feemanager.PackSetFeeConfig(testFeeConfig) require.NoError(t, err) return input }, - SuppliedGas: SetFeeConfigGasCost - 1, + SuppliedGas: feemanager.SetFeeConfigGasCost - 1, ReadOnly: false, ExpectedErr: vm.ErrOutOfGas.Error(), }, { Name: "set_config_with_extra_padded_bytes_should_fail_before_Durango", Caller: allowlisttest.TestEnabledAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(feemanager.Module.Address), InputFn: func(t testing.TB) []byte { - input, err := PackSetFeeConfig(testFeeConfig) + input, err := feemanager.PackSetFeeConfig(testFeeConfig) require.NoError(t, err) input = append(input, make([]byte, 32)...) @@ -330,9 +320,9 @@ var ( config.EXPECT().IsDurango(gomock.Any()).Return(false).AnyTimes() return config }, - SuppliedGas: SetFeeConfigGasCost, + SuppliedGas: feemanager.SetFeeConfigGasCost, ReadOnly: false, - ExpectedErr: ErrInvalidLen.Error(), + ExpectedErr: feemanager.ErrInvalidLen.Error(), SetupBlockContext: func(mbc *contract.MockBlockContext) { mbc.EXPECT().Number().Return(testBlockNumber).AnyTimes() mbc.EXPECT().Timestamp().Return(uint64(0)).AnyTimes() @@ -341,9 +331,9 @@ var ( { Name: "set_config_with_extra_padded_bytes_should_succeed_with_Durango", Caller: allowlisttest.TestEnabledAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(feemanager.Module.Address), InputFn: func(t testing.TB) []byte { - input, err := PackSetFeeConfig(testFeeConfig) + input, err := feemanager.PackSetFeeConfig(testFeeConfig) require.NoError(t, err) input = append(input, make([]byte, 32)...) @@ -354,7 +344,7 @@ var ( config.EXPECT().IsDurango(gomock.Any()).Return(true).AnyTimes() return config }, - SuppliedGas: SetFeeConfigGasCost + FeeConfigChangedEventGasCost, + SuppliedGas: feemanager.SetFeeConfigGasCost + feemanager.FeeConfigChangedEventGasCost, ReadOnly: false, ExpectedRes: []byte{}, SetupBlockContext: func(mbc *contract.MockBlockContext) { @@ -362,9 +352,9 @@ var ( mbc.EXPECT().Timestamp().Return(uint64(0)).AnyTimes() }, AfterHook: func(t testing.TB, state *extstate.StateDB) { - feeConfig := GetStoredFeeConfig(state) + feeConfig := feemanager.GetStoredFeeConfig(state) require.Equal(t, testFeeConfig, feeConfig) - lastChangedAt := GetFeeConfigLastChangedAt(state) + lastChangedAt := feemanager.GetFeeConfigLastChangedAt(state) require.Equal(t, testBlockNumber, lastChangedAt) logs := state.Logs() @@ -375,15 +365,15 @@ var ( { Name: "setFeeConfig_regression_test_should_fail_before_Durango", Caller: allowlisttest.TestEnabledAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(feemanager.Module.Address), Input: common.Hex2Bytes(regressionBytes), ChainConfigFn: func(ctrl *gomock.Controller) precompileconfig.ChainConfig { config := precompileconfig.NewMockChainConfig(ctrl) config.EXPECT().IsDurango(gomock.Any()).Return(false).AnyTimes() return config }, - SuppliedGas: SetFeeConfigGasCost, - ExpectedErr: ErrInvalidLen.Error(), + SuppliedGas: feemanager.SetFeeConfigGasCost, + ExpectedErr: feemanager.ErrInvalidLen.Error(), ReadOnly: false, SetupBlockContext: func(mbc *contract.MockBlockContext) { mbc.EXPECT().Number().Return(testBlockNumber).AnyTimes() @@ -393,14 +383,14 @@ var ( { Name: "setFeeConfig_regression_test_should_succeed_after_Durango", Caller: allowlisttest.TestEnabledAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(feemanager.Module.Address), Input: common.Hex2Bytes(regressionBytes), ChainConfigFn: func(ctrl *gomock.Controller) precompileconfig.ChainConfig { config := precompileconfig.NewMockChainConfig(ctrl) config.EXPECT().IsDurango(gomock.Any()).Return(true).AnyTimes() return config }, - SuppliedGas: SetFeeConfigGasCost + FeeConfigChangedEventGasCost, + SuppliedGas: feemanager.SetFeeConfigGasCost + feemanager.FeeConfigChangedEventGasCost, ReadOnly: false, ExpectedRes: []byte{}, SetupBlockContext: func(mbc *contract.MockBlockContext) { @@ -408,9 +398,9 @@ var ( mbc.EXPECT().Timestamp().Return(uint64(0)).AnyTimes() }, AfterHook: func(t testing.TB, state *extstate.StateDB) { - feeConfig := GetStoredFeeConfig(state) + feeConfig := feemanager.GetStoredFeeConfig(state) require.Equal(t, regressionFeeConfig, feeConfig) - lastChangedAt := GetFeeConfigLastChangedAt(state) + lastChangedAt := feemanager.GetFeeConfigLastChangedAt(state) require.Equal(t, testBlockNumber, lastChangedAt) logs := state.Logs() @@ -420,18 +410,18 @@ var ( { Name: "set_config_should_not_emit_event_before_Durango", Caller: allowlisttest.TestEnabledAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(feemanager.Module.Address), ChainConfigFn: func(ctrl *gomock.Controller) precompileconfig.ChainConfig { config := precompileconfig.NewMockChainConfig(ctrl) config.EXPECT().IsDurango(gomock.Any()).Return(false).AnyTimes() return config }, InputFn: func(t testing.TB) []byte { - input, err := PackSetFeeConfig(testFeeConfig) + input, err := feemanager.PackSetFeeConfig(testFeeConfig) require.NoError(t, err) return input }, - SuppliedGas: SetFeeConfigGasCost, + SuppliedGas: feemanager.SetFeeConfigGasCost, ReadOnly: false, ExpectedRes: []byte{}, AfterHook: func(t testing.TB, state *extstate.StateDB) { @@ -443,7 +433,7 @@ var ( ) func TestFeeManager(t *testing.T) { - allowlisttest.RunPrecompileWithAllowListTests(t, Module, tests) + allowlisttest.RunPrecompileWithAllowListTests(t, feemanager.Module, tests) } func assertFeeEvent( @@ -458,13 +448,13 @@ func assertFeeEvent( require.Equal( t, []common.Hash{ - FeeManagerABI.Events["FeeConfigChanged"].ID, + feemanager.FeeManagerABI.Events["FeeConfigChanged"].ID, common.BytesToHash(sender[:]), }, log.Topics, ) - oldFeeConfig, resFeeConfig, err := UnpackFeeConfigChangedEventData(log.Data) + oldFeeConfig, resFeeConfig, err := feemanager.UnpackFeeConfigChangedEventData(log.Data) require.NoError(t, err) require.True(t, expectedOldFeeConfig.Equal(&oldFeeConfig), "expected %v, got %v", expectedOldFeeConfig, oldFeeConfig) require.True(t, expectedNewFeeConfig.Equal(&resFeeConfig), "expected %v, got %v", expectedNewFeeConfig, resFeeConfig) diff --git a/precompile/contracts/feemanager/unpack_pack_test.go b/precompile/contracts/feemanager/unpack_pack_test.go index 2f46409624..ea8cb590f6 100644 --- a/precompile/contracts/feemanager/unpack_pack_test.go +++ b/precompile/contracts/feemanager/unpack_pack_test.go @@ -21,6 +21,7 @@ var ( setFeeConfigSignature = contract.CalculateFunctionSelector("setFeeConfig(uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256)") getFeeConfigSignature = contract.CalculateFunctionSelector("getFeeConfig()") getFeeConfigLastChangedAtSignature = contract.CalculateFunctionSelector("getFeeConfigLastChangedAt()") + testFeeConfig = commontype.ValidTestFeeConfig ) func FuzzPackGetFeeConfigOutputEqualTest(f *testing.F) { diff --git a/precompile/contracts/nativeminter/simulated_test.go b/precompile/contracts/nativeminter/simulated_test.go index e915319853..5560d82e97 100644 --- a/precompile/contracts/nativeminter/simulated_test.go +++ b/precompile/contracts/nativeminter/simulated_test.go @@ -19,6 +19,7 @@ import ( "github.com/ava-labs/subnet-evm/params/extras" "github.com/ava-labs/subnet-evm/plugin/evm/customtypes" "github.com/ava-labs/subnet-evm/precompile/allowlist" + "github.com/ava-labs/subnet-evm/precompile/allowlist/allowlisttest" "github.com/ava-labs/subnet-evm/precompile/contracts/nativeminter" "github.com/ava-labs/subnet-evm/precompile/contracts/testutils" "github.com/ava-labs/subnet-evm/utils" @@ -118,7 +119,7 @@ func TestNativeMinter(t *testing.T) { test: func(t *testing.T, backend *sim.Backend, nativeMinter *nativeminterbindings.INativeMinter) { testContractAddr, testContract := deployNativeMinterTest(t, backend, admin) - testutils.VerifyRole(t, nativeMinter, testContractAddr, allowlist.NoRole) + allowlisttest.VerifyRole(t, nativeMinter, testContractAddr, allowlist.NoRole) testAddr := common.HexToAddress("0x1234567890123456789012345678901234567890") @@ -132,11 +133,11 @@ func TestNativeMinter(t *testing.T) { test: func(t *testing.T, backend *sim.Backend, nativeMinter *nativeminterbindings.INativeMinter) { testContractAddr, _ := deployNativeMinterTest(t, backend, admin) - testutils.VerifyRole(t, nativeMinter, testContractAddr, allowlist.NoRole) + allowlisttest.VerifyRole(t, nativeMinter, testContractAddr, allowlist.NoRole) - testutils.SetAsEnabled(t, backend, nativeMinter, admin, testContractAddr) + allowlisttest.SetAsEnabled(t, backend, nativeMinter, admin, testContractAddr) - testutils.VerifyRole(t, nativeMinter, testContractAddr, allowlist.EnabledRole) + allowlisttest.VerifyRole(t, nativeMinter, testContractAddr, allowlist.EnabledRole) }, }, { @@ -145,7 +146,7 @@ func TestNativeMinter(t *testing.T) { testContractAddr, testContract := deployNativeMinterTest(t, backend, admin) testAddr := common.HexToAddress("0x1234567890123456789012345678901234567890") - testutils.SetAsEnabled(t, backend, nativeMinter, admin, testContractAddr) + allowlisttest.SetAsEnabled(t, backend, nativeMinter, admin, testContractAddr) initialBalance, err := backend.Client().BalanceAt(t.Context(), testAddr, nil) require.NoError(t, err) diff --git a/precompile/contracts/rewardmanager/config_test.go b/precompile/contracts/rewardmanager/config_test.go index 7c0b8beaab..201b97e2f7 100644 --- a/precompile/contracts/rewardmanager/config_test.go +++ b/precompile/contracts/rewardmanager/config_test.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. -package rewardmanager +package rewardmanager_test import ( "testing" @@ -10,6 +10,7 @@ import ( "go.uber.org/mock/gomock" "github.com/ava-labs/subnet-evm/precompile/allowlist/allowlisttest" + "github.com/ava-labs/subnet-evm/precompile/contracts/rewardmanager" "github.com/ava-labs/subnet-evm/precompile/precompileconfig" "github.com/ava-labs/subnet-evm/precompile/precompiletest" "github.com/ava-labs/subnet-evm/utils" @@ -21,14 +22,14 @@ func TestVerify(t *testing.T) { managers := []common.Address{allowlisttest.TestManagerAddr} tests := map[string]precompiletest.ConfigVerifyTest{ "both reward mechanisms should not be activated at the same time in reward manager": { - Config: NewConfig(utils.NewUint64(3), admins, enableds, managers, &InitialRewardConfig{ + Config: rewardmanager.NewConfig(utils.NewUint64(3), admins, enableds, managers, &rewardmanager.InitialRewardConfig{ AllowFeeRecipients: true, RewardAddress: common.HexToAddress("0x01"), }), - ExpectedError: ErrCannotEnableBothRewards.Error(), + ExpectedError: rewardmanager.ErrCannotEnableBothRewards.Error(), }, } - allowlisttest.VerifyPrecompileWithAllowListTests(t, Module, tests) + allowlisttest.VerifyPrecompileWithAllowListTests(t, rewardmanager.Module, tests) } func TestEqual(t *testing.T) { @@ -37,46 +38,46 @@ func TestEqual(t *testing.T) { managers := []common.Address{allowlisttest.TestManagerAddr} tests := map[string]precompiletest.ConfigEqualTest{ "non-nil config and nil other": { - Config: NewConfig(utils.NewUint64(3), admins, enableds, managers, nil), + Config: rewardmanager.NewConfig(utils.NewUint64(3), admins, enableds, managers, nil), Other: nil, Expected: false, }, "different type": { - Config: NewConfig(utils.NewUint64(3), admins, enableds, managers, nil), + Config: rewardmanager.NewConfig(utils.NewUint64(3), admins, enableds, managers, nil), Other: precompileconfig.NewMockConfig(gomock.NewController(t)), Expected: false, }, "different timestamp": { - Config: NewConfig(utils.NewUint64(3), admins, nil, nil, nil), - Other: NewConfig(utils.NewUint64(4), admins, nil, nil, nil), + Config: rewardmanager.NewConfig(utils.NewUint64(3), admins, nil, nil, nil), + Other: rewardmanager.NewConfig(utils.NewUint64(4), admins, nil, nil, nil), Expected: false, }, "non-nil initial config and nil initial config": { - Config: NewConfig(utils.NewUint64(3), admins, nil, nil, &InitialRewardConfig{ + Config: rewardmanager.NewConfig(utils.NewUint64(3), admins, nil, nil, &rewardmanager.InitialRewardConfig{ AllowFeeRecipients: true, }), - Other: NewConfig(utils.NewUint64(3), admins, nil, nil, nil), + Other: rewardmanager.NewConfig(utils.NewUint64(3), admins, nil, nil, nil), Expected: false, }, "different initial config": { - Config: NewConfig(utils.NewUint64(3), admins, nil, nil, &InitialRewardConfig{ + Config: rewardmanager.NewConfig(utils.NewUint64(3), admins, nil, nil, &rewardmanager.InitialRewardConfig{ RewardAddress: common.HexToAddress("0x01"), }), - Other: NewConfig(utils.NewUint64(3), admins, nil, nil, - &InitialRewardConfig{ + Other: rewardmanager.NewConfig(utils.NewUint64(3), admins, nil, nil, + &rewardmanager.InitialRewardConfig{ RewardAddress: common.HexToAddress("0x02"), }), Expected: false, }, "same config": { - Config: NewConfig(utils.NewUint64(3), admins, nil, nil, &InitialRewardConfig{ + Config: rewardmanager.NewConfig(utils.NewUint64(3), admins, nil, nil, &rewardmanager.InitialRewardConfig{ RewardAddress: common.HexToAddress("0x01"), }), - Other: NewConfig(utils.NewUint64(3), admins, nil, nil, &InitialRewardConfig{ + Other: rewardmanager.NewConfig(utils.NewUint64(3), admins, nil, nil, &rewardmanager.InitialRewardConfig{ RewardAddress: common.HexToAddress("0x01"), }), Expected: true, }, } - allowlisttest.EqualPrecompileWithAllowListTests(t, Module, tests) + allowlisttest.EqualPrecompileWithAllowListTests(t, rewardmanager.Module, tests) } diff --git a/precompile/contracts/rewardmanager/contract_test.go b/precompile/contracts/rewardmanager/contract_test.go index 0d932d40f6..39852eb751 100644 --- a/precompile/contracts/rewardmanager/contract_test.go +++ b/precompile/contracts/rewardmanager/contract_test.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. -package rewardmanager +package rewardmanager_test import ( "testing" @@ -15,6 +15,7 @@ import ( "github.com/ava-labs/subnet-evm/constants" "github.com/ava-labs/subnet-evm/core/extstate" "github.com/ava-labs/subnet-evm/precompile/allowlist/allowlisttest" + "github.com/ava-labs/subnet-evm/precompile/contracts/rewardmanager" "github.com/ava-labs/subnet-evm/precompile/precompileconfig" "github.com/ava-labs/subnet-evm/precompile/precompiletest" @@ -27,60 +28,60 @@ var ( { Name: "set_allow_fee_recipients_from_no_role_fails", Caller: allowlisttest.TestNoRoleAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(rewardmanager.Module.Address), InputFn: func(t testing.TB) []byte { - input, err := PackAllowFeeRecipients() + input, err := rewardmanager.PackAllowFeeRecipients() require.NoError(t, err) return input }, - SuppliedGas: AllowFeeRecipientsGasCost, + SuppliedGas: rewardmanager.AllowFeeRecipientsGasCost, ReadOnly: false, - ExpectedErr: ErrCannotAllowFeeRecipients.Error(), + ExpectedErr: rewardmanager.ErrCannotAllowFeeRecipients.Error(), }, { Name: "set_reward_address_from_no_role_fails", Caller: allowlisttest.TestNoRoleAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(rewardmanager.Module.Address), InputFn: func(t testing.TB) []byte { - input, err := PackSetRewardAddress(rewardAddress) + input, err := rewardmanager.PackSetRewardAddress(rewardAddress) require.NoError(t, err) return input }, - SuppliedGas: SetRewardAddressGasCost, + SuppliedGas: rewardmanager.SetRewardAddressGasCost, ReadOnly: false, - ExpectedErr: ErrCannotSetRewardAddress.Error(), + ExpectedErr: rewardmanager.ErrCannotSetRewardAddress.Error(), }, { Name: "disable_rewards_from_no_role_fails", Caller: allowlisttest.TestNoRoleAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(rewardmanager.Module.Address), InputFn: func(t testing.TB) []byte { - input, err := PackDisableRewards() + input, err := rewardmanager.PackDisableRewards() require.NoError(t, err) return input }, - SuppliedGas: DisableRewardsGasCost, + SuppliedGas: rewardmanager.DisableRewardsGasCost, ReadOnly: false, - ExpectedErr: ErrCannotDisableRewards.Error(), + ExpectedErr: rewardmanager.ErrCannotDisableRewards.Error(), }, { Name: "set_allow_fee_recipients_from_enabled_succeeds", Caller: allowlisttest.TestEnabledAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(rewardmanager.Module.Address), InputFn: func(t testing.TB) []byte { - input, err := PackAllowFeeRecipients() + input, err := rewardmanager.PackAllowFeeRecipients() require.NoError(t, err) return input }, - SuppliedGas: AllowFeeRecipientsGasCost + FeeRecipientsAllowedEventGasCost, + SuppliedGas: rewardmanager.AllowFeeRecipientsGasCost + rewardmanager.FeeRecipientsAllowedEventGasCost, ReadOnly: false, ExpectedRes: []byte{}, AfterHook: func(t testing.TB, state *extstate.StateDB) { - _, isFeeRecipients := GetStoredRewardAddress(state) + _, isFeeRecipients := rewardmanager.GetStoredRewardAddress(state) require.True(t, isFeeRecipients) logs := state.Logs() @@ -90,9 +91,9 @@ var ( { Name: "set_fee_recipients_should_not_emit_events_pre_Durango", Caller: allowlisttest.TestEnabledAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(rewardmanager.Module.Address), InputFn: func(t testing.TB) []byte { - input, err := PackAllowFeeRecipients() + input, err := rewardmanager.PackAllowFeeRecipients() require.NoError(t, err) return input @@ -104,7 +105,7 @@ var ( mockChainConfig.EXPECT().IsDurango(gomock.Any()).AnyTimes().Return(false) return mockChainConfig }, - SuppliedGas: AllowFeeRecipientsGasCost, + SuppliedGas: rewardmanager.AllowFeeRecipientsGasCost, ReadOnly: false, ExpectedRes: []byte{}, AfterHook: func(t testing.TB, stateDB *extstate.StateDB) { @@ -116,18 +117,18 @@ var ( { Name: "set_reward_address_from_enabled_succeeds", Caller: allowlisttest.TestEnabledAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(rewardmanager.Module.Address), InputFn: func(t testing.TB) []byte { - input, err := PackSetRewardAddress(rewardAddress) + input, err := rewardmanager.PackSetRewardAddress(rewardAddress) require.NoError(t, err) return input }, - SuppliedGas: SetRewardAddressGasCost + RewardAddressChangedEventGasCost, + SuppliedGas: rewardmanager.SetRewardAddressGasCost + rewardmanager.RewardAddressChangedEventGasCost, ReadOnly: false, ExpectedRes: []byte{}, AfterHook: func(t testing.TB, state *extstate.StateDB) { - address, isFeeRecipients := GetStoredRewardAddress(state) + address, isFeeRecipients := rewardmanager.GetStoredRewardAddress(state) require.Equal(t, rewardAddress, address) require.False(t, isFeeRecipients) @@ -138,18 +139,18 @@ var ( { Name: "set_allow_fee_recipients_from_manager_succeeds", Caller: allowlisttest.TestManagerAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(rewardmanager.Module.Address), InputFn: func(t testing.TB) []byte { - input, err := PackAllowFeeRecipients() + input, err := rewardmanager.PackAllowFeeRecipients() require.NoError(t, err) return input }, - SuppliedGas: AllowFeeRecipientsGasCost + FeeRecipientsAllowedEventGasCost, + SuppliedGas: rewardmanager.AllowFeeRecipientsGasCost + rewardmanager.FeeRecipientsAllowedEventGasCost, ReadOnly: false, ExpectedRes: []byte{}, AfterHook: func(t testing.TB, state *extstate.StateDB) { - _, isFeeRecipients := GetStoredRewardAddress(state) + _, isFeeRecipients := rewardmanager.GetStoredRewardAddress(state) require.True(t, isFeeRecipients) logs := state.Logs() @@ -159,18 +160,18 @@ var ( { Name: "set_reward_address_from_manager_succeeds", Caller: allowlisttest.TestManagerAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(rewardmanager.Module.Address), InputFn: func(t testing.TB) []byte { - input, err := PackSetRewardAddress(rewardAddress) + input, err := rewardmanager.PackSetRewardAddress(rewardAddress) require.NoError(t, err) return input }, - SuppliedGas: SetRewardAddressGasCost + RewardAddressChangedEventGasCost, + SuppliedGas: rewardmanager.SetRewardAddressGasCost + rewardmanager.RewardAddressChangedEventGasCost, ReadOnly: false, ExpectedRes: []byte{}, AfterHook: func(t testing.TB, state *extstate.StateDB) { - address, isFeeRecipients := GetStoredRewardAddress(state) + address, isFeeRecipients := rewardmanager.GetStoredRewardAddress(state) require.Equal(t, rewardAddress, address) require.False(t, isFeeRecipients) @@ -181,9 +182,9 @@ var ( { Name: "change_reward_address_should_not_emit_events_pre_Durango", Caller: allowlisttest.TestManagerAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(rewardmanager.Module.Address), InputFn: func(t testing.TB) []byte { - input, err := PackSetRewardAddress(rewardAddress) + input, err := rewardmanager.PackSetRewardAddress(rewardAddress) require.NoError(t, err) return input @@ -195,7 +196,7 @@ var ( mockChainConfig.EXPECT().IsDurango(gomock.Any()).AnyTimes().Return(false) return mockChainConfig }, - SuppliedGas: SetRewardAddressGasCost, + SuppliedGas: rewardmanager.SetRewardAddressGasCost, ReadOnly: false, ExpectedRes: []byte{}, AfterHook: func(t testing.TB, stateDB *extstate.StateDB) { @@ -207,18 +208,18 @@ var ( { Name: "disable_rewards_from_manager_succeeds", Caller: allowlisttest.TestManagerAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(rewardmanager.Module.Address), InputFn: func(t testing.TB) []byte { - input, err := PackDisableRewards() + input, err := rewardmanager.PackDisableRewards() require.NoError(t, err) return input }, - SuppliedGas: DisableRewardsGasCost + RewardsDisabledEventGasCost, + SuppliedGas: rewardmanager.DisableRewardsGasCost + rewardmanager.RewardsDisabledEventGasCost, ReadOnly: false, ExpectedRes: []byte{}, AfterHook: func(t testing.TB, state *extstate.StateDB) { - address, isFeeRecipients := GetStoredRewardAddress(state) + address, isFeeRecipients := rewardmanager.GetStoredRewardAddress(state) require.False(t, isFeeRecipients) require.Equal(t, constants.BlackholeAddr, address) @@ -229,18 +230,18 @@ var ( { Name: "disable_rewards_from_enabled_succeeds", Caller: allowlisttest.TestEnabledAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(rewardmanager.Module.Address), InputFn: func(t testing.TB) []byte { - input, err := PackDisableRewards() + input, err := rewardmanager.PackDisableRewards() require.NoError(t, err) return input }, - SuppliedGas: DisableRewardsGasCost + RewardsDisabledEventGasCost, + SuppliedGas: rewardmanager.DisableRewardsGasCost + rewardmanager.RewardsDisabledEventGasCost, ReadOnly: false, ExpectedRes: []byte{}, AfterHook: func(t testing.TB, state *extstate.StateDB) { - address, isFeeRecipients := GetStoredRewardAddress(state) + address, isFeeRecipients := rewardmanager.GetStoredRewardAddress(state) require.False(t, isFeeRecipients) require.Equal(t, constants.BlackholeAddr, address) @@ -251,9 +252,9 @@ var ( { Name: "disable_rewards_should_not_emit_event_pre_Durango", Caller: allowlisttest.TestManagerAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(rewardmanager.Module.Address), InputFn: func(t testing.TB) []byte { - input, err := PackDisableRewards() + input, err := rewardmanager.PackDisableRewards() require.NoError(t, err) return input @@ -265,7 +266,7 @@ var ( mockChainConfig.EXPECT().IsDurango(gomock.Any()).AnyTimes().Return(false) return mockChainConfig }, - SuppliedGas: SetRewardAddressGasCost, + SuppliedGas: rewardmanager.SetRewardAddressGasCost, ReadOnly: false, ExpectedRes: []byte{}, AfterHook: func(t testing.TB, stateDB *extstate.StateDB) { @@ -278,19 +279,19 @@ var ( Name: "get_current_reward_address_from_no_role_succeeds", Caller: allowlisttest.TestNoRoleAddr, BeforeHook: func(t testing.TB, state *extstate.StateDB) { - allowlisttest.SetDefaultRoles(Module.Address)(t, state) - StoreRewardAddress(state, rewardAddress) + allowlisttest.SetDefaultRoles(rewardmanager.Module.Address)(t, state) + rewardmanager.StoreRewardAddress(state, rewardAddress) }, InputFn: func(t testing.TB) []byte { - input, err := PackCurrentRewardAddress() + input, err := rewardmanager.PackCurrentRewardAddress() require.NoError(t, err) return input }, - SuppliedGas: CurrentRewardAddressGasCost, + SuppliedGas: rewardmanager.CurrentRewardAddressGasCost, ReadOnly: false, ExpectedRes: func() []byte { - res, err := PackCurrentRewardAddressOutput(rewardAddress) + res, err := rewardmanager.PackCurrentRewardAddressOutput(rewardAddress) if err != nil { panic(err) } @@ -301,18 +302,18 @@ var ( Name: "get_are_fee_recipients_allowed_from_no_role_succeeds", Caller: allowlisttest.TestNoRoleAddr, BeforeHook: func(t testing.TB, state *extstate.StateDB) { - allowlisttest.SetDefaultRoles(Module.Address)(t, state) - EnableAllowFeeRecipients(state) + allowlisttest.SetDefaultRoles(rewardmanager.Module.Address)(t, state) + rewardmanager.EnableAllowFeeRecipients(state) }, InputFn: func(t testing.TB) []byte { - input, err := PackAreFeeRecipientsAllowed() + input, err := rewardmanager.PackAreFeeRecipientsAllowed() require.NoError(t, err) return input }, - SuppliedGas: AreFeeRecipientsAllowedGasCost, + SuppliedGas: rewardmanager.AreFeeRecipientsAllowedGasCost, ReadOnly: false, ExpectedRes: func() []byte { - res, err := PackAreFeeRecipientsAllowedOutput(true) + res, err := rewardmanager.PackAreFeeRecipientsAllowedOutput(true) if err != nil { panic(err) } @@ -322,21 +323,21 @@ var ( { Name: "get_initial_config_with_address", Caller: allowlisttest.TestNoRoleAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(rewardmanager.Module.Address), InputFn: func(t testing.TB) []byte { - input, err := PackCurrentRewardAddress() + input, err := rewardmanager.PackCurrentRewardAddress() require.NoError(t, err) return input }, - SuppliedGas: CurrentRewardAddressGasCost, - Config: &Config{ - InitialRewardConfig: &InitialRewardConfig{ + SuppliedGas: rewardmanager.CurrentRewardAddressGasCost, + Config: &rewardmanager.Config{ + InitialRewardConfig: &rewardmanager.InitialRewardConfig{ RewardAddress: rewardAddress, }, }, ReadOnly: false, ExpectedRes: func() []byte { - res, err := PackCurrentRewardAddressOutput(rewardAddress) + res, err := rewardmanager.PackCurrentRewardAddressOutput(rewardAddress) if err != nil { panic(err) } @@ -346,21 +347,21 @@ var ( { Name: "get_initial_config_with_allow_fee_recipients_enabled", Caller: allowlisttest.TestNoRoleAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(rewardmanager.Module.Address), InputFn: func(t testing.TB) []byte { - input, err := PackAreFeeRecipientsAllowed() + input, err := rewardmanager.PackAreFeeRecipientsAllowed() require.NoError(t, err) return input }, - SuppliedGas: AreFeeRecipientsAllowedGasCost, - Config: &Config{ - InitialRewardConfig: &InitialRewardConfig{ + SuppliedGas: rewardmanager.AreFeeRecipientsAllowedGasCost, + Config: &rewardmanager.Config{ + InitialRewardConfig: &rewardmanager.InitialRewardConfig{ AllowFeeRecipients: true, }, }, ReadOnly: false, ExpectedRes: func() []byte { - res, err := PackAreFeeRecipientsAllowedOutput(true) + res, err := rewardmanager.PackAreFeeRecipientsAllowedOutput(true) if err != nil { panic(err) } @@ -370,84 +371,84 @@ var ( { Name: "readOnly_allow_fee_recipients_with_allowed_role_fails", Caller: allowlisttest.TestEnabledAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(rewardmanager.Module.Address), InputFn: func(t testing.TB) []byte { - input, err := PackAllowFeeRecipients() + input, err := rewardmanager.PackAllowFeeRecipients() require.NoError(t, err) return input }, - SuppliedGas: AllowFeeRecipientsGasCost, + SuppliedGas: rewardmanager.AllowFeeRecipientsGasCost, ReadOnly: true, ExpectedErr: vm.ErrWriteProtection.Error(), }, { Name: "readOnly_set_reward_address_with_allowed_role_fails", Caller: allowlisttest.TestEnabledAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(rewardmanager.Module.Address), InputFn: func(t testing.TB) []byte { - input, err := PackSetRewardAddress(rewardAddress) + input, err := rewardmanager.PackSetRewardAddress(rewardAddress) require.NoError(t, err) return input }, - SuppliedGas: SetRewardAddressGasCost, + SuppliedGas: rewardmanager.SetRewardAddressGasCost, ReadOnly: true, ExpectedErr: vm.ErrWriteProtection.Error(), }, { Name: "insufficient_gas_set_reward_address_from_allowed_role", Caller: allowlisttest.TestEnabledAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(rewardmanager.Module.Address), InputFn: func(t testing.TB) []byte { - input, err := PackSetRewardAddress(rewardAddress) + input, err := rewardmanager.PackSetRewardAddress(rewardAddress) require.NoError(t, err) return input }, - SuppliedGas: SetRewardAddressGasCost + RewardAddressChangedEventGasCost - 1, + SuppliedGas: rewardmanager.SetRewardAddressGasCost + rewardmanager.RewardAddressChangedEventGasCost - 1, ReadOnly: false, ExpectedErr: vm.ErrOutOfGas.Error(), }, { Name: "insufficient_gas_allow_fee_recipients_from_allowed_role", Caller: allowlisttest.TestEnabledAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(rewardmanager.Module.Address), InputFn: func(t testing.TB) []byte { - input, err := PackAllowFeeRecipients() + input, err := rewardmanager.PackAllowFeeRecipients() require.NoError(t, err) return input }, - SuppliedGas: AllowFeeRecipientsGasCost + FeeRecipientsAllowedEventGasCost - 1, + SuppliedGas: rewardmanager.AllowFeeRecipientsGasCost + rewardmanager.FeeRecipientsAllowedEventGasCost - 1, ReadOnly: false, ExpectedErr: vm.ErrOutOfGas.Error(), }, { Name: "insufficient_gas_read_current_reward_address_from_allowed_role", Caller: allowlisttest.TestEnabledAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(rewardmanager.Module.Address), InputFn: func(t testing.TB) []byte { - input, err := PackCurrentRewardAddress() + input, err := rewardmanager.PackCurrentRewardAddress() require.NoError(t, err) return input }, - SuppliedGas: CurrentRewardAddressGasCost - 1, + SuppliedGas: rewardmanager.CurrentRewardAddressGasCost - 1, ReadOnly: false, ExpectedErr: vm.ErrOutOfGas.Error(), }, { Name: "insufficient_gas_are_fee_recipients_allowed_from_allowed_role", Caller: allowlisttest.TestEnabledAddr, - BeforeHook: allowlisttest.SetDefaultRoles(Module.Address), + BeforeHook: allowlisttest.SetDefaultRoles(rewardmanager.Module.Address), InputFn: func(t testing.TB) []byte { - input, err := PackAreFeeRecipientsAllowed() + input, err := rewardmanager.PackAreFeeRecipientsAllowed() require.NoError(t, err) return input }, - SuppliedGas: AreFeeRecipientsAllowedGasCost - 1, + SuppliedGas: rewardmanager.AreFeeRecipientsAllowedGasCost - 1, ReadOnly: false, ExpectedErr: vm.ErrOutOfGas.Error(), }, @@ -455,7 +456,7 @@ var ( ) func TestRewardManagerRun(t *testing.T) { - allowlisttest.RunPrecompileWithAllowListTests(t, Module, tests) + allowlisttest.RunPrecompileWithAllowListTests(t, rewardmanager.Module, tests) } func assertRewardAddressChanged( @@ -470,7 +471,7 @@ func assertRewardAddressChanged( require.Equal( t, []common.Hash{ - RewardManagerABI.Events["RewardAddressChanged"].ID, + rewardmanager.RewardManagerABI.Events["RewardAddressChanged"].ID, common.BytesToHash(caller[:]), common.BytesToHash(oldAddress[:]), common.BytesToHash(newAddress[:]), @@ -490,7 +491,7 @@ func assertRewardsDisabled( require.Equal( t, []common.Hash{ - RewardManagerABI.Events["RewardsDisabled"].ID, + rewardmanager.RewardManagerABI.Events["RewardsDisabled"].ID, common.BytesToHash(caller[:]), }, log.Topics, @@ -508,7 +509,7 @@ func assertFeeRecipientsAllowed( require.Equal( t, []common.Hash{ - RewardManagerABI.Events["FeeRecipientsAllowed"].ID, + rewardmanager.RewardManagerABI.Events["FeeRecipientsAllowed"].ID, common.BytesToHash(caller[:]), }, log.Topics, diff --git a/precompile/contracts/txallowlist/config_test.go b/precompile/contracts/txallowlist/config_test.go index 31ecf4aaea..61b2a6b2ef 100644 --- a/precompile/contracts/txallowlist/config_test.go +++ b/precompile/contracts/txallowlist/config_test.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. -package txallowlist +package txallowlist_test import ( "testing" @@ -10,13 +10,14 @@ import ( "go.uber.org/mock/gomock" "github.com/ava-labs/subnet-evm/precompile/allowlist/allowlisttest" + "github.com/ava-labs/subnet-evm/precompile/contracts/txallowlist" "github.com/ava-labs/subnet-evm/precompile/precompileconfig" "github.com/ava-labs/subnet-evm/precompile/precompiletest" "github.com/ava-labs/subnet-evm/utils" ) func TestVerify(t *testing.T) { - allowlisttest.VerifyPrecompileWithAllowListTests(t, Module, nil) + allowlisttest.VerifyPrecompileWithAllowListTests(t, txallowlist.Module, nil) } func TestEqual(t *testing.T) { @@ -25,25 +26,25 @@ func TestEqual(t *testing.T) { managers := []common.Address{allowlisttest.TestManagerAddr} tests := map[string]precompiletest.ConfigEqualTest{ "non-nil config and nil other": { - Config: NewConfig(utils.NewUint64(3), admins, enableds, managers), + Config: txallowlist.NewConfig(utils.NewUint64(3), admins, enableds, managers), Other: nil, Expected: false, }, "different type": { - Config: NewConfig(nil, nil, nil, nil), + Config: txallowlist.NewConfig(nil, nil, nil, nil), Other: precompileconfig.NewMockConfig(gomock.NewController(t)), Expected: false, }, "different timestamp": { - Config: NewConfig(utils.NewUint64(3), admins, enableds, managers), - Other: NewConfig(utils.NewUint64(4), admins, enableds, managers), + Config: txallowlist.NewConfig(utils.NewUint64(3), admins, enableds, managers), + Other: txallowlist.NewConfig(utils.NewUint64(4), admins, enableds, managers), Expected: false, }, "same config": { - Config: NewConfig(utils.NewUint64(3), admins, enableds, managers), - Other: NewConfig(utils.NewUint64(3), admins, enableds, managers), + Config: txallowlist.NewConfig(utils.NewUint64(3), admins, enableds, managers), + Other: txallowlist.NewConfig(utils.NewUint64(3), admins, enableds, managers), Expected: true, }, } - allowlisttest.EqualPrecompileWithAllowListTests(t, Module, tests) + allowlisttest.EqualPrecompileWithAllowListTests(t, txallowlist.Module, tests) } diff --git a/precompile/contracts/txallowlist/contract_test.go b/precompile/contracts/txallowlist/contract_test.go index bdbe3b7c1b..26aebc18d4 100644 --- a/precompile/contracts/txallowlist/contract_test.go +++ b/precompile/contracts/txallowlist/contract_test.go @@ -1,14 +1,15 @@ // Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. -package txallowlist +package txallowlist_test import ( "testing" "github.com/ava-labs/subnet-evm/precompile/allowlist/allowlisttest" + "github.com/ava-labs/subnet-evm/precompile/contracts/txallowlist" ) func TestTxAllowListRun(t *testing.T) { - allowlisttest.RunPrecompileWithAllowListTests(t, Module, nil) + allowlisttest.RunPrecompileWithAllowListTests(t, txallowlist.Module, nil) }