|
|
|
@ -27,13 +27,16 @@ var (
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// IERC20ABI is the input ABI used to generate the binding from.
|
|
|
|
|
const IERC20ABI = "[{\"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\":\"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\":\"amount\",\"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\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]"
|
|
|
|
|
const IERC20ABI = "[{\"constant\":true,\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"spender\",\"type\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"sender\",\"type\":\"address\"},{\"name\":\"recipient\",\"type\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"recipient\",\"type\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"owner\",\"type\":\"address\"},{\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"}]"
|
|
|
|
|
|
|
|
|
|
// IERC20FuncSigs maps the 4-byte function signature to its string representation.
|
|
|
|
|
var IERC20FuncSigs = map[string]string{
|
|
|
|
|
"dd62ed3e": "allowance(address,address)",
|
|
|
|
|
"095ea7b3": "approve(address,uint256)",
|
|
|
|
|
"70a08231": "balanceOf(address)",
|
|
|
|
|
"313ce567": "decimals()",
|
|
|
|
|
"06fdde03": "name()",
|
|
|
|
|
"95d89b41": "symbol()",
|
|
|
|
|
"18160ddd": "totalSupply()",
|
|
|
|
|
"a9059cbb": "transfer(address,uint256)",
|
|
|
|
|
"23b872dd": "transferFrom(address,address,uint256)",
|
|
|
|
@ -243,6 +246,99 @@ func (_IERC20 *IERC20CallerSession) BalanceOf(account common.Address) (*big.Int,
|
|
|
|
|
return _IERC20.Contract.BalanceOf(&_IERC20.CallOpts, account)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Decimals is a free data retrieval call binding the contract method 0x313ce567.
|
|
|
|
|
//
|
|
|
|
|
// Solidity: function decimals() view returns(uint8)
|
|
|
|
|
func (_IERC20 *IERC20Caller) Decimals(opts *bind.CallOpts) (uint8, error) {
|
|
|
|
|
var out []interface{}
|
|
|
|
|
err := _IERC20.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 (_IERC20 *IERC20Session) Decimals() (uint8, error) {
|
|
|
|
|
return _IERC20.Contract.Decimals(&_IERC20.CallOpts)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Decimals is a free data retrieval call binding the contract method 0x313ce567.
|
|
|
|
|
//
|
|
|
|
|
// Solidity: function decimals() view returns(uint8)
|
|
|
|
|
func (_IERC20 *IERC20CallerSession) Decimals() (uint8, error) {
|
|
|
|
|
return _IERC20.Contract.Decimals(&_IERC20.CallOpts)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Name is a free data retrieval call binding the contract method 0x06fdde03.
|
|
|
|
|
//
|
|
|
|
|
// Solidity: function name() view returns(string)
|
|
|
|
|
func (_IERC20 *IERC20Caller) Name(opts *bind.CallOpts) (string, error) {
|
|
|
|
|
var out []interface{}
|
|
|
|
|
err := _IERC20.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 (_IERC20 *IERC20Session) Name() (string, error) {
|
|
|
|
|
return _IERC20.Contract.Name(&_IERC20.CallOpts)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Name is a free data retrieval call binding the contract method 0x06fdde03.
|
|
|
|
|
//
|
|
|
|
|
// Solidity: function name() view returns(string)
|
|
|
|
|
func (_IERC20 *IERC20CallerSession) Name() (string, error) {
|
|
|
|
|
return _IERC20.Contract.Name(&_IERC20.CallOpts)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Symbol is a free data retrieval call binding the contract method 0x95d89b41.
|
|
|
|
|
//
|
|
|
|
|
// Solidity: function symbol() view returns(string)
|
|
|
|
|
func (_IERC20 *IERC20Caller) Symbol(opts *bind.CallOpts) (string, error) {
|
|
|
|
|
var out []interface{}
|
|
|
|
|
err := _IERC20.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 (_IERC20 *IERC20Session) Symbol() (string, error) {
|
|
|
|
|
return _IERC20.Contract.Symbol(&_IERC20.CallOpts)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Symbol is a free data retrieval call binding the contract method 0x95d89b41.
|
|
|
|
|
//
|
|
|
|
|
// Solidity: function symbol() view returns(string)
|
|
|
|
|
func (_IERC20 *IERC20CallerSession) Symbol() (string, error) {
|
|
|
|
|
return _IERC20.Contract.Symbol(&_IERC20.CallOpts)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd.
|
|
|
|
|
//
|
|
|
|
|
// Solidity: function totalSupply() view returns(uint256)
|
|
|
|
|