From b2ae4238018c3177178593070268f761c9c9c10a Mon Sep 17 00:00:00 2001 From: Andres Martin Aiello <50411235+andresaiello@users.noreply.github.com> Date: Fri, 8 Sep 2023 11:52:40 -0300 Subject: [PATCH] feat: Add IWETH9 with solidity 0.8 to protocol-contracts (#81) --- contracts/zevm/interfaces/IWZETA.sol | 25 + lib/address.helpers.ts | 2 +- lib/address.tools.ts | 4 +- .../zevm/interfaces/iwzeta.sol/iweth9.go | 977 ++++++++++++++++++ test/ZetaTokenConsumer.spec.ts | 18 +- .../zevm/interfaces/IWZETA.sol/IWETH9.ts | 438 ++++++++ .../zevm/interfaces/IWZETA.sol/index.ts | 4 + .../contracts/zevm/interfaces/index.ts | 2 + .../interfaces/IWZETA.sol/IWETH9__factory.ts | 264 +++++ .../zevm/interfaces/IWZETA.sol/index.ts | 4 + .../contracts/zevm/interfaces/index.ts | 1 + typechain-types/hardhat.d.ts | 9 + typechain-types/index.ts | 2 + 13 files changed, 1738 insertions(+), 12 deletions(-) create mode 100644 contracts/zevm/interfaces/IWZETA.sol create mode 100644 pkg/contracts/zevm/interfaces/iwzeta.sol/iweth9.go create mode 100644 typechain-types/contracts/zevm/interfaces/IWZETA.sol/IWETH9.ts create mode 100644 typechain-types/contracts/zevm/interfaces/IWZETA.sol/index.ts create mode 100644 typechain-types/factories/contracts/zevm/interfaces/IWZETA.sol/IWETH9__factory.ts create mode 100644 typechain-types/factories/contracts/zevm/interfaces/IWZETA.sol/index.ts diff --git a/contracts/zevm/interfaces/IWZETA.sol b/contracts/zevm/interfaces/IWZETA.sol new file mode 100644 index 00000000..f5a895d2 --- /dev/null +++ b/contracts/zevm/interfaces/IWZETA.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.7; + +interface IWETH9 { + event Approval(address indexed owner, address indexed spender, uint value); + event Transfer(address indexed from, address indexed to, uint value); + event Deposit(address indexed dst, uint wad); + event Withdrawal(address indexed src, uint wad); + + function totalSupply() external view returns (uint); + + function balanceOf(address owner) external view returns (uint); + + function allowance(address owner, address spender) external view returns (uint); + + function approve(address spender, uint wad) external returns (bool); + + function transfer(address to, uint wad) external returns (bool); + + function transferFrom(address from, address to, uint wad) external returns (bool); + + function deposit() external payable; + + function withdraw(uint wad) external; +} diff --git a/lib/address.helpers.ts b/lib/address.helpers.ts index b73913cf..336471d9 100644 --- a/lib/address.helpers.ts +++ b/lib/address.helpers.ts @@ -10,7 +10,7 @@ const MissingZetaNetworkError = new Error( export const ProtocolNetworkNetworkNameMap: Record = { baobab_testnet: "klaytn-baobab", bsc_testnet: "bsc-testnet", - etherum_mainnet: "eth-mainnet", + ethereum_mainnet: "eth-mainnet", goerli_testnet: "goerli", mumbai_testnet: "polygon-mumbai", zeta_testnet: "athens", diff --git a/lib/address.tools.ts b/lib/address.tools.ts index d2374e37..3a2c952c 100644 --- a/lib/address.tools.ts +++ b/lib/address.tools.ts @@ -49,8 +49,8 @@ export declare type NonZetaAddress = "uniswapV2Router02" | "uniswapV3Factory" | export const nonZetaAddress: NonZetaAddress[] = ["uniswapV2Router02", "uniswapV3Router", "uniswapV3Factory", "weth9"]; -export declare type ZetaProtocolMainNetwork = "etherum_mainnet"; -export const zetaProtocolMainNetworks: ZetaProtocolMainNetwork[] = ["etherum_mainnet"]; +export declare type ZetaProtocolMainNetwork = "ethereum_mainnet"; +export const zetaProtocolMainNetworks: ZetaProtocolMainNetwork[] = ["ethereum_mainnet"]; export declare type ZetaProtocolNetwork = ZetaProtocolMainNetwork | ZetaProtocolTestNetwork; export const zetaProtocolNetworks: ZetaProtocolNetwork[] = [...zetaProtocolTestNetworks, ...zetaProtocolMainNetworks]; diff --git a/pkg/contracts/zevm/interfaces/iwzeta.sol/iweth9.go b/pkg/contracts/zevm/interfaces/iwzeta.sol/iweth9.go new file mode 100644 index 00000000..c152269a --- /dev/null +++ b/pkg/contracts/zevm/interfaces/iwzeta.sol/iweth9.go @@ -0,0 +1,977 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package iwzeta + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +// IWETH9MetaData contains all meta data concerning the IWETH9 contract. +var IWETH9MetaData = &bind.MetaData{ + ABI: "[{\"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\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"src\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"Withdrawal\",\"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\":\"wad\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"payable\",\"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\":\"wad\",\"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\":\"wad\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", +} + +// IWETH9ABI is the input ABI used to generate the binding from. +// Deprecated: Use IWETH9MetaData.ABI instead. +var IWETH9ABI = IWETH9MetaData.ABI + +// IWETH9 is an auto generated Go binding around an Ethereum contract. +type IWETH9 struct { + IWETH9Caller // Read-only binding to the contract + IWETH9Transactor // Write-only binding to the contract + IWETH9Filterer // Log filterer for contract events +} + +// IWETH9Caller is an auto generated read-only Go binding around an Ethereum contract. +type IWETH9Caller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// IWETH9Transactor is an auto generated write-only Go binding around an Ethereum contract. +type IWETH9Transactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// IWETH9Filterer is an auto generated log filtering Go binding around an Ethereum contract events. +type IWETH9Filterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// IWETH9Session is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type IWETH9Session struct { + Contract *IWETH9 // 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 +} + +// IWETH9CallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type IWETH9CallerSession struct { + Contract *IWETH9Caller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// IWETH9TransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type IWETH9TransactorSession struct { + Contract *IWETH9Transactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// IWETH9Raw is an auto generated low-level Go binding around an Ethereum contract. +type IWETH9Raw struct { + Contract *IWETH9 // Generic contract binding to access the raw methods on +} + +// IWETH9CallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type IWETH9CallerRaw struct { + Contract *IWETH9Caller // Generic read-only contract binding to access the raw methods on +} + +// IWETH9TransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type IWETH9TransactorRaw struct { + Contract *IWETH9Transactor // Generic write-only contract binding to access the raw methods on +} + +// NewIWETH9 creates a new instance of IWETH9, bound to a specific deployed contract. +func NewIWETH9(address common.Address, backend bind.ContractBackend) (*IWETH9, error) { + contract, err := bindIWETH9(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &IWETH9{IWETH9Caller: IWETH9Caller{contract: contract}, IWETH9Transactor: IWETH9Transactor{contract: contract}, IWETH9Filterer: IWETH9Filterer{contract: contract}}, nil +} + +// NewIWETH9Caller creates a new read-only instance of IWETH9, bound to a specific deployed contract. +func NewIWETH9Caller(address common.Address, caller bind.ContractCaller) (*IWETH9Caller, error) { + contract, err := bindIWETH9(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &IWETH9Caller{contract: contract}, nil +} + +// NewIWETH9Transactor creates a new write-only instance of IWETH9, bound to a specific deployed contract. +func NewIWETH9Transactor(address common.Address, transactor bind.ContractTransactor) (*IWETH9Transactor, error) { + contract, err := bindIWETH9(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &IWETH9Transactor{contract: contract}, nil +} + +// NewIWETH9Filterer creates a new log filterer instance of IWETH9, bound to a specific deployed contract. +func NewIWETH9Filterer(address common.Address, filterer bind.ContractFilterer) (*IWETH9Filterer, error) { + contract, err := bindIWETH9(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &IWETH9Filterer{contract: contract}, nil +} + +// bindIWETH9 binds a generic wrapper to an already deployed contract. +func bindIWETH9(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := IWETH9MetaData.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 (_IWETH9 *IWETH9Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _IWETH9.Contract.IWETH9Caller.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 (_IWETH9 *IWETH9Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _IWETH9.Contract.IWETH9Transactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_IWETH9 *IWETH9Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _IWETH9.Contract.IWETH9Transactor.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 (_IWETH9 *IWETH9CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _IWETH9.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 (_IWETH9 *IWETH9TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _IWETH9.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_IWETH9 *IWETH9TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _IWETH9.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 (_IWETH9 *IWETH9Caller) Allowance(opts *bind.CallOpts, owner common.Address, spender common.Address) (*big.Int, error) { + var out []interface{} + err := _IWETH9.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 (_IWETH9 *IWETH9Session) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { + return _IWETH9.Contract.Allowance(&_IWETH9.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 (_IWETH9 *IWETH9CallerSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { + return _IWETH9.Contract.Allowance(&_IWETH9.CallOpts, owner, spender) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address owner) view returns(uint256) +func (_IWETH9 *IWETH9Caller) BalanceOf(opts *bind.CallOpts, owner common.Address) (*big.Int, error) { + var out []interface{} + err := _IWETH9.contract.Call(opts, &out, "balanceOf", owner) + + 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 owner) view returns(uint256) +func (_IWETH9 *IWETH9Session) BalanceOf(owner common.Address) (*big.Int, error) { + return _IWETH9.Contract.BalanceOf(&_IWETH9.CallOpts, owner) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address owner) view returns(uint256) +func (_IWETH9 *IWETH9CallerSession) BalanceOf(owner common.Address) (*big.Int, error) { + return _IWETH9.Contract.BalanceOf(&_IWETH9.CallOpts, owner) +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_IWETH9 *IWETH9Caller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _IWETH9.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 (_IWETH9 *IWETH9Session) TotalSupply() (*big.Int, error) { + return _IWETH9.Contract.TotalSupply(&_IWETH9.CallOpts) +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_IWETH9 *IWETH9CallerSession) TotalSupply() (*big.Int, error) { + return _IWETH9.Contract.TotalSupply(&_IWETH9.CallOpts) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 wad) returns(bool) +func (_IWETH9 *IWETH9Transactor) Approve(opts *bind.TransactOpts, spender common.Address, wad *big.Int) (*types.Transaction, error) { + return _IWETH9.contract.Transact(opts, "approve", spender, wad) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 wad) returns(bool) +func (_IWETH9 *IWETH9Session) Approve(spender common.Address, wad *big.Int) (*types.Transaction, error) { + return _IWETH9.Contract.Approve(&_IWETH9.TransactOpts, spender, wad) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 wad) returns(bool) +func (_IWETH9 *IWETH9TransactorSession) Approve(spender common.Address, wad *big.Int) (*types.Transaction, error) { + return _IWETH9.Contract.Approve(&_IWETH9.TransactOpts, spender, wad) +} + +// Deposit is a paid mutator transaction binding the contract method 0xd0e30db0. +// +// Solidity: function deposit() payable returns() +func (_IWETH9 *IWETH9Transactor) Deposit(opts *bind.TransactOpts) (*types.Transaction, error) { + return _IWETH9.contract.Transact(opts, "deposit") +} + +// Deposit is a paid mutator transaction binding the contract method 0xd0e30db0. +// +// Solidity: function deposit() payable returns() +func (_IWETH9 *IWETH9Session) Deposit() (*types.Transaction, error) { + return _IWETH9.Contract.Deposit(&_IWETH9.TransactOpts) +} + +// Deposit is a paid mutator transaction binding the contract method 0xd0e30db0. +// +// Solidity: function deposit() payable returns() +func (_IWETH9 *IWETH9TransactorSession) Deposit() (*types.Transaction, error) { + return _IWETH9.Contract.Deposit(&_IWETH9.TransactOpts) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address to, uint256 wad) returns(bool) +func (_IWETH9 *IWETH9Transactor) Transfer(opts *bind.TransactOpts, to common.Address, wad *big.Int) (*types.Transaction, error) { + return _IWETH9.contract.Transact(opts, "transfer", to, wad) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address to, uint256 wad) returns(bool) +func (_IWETH9 *IWETH9Session) Transfer(to common.Address, wad *big.Int) (*types.Transaction, error) { + return _IWETH9.Contract.Transfer(&_IWETH9.TransactOpts, to, wad) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address to, uint256 wad) returns(bool) +func (_IWETH9 *IWETH9TransactorSession) Transfer(to common.Address, wad *big.Int) (*types.Transaction, error) { + return _IWETH9.Contract.Transfer(&_IWETH9.TransactOpts, to, wad) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address from, address to, uint256 wad) returns(bool) +func (_IWETH9 *IWETH9Transactor) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, wad *big.Int) (*types.Transaction, error) { + return _IWETH9.contract.Transact(opts, "transferFrom", from, to, wad) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address from, address to, uint256 wad) returns(bool) +func (_IWETH9 *IWETH9Session) TransferFrom(from common.Address, to common.Address, wad *big.Int) (*types.Transaction, error) { + return _IWETH9.Contract.TransferFrom(&_IWETH9.TransactOpts, from, to, wad) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address from, address to, uint256 wad) returns(bool) +func (_IWETH9 *IWETH9TransactorSession) TransferFrom(from common.Address, to common.Address, wad *big.Int) (*types.Transaction, error) { + return _IWETH9.Contract.TransferFrom(&_IWETH9.TransactOpts, from, to, wad) +} + +// Withdraw is a paid mutator transaction binding the contract method 0x2e1a7d4d. +// +// Solidity: function withdraw(uint256 wad) returns() +func (_IWETH9 *IWETH9Transactor) Withdraw(opts *bind.TransactOpts, wad *big.Int) (*types.Transaction, error) { + return _IWETH9.contract.Transact(opts, "withdraw", wad) +} + +// Withdraw is a paid mutator transaction binding the contract method 0x2e1a7d4d. +// +// Solidity: function withdraw(uint256 wad) returns() +func (_IWETH9 *IWETH9Session) Withdraw(wad *big.Int) (*types.Transaction, error) { + return _IWETH9.Contract.Withdraw(&_IWETH9.TransactOpts, wad) +} + +// Withdraw is a paid mutator transaction binding the contract method 0x2e1a7d4d. +// +// Solidity: function withdraw(uint256 wad) returns() +func (_IWETH9 *IWETH9TransactorSession) Withdraw(wad *big.Int) (*types.Transaction, error) { + return _IWETH9.Contract.Withdraw(&_IWETH9.TransactOpts, wad) +} + +// IWETH9ApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the IWETH9 contract. +type IWETH9ApprovalIterator struct { + Event *IWETH9Approval // 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 *IWETH9ApprovalIterator) 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(IWETH9Approval) + 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(IWETH9Approval) + 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 *IWETH9ApprovalIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IWETH9ApprovalIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IWETH9Approval represents a Approval event raised by the IWETH9 contract. +type IWETH9Approval 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 (_IWETH9 *IWETH9Filterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*IWETH9ApprovalIterator, 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 := _IWETH9.contract.FilterLogs(opts, "Approval", ownerRule, spenderRule) + if err != nil { + return nil, err + } + return &IWETH9ApprovalIterator{contract: _IWETH9.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 (_IWETH9 *IWETH9Filterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *IWETH9Approval, 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 := _IWETH9.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(IWETH9Approval) + if err := _IWETH9.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 (_IWETH9 *IWETH9Filterer) ParseApproval(log types.Log) (*IWETH9Approval, error) { + event := new(IWETH9Approval) + if err := _IWETH9.contract.UnpackLog(event, "Approval", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// IWETH9DepositIterator is returned from FilterDeposit and is used to iterate over the raw logs and unpacked data for Deposit events raised by the IWETH9 contract. +type IWETH9DepositIterator struct { + Event *IWETH9Deposit // 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 *IWETH9DepositIterator) 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(IWETH9Deposit) + 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(IWETH9Deposit) + 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 *IWETH9DepositIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IWETH9DepositIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IWETH9Deposit represents a Deposit event raised by the IWETH9 contract. +type IWETH9Deposit 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 (_IWETH9 *IWETH9Filterer) FilterDeposit(opts *bind.FilterOpts, dst []common.Address) (*IWETH9DepositIterator, error) { + + var dstRule []interface{} + for _, dstItem := range dst { + dstRule = append(dstRule, dstItem) + } + + logs, sub, err := _IWETH9.contract.FilterLogs(opts, "Deposit", dstRule) + if err != nil { + return nil, err + } + return &IWETH9DepositIterator{contract: _IWETH9.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 (_IWETH9 *IWETH9Filterer) WatchDeposit(opts *bind.WatchOpts, sink chan<- *IWETH9Deposit, dst []common.Address) (event.Subscription, error) { + + var dstRule []interface{} + for _, dstItem := range dst { + dstRule = append(dstRule, dstItem) + } + + logs, sub, err := _IWETH9.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(IWETH9Deposit) + if err := _IWETH9.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 (_IWETH9 *IWETH9Filterer) ParseDeposit(log types.Log) (*IWETH9Deposit, error) { + event := new(IWETH9Deposit) + if err := _IWETH9.contract.UnpackLog(event, "Deposit", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// IWETH9TransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the IWETH9 contract. +type IWETH9TransferIterator struct { + Event *IWETH9Transfer // 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 *IWETH9TransferIterator) 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(IWETH9Transfer) + 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(IWETH9Transfer) + 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 *IWETH9TransferIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IWETH9TransferIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IWETH9Transfer represents a Transfer event raised by the IWETH9 contract. +type IWETH9Transfer 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 (_IWETH9 *IWETH9Filterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*IWETH9TransferIterator, 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 := _IWETH9.contract.FilterLogs(opts, "Transfer", fromRule, toRule) + if err != nil { + return nil, err + } + return &IWETH9TransferIterator{contract: _IWETH9.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 (_IWETH9 *IWETH9Filterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *IWETH9Transfer, 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 := _IWETH9.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(IWETH9Transfer) + if err := _IWETH9.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 (_IWETH9 *IWETH9Filterer) ParseTransfer(log types.Log) (*IWETH9Transfer, error) { + event := new(IWETH9Transfer) + if err := _IWETH9.contract.UnpackLog(event, "Transfer", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// IWETH9WithdrawalIterator is returned from FilterWithdrawal and is used to iterate over the raw logs and unpacked data for Withdrawal events raised by the IWETH9 contract. +type IWETH9WithdrawalIterator struct { + Event *IWETH9Withdrawal // 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 *IWETH9WithdrawalIterator) 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(IWETH9Withdrawal) + 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(IWETH9Withdrawal) + 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 *IWETH9WithdrawalIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IWETH9WithdrawalIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IWETH9Withdrawal represents a Withdrawal event raised by the IWETH9 contract. +type IWETH9Withdrawal struct { + Src common.Address + Wad *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterWithdrawal is a free log retrieval operation binding the contract event 0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65. +// +// Solidity: event Withdrawal(address indexed src, uint256 wad) +func (_IWETH9 *IWETH9Filterer) FilterWithdrawal(opts *bind.FilterOpts, src []common.Address) (*IWETH9WithdrawalIterator, error) { + + var srcRule []interface{} + for _, srcItem := range src { + srcRule = append(srcRule, srcItem) + } + + logs, sub, err := _IWETH9.contract.FilterLogs(opts, "Withdrawal", srcRule) + if err != nil { + return nil, err + } + return &IWETH9WithdrawalIterator{contract: _IWETH9.contract, event: "Withdrawal", logs: logs, sub: sub}, nil +} + +// WatchWithdrawal is a free log subscription operation binding the contract event 0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65. +// +// Solidity: event Withdrawal(address indexed src, uint256 wad) +func (_IWETH9 *IWETH9Filterer) WatchWithdrawal(opts *bind.WatchOpts, sink chan<- *IWETH9Withdrawal, src []common.Address) (event.Subscription, error) { + + var srcRule []interface{} + for _, srcItem := range src { + srcRule = append(srcRule, srcItem) + } + + logs, sub, err := _IWETH9.contract.WatchLogs(opts, "Withdrawal", 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(IWETH9Withdrawal) + if err := _IWETH9.contract.UnpackLog(event, "Withdrawal", 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 +} + +// ParseWithdrawal is a log parse operation binding the contract event 0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65. +// +// Solidity: event Withdrawal(address indexed src, uint256 wad) +func (_IWETH9 *IWETH9Filterer) ParseWithdrawal(log types.Log) (*IWETH9Withdrawal, error) { + event := new(IWETH9Withdrawal) + if err := _IWETH9.contract.UnpackLog(event, "Withdrawal", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/test/ZetaTokenConsumer.spec.ts b/test/ZetaTokenConsumer.spec.ts index 6e8c2971..77f85b36 100644 --- a/test/ZetaTokenConsumer.spec.ts +++ b/test/ZetaTokenConsumer.spec.ts @@ -62,17 +62,17 @@ describe("ZetaTokenConsumer tests", () => { */ const createPoolV3 = async (signer: SignerWithAddress, tokenAddress: string) => { const DAI = getExternalAddress("dai", { - customNetworkName: "etherum_mainnet", + customNetworkName: "ethereum_mainnet", customZetaNetwork: "mainnet", }); const UNI_NFT_MANAGER_V3 = getExternalAddress("uniswapV3NftManager", { - customNetworkName: "etherum_mainnet", + customNetworkName: "ethereum_mainnet", customZetaNetwork: "mainnet", }); const USDC = getExternalAddress("usdc", { - customNetworkName: "etherum_mainnet", + customNetworkName: "ethereum_mainnet", customZetaNetwork: "mainnet", }); @@ -124,22 +124,22 @@ describe("ZetaTokenConsumer tests", () => { }); const DAI = getExternalAddress("dai", { - customNetworkName: "etherum_mainnet", + customNetworkName: "ethereum_mainnet", customZetaNetwork: "mainnet", }); USDCAddr = getExternalAddress("usdc", { - customNetworkName: "etherum_mainnet", + customNetworkName: "ethereum_mainnet", customZetaNetwork: "mainnet", }); - uniswapV2RouterAddr = getNonZetaAddress("uniswapV2Router02", "etherum_mainnet"); + uniswapV2RouterAddr = getNonZetaAddress("uniswapV2Router02", "ethereum_mainnet"); - const UNI_FACTORY_V3 = getNonZetaAddress("uniswapV3Factory", "etherum_mainnet"); + const UNI_FACTORY_V3 = getNonZetaAddress("uniswapV3Factory", "ethereum_mainnet"); - const UNI_ROUTER_V3 = getNonZetaAddress("uniswapV3Router", "etherum_mainnet"); + const UNI_ROUTER_V3 = getNonZetaAddress("uniswapV3Router", "ethereum_mainnet"); - const WETH9 = getNonZetaAddress("weth9", "etherum_mainnet"); + const WETH9 = getNonZetaAddress("weth9", "ethereum_mainnet"); // For testing purposes we use an existing uni v3 pool await swapToken(tssUpdater, DAI, parseEther("10000")); diff --git a/typechain-types/contracts/zevm/interfaces/IWZETA.sol/IWETH9.ts b/typechain-types/contracts/zevm/interfaces/IWZETA.sol/IWETH9.ts new file mode 100644 index 00000000..fadc91d2 --- /dev/null +++ b/typechain-types/contracts/zevm/interfaces/IWZETA.sol/IWETH9.ts @@ -0,0 +1,438 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PayableOverrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { + FunctionFragment, + Result, + EventFragment, +} from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, + PromiseOrValue, +} from "../../../../common"; + +export interface IWETH9Interface extends utils.Interface { + functions: { + "allowance(address,address)": FunctionFragment; + "approve(address,uint256)": FunctionFragment; + "balanceOf(address)": FunctionFragment; + "deposit()": FunctionFragment; + "totalSupply()": FunctionFragment; + "transfer(address,uint256)": FunctionFragment; + "transferFrom(address,address,uint256)": FunctionFragment; + "withdraw(uint256)": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "allowance" + | "approve" + | "balanceOf" + | "deposit" + | "totalSupply" + | "transfer" + | "transferFrom" + | "withdraw" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "allowance", + values: [PromiseOrValue, PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "approve", + values: [PromiseOrValue, PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "balanceOf", + values: [PromiseOrValue] + ): string; + encodeFunctionData(functionFragment: "deposit", values?: undefined): string; + encodeFunctionData( + functionFragment: "totalSupply", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "transfer", + values: [PromiseOrValue, PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "transferFrom", + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ] + ): string; + encodeFunctionData( + functionFragment: "withdraw", + values: [PromiseOrValue] + ): string; + + decodeFunctionResult(functionFragment: "allowance", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "deposit", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "totalSupply", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "transfer", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "transferFrom", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "withdraw", data: BytesLike): Result; + + events: { + "Approval(address,address,uint256)": EventFragment; + "Deposit(address,uint256)": EventFragment; + "Transfer(address,address,uint256)": EventFragment; + "Withdrawal(address,uint256)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "Approval"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Deposit"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Transfer"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Withdrawal"): EventFragment; +} + +export interface ApprovalEventObject { + owner: string; + spender: string; + value: BigNumber; +} +export type ApprovalEvent = TypedEvent< + [string, string, BigNumber], + ApprovalEventObject +>; + +export type ApprovalEventFilter = TypedEventFilter; + +export interface DepositEventObject { + dst: string; + wad: BigNumber; +} +export type DepositEvent = TypedEvent<[string, BigNumber], DepositEventObject>; + +export type DepositEventFilter = TypedEventFilter; + +export interface TransferEventObject { + from: string; + to: string; + value: BigNumber; +} +export type TransferEvent = TypedEvent< + [string, string, BigNumber], + TransferEventObject +>; + +export type TransferEventFilter = TypedEventFilter; + +export interface WithdrawalEventObject { + src: string; + wad: BigNumber; +} +export type WithdrawalEvent = TypedEvent< + [string, BigNumber], + WithdrawalEventObject +>; + +export type WithdrawalEventFilter = TypedEventFilter; + +export interface IWETH9 extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: IWETH9Interface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + allowance( + owner: PromiseOrValue, + spender: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + approve( + spender: PromiseOrValue, + wad: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + balanceOf( + owner: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + deposit( + overrides?: PayableOverrides & { from?: PromiseOrValue } + ): Promise; + + totalSupply(overrides?: CallOverrides): Promise<[BigNumber]>; + + transfer( + to: PromiseOrValue, + wad: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + transferFrom( + from: PromiseOrValue, + to: PromiseOrValue, + wad: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + withdraw( + wad: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + }; + + allowance( + owner: PromiseOrValue, + spender: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + approve( + spender: PromiseOrValue, + wad: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + balanceOf( + owner: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + deposit( + overrides?: PayableOverrides & { from?: PromiseOrValue } + ): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + to: PromiseOrValue, + wad: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + transferFrom( + from: PromiseOrValue, + to: PromiseOrValue, + wad: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + withdraw( + wad: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + callStatic: { + allowance( + owner: PromiseOrValue, + spender: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + approve( + spender: PromiseOrValue, + wad: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + balanceOf( + owner: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + deposit(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + to: PromiseOrValue, + wad: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + transferFrom( + from: PromiseOrValue, + to: PromiseOrValue, + wad: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + withdraw( + wad: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + }; + + filters: { + "Approval(address,address,uint256)"( + owner?: PromiseOrValue | null, + spender?: PromiseOrValue | null, + value?: null + ): ApprovalEventFilter; + Approval( + owner?: PromiseOrValue | null, + spender?: PromiseOrValue | null, + value?: null + ): ApprovalEventFilter; + + "Deposit(address,uint256)"( + dst?: PromiseOrValue | null, + wad?: null + ): DepositEventFilter; + Deposit( + dst?: PromiseOrValue | null, + wad?: null + ): DepositEventFilter; + + "Transfer(address,address,uint256)"( + from?: PromiseOrValue | null, + to?: PromiseOrValue | null, + value?: null + ): TransferEventFilter; + Transfer( + from?: PromiseOrValue | null, + to?: PromiseOrValue | null, + value?: null + ): TransferEventFilter; + + "Withdrawal(address,uint256)"( + src?: PromiseOrValue | null, + wad?: null + ): WithdrawalEventFilter; + Withdrawal( + src?: PromiseOrValue | null, + wad?: null + ): WithdrawalEventFilter; + }; + + estimateGas: { + allowance( + owner: PromiseOrValue, + spender: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + approve( + spender: PromiseOrValue, + wad: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + balanceOf( + owner: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + deposit( + overrides?: PayableOverrides & { from?: PromiseOrValue } + ): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + to: PromiseOrValue, + wad: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + transferFrom( + from: PromiseOrValue, + to: PromiseOrValue, + wad: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + withdraw( + wad: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + }; + + populateTransaction: { + allowance( + owner: PromiseOrValue, + spender: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + approve( + spender: PromiseOrValue, + wad: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + balanceOf( + owner: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + deposit( + overrides?: PayableOverrides & { from?: PromiseOrValue } + ): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + to: PromiseOrValue, + wad: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + transferFrom( + from: PromiseOrValue, + to: PromiseOrValue, + wad: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + withdraw( + wad: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + }; +} diff --git a/typechain-types/contracts/zevm/interfaces/IWZETA.sol/index.ts b/typechain-types/contracts/zevm/interfaces/IWZETA.sol/index.ts new file mode 100644 index 00000000..95069327 --- /dev/null +++ b/typechain-types/contracts/zevm/interfaces/IWZETA.sol/index.ts @@ -0,0 +1,4 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +export type { IWETH9 } from "./IWETH9"; diff --git a/typechain-types/contracts/zevm/interfaces/index.ts b/typechain-types/contracts/zevm/interfaces/index.ts index 6d9f235a..5328b2e6 100644 --- a/typechain-types/contracts/zevm/interfaces/index.ts +++ b/typechain-types/contracts/zevm/interfaces/index.ts @@ -1,6 +1,8 @@ /* Autogenerated file. Do not edit manually. */ /* tslint:disable */ /* eslint-disable */ +import type * as iwzetaSol from "./IWZETA.sol"; +export type { iwzetaSol }; export type { IUniswapV2Router01 } from "./IUniswapV2Router01"; export type { IUniswapV2Router02 } from "./IUniswapV2Router02"; export type { IZRC20 } from "./IZRC20"; diff --git a/typechain-types/factories/contracts/zevm/interfaces/IWZETA.sol/IWETH9__factory.ts b/typechain-types/factories/contracts/zevm/interfaces/IWZETA.sol/IWETH9__factory.ts new file mode 100644 index 00000000..91148899 --- /dev/null +++ b/typechain-types/factories/contracts/zevm/interfaces/IWZETA.sol/IWETH9__factory.ts @@ -0,0 +1,264 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; +import type { + IWETH9, + IWETH9Interface, +} from "../../../../../contracts/zevm/interfaces/IWZETA.sol/IWETH9"; + +const _abi = [ + { + 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: "from", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "to", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "Transfer", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "src", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "wad", + type: "uint256", + }, + ], + name: "Withdrawal", + 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: "wad", + type: "uint256", + }, + ], + name: "approve", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + ], + name: "balanceOf", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "deposit", + outputs: [], + stateMutability: "payable", + 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: "wad", + 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: "wad", + type: "uint256", + }, + ], + name: "transferFrom", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "wad", + type: "uint256", + }, + ], + name: "withdraw", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, +] as const; + +export class IWETH9__factory { + static readonly abi = _abi; + static createInterface(): IWETH9Interface { + return new utils.Interface(_abi) as IWETH9Interface; + } + static connect(address: string, signerOrProvider: Signer | Provider): IWETH9 { + return new Contract(address, _abi, signerOrProvider) as IWETH9; + } +} diff --git a/typechain-types/factories/contracts/zevm/interfaces/IWZETA.sol/index.ts b/typechain-types/factories/contracts/zevm/interfaces/IWZETA.sol/index.ts new file mode 100644 index 00000000..d3b0ed8d --- /dev/null +++ b/typechain-types/factories/contracts/zevm/interfaces/IWZETA.sol/index.ts @@ -0,0 +1,4 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +export { IWETH9__factory } from "./IWETH9__factory"; diff --git a/typechain-types/factories/contracts/zevm/interfaces/index.ts b/typechain-types/factories/contracts/zevm/interfaces/index.ts index 57e32557..0b7ab835 100644 --- a/typechain-types/factories/contracts/zevm/interfaces/index.ts +++ b/typechain-types/factories/contracts/zevm/interfaces/index.ts @@ -1,6 +1,7 @@ /* Autogenerated file. Do not edit manually. */ /* tslint:disable */ /* eslint-disable */ +export * as iwzetaSol from "./IWZETA.sol"; export { IUniswapV2Router01__factory } from "./IUniswapV2Router01__factory"; export { IUniswapV2Router02__factory } from "./IUniswapV2Router02__factory"; export { IZRC20__factory } from "./IZRC20__factory"; diff --git a/typechain-types/hardhat.d.ts b/typechain-types/hardhat.d.ts index 9480990e..c5849184 100644 --- a/typechain-types/hardhat.d.ts +++ b/typechain-types/hardhat.d.ts @@ -292,6 +292,10 @@ declare module "hardhat/types/runtime" { name: "IUniswapV2Router02", signerOrOptions?: ethers.Signer | FactoryOptions ): Promise; + getContractFactory( + name: "IWETH9", + signerOrOptions?: ethers.Signer | FactoryOptions + ): Promise; getContractFactory( name: "IZRC20", signerOrOptions?: ethers.Signer | FactoryOptions @@ -671,6 +675,11 @@ declare module "hardhat/types/runtime" { address: string, signer?: ethers.Signer ): Promise; + getContractAt( + name: "IWETH9", + address: string, + signer?: ethers.Signer + ): Promise; getContractAt( name: "IZRC20", address: string, diff --git a/typechain-types/index.ts b/typechain-types/index.ts index 9d7b4460..6ea7edff 100644 --- a/typechain-types/index.ts +++ b/typechain-types/index.ts @@ -136,6 +136,8 @@ export type { IZRC20 } from "./contracts/zevm/Interfaces.sol/IZRC20"; export { IZRC20__factory } from "./factories/contracts/zevm/Interfaces.sol/IZRC20__factory"; export type { IZRC20Metadata } from "./contracts/zevm/Interfaces.sol/IZRC20Metadata"; export { IZRC20Metadata__factory } from "./factories/contracts/zevm/Interfaces.sol/IZRC20Metadata__factory"; +export type { IWETH9 } from "./contracts/zevm/interfaces/IWZETA.sol/IWETH9"; +export { IWETH9__factory } from "./factories/contracts/zevm/interfaces/IWZETA.sol/IWETH9__factory"; export type { ZContract } from "./contracts/zevm/interfaces/ZContract"; export { ZContract__factory } from "./factories/contracts/zevm/interfaces/ZContract__factory"; export type { SystemContract } from "./contracts/zevm/SystemContract.sol/SystemContract";